'0x04 reference&tools'에 해당되는 글 40건

  1. 2009.12.24 Mongoose
  2. 2009.12.10 Waledac 관련 자료
  3. 2009.11.10 Koobface 웜 2
  4. 2009.10.23 Gumblar Reloaded
  5. 2009.09.23 pcap file format 1
  6. 2009.07.16 7.7대란 원흉 악성코드간의 관계도(안랩) 1
  7. 2009.07.07 imrabot
  8. 2009.06.25 Andrew Martin의 Nine-Ball 공격 분석
  9. 2009.03.12 iDefenseLab Malcode Analysis Software Tools
  10. 2009.03.02 Windows Handle
0x04 reference&tools2009. 12. 24. 13:55


http://code.google.com/p/mongoose/

PT나 시연때 간단하게 쓰기 좋은 웹서버입니다.




Overview


Mongoose is an easy to use web server. It can be embedded into existing application to provide a web interface to it.

Mongoose web server executable is self-sufficient, it does not depend on anything to start serving requests. If it is copied to any directory and executed, it starts to serve that directory on port 8080 (so to access files, go to http://localhost:8080). If some additional config is required - for example, different listening port or IP-based access control, then a mongoose.conf file with respective options (see example) can be created in the same directory where executable lives. This makes Mongoose perfect for all sorts of demos, quick tests, file sharing, and Web programming.

Features


  • Crossplatform - works on Windows, MacOS and most flavors of UNIX
  • CGI, SSL, SSI, Digest (MD5) authorization, resumed download, aliases
  • IP-based ACL, Windows service, GET, POST, HEAD, PUT, DELETE methods
  • Small footprint: 40 Kb executable on Linux 2.6 i386 system
  • Embeddable with simple and clean API. Source is in single .c file to make things easy
  • Language suport for:
    • C/C++ (native)
    • Python - since version 2.6 (done)
    • C# - since version 2.7 (done)
    • Ruby - since version 2.9 (todo)
    • Lua - since version 2.9 (todo)
Posted by demantos
0x04 reference&tools2009. 12. 10. 15:17
Posted by demantos
0x04 reference&tools2009. 11. 10. 14:08


오늘 아침 아래 글을 보았습니다.

http://blog.ahnlab.com/asec/176?TSSESSIONblogahnlabcom=67765c093a27d0b62777426c78d3e4c4


이슈가 된지 오래되었는데 이전에 나왔던 koobface와 약간 다른 양상을 보인다고 하는군요..
유튜브(YouTube) 동영상 관련 코덱으로 위장해서 전파가 되고 있었고
동영상을 클릭하면 Flash Player 10.37을 설치하라고 하면서 Setup.exe 파일을 다운로드해서 실행한다고 합니다.
일단 감염이 되면 system32 폴더에 ld15.exe 파일을 생성합니다.

이번건이 변종이라고 해서 예전에 나왔던 샘플을 구해봤습니다.
꽤 많더군요..(20개 -_-;;)

일단 앞뒤 안보고 전부 실행해봤습니다.
파일들이 많이 생기더군요..

이번건와 다른점은 system32 폴더가 아닌 C:\WINDOWS 폴더에 파일들을 생성하고 있었습니다.

좀 더 검색을 해보니 트렌드마이크로에 좋은 분석 자료들이 있더군요..

일단 koobface 웜의 동작도(?)부터 보시죠..


[클릭해서 크게보세요]


원문 : http://blog.trendmicro.com/the-real-face-of-koobface/


참 대단한 녀석이군....이라는 생각이 들었습니다.
시간나면 확보된 샘플들 하나씩 분석해봐야겠습니다.
(과연....가짜 rar이나 마무리 지어라...-_-;;;;)

마지막으로 트렌드마이크로에서 가져온 koobface 분석보고서입니다.
상당히 자세하게 작성되어 있는 좋은 자료로 보여 첨부합니다.






Posted by demantos
0x04 reference&tools2009. 10. 23. 10:42


[참고 블로그]
http://hummingbird.tistory.com/1049
http://viruslab.tistory.com/689
http://blog.ahnlab.com/asec/162 [추가]



Gumblar Reloaded


http://blogs.iss.net/archive/GumblarReloaded.html

Posted by John Kuhn and Ryan McNulty with a little help from Holly Stewart on October 19, 2009 at 4:12 PM EDT.

Gumblar is back, and it has an upgraded arsenal of exploits to compromise your browser, Office, and Adobe® products.

Here in Managed Security Services, we’ve noticed a considerable elevation in our global hits on malicious PDF files.  More specifically, the signature used to detect the latest Adobe Reader Remote Code Execution has picked up most of the activity.  Here's a graph of the attacks we’re seeing:


 
The event count on Oct 19 ended at over a thousand events, five times the normal event count for this kind of malicious PDF and nearly doubling the kind of attack activity we've seen in the past.

Upon reviewing the data, it became very apparent that the sites hosting the malicious files were legitimate websites (privately owned and operated).  All of these websites have been compromised and are now indiscriminately serving the malicious payload to countless victims.

In the past, Gumblar has been known to use stolen FTP password credentials to compromise their victim’s websites.  We can only guess that these compromises were no different.  As website visitors get infected, they (unknowingly) are farmed for any FTP credentials, seemingly providing the Gumblar controllers with an endless supply of future websites they can compromise.

So what’s different this time around?  In previous versions of Gumblar, the malicious scripts and payload were hosted on a remote server.  Iframe code was injected into the compromised website, and it redirected visitors to their rogue server (gumblar.cn).  This time around, they are placing the malicious scripts and payload directly on the compromised host, which gives them a decentralized and redundant attack vector, spread across thousands of legitimate websites around the world.

The uploaded scripts are placed carefully to match existing file structures currently on the websites.  Heavy obfuscation is used in an attempt to evade some existing security measures.

Here's a snippet of the obfuscated malicious script:

Some of the attack vectors have also changed.  Today, we see the following exploits in play:

All of these attacks are very recent and effective at compromising the client side victim in an effort to propagate their malicious payload worldwide.  Coverage for the updated Trojan is still very low according to an analysis done through VirusTotal.

Your best means of protection is to use protections provided by your IPS/IDS device and to apply the latest patches for all of the affected applications, if you haven’t already done so.

Gumblar is a force to be reckoned with, and this latest push of theirs is a true testament to that fact.  As always, we’ll do our best to keep you informed of its changes and activities here.

 

Change History

Tue, Oct 20, 2009: Updated the chart to reflect the event count total at the end of Monday.


 



Reloaded 라는 단어를 보니 매트릭스가 생각나는군요...^^;;
오늘 저녁엔 매트릭스나 볼까....




Posted by demantos
0x04 reference&tools2009. 9. 23. 12:21

어제 직원이 가져온 "해킹과 보안" 책을 봤습니다.
SecurityProof에서 만든 잡지인데 POC2008 Reverse Engineering Contest 우승팀 분석 보고서가 있더군요..
문제에 사용되었던 파일은 http://www.powerofcommunity.net/recon.zip 에서 다운로드 가능합니다.

첫번째 나오는 내용이 pcap 파일을 분석하는 내용인데 pcap 파일 포맷과 타입에 대해서 알고 있어야 풀이가 가능한 문제더군요..
그래서 간단히 공부한 내용 정리해서 올려봅니다.


Wireshark

아마 현재 가장 많이 사용하는 패킷 캡쳐툴은 Wireshark가 아닌가 생각됩니다.
물론 아직도 Ethereal을 고집하시는 분들도 계시지만 Wireshark랑 기능이나 GUI나 다 똑같으니...

공부하던 중 Wireshark 설치시 같이 설치되는 CLI 명령 중 잘 사용하면 좋을 것 같은 명령이 있었습니다.
(저만 모르고 있었던건 아니겠죠...-_-;;)


capinfos.exe

pcap 파일의 정보를 보여줍니다.

PS C:\Program Files\Wireshark> .\capinfos.exe E:\wargame\POC_RE_Contest\Network\analysis_1.cap
File name: E:\wargame\POC_RE_Contest\Network\analysis_1.cap
File type: Wireshark/tcpdump/... - libpcap
File encapsulation: SLIP
Number of packets: 914
File size: 269172 bytes
Data size: 255896 bytes
Capture duration: 133057646.198371 seconds
Start time: Fri Apr 16 17:03:30 2004
End time: Fri Jul 04 17:30:56 2008
Data rate: 0.00 bytes/s
Data rate: 0.02 bits/s
Average packet size: 279.97 bytes

파일 타입은 libpcap이고 파일은 SLIP형태로 캡슐화되어 있다는 것을 알 수 있습니다.



editcap.exe

pcap 파일 포캣을 수정하거나 변경합니다.

PS C:\Program Files\Wireshark> .\editcap.exe E:\wargame\POC_RE_Contest\Network\analysis_1.cap -F libpcap -T etherE:\wargame\POC_RE_Contest\Network\analysis_1_ether.cap

파일 타입을 libpcap으로 변경하고 캡슐화 방식을 ethernet으로 변경하라는 명령입니다.



-T 옵션을 쓰고 캡슐화 타입을 쓰지 않으시면 전체 캡슐화 타입을 확인하실 수 있고 -F 옵션을 쓰고 캡쳐 타입을 쓰지 않으시면 전체 캡쳐 타입을 확인하실 수 있습니다.

ethernet 캡슐화 타입은 우리가 일반적으로 알고 있는 ethernet상에서의 패킷을 의미하고 SLIP는 Serial Line Internet Protocol로 일반 가정PC에 모뎀을 달아서 통신하게 되는데 이 때 전화국 서버와 PC의 시리얼 라인상으로 TCP나 IP 트래픽을 전송하는데 있어서 필요한 프로토콜입니다.

어차피 pcap은 네트워크 통신에 사용된 패킷을 캡쳐한 것인데 어느 구간에서 캡쳐하느냐에 따라서 캡슐화 타입이 다를 것입니다.

문제에서 제시했던 pcap 파일을 까보면 다음과 같이 프로토콜이 UNKNOWN이라고 나오는걸 확인하실 수 있습니다.




이것은 파일 자체에 캡슐화 타입과 실제 캡쳐된 파일의 캡슐화 타입이 다르기 때문인데요 캡슐화 타입을 ethernet으로 바꾸면 정상적인 패킷을 볼 수 있습니다.




capinfos.exe 파일로 pcap 파일의 형태를 파악하고 editcap.exe로 타입을 변경하니 정상적인 패킷을 볼 수 있었습니다.
앞으로 이상한 pcap 파일을 보면 두개의 명령을 통해서 먼저 확인하는 습관을 들여야 겠군요...^^


PCAP file format

위 내용을 보다보니 pcap 파일의 포맷이 궁금해서 찾아봤습니다. 생각보다 단순했었습니다.

Global Header

Packet Header

Packet Data

Packet Header

Packet Data

Packet Header

Packet Data

...






파란색이 Global Header이고 붉은색으로 된 부분이 Packet Header와 Packet Data입니다.
Wireshark에서 볼 때 한줄 한줄의 내용이 붉은색으로 된 Packet Header와 Data가 되는거죠.

좀 자세한 내용은 아래 링크를 참조하시면 되겠습니다.
아래 링크에 나오는 구조체는 wireshark 소스코드에서 wiretap/libpcap.h 파일에서 확인하실 수 있습니다.
소스코드에서 약간 다른부분이라면 magic number를 따로 선언해서 사용하고 있다는 점입니다.(그냥 참고만 하시면 되겠습니다)

http://wiki.wireshark.org/Development/LibpcapFileFormat

http://mindori.egloos.com/2390488





이로써 아주 간단한 pcap file format에 대해서 알아보았습니다.

패킷 분석을 자주하시는 분들께 도움이 되었으면 합니다.






Posted by demantos
0x04 reference&tools2009. 7. 16. 18:22

바이러스랩님 블로그 갔다가 발견했습니다.

http://viruslab.tistory.com/935


원본은 안랩 메인페이지에서 링크타고 들어가니 나오더군요..

http://kr.ahnlab.com/info/securityinfo/newSecuNewsView.ahn?category=001&mid_cate=003&cPage=1&seq=14680


정리가 잘되어 있습니다.






이미 끝난 일이긴 하지만 이번 일은 쓰디쓴 교훈으로 삼고 머리속에 잘 심어놔야겠습니다.

이런 공격이 또 발생할지 아니면 좀 더 진화된 형태로 발생할지는 아무도 모르는 것이겠지요..



해답은 한가지밖에 없는 듯 합니다.

무한삽질~


삽질을 통해 진화하는 여러분들의 브레인을 보고 싶습니다~ ㅋㅋ







Posted by demantos
0x04 reference&tools2009. 7. 7. 18:52

얼마전 작성했던 DNS MX 쿼리 증가 관련 글에 약간 추가할 내용이 생겼습니다.

http://malwarelab.tistory.com/33
http://malwarelab.tistory.com/34


그때 당시 캡쳐했던 패킷에서 제가 지나쳤던 부분이 있었는데 바로 imrabot이라는 녀석이었습니다.

악성 도메인으로부터 파일을 받아서 실행을 하고 스팸메일을 뿌리기 바로 직전에 통신 내용입니다.




bot_id와 mode라는 파라미터값을 전달하자 이상한 값들이 리턴되고 있습니다.

해쉬값인듯 한데 마지막에 == 이 있어서 baase64인가보다 하고 디코딩을 시도해봤지만 base64로 인코딩된게 아니었는지

정상적으로 디코딩이 되지 않았습니다.



최근 급증하고 있는 DNS MX 쿼리는 이 녀석이 확실한 듯 하구요

정보를 찾다가 일본 사이트에서 좋은 정보를 찾을 수 있었습니다.

http://jvnrss.ise.chuo-u.ac.jp/csn/index.cgi?p=%CA%CC%A4%CEspam+bot



Fast Flux라는 기법이라고 지인분께 들었는데요

Fast Flux는 nchovy 사이트를 참조하시면 되겠습니다.

솔직히 전 잘 이해가 안갑니다...ㅜ.ㅜ

이해가 잘 되시는 분들께서 알려주시면 감사~하겠습니다.

http://nchovy.kr/forum/5/article/184





Posted by demantos
0x04 reference&tools2009. 6. 25. 18:06



얼마전 보안뉴스에 나왔던 나인볼 공격 관련 기사입니다.

http://www.boannews.com/media/view.asp?idx=16720&kind=1


검색하다가 우연히 발견한 글입니다.

http://www.martinsecurity.net/2009/06/16/nine-ball-gumblar-redux-40000-websites-compromised/




그런데 위 분석글에서 나오는 도메인들은 국내 ISP의 DNS에서는 질의 결과가 나오지 않습니다.

국내에서는 효용성이 없는 악성코드일까요??

이슈화되긴 했지만 아무튼 좀 더 확인을 해봐야겠습니다.







Posted by demantos
0x04 reference&tools2009. 3. 12. 13:10

http://labs.idefense.com/software/malcode.php


악성코드분석에 너무나도 유명한 프로그램인 SysAnlyzer를 만든 David Zimmer가 속한 iDefenseLab의 막성코드분석 툴입니다.

SysAnlyzer 외에도 Malcode Analysis Pack, HookExplorer, Multipot 등의 툴이 있습니다.

특히 Malcode Analysis Pack이란 놈이 맘에 듭니다.

Shell Extension 기능이 있는데 Strings, Hash Files, Decompile, MD5 Hash 기능이 마우스 오른쪽 클릭으로 가능합니다.




지금 IRTK(Insident Response ToolKit)라는 이름으로 분석 툴킷을 만들어 볼까 하는데

요놈도 선정 대상 리스트에 올려야겠습니다.




IRTK....
이름만 거창합니다. -_-;;




Posted by demantos
0x04 reference&tools2009. 3. 2. 14:08

윈도우 핸들에 관한 내용입니다.

출처는 소마님의 "Windows 쪼물딱 거리기" 블로그입니다.
http://somma.egloos.com/2947301

좀 더 디테일한 분석을 위해서 꼭 필요한 내용인 듯 합니다.
시스템에 대한 전반적인 이해에 도움도 될 것 같구요.




이 자료를 보니 Windows Internals 책을 빨리 사서 봐야겠다는 생각이 듭니다.

오늘 저녁에 서점에 가야할 듯...




추가. Windows Object 관련 자료들 모음
http://lucid7.egloos.com/1886838

트랙백 기능이 좋긴 좋군요...

Posted by demantos