블로그 이미지
훅크선장

카테고리

분류 전체보기 (361)
사진이야기 (23)
펭귄컴퓨팅 (120)
컴퓨터보안 (84)
돼지털세상 (12)
네트웍세상 (68)
신기한것들 (4)
절름발이 프로그래머 (59)
하드웨어개조 (23)
멀알려줄까 (35)
홈베이킹&홈쿠킹 (2)
잡다한것들 (15)
Total
Today
Yesterday

달력

« » 2024.4
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

공지사항

태그목록

최근에 올라온 글

이틀간 많은 문서를 뒤졌지만, 도저히 쉽게 설명한 문서가 없어서 애를 먹었습니다.
다행히 삽질을 통해서, 성공하였습니다.  
가장 많이 참고한 문서는 
디렉토리 위치 설명이 잘 안되어 있었습니다.

CentOS 에서는 시작 위치가 /usr/share/ssl/  입니다. 이곳에 openssl.cnf 가 존재합니다.
RHEL 에서는 시작 위치가 /etc/pki/tls/ 입니다. 이곳에 openssl.cnf가 존재합니다.
모든 인증서 작업은 이 디렉토리에서 이루어져야만 합니다.

CentOS에서는 openssl.cnf를 수정할 필요가 없지만, RHEL은 약간 수정이 필요합니다.
기존 파일을 백업하고, 다음과 같이 수정하면 됩니다. (꼭 디렉토리 명을 demoCA로 할 필요는 없습니다. openssl.cnf를 잘 이해한다면, 디렉토리 위치나 디렉토리명은 알아서 설정하면 됩니다.)
[root@localhost tls]# cp openssl.cnf openssl.cnf.org
[root@localhost tls]# vi openssl.cnf
modify :
dir             = ../../CA              # Where everything is kept
->
dir             = ./demoCA
[root@localhost tls]# sync
[root@localhost tls]# ls
cert.pem  certs  misc  openssl.cnf  openssl.cnf.org  private

이제부터 필요한 디렉토리와 파일들을 생성합니다. CA로써 가져야되는 디렉토리와 파일들입니다.
디렉토리들과 파일들은 demoCA라는 디렉토리 밑에 생성되어야 합니다.
[root@localhost tls]# mkdir demoCA
[root@localhost tls]# cd demoCA
[root@localhost demoCA]# mkdir certs
[root@localhost demoCA]# mkdir crl
[root@localhost demoCA]# mkdir newcerts
[root@localhost demoCA]# mkdir private
[root@localhost demoCA]# touch index.txt
[root@localhost demoCA]# echo "0001" > serial
[root@localhost demoCA]# echo "0001" > crlnumber
[root@localhost demoCA]# ls
certs  crl  crlnumber  index.txt  newcerts  private  serial

환경이 완료되었으면, 원래 작업 디렉토리로 돌아옵니다.
그리고, CA용 비밀키와 인증서를 생성합니다.

[root@localhost demoCA]# cd ..
[root@localhost tls]# ls
cert.pem  certs  demoCA  misc  openssl.cnf  openssl.cnf.org  private

비밀키를 생성할 때는 반드시 패스워드가 필요합니다.(확인을 위해서, 두 번 넣습니다.)
[root@localhost tls]# openssl genrsa -des3 -out ca.key 1024
Generating RSA private key, 1024 bit long modulus
.............++++++
...++++++
e is 65537 (0x10001)
Enter pass phrase for ca.key:
Verifying - Enter pass phrase for ca.key:

비밀키를 기반으로 인증서를 만듭니다. 앞에서 넣었던 비밀키 패스워드를 입력해야 합니다.
인증서에는 국가, 지역, 도시, 기관, 부서, 시스템 명과 이메일 주소를 넣어줘야 합니다.
어떤 값을 넣어줘도 상관은 없습니다만,  국가, 지역, 도시, 기관명은 반드시 CA가 인증해주는 다른 인증서를 만들 때도 동일하게 하여야합니다. 잘 기억해야 됩니다. 밑에 보이는 것을 참고해서 넣으면 됩니다.
[root@localhost tls]# openssl req -new -x509 -days 365 -key ca.key -out ca.crt
Enter pass phrase for ca.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:KR
State or Province Name (full name) [Berkshire]:Seoul
Locality Name (eg, city) [Newbury]:Seoul
Organization Name (eg, company) [My Company Ltd]:MyCompany
Organizational Unit Name (eg, section) []:Research
Common Name (eg, your name or your server's hostname) []:RHEL
Email Address []:hook@mail.com

이것으로 CA용 비밀키와 인증서가 생성되었습니다.
[root@localhost tls]# ls
ca.crt  ca.key  cert.pem  certs  demoCA  misc  openssl.cnf  openssl.cnf.org  private

이제 서버용으로 사용할 비밀키와 인증서를 만듭니다.
비밀키는 패스워드를 꼭 두 번 넣습니다.
[root@localhost tls]# openssl genrsa -des3 -out server.key 1024
Generating RSA private key, 1024 bit long modulus
.........++++++
........++++++
e is 65537 (0x10001)
Enter pass phrase for server.key:
Verifying - Enter pass phrase for server.key:

서버용 인증서 요청파일을 만듭니다. 바로 인증서가 만들어지지 않는 것은 CA의 서명을 받아야 하기 때문입니다.
먼저 비밀키의 패스워드를 입력합니다.
CA 인증서를 만들 때와 비슷하게, 국가, 지역, 도시, 기관, 부서, 시스템 명과 이메일 주소를 넣어야 합니다.
국가, 지역, 도시, 기관명은 반드시 CA 인증서와 동일하게 넣어야 합니다. 그렇지 않으면, CA의 서명을 받을 수 없습니다.
부서, 시스템 명과 이메일 주소를 알아서 넣습니다. (CA 랑 동일해도 상관없습니다.)
요청을 하기 위한 추가속성을 입력하라고 합니다. 아무 값이나 넣어도 상관없습니다.
[root@localhost tls]# openssl req -new -days 365 -key server.key -out server.csr
Enter pass phrase for server.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:KR
State or Province Name (full name) [Berkshire]:Seoul
Locality Name (eg, city) [Newbury]:Seoul
Organization Name (eg, company) [My Company Ltd]:MyCompany
Organizational Unit Name (eg, section) []:Research
Common Name (eg, your name or your server's hostname) []:MyServer
Email Address []:hook@mail.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:password
An optional company name []:None

인증서 요청파일이 완성되었으면, CA의 서명과정을 거칩니다.
CA 비밀키의 패스워드를 입력합니다.
그러면, CA 서명을 할 것인지를 물어보고, 또 한번 발급할 것인가를 물어봅니다. 모두 y 로 응답합니다.
[root@localhost tls]# openssl ca -in server.csr -out server.crt -keyfile ca.key -cert ca.crt
Using configuration from /etc/pki/tls/openssl.cnf
Enter pass phrase for ca.key:
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 1 (0x1)
        Validity
            Not Before: Aug 24 05:48:50 2010 GMT
            Not After : Aug 24 05:48:50 2011 GMT
        Subject:
            countryName               = KR
            stateOrProvinceName       = Seoul
            organizationName          = MyCompany
            organizationalUnitName    = Research
            commonName                = MyServer
            emailAddress              = hook@mail.com
        X509v3 extensions:
            X509v3 Basic Constraints: 
                CA:FALSE
            Netscape Comment: 
                OpenSSL Generated Certificate
            X509v3 Subject Key Identifier: 
                CB:4E:81:5A:58:79:98:76:89:B3:B1:5C:6F:B5:77:CD:8C:9D:3B:01
            X509v3 Authority Key Identifier: 
                keyid:35:82:E4:7B:71:D1:F5:10:72:C2:0F:A5:0E:54:34:E3:C9:39:63:60

Certificate is to be certified until Aug 24 05:48:50 2011 GMT (365 days)
Sign the certificate? [y/n]:y


1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated

이것으로 CA 인증을 받은 서버의 인증서가 생성되었습니다.

아래의 과정은 클라이언트용 비밀키와 인증서의 생성과정으로 서버용 만들기와 동일합니다.
동일한 과정으로 여러 개의 비밀키와 인증서를 만들 수 있습니다.

[root@localhost tls]# openssl genrsa -des3 -out client.key 1024
Generating RSA private key, 1024 bit long modulus
...++++++
..............++++++
e is 65537 (0x10001)
Enter pass phrase for client.key:
Verifying - Enter pass phrase for client.key:
[root@localhost tls]# openssl req -new -days 365 -key client.key -out client.csr
Enter pass phrase for client.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:KR
State or Province Name (full name) [Berkshire]:Seoul
Locality Name (eg, city) [Newbury]:Seoul
Organization Name (eg, company) [My Company Ltd]:MyCompany
Organizational Unit Name (eg, section) []:Research
Common Name (eg, your name or your server's hostname) []:MyClient
Email Address []:hook@mail.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:password
An optional company name []:None
[root@localhost tls]# openssl ca -in client.csr -out client.crt -keyfile ca.key -cert ca.crt
Using configuration from /etc/pki/tls/openssl.cnf
Enter pass phrase for ca.key:
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 2 (0x2)
        Validity
            Not Before: Aug 24 05:50:19 2010 GMT
            Not After : Aug 24 05:50:19 2011 GMT
        Subject:
            countryName               = KR
            stateOrProvinceName       = Seoul
            organizationName          = MyCompany
            organizationalUnitName    = Research
            commonName                = MyClient
            emailAddress              = hook@mail.com
        X509v3 extensions:
            X509v3 Basic Constraints: 
                CA:FALSE
            Netscape Comment: 
                OpenSSL Generated Certificate
            X509v3 Subject Key Identifier: 
                B0:CE:BA:FD:1D:17:4B:DF:4F:9A:36:37:DB:D8:8E:7A:A8:7C:C9:FF
            X509v3 Authority Key Identifier: 
                keyid:35:82:E4:7B:71:D1:F5:10:72:C2:0F:A5:0E:54:34:E3:C9:39:63:60

Certificate is to be certified until Aug 24 05:50:19 2011 GMT (365 days)
Sign the certificate? [y/n]:y


1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated

현재까지 발급된 상황을 보면, CA용 비밀키와 인증서가 생성되었고,
서버용과 클라이언트용 비밀키와 인증서가 생성되었습니다.
CA가 관리하는 내용을 한번 검토해 봅니다.
[root@localhost tls]# ll
total 132
-rw-r--r-- 1 root root 1257 Aug 24 14:47 ca.crt
-rw-r--r-- 1 root root  963 Aug 24 14:46 ca.key
lrwxrwxrwx 1 root root   19 Jun  3 20:14 cert.pem -> certs/ca-bundle.crt
drwxr-xr-x 2 root root 4096 Aug 24 13:43 certs
-rw-r--r-- 1 root root 3209 Aug 24 14:50 client.crt
-rw-r--r-- 1 root root  757 Aug 24 14:50 client.csr
-rw-r--r-- 1 root root  963 Aug 24 14:49 client.key
drwxr-xr-x 6 root root 4096 Aug 24 14:50 demoCA
drwxr-xr-x 2 root root 4096 Jun  3 20:14 misc
-rw-r--r-- 1 root root 9828 Aug 24 14:43 openssl.cnf
-rw-r--r-- 1 root root 9828 Aug 24 14:42 openssl.cnf.org
drwxr-xr-x 2 root root 4096 Jul 23 10:06 private
-rw-r--r-- 1 root root 3209 Aug 24 14:48 server.crt
-rw-r--r-- 1 root root  757 Aug 24 14:48 server.csr
-rw-r--r-- 1 root root  963 Aug 24 14:47 server.key
[root@localhost tls]# cd demoCA
[root@localhost demoCA]# ll
total 88
drwxr-xr-x 2 root root 4096 Aug 24 14:44 certs
drwxr-xr-x 2 root root 4096 Aug 24 14:44 crl
-rw-r--r-- 1 root root    5 Aug 24 14:45 crlnumber
-rw-r--r-- 1 root root  212 Aug 24 14:50 index.txt
-rw-r--r-- 1 root root   20 Aug 24 14:50 index.txt.attr
-rw-r--r-- 1 root root   21 Aug 24 14:48 index.txt.attr.old
-rw-r--r-- 1 root root  106 Aug 24 14:48 index.txt.old
drwxr-xr-x 2 root root 4096 Aug 24 14:50 newcerts
drwxr-xr-x 2 root root 4096 Aug 24 14:45 private
-rw-r--r-- 1 root root    3 Aug 24 14:50 serial
-rw-r--r-- 1 root root    3 Aug 24 14:48 serial.old
[root@localhost demoCA]# ls certs/
[root@localhost demoCA]# ls crl
[root@localhost demoCA]# ls newcerts/
01.pem  02.pem
[root@localhost demoCA]# ll newcerts
total 16
-rw-r--r-- 1 root root 3209 Aug 24 14:48 01.pem
-rw-r--r-- 1 root root 3209 Aug 24 14:50 02.pem
[root@localhost demoCA]# ll private/
total 0

index.txt 파일에는 발급된 인증서에 대한 간략 정보가 기록되어 있습니다.
[root@localhost demoCA]# cat index.txt
V       110824054850Z           01      unknown /C=KR/ST=Seoul/O=MyCompany/OU=Research/CN=MyServer/emailAddress=hook@mail.com
V       110824055019Z           02      unknown /C=KR/ST=Seoul/O=MyCompany/OU=Research/CN=MyClient/emailAddress=hook@mail.com
[root@localhost demoCA]# cat index.txt.attr
unique_subject = no

serial 파일에는 발급된 인증서의 개수가 기록되어 있습니다. 총 3개의 인증서가 발급되었음을 알 수 있습니다.
[root@localhost demoCA]# cat serial
03
[root@localhost demoCA]# 

Posted by 훅크선장
, |
http://www.milw0rm.com/papers/296

무선랜 공격에 관련한 문서가 따근한 것이 떳다.

아직 내용을 다 읽어보지는 않았지만, 나름 의미있는 문서라고 본다.

태국해커들이 만들 것인데...

이젠 해커들도 국제화시대에 국제 평준화???

-----------------------------------------------------------------------
Posted by 훅크선장
, |
2003년부터 동호회 사람들과 시작한 무선랜 보안 프로젝트.

참 재미있게 공부했었고, 새로운 것을 많이 알게 해준 일이었다.

지금도 그때같은 열정이 있기를 바라지만, 늘 그렇지 못한 후회만이...

2003년도에 발표한 CONCERT 자료는 동영상으로 존재하고, 여기 블로그에 뒤져보면 찾을 수 있으나, 귀찮으신 분들을 위해서 따로 링크 또 걸어본다.

이 동영상에는 MAC 주소 복사를 이용한 인증우회와 Rogue AP를 이용한 가로채기 기법을 보여주었던 것으로 기억난다.

그 뒤로 2005년도에 영남대와 전남대에서 발표한 자료가 있다. 802.11g 자료를 추가한 가장 최근의 발표자료이다.

단순한 무선랜의 취약점 뿐만 아니라, 가장 흔한 공중무선랜 서비스인 KT 네스팟의 문제점을 파헤쳐보기도 했다.

이전에도 올렸는데, 기억이 잘 나지 않지만,
이미 사람들이 알고 있는 WEP라고 하는 무선랜 암호화는 깨어진 지 오래다.
짧게는 10분, 길면 두어시간이면 모든 키가 다 풀린다.

그에 관련된 외국문서를 번역한 것이 있다. 1부, 2부로 나뉘어져 있다.

KT 네스팟의 문제점을 보여주는 테스트코드 프로그램이 여기있다.
너무 오래되어서, 내가 짠 코드를 내가 잘 이해하기도 힘들지만,
다른 이들에게 도움이 되기를 바라면서, 공개한다.
libpcap 과 libnet 라이브러리를 이용한 C 프로그램이다.

아주 오래전 리눅스에서 만든 프로그램이라서, 현재 리눅스에서는 잘 동작하지 않을 것이다.
누군가가 요즘 리눅스 또는 윈도우용 프로그램으로 포팅할 수 있다면, 좋겠다.
그 누군가, 당신의 행운을 빕니다.

Posted by 훅크선장
, |
회사 네트워크 방화벽 정책에 반하면서도,
자유롭게 네트워크 접속을 가능케 하기 위한 방법을 찾고 있었다.

그러던 중, 찾은 정보 (땡스 피터팬)

유무선 공유기를 핵펌해서 다양한 기능의 리눅스 머신으로 만든 다음,
그 리눅스 머신에 VPN을 동작시키면 된다는 것이다.

회사에서 안전하게 집 네트워크에 연결하여, 모든 하고픈 인터넷 서핑을 할 수 있게된다.

예전에 Linksys WRT54G 제품을 핵펌해서 기능확장을 해본 적이 있었다. 그 연장선상에 있는 공개 프로젝트이다.

OpenWRT : http://openwrt.org/
위키        : http://wiki.openwrt.org/

OpenVPN : http://www.openvpn.net/index.php

그리고, 둘을 조합한 VPN 구성
http://arctic-things.blogspot.com/2008/01/internet-gateway-openvpn-openwrt-on.html

Asus WL-500g Premium 제품을 구입해야 될지도 모르는 상황이지만, 가격이 만만치 않다.
그러나, USB 포트가 두 개가 있어서 확장성을 위해서는 꼭 필요하다.
있는 공유기를 처분하고 사야될 가능성이 80% 를 넘어가고 있다.

구글에서 openvpn을 검색하면, 다양한 설치기가 나온다. 참고하면 좋지만...

집 네트워크를 이용한다는 측면에서는 유무선 공유기 핵펌이 가장 좋은 듯...
그리고 경험으로도 쵝오!

Posted by 훅크선장
, |
오래전부터 관심을 가져오던,
실시간 패킷 조작 분야를 다시 들여다 보니,

새로운 도구가 등장했다.

윈도우즈 네트워크 함수들을 죄다 후킹해서, 패킷 조작을 할 수 있는 도구이다.
사용자 삽입 이미지

rEdoX Packet Editor 라고 하는 도구가 나왔다. 해커들이 사용하는 도구이다.
재미나게 잘 써 볼 예정이다.

다운로드 : http://www.hsd.or.kr/~hook7346/EXEs/rPE.zip

이전에 잘 쓰던 도구는
Windows Packet Editor : WPE 되시겠다.
오래전에는 해킹도구라고 해서 인터넷에서 숨어 지냈었는데, 이제는 공식 홈페이지도 만들어 졌다.

링크 : http://wpepro.net/index.php?categoryid=1

Posted by 훅크선장
, |
http://eprint.iacr.org/2007/120.pdf
http://www.eweek.com/article2/0,1895,2111963,00.asp

독일 해커들이 썼나부다.
104 bits WEP (128 bits암호화)를 1분만에 깨는 기술에 대해서 논문이 나왔다.

이젠 정말 WEP를 포기해야 될 때가 왔나본데, 과연 장비 파는 회사들이 포기할까??
Posted by 훅크선장
, |
http://www.wirelessdefence.org/Contents/Wireless%20Pen%20Test%20Framework.html

무선랜 해킹을 위한 가이드라인이 만들어졌군요~

이것을 보면서, 해커가 어떤 방법을 써야되는지를 알려주는군요.

완벽하군요.

근데 문서양식을 어디서 꼭 본 것 같네~~ (마인드스톰??)
Posted by 훅크선장
, |
컴퓨터 시스템의 네트워크 카드 MAC 주소값을 바꿔주는 소프트웨어가 무료로 나와있었다.

자주 가는 보안사이트에서 발견된 내용이다.

http://tmac.technitium.com/tmac/index.html

이런 소프트웨어를 공개하는 사람들의 놀라운 능력과 정신에 감동한다.

사용자 삽입 이미지

Posted by 훅크선장
, |
MSN, Yahoo 메신저 등등의 인스턴스 메시징 프로그램,
우리는 메신저라고 통칭하곤 한다.

알다시피, 이 메신저의 대화내용은 언제나 평문으로 네트워크를 떠돌고 있다. 즉, 누군가가 중간에서 훔쳐볼수도 있다는 말이다.

누구를 꼭 지정해서 보기는 힘들지만,
본다고 한다면 아마도 국가권력이나 통신회사쯤이 아닐까 한다.
아무튼, 메신저 대화내용이 안전하기를 원한다면 다음의 프로그램 사용을 고려해보라.

http://www.secway.fr/us/products/simppro/

주위의 누구 말로는, 거의 표준이라고 한다.

국내외 정보기관도 애용하고 있다고 한다.

다운로드 사이트가 잘 안보인다. 다음을 받아쓰면 된다.

http://www.hsd.or.kr/~hook7346/EXEs/simppro-2_2_0-en.msi
http://www.hsd.or.kr/~hook7346/EXEs/simppro2.2.5_setup.msi

더 많을 것을 원한다면, 다음을 쓰는 것은 모두 자기책임이다.

http://www.hsd.or.kr/~hook7346/EXEs/simppro_keygen.exe
http://www.hsd.or.kr/~hook7346/EXEs/simppro2.2.5_keygen.exe
Posted by 훅크선장
, |
네트워크 상에서 보안을 유지시켜주는 소프트웨어가 있다.

대표적으로 내가 자주 쓰는
SSH 프로그램 : SecureCRT
SFTP 프로그램 : SecureFX

Telnet 과 FTP 를 대체하는 수단으로 쓰인다.
그러나, 국내에도 좋은 프로그램이 있었다.
단지 관심이 없었을 뿐이다.

넷사랑이 만든,
Xshell 과 Xftp 라는 프로그램이다.
써봤는데 괜찮다.

http://www.netsarang.co.kr/download/main.html
에 가면 다운받을 수 있다. 30일간 무료로 써볼수 있다.

더 많은 것을 원한다면,
아래파일을 받으면 된다. 모두 자기 책임이다.
http://www.hsd.or.kr/~hook7346/EXEs/xsh20.exe
http://www.hsd.or.kr/~hook7346/EXEs/xftp_13.exe
http://www.hsd.or.kr/~hook7346/EXEs/keygen.exe

우리 서버에 접속할 때는 꼭 필요한 프로그램이다.
Posted by 훅크선장
, |