Tag Archives: Security

OpenSSL hacks

Quick command snippets for managing an SSL CA:

Generating a private key:

openssl genrsa -des3 -out www.mananet.net.key 2048

Generating a CRL:

openssl req -new -key www.mananet.net.key -out www.mananet.net.csr -days 3650 -sha256

Signing:

openssl ca -in www.mananet.net.csr -out www.mananet.net.pem -config /root/ca/config.txt

Generating a pfx file for windows:

openssl pkcs12 -export -out www.mananet.net.pfx -inkey www.mananet.net.key -in www.mananet.net.pem

Revoking a certificate:

openssl ca -revoke /root/ca/newcerts/0E.pem -config /root/ca/config.txt

NSA AURORAGOLD

지금까지 NSA의 만행을 세상에 고발하여 화제가 되었던 에드워드 스노우든이 오는 9일 지금까지 알려지지 않은 새로운 비밀작전을 다시한번 세상에 공개했습니다.

코드네임 오로라 골드(AURORAGOLD)라 불리는 이 임무는 세계 각국 통신회사들의 내부 네트워크 정보를 수집하여 NSA가 언제나 그 속의 취약점을 뚫고 들어가 특정 데이터를 취득할 수 있도록 하는 목적으로 진행되고 있었습니다.

각국 통신사 엔지니어들의 이메일을 감청한것과 더불어, 세계 모바일 표준규약을 만드는 GSMA 직원들의 이메일과 인트라넷도 감시 대상이였던것으로 밝혀졌습니다. 발표 자료에 나타난 바과 같이 전세계 701개의 통신사가 감청 대상이란 것이 사실이라면 전세계 985개의 통신사 중 70%가 NSA의 손아귀 안에 있는 것이 됩니다.

실제로 2011년에 아프리카 주둔 미군의 요청으로 리비아 통신사의 네트워크 구조도를 제공하여 타인의 문자 메세지를 확인할 수 있었던 사실이 스노우든이 제공한 NSA 내부 발표 자료에 수록되어 있습니다.

bzjejxdp2xg2zya7luqo
발표 자료에 수록된, 지금까지의 자료 수집 정도를 보여주는 저 슬라이드는 NSA가 놀라울 만큼의 침투력을 가지고 있다는 사실을 보여 줍니다.

여기서 한가지 주목할 점은, NSA가 특히 눈독을 들이고 있는 IR.21이라는 문서에 있습니다. 이는 통신사간의 통신 (로밍 등)의 서비스 이용시 호환성 문제를 최소화하기 위해 각 통신사에서 정리하는 하드웨어와 소프트웨어의 정보와 그 구성에 대한 자료입니다. 이는 NSA에게도 네트워크의 이해도를 높일 수 있는 중요한 자료가 됩니다.

모바일 네트워크의 구조상 무선 프로토콜은 암호화되어 안전할지라도 기지국 자체의 데이터를 수집해버리는 것에는 별다른 해결책이 없습니다.

이에 대해 GSMA측은 불법적인 사안이 있는지에 대해 검토한 뒤 대응하겠다는 입장을 보였으며

NSA 대변인은 NSA가 “상호작용이 가능하며 안전한” 인터넷을 구축하는데 힘쓰고 있다고 설명했습니다. (“open, interoperable, and secure global internet.”)

하지만 더이상의 프로젝트 진행이나 현 상황에 대한 언급은 하지 않았습니다.

Kicking spammers out of your Asterisk server

If you have your asterisk server connected to the public internet, there always will be some bad boys trying to brute-force into your PBX.

A few months before I found my asterisk server dead. Looking through the logs I was surprised to find that it was the spammers trying to brute force the password, eventually filling up the entire disk with error logs and crashing the server. Unfortunately that server operated on a single partition scheme with everything allocated for / .


[Sep 12 20:24:02] NOTICE[28190] chan_sip.c: Registration from '"249" ' failed for '37.8.53.84:10937' - No matching peer found
[Sep 12 20:24:02] NOTICE[28190] chan_sip.c: Registration from '"249" ' failed for '37.8.53.84:10937' - No matching peer found
[Sep 12 20:24:21] NOTICE[28190] chan_sip.c: Registration from '"497" ' failed for '37.8.53.84:5060' - No matching peer found
[Sep 12 20:24:21] NOTICE[28190] chan_sip.c: Registration from '"497" ' failed for '37.8.53.84:5060' - No matching peer found

Yesterday same thing happened again, but luckily I found it early enough to block it before it crashes the server.


iptables -I INPUT -s 37.8.53.84 -j DROP

I used iptables to filter out those garbage packets.
To view the blocked ip list use the following command.


iptables -n -L

It can be rather annoying when it comes to a production server where there are so many logs to inspect.
I recommend creating a script to automate the tasks if that is the case.