SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Building an Automated Malware Behavioral Analysis Environment Using Free and Open-Source Tools Jim Clausing, PMTS, AT&T CSO 18 Jun 2009
Thanx up front Page 2
The Author
Page 4 Jim Clausing, GCIA, GCFA, GREM, GCIH, GCFW, GSIP, GSOC, SSP-MPA, CISSP GCIA (Gold) #64 – 2000 GCFA (Gold) #25 – 2002 GREM (Gold) #48 – 2005 And other certs along the way… SANS Mentor, StaySharp/STAR instructor, CommunitySANS instructor, Internet Storm Center handler since 2002 Instrument-rated private pilot – 2003/2004
The Paper
Page 6 SANSFIRE 2008
The patches and scripts http://handlers.sans.org/jclausing/grem_gold/ http://www.giac.org/certified_professionals/practicals/grem/48.php Page 7
The Environment – A Little History
In the beginning Page 9
Malware DB Page 10
Motivation – The Environment
Forest?  Trees? Page 12
Unpacking may lead to surprises – like no results  Page 13
Page 14 We’ve got malware, now what?
Truman (well, and Joe Stewart) FTW Page 15
The Analysis Environment
Processing a Sample
Analysis Flow Page 18
Submission [jac@fltruman001 ~]$ for i in 090???-*.piz; do sudo submit.sh $i && mv $i old-malware/; sleep 10; done     Archive:  090529-rnd_jpg.piz   inflating: rnd.jpg                  *****Processing rnd.jpg - ONEBOOT****** interface: eth1 (4.0.0.0/255.0.0.0) filter: (ip) and ( not port 45612 and not port 45611 and not tcp port 6987 and not udp port 32785 ) tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 1514 bytes Starting Faux FTP Server Emulation on port 21 Starting Faux MySQL Server Emulation on port 3306 Starting Faux SMTP Server Emulation on port 25 Starting Faux SMB Server Emulation on port 445 Starting Faux IRC Server Emulation on port 6667 Starting Faux DNS Server Emulation on port 53 Page 19
Monitoring [jac@fltruman001 ~]$ alias status alias status='cat /tmp/current.txt && echo "" && cat /tmp/sandnet*.log | tr -c "[:print:][:blank:]" "." ; tcpdump -nnr /tmp/sandnet.pcap -w - "not broadcast and (not src net 4.5.6 or not dst net 4.5.6)" | ipaudit -CST -r - -l 4.5.6.7 ; ngrep -I /tmp/sandnet.pcap "GET|POST|HEAD|OPTIONS|JOIN" "tcp port 80 and not host 4.5.6.1" | tr -c "[:print:][:blank:]" "."‘ Page 20
Monitoring, cont’d [jac@fltruman001 ~]$ status Server.exe request: name=ftp.sickbassline.com, class=IN, type=A, peer=4.5.6.7 responseIP: 4.3.2.86 responseIP: 4.3.2.63 response: rcode=NOERROR, … …, auth=, add=, aa=1 request: name=time.windows.com, class=IN, type=A, peer=4.5.6.7 responseIP: 4.5.6.1 response: rcode=NOERROR, ans=…, auth=, add=, aa=1 Connection from 4.5.6.7 USER 0wn@sickbassline.com PASS smokeweed TYPE A PORT 4,5,6,7,4,7 STOR User.mps reading from file /tmp/sandnet.pcap, link-type EN10MB (Ethernet) 4.5.6.7 4.3.2.86 6 1030 21 674 578 9 9 2009-06-04-11:24:02.2148 2009-06-04-11:24:03.3459 1 1 4.5.6.7 224.0.0.22 2 0 0 0 108 0 2 2009-06-04-11:24:09.5569 2009-06-04-11:24:10.4709 1 1 input: /tmp/sandnet.pcap filter: (ip) and ( tcp port 80 and not host 4.5.6.1 ) match: GET|POST|HEAD|OPTIONS|JOIN ##########exit Page 21
Page 22 Original Truman Analysis Tools
Page 23 The 4 Areas of Analysis
The Report – Tool Output
Page 25 Identify the OS Summary report for xxx.xxx-XPSP2-files created at ……… OS info>>> kern - Determine OS from a Windows RAM Dump (v.0.1_20060914) Ex: kern <path_to_dump_file> File Description   : NT Kernel & System File Version       : 5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) Internal Name      : ntoskrnl.exe Original File Name :  Product Name       : Microsoft® Windows® Operating System Product Version    : 5.1.2600.2180
Page 26 Analyzing Network Traffic – fauxdns DNS>>> request: name=sslrapidshare.or.tp, class=IN, type=A, peer=4.5.6.7 responseIP: 4.3.2.51 responseIP: 4.3.2.154 response: rcode=NOERROR, ans=… …, auth=, add=, aa=1 request: name=gfmd1.or.tp, class=IN, type=A, peer=4.5.6.7 responseIP: 4.3.2.104 responseIP: 4.3.2.240 response: rcode=NOERROR, ans=… …, auth=, add=, aa=1 request: name=time.windows.com, class=IN, type=A, peer=4.5.6.7 responseIP: 4.5.6.1 response: rcode=NOERROR, ans=…, auth=, add=, aa=1
Analyzing Network Traffic – fauxftp Connection from 4.5.6.7 USER 0wn@sickbassline.com PASS smokeweed TYPE A PORT 4,5,6,7,4,7 STOR User.mps Page 27
Page 28 Analyzing Network Traffic – fauxirc IRC>>> 2009-05-27-16:49:17: Connection from 4.5.6.7 2009-05-27-16:49:17: PASS lammers 2009-05-27-16:49:17: NICK [00|USA|296161] 2009-05-27-16:49:18: USER XP-8165 * 0 :ATT 2009-05-27-16:49:18: MODE [00|USA|296161] +iB-x 2009-05-27-16:49:18: JOIN #WiFi-a Crypt 2009-05-27-17:00:13: QUIT System shutting down. 2009-05-27-17:00:15: QUIT Leaving
Page 29 Analyzing Network Traffic – ipaudit IP traffic>>> srcdst  proto sp dp bytes   pkts  start  end  1 / 2 4.5.6.7 4.3.2.516 1046 80 748 346 5 5 2009-05-27-16:49:17.1300  2009-05-27-16:49:17.1473 1 2 4.5.6.7 4.3.2.104 6 1047 4242 816 697 10 10 2009-05-27- 16:49:17.1613 2009-05-27-17:00:15.5921 1 2 4.5.6.7 239.255.255.250 17 1050 1900 0 525 0 3 2009-05-27-16:49:17.3746 2009-05-27-16:49:23.3815 1 1 4.5.6.7 224.0.0.22 2 0 0 0 108 0 2 2009-05-27-17:00:14.2087 2009-05-27-17:00:14.9690 1 1
Page 30 Analyzing Network Traffic – tshark =================================================================== Protocol Hierarchy Statistics Filter: frame frame                                    frames:602 bytes:733467   eth                                    frames:602 bytes:733467 ip                                   frames:573 bytes:731979 tcp                                frames:387 bytes:146779         http                             frames:30 bytes:22708           short                          frames:5 bytes:17790           data-text-lines                frames:3 bytes:644         data                             frames:8 bytes:849 udp                                frames:57 bytes:10014 nbdgm                            frames:11 bytes:2511 smb                            frames:11 bytes:2511 mailslot                     frames:11 bytes:2511               browser                    frames:11 bytes:2511 nbns                             frames:27 bytes:2538 dns                              frames:6 bytes:532         http                             frames:3 bytes:525 ntp                              frames:2 bytes:180 bootp                            frames:8 bytes:3728       short                              frames:127 bytes:575066 igmp                               frames:2 bytes:120 arp                                  frames:29 bytes:1488 ===================================================================
Page 31 Analyzing Network Traffic – tcptrace HTTP>>> mod_http: Capturing HTTP traffic (port 80) 1 arg remaining, starting with '../small.pcap' Ostermann'stcptrace -- version 6.6.7 -- Thu Nov  4, 2004 10 packets seen, 10 TCP packets traced elapsed wallclock time: 0:00:00.002643, 3783 pkts/sec analyzed trace file elapsed time: 0:00:00.017257 Http module output: 4.5.6.7:1046 ==> 4.3.2.51:80 (a2b)   Server Syn Time:      Wed May 27 16:49:17.130145 2009 (1243457357.130)   Client Syn Time:      Wed May 27 16:49:17.130085 2009 (1243457357.130)   Server Fin Time:      Wed May 27 16:49:17.146947 2009 (1243457357.147)   Client Fin Time:      Wed May 27 16:49:17.147323 2009 (1243457357.147) GET /here2 HTTP/1.0         Response Code:       404 (Not Found)         Request Length:      66         Reply Length:        468         Content Length:      289         Content Type  :      text/html;         Time request sent:   Wed May 27 16:49:17.130584 2009 (…)         Time reply started:  Wed May 27 16:49:17.146886 2009 (…)         Time reply ACKed:    Wed May 27 16:49:17.147077 2009 (…)         Elapsed time:  16 ms (request to first byte sent)         Elapsed time:  16 ms (request to content ACKed)
Page 32 Analyzing Disk Image – AIDE --------------------------------------------------- Added files: --------------------------------------------------- added: /mnt/new/WINDOWS/avmont.exe added: /mnt/new/Documents and Settings/All Users/Application Data/TEMP --------------------------------------------------- Removed files: --------------------------------------------------- removed: /mnt/new/WINDOWS/system32/CatRoot2/tmp.edb --------------------------------------------------- Changed files: --------------------------------------------------- changed: /mnt/new/WINDOWS/system32/drivers/etc/hosts changed: /mnt/new/WINDOWS/WindowsUpdate.log changed: /mnt/new/WINDOWS/setupapi.log
Page 33 Analyzing Disk Image – ADS Alternate Data Streams>>> /mnt/new/Documents and Settings/All Users/Application Data/TEMP -> 75443743 getfattr --absolute-names -n ntfs.streams.list -PR /mnt/new
Page 34 Analyzing Disk Image – RegRipper Registry Run Key changes>>> Registry Service Key changes>>> +AvMont|Monitor de Antivirus|"C:INDOWSvmont.exe"|0x0|Auto Start| -RemoteRegistry|Remote Registry|%SystemRoot%ystem32vchost.exe -k LocalService|Share_Process|Auto Start| +RemoteRegistry|Remote Registry|%SystemRoot%ystem32vchost.exe -k LocalService|Share_Process|Disabled| -wscsvc|Security Center|%SystemRoot%ystem32vchost.exe -k netsvcs|Share_Process|Auto Start| +wscsvc|Security Center|%SystemRoot%ystem32vchost.exe -k netsvcs|Share_Process|Disabled| Firewall changes>>> -EnableFirewall -> 1
Page 35 Analyzing Disk Image – hosts file* Host file changes>>> + +127.0.0.1      www.symantec.com +127.0.0.1      securityresponse.symantec.com +127.0.0.1      symantec.com +127.0.0.1      www.sophos.com +127.0.0.1      sophos.com +127.0.0.1      www.mcafee.com +127.0.0.1      mcafee.com +127.0.0.1      liveupdate.symantecliveupdate.com +127.0.0.1      www.viruslist.com +127.0.0.1      viruslist.com +127.0.0.1      viruslist.com +127.0.0.1      f-secure.com +127.0.0.1      www.f-secure.com +127.0.0.1      kaspersky.com +127.0.0.1      kaspersky-labs.com +127.0.0.1      www.avp.com +127.0.0.1      www.kaspersky.com +127.0.0.1      avp.com
Memory Image Analysis – Volatility Page 36
Page 37 Analyzing Memory Image – connections Open Ports>>> Local Address             Remote Address            Pid 4.5.6.7:1047              4.3.2.104:4242            1484   896    135    6      Wed May 27 20:39:59 2009   1032   1027   17     Wed May 27 20:40:13 2009   1096   1900   17     Wed May 27 20:40:14 2009   1484   1047   6      Wed May 27 20:49:18 2009  < 908                  ->  135   TCP                                  > 896                  ->  135   TCP                                  9,11c9,11 < 992                  ->  1032  TCP                                  > 1484  avmont         ->  1047  TCP   C:INDOWSvmont.exe          14,15c14,16 < 992                  ->  138   UDP                                  < 908                  ->  445   UDP                                  > 1484  avmont         ->  137   UDP   C:INDOWSvmont.exe          > 0     System         ->  138   UDP                                  > 896                  ->  445   UDP
Page 38 Memory/Static Binary Analysis – ssdeep ssdeep info>>> 1536:RVt4qqO5FjciL3KBupEAbAX/e9SP+IaiOW:eu5tciL3KApRbAz+Ia1W,"abod.exe" 768:ruBNNTLa973GMVkIZqqnO5FDvcTsvJesUJDSP+f4/cF1oGoiOWK:YVt4qqO5FjcSe9SP+JaiOW, "/data/forensics/abod.exe-XPSP2-files/0c596000-abod.exe“ -------------------------------------------------------------------------------- ssdeep info>>> 1536:0BlSTT+JwGgVXGsOkCMGVLwaQyafnSI0OYRr:0BYNlVXGsOtPwFtfm, "1b1e067fdb0f2a44a50d9e290022b9ed.exe" 1b1e067fdb0f2a44a50d9e290022b9ed.exe matches e933dbd16c9509418a2212c9d62c7976.exe (80) 3072:0zhQO2dw847UiImHkwebMPK4wRE4pRThKt/94:09QbViEwEM94TThKt14, "/data/forensics/1b1e067fdb0f2a44a50d9e290022b9ed.exe-XPSP2-files/0ca74000-sandnet.exe" /data/forensics/1b1e067fdb0f2a44a50d9e290022b9ed.exe-XPSP2-files/0ca74000-sandnet.exe matches /data/forensics/e933dbd16c9509418a2212 c9d62c7976.exe-XPSP2-files/007bc000-sandnet.exe (96)
Page 39 Static Binary Analysis – binhash BinHash info>>> File: [/forensics/exes/abod.exe]        b826d0f222242c1e48f4e1ebe778a534 PE Phdr:        af86103672ba3bba2d21f2691465520f PE Opt Hdr:     f8ea55a399eeec409874af01ca0cf01d Import [1] Offset: (f570) Size: (180): 93f613363a9cb87c3a20e3f2e1fc47b7 Import [12] Offset: (f000) Size: (608): eafa58275a218a26f92631bf75b10b8f [0] (.text) (VirtualAddress: 00001000) (PtrToData: 00001000) (SizeOfData: 0000e000)  Shdr: aaa4cacbb1cc38713961cc2e5931b982 Shdr Data: f571948f8203e66d09c87b00ae748c8d [1] (.rdata) (VirtualAddress: 0000f000) (PtrToData: 0000f000) (SizeOfData: 00002000)  Shdr: 46aa637bbc2c0335c427f6ca42021df9 Shdr Data: 3b10f3f4c6012e87d46686464575926c [2] (.data) (VirtualAddress: 00011000) (PtrToData: 00011000) (SizeOfData: 00003000)  Shdr: cff63d398711731f58eee390a6ce8513 Shdr Data: 71cc6a0ff1c18b313d21f1f03229738e
Page 40 Static Binary Analysis – packerid.py Packer info>>> [['Armadillo v1.71'], ['Microsoft Visual C++ v5.0/v6.0 (MFC)'], ['Microsoft Visual C++']]
Page 41 Static Binary Analysis – Volatility malfind.py* # # lsass.exe (Pid: 676) # + VAD node @821bfb00 Start 00c60000 End 00c6ffff Tag VadS Flags  18 + VAD node @8236b208 Start 00c80000 End 00c96fff Tag VadS Flags  18   - Status: disassembling with pydasm...    0xc80000 call 0x567d    0xc80005 retn 0x8    0xc80008 push ecx    0xc80009 push esi    0xc8000a call 0x1582 Found 2 suspicious Vad entries
Page 42 Limitations
Page 43 Future Work
Page 44 More Future Work
Questions? E-mail: jac@att.com or jclausing@isc.sans.org  Page 45
SANS Mentor Class – SEC 508 (Forensics) For those of you from central OH (or folks you work with), I’ll be facilitating another mentor class in the fall. Thursday evenings from 6:30-8:30PM in Reynoldsburg, OH running 10 Sep-12 Nov. http://www.sans.org/mentor/details.php?nid=19458 Page 46

Weitere ähnliche Inhalte

Was ist angesagt?

Teach your (micro)services talk Protocol Buffers with gRPC.
Teach your (micro)services talk Protocol Buffers with gRPC.Teach your (micro)services talk Protocol Buffers with gRPC.
Teach your (micro)services talk Protocol Buffers with gRPC.
Mihai Iachimovschi
 
How happy they became with H2O/mruby and the future of HTTP
How happy they became with H2O/mruby and the future of HTTPHow happy they became with H2O/mruby and the future of HTTP
How happy they became with H2O/mruby and the future of HTTP
Ichito Nagata
 
How You Will Get Hacked Ten Years from Now
How You Will Get Hacked Ten Years from NowHow You Will Get Hacked Ten Years from Now
How You Will Get Hacked Ten Years from Now
julievreeland
 

Was ist angesagt? (20)

DEF CON 27 - MAKSIM SHUDRAK - zero bugs found hold my beer afl how to improve...
DEF CON 27 - MAKSIM SHUDRAK - zero bugs found hold my beer afl how to improve...DEF CON 27 - MAKSIM SHUDRAK - zero bugs found hold my beer afl how to improve...
DEF CON 27 - MAKSIM SHUDRAK - zero bugs found hold my beer afl how to improve...
 
H2O - the optimized HTTP server
H2O - the optimized HTTP serverH2O - the optimized HTTP server
H2O - the optimized HTTP server
 
Reorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and BeyondReorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and Beyond
 
7. protocols
7. protocols7. protocols
7. protocols
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
 
Teach your (micro)services talk Protocol Buffers with gRPC.
Teach your (micro)services talk Protocol Buffers with gRPC.Teach your (micro)services talk Protocol Buffers with gRPC.
Teach your (micro)services talk Protocol Buffers with gRPC.
 
7.protocols 2
7.protocols 27.protocols 2
7.protocols 2
 
Promise of Push (HTTP/2 Web Performance)
Promise of Push (HTTP/2 Web Performance)Promise of Push (HTTP/2 Web Performance)
Promise of Push (HTTP/2 Web Performance)
 
Cache aware-server-push in H2O version 1.5
Cache aware-server-push in H2O version 1.5Cache aware-server-push in H2O version 1.5
Cache aware-server-push in H2O version 1.5
 
PLNOG 17 - Patryk Wojtachnio - DDoS mitygacja oraz ochrona sieci w środowisku...
PLNOG 17 - Patryk Wojtachnio - DDoS mitygacja oraz ochrona sieci w środowisku...PLNOG 17 - Patryk Wojtachnio - DDoS mitygacja oraz ochrona sieci w środowisku...
PLNOG 17 - Patryk Wojtachnio - DDoS mitygacja oraz ochrona sieci w środowisku...
 
DNS-SD Extentions
DNS-SD ExtentionsDNS-SD Extentions
DNS-SD Extentions
 
How to Troubleshoot OpenStack Without Losing Sleep
How to Troubleshoot OpenStack Without Losing SleepHow to Troubleshoot OpenStack Without Losing Sleep
How to Troubleshoot OpenStack Without Losing Sleep
 
Wuala, P2P Online Storage
Wuala, P2P Online StorageWuala, P2P Online Storage
Wuala, P2P Online Storage
 
How happy they became with H2O/mruby and the future of HTTP
How happy they became with H2O/mruby and the future of HTTPHow happy they became with H2O/mruby and the future of HTTP
How happy they became with H2O/mruby and the future of HTTP
 
How You Will Get Hacked Ten Years from Now
How You Will Get Hacked Ten Years from NowHow You Will Get Hacked Ten Years from Now
How You Will Get Hacked Ten Years from Now
 
Make gRPC great again
Make gRPC great againMake gRPC great again
Make gRPC great again
 
gofortution
gofortutiongofortution
gofortution
 
"Powershell kung-fu" - Paweł Maziarz
"Powershell kung-fu" - Paweł Maziarz"Powershell kung-fu" - Paweł Maziarz
"Powershell kung-fu" - Paweł Maziarz
 
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
 
Developing the fastest HTTP/2 server
Developing the fastest HTTP/2 serverDeveloping the fastest HTTP/2 server
Developing the fastest HTTP/2 server
 

Andere mochten auch

Unidad II. Modelo de Datos
Unidad II. Modelo de DatosUnidad II. Modelo de Datos
Unidad II. Modelo de Datos
ucbasededatos
 
Jesuitas Ecuador - Noticias Diciembre 2012
Jesuitas Ecuador - Noticias Diciembre 2012Jesuitas Ecuador - Noticias Diciembre 2012
Jesuitas Ecuador - Noticias Diciembre 2012
JesuitasEc
 
Librovirtual1 47
Librovirtual1 47Librovirtual1 47
Librovirtual1 47
Diana Noboa
 
Maxwell Y Los Bichos Raros
Maxwell Y Los Bichos RarosMaxwell Y Los Bichos Raros
Maxwell Y Los Bichos Raros
maspereiracom
 
Revista fetracom pdf
Revista fetracom pdfRevista fetracom pdf
Revista fetracom pdf
Rodrigo Brito
 
Estrutura patrimonial e plano de contas
Estrutura patrimonial e plano de contasEstrutura patrimonial e plano de contas
Estrutura patrimonial e plano de contas
Concurseiro Antenado
 

Andere mochten auch (20)

Unidad II. Modelo de Datos
Unidad II. Modelo de DatosUnidad II. Modelo de Datos
Unidad II. Modelo de Datos
 
Jesuitas Ecuador - Noticias Diciembre 2012
Jesuitas Ecuador - Noticias Diciembre 2012Jesuitas Ecuador - Noticias Diciembre 2012
Jesuitas Ecuador - Noticias Diciembre 2012
 
Globalizacion1
Globalizacion1Globalizacion1
Globalizacion1
 
Librovirtual1 47
Librovirtual1 47Librovirtual1 47
Librovirtual1 47
 
Maxwell Y Los Bichos Raros
Maxwell Y Los Bichos RarosMaxwell Y Los Bichos Raros
Maxwell Y Los Bichos Raros
 
Revista fetracom pdf
Revista fetracom pdfRevista fetracom pdf
Revista fetracom pdf
 
Redes Clase 3
Redes Clase 3Redes Clase 3
Redes Clase 3
 
Estrutura patrimonial e plano de contas
Estrutura patrimonial e plano de contasEstrutura patrimonial e plano de contas
Estrutura patrimonial e plano de contas
 
Inteligencia emocional
Inteligencia emocionalInteligencia emocional
Inteligencia emocional
 
Parque nacional río abiseo
Parque nacional río abiseoParque nacional río abiseo
Parque nacional río abiseo
 
Constancia
ConstanciaConstancia
Constancia
 
Cartilla de políticas
Cartilla de políticas Cartilla de políticas
Cartilla de políticas
 
Educación[1]..
Educación[1]..Educación[1]..
Educación[1]..
 
Code of conduct
Code of conductCode of conduct
Code of conduct
 
Mediana
MedianaMediana
Mediana
 
A doena como_caminho
A doena como_caminhoA doena como_caminho
A doena como_caminho
 
Estratégia
EstratégiaEstratégia
Estratégia
 
Actividad de aprendizaje 8
Actividad de aprendizaje 8Actividad de aprendizaje 8
Actividad de aprendizaje 8
 
Atitudes
AtitudesAtitudes
Atitudes
 
Chapter3
Chapter3Chapter3
Chapter3
 

Ähnlich wie Building an Automated Behavioral Malware Analysis Environment using Free and Open-Source Software

Hacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning TechniquesHacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning Techniques
amiable_indian
 
import rdma: zero-copy networking with RDMA and Python
import rdma: zero-copy networking with RDMA and Pythonimport rdma: zero-copy networking with RDMA and Python
import rdma: zero-copy networking with RDMA and Python
groveronline
 
Pentesting111111 Cheat Sheet_OSCP_2023.pdf
Pentesting111111 Cheat Sheet_OSCP_2023.pdfPentesting111111 Cheat Sheet_OSCP_2023.pdf
Pentesting111111 Cheat Sheet_OSCP_2023.pdf
faker1842002
 
Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)
Ontico
 

Ähnlich wie Building an Automated Behavioral Malware Analysis Environment using Free and Open-Source Software (20)

Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby Systems
 
Incident response: Advanced Network Forensics
Incident response: Advanced Network ForensicsIncident response: Advanced Network Forensics
Incident response: Advanced Network Forensics
 
Day2
Day2Day2
Day2
 
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
 
Debugging Ruby
Debugging RubyDebugging Ruby
Debugging Ruby
 
HTTP/2 What's inside and Why
HTTP/2 What's inside and WhyHTTP/2 What's inside and Why
HTTP/2 What's inside and Why
 
Pycon - Python for ethical hackers
Pycon - Python for ethical hackers Pycon - Python for ethical hackers
Pycon - Python for ethical hackers
 
Primer to Browser Netwroking
Primer to Browser NetwrokingPrimer to Browser Netwroking
Primer to Browser Netwroking
 
The Road to End-to-End Encryption in Jitsi Meet
The Road to End-to-End Encryption in Jitsi MeetThe Road to End-to-End Encryption in Jitsi Meet
The Road to End-to-End Encryption in Jitsi Meet
 
Stress your DUT
Stress your DUTStress your DUT
Stress your DUT
 
PLNOG20 - Paweł Małachowski - Stress your DUT–wykorzystanie narzędzi open sou...
PLNOG20 - Paweł Małachowski - Stress your DUT–wykorzystanie narzędzi open sou...PLNOG20 - Paweł Małachowski - Stress your DUT–wykorzystanie narzędzi open sou...
PLNOG20 - Paweł Małachowski - Stress your DUT–wykorzystanie narzędzi open sou...
 
Hacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning TechniquesHacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning Techniques
 
import rdma: zero-copy networking with RDMA and Python
import rdma: zero-copy networking with RDMA and Pythonimport rdma: zero-copy networking with RDMA and Python
import rdma: zero-copy networking with RDMA and Python
 
Pentesting111111 Cheat Sheet_OSCP_2023.pdf
Pentesting111111 Cheat Sheet_OSCP_2023.pdfPentesting111111 Cheat Sheet_OSCP_2023.pdf
Pentesting111111 Cheat Sheet_OSCP_2023.pdf
 
The post release technologies of Crysis 3 (Slides Only) - Stewart Needham
The post release technologies of Crysis 3 (Slides Only) - Stewart NeedhamThe post release technologies of Crysis 3 (Slides Only) - Stewart Needham
The post release technologies of Crysis 3 (Slides Only) - Stewart Needham
 
Top-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptxTop-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptx
 
Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)
 
CCNP Data Center Centralized Management Automation
CCNP Data Center Centralized Management AutomationCCNP Data Center Centralized Management Automation
CCNP Data Center Centralized Management Automation
 
Encrypted DNS research @ nic.at
Encrypted DNS research @ nic.atEncrypted DNS research @ nic.at
Encrypted DNS research @ nic.at
 
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande Modem
 

Building an Automated Behavioral Malware Analysis Environment using Free and Open-Source Software

  • 1. Building an Automated Malware Behavioral Analysis Environment Using Free and Open-Source Tools Jim Clausing, PMTS, AT&T CSO 18 Jun 2009
  • 2. Thanx up front Page 2
  • 4. Page 4 Jim Clausing, GCIA, GCFA, GREM, GCIH, GCFW, GSIP, GSOC, SSP-MPA, CISSP GCIA (Gold) #64 – 2000 GCFA (Gold) #25 – 2002 GREM (Gold) #48 – 2005 And other certs along the way… SANS Mentor, StaySharp/STAR instructor, CommunitySANS instructor, Internet Storm Center handler since 2002 Instrument-rated private pilot – 2003/2004
  • 7. The patches and scripts http://handlers.sans.org/jclausing/grem_gold/ http://www.giac.org/certified_professionals/practicals/grem/48.php Page 7
  • 8. The Environment – A Little History
  • 11. Motivation – The Environment
  • 12. Forest? Trees? Page 12
  • 13. Unpacking may lead to surprises – like no results  Page 13
  • 14. Page 14 We’ve got malware, now what?
  • 15. Truman (well, and Joe Stewart) FTW Page 15
  • 19. Submission [jac@fltruman001 ~]$ for i in 090???-*.piz; do sudo submit.sh $i && mv $i old-malware/; sleep 10; done Archive: 090529-rnd_jpg.piz inflating: rnd.jpg *****Processing rnd.jpg - ONEBOOT****** interface: eth1 (4.0.0.0/255.0.0.0) filter: (ip) and ( not port 45612 and not port 45611 and not tcp port 6987 and not udp port 32785 ) tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 1514 bytes Starting Faux FTP Server Emulation on port 21 Starting Faux MySQL Server Emulation on port 3306 Starting Faux SMTP Server Emulation on port 25 Starting Faux SMB Server Emulation on port 445 Starting Faux IRC Server Emulation on port 6667 Starting Faux DNS Server Emulation on port 53 Page 19
  • 20. Monitoring [jac@fltruman001 ~]$ alias status alias status='cat /tmp/current.txt && echo "" && cat /tmp/sandnet*.log | tr -c "[:print:][:blank:]" "." ; tcpdump -nnr /tmp/sandnet.pcap -w - "not broadcast and (not src net 4.5.6 or not dst net 4.5.6)" | ipaudit -CST -r - -l 4.5.6.7 ; ngrep -I /tmp/sandnet.pcap "GET|POST|HEAD|OPTIONS|JOIN" "tcp port 80 and not host 4.5.6.1" | tr -c "[:print:][:blank:]" "."‘ Page 20
  • 21. Monitoring, cont’d [jac@fltruman001 ~]$ status Server.exe request: name=ftp.sickbassline.com, class=IN, type=A, peer=4.5.6.7 responseIP: 4.3.2.86 responseIP: 4.3.2.63 response: rcode=NOERROR, … …, auth=, add=, aa=1 request: name=time.windows.com, class=IN, type=A, peer=4.5.6.7 responseIP: 4.5.6.1 response: rcode=NOERROR, ans=…, auth=, add=, aa=1 Connection from 4.5.6.7 USER 0wn@sickbassline.com PASS smokeweed TYPE A PORT 4,5,6,7,4,7 STOR User.mps reading from file /tmp/sandnet.pcap, link-type EN10MB (Ethernet) 4.5.6.7 4.3.2.86 6 1030 21 674 578 9 9 2009-06-04-11:24:02.2148 2009-06-04-11:24:03.3459 1 1 4.5.6.7 224.0.0.22 2 0 0 0 108 0 2 2009-06-04-11:24:09.5569 2009-06-04-11:24:10.4709 1 1 input: /tmp/sandnet.pcap filter: (ip) and ( tcp port 80 and not host 4.5.6.1 ) match: GET|POST|HEAD|OPTIONS|JOIN ##########exit Page 21
  • 22. Page 22 Original Truman Analysis Tools
  • 23. Page 23 The 4 Areas of Analysis
  • 24. The Report – Tool Output
  • 25. Page 25 Identify the OS Summary report for xxx.xxx-XPSP2-files created at ……… OS info>>> kern - Determine OS from a Windows RAM Dump (v.0.1_20060914) Ex: kern <path_to_dump_file> File Description : NT Kernel & System File Version : 5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) Internal Name : ntoskrnl.exe Original File Name : Product Name : Microsoft® Windows® Operating System Product Version : 5.1.2600.2180
  • 26. Page 26 Analyzing Network Traffic – fauxdns DNS>>> request: name=sslrapidshare.or.tp, class=IN, type=A, peer=4.5.6.7 responseIP: 4.3.2.51 responseIP: 4.3.2.154 response: rcode=NOERROR, ans=… …, auth=, add=, aa=1 request: name=gfmd1.or.tp, class=IN, type=A, peer=4.5.6.7 responseIP: 4.3.2.104 responseIP: 4.3.2.240 response: rcode=NOERROR, ans=… …, auth=, add=, aa=1 request: name=time.windows.com, class=IN, type=A, peer=4.5.6.7 responseIP: 4.5.6.1 response: rcode=NOERROR, ans=…, auth=, add=, aa=1
  • 27. Analyzing Network Traffic – fauxftp Connection from 4.5.6.7 USER 0wn@sickbassline.com PASS smokeweed TYPE A PORT 4,5,6,7,4,7 STOR User.mps Page 27
  • 28. Page 28 Analyzing Network Traffic – fauxirc IRC>>> 2009-05-27-16:49:17: Connection from 4.5.6.7 2009-05-27-16:49:17: PASS lammers 2009-05-27-16:49:17: NICK [00|USA|296161] 2009-05-27-16:49:18: USER XP-8165 * 0 :ATT 2009-05-27-16:49:18: MODE [00|USA|296161] +iB-x 2009-05-27-16:49:18: JOIN #WiFi-a Crypt 2009-05-27-17:00:13: QUIT System shutting down. 2009-05-27-17:00:15: QUIT Leaving
  • 29. Page 29 Analyzing Network Traffic – ipaudit IP traffic>>> srcdst proto sp dp bytes pkts start end 1 / 2 4.5.6.7 4.3.2.516 1046 80 748 346 5 5 2009-05-27-16:49:17.1300 2009-05-27-16:49:17.1473 1 2 4.5.6.7 4.3.2.104 6 1047 4242 816 697 10 10 2009-05-27- 16:49:17.1613 2009-05-27-17:00:15.5921 1 2 4.5.6.7 239.255.255.250 17 1050 1900 0 525 0 3 2009-05-27-16:49:17.3746 2009-05-27-16:49:23.3815 1 1 4.5.6.7 224.0.0.22 2 0 0 0 108 0 2 2009-05-27-17:00:14.2087 2009-05-27-17:00:14.9690 1 1
  • 30. Page 30 Analyzing Network Traffic – tshark =================================================================== Protocol Hierarchy Statistics Filter: frame frame frames:602 bytes:733467 eth frames:602 bytes:733467 ip frames:573 bytes:731979 tcp frames:387 bytes:146779 http frames:30 bytes:22708 short frames:5 bytes:17790 data-text-lines frames:3 bytes:644 data frames:8 bytes:849 udp frames:57 bytes:10014 nbdgm frames:11 bytes:2511 smb frames:11 bytes:2511 mailslot frames:11 bytes:2511 browser frames:11 bytes:2511 nbns frames:27 bytes:2538 dns frames:6 bytes:532 http frames:3 bytes:525 ntp frames:2 bytes:180 bootp frames:8 bytes:3728 short frames:127 bytes:575066 igmp frames:2 bytes:120 arp frames:29 bytes:1488 ===================================================================
  • 31. Page 31 Analyzing Network Traffic – tcptrace HTTP>>> mod_http: Capturing HTTP traffic (port 80) 1 arg remaining, starting with '../small.pcap' Ostermann'stcptrace -- version 6.6.7 -- Thu Nov 4, 2004 10 packets seen, 10 TCP packets traced elapsed wallclock time: 0:00:00.002643, 3783 pkts/sec analyzed trace file elapsed time: 0:00:00.017257 Http module output: 4.5.6.7:1046 ==> 4.3.2.51:80 (a2b) Server Syn Time: Wed May 27 16:49:17.130145 2009 (1243457357.130) Client Syn Time: Wed May 27 16:49:17.130085 2009 (1243457357.130) Server Fin Time: Wed May 27 16:49:17.146947 2009 (1243457357.147) Client Fin Time: Wed May 27 16:49:17.147323 2009 (1243457357.147) GET /here2 HTTP/1.0 Response Code: 404 (Not Found) Request Length: 66 Reply Length: 468 Content Length: 289 Content Type : text/html; Time request sent: Wed May 27 16:49:17.130584 2009 (…) Time reply started: Wed May 27 16:49:17.146886 2009 (…) Time reply ACKed: Wed May 27 16:49:17.147077 2009 (…) Elapsed time: 16 ms (request to first byte sent) Elapsed time: 16 ms (request to content ACKed)
  • 32. Page 32 Analyzing Disk Image – AIDE --------------------------------------------------- Added files: --------------------------------------------------- added: /mnt/new/WINDOWS/avmont.exe added: /mnt/new/Documents and Settings/All Users/Application Data/TEMP --------------------------------------------------- Removed files: --------------------------------------------------- removed: /mnt/new/WINDOWS/system32/CatRoot2/tmp.edb --------------------------------------------------- Changed files: --------------------------------------------------- changed: /mnt/new/WINDOWS/system32/drivers/etc/hosts changed: /mnt/new/WINDOWS/WindowsUpdate.log changed: /mnt/new/WINDOWS/setupapi.log
  • 33. Page 33 Analyzing Disk Image – ADS Alternate Data Streams>>> /mnt/new/Documents and Settings/All Users/Application Data/TEMP -> 75443743 getfattr --absolute-names -n ntfs.streams.list -PR /mnt/new
  • 34. Page 34 Analyzing Disk Image – RegRipper Registry Run Key changes>>> Registry Service Key changes>>> +AvMont|Monitor de Antivirus|"C:INDOWSvmont.exe"|0x0|Auto Start| -RemoteRegistry|Remote Registry|%SystemRoot%ystem32vchost.exe -k LocalService|Share_Process|Auto Start| +RemoteRegistry|Remote Registry|%SystemRoot%ystem32vchost.exe -k LocalService|Share_Process|Disabled| -wscsvc|Security Center|%SystemRoot%ystem32vchost.exe -k netsvcs|Share_Process|Auto Start| +wscsvc|Security Center|%SystemRoot%ystem32vchost.exe -k netsvcs|Share_Process|Disabled| Firewall changes>>> -EnableFirewall -> 1
  • 35. Page 35 Analyzing Disk Image – hosts file* Host file changes>>> + +127.0.0.1 www.symantec.com +127.0.0.1 securityresponse.symantec.com +127.0.0.1 symantec.com +127.0.0.1 www.sophos.com +127.0.0.1 sophos.com +127.0.0.1 www.mcafee.com +127.0.0.1 mcafee.com +127.0.0.1 liveupdate.symantecliveupdate.com +127.0.0.1 www.viruslist.com +127.0.0.1 viruslist.com +127.0.0.1 viruslist.com +127.0.0.1 f-secure.com +127.0.0.1 www.f-secure.com +127.0.0.1 kaspersky.com +127.0.0.1 kaspersky-labs.com +127.0.0.1 www.avp.com +127.0.0.1 www.kaspersky.com +127.0.0.1 avp.com
  • 36. Memory Image Analysis – Volatility Page 36
  • 37. Page 37 Analyzing Memory Image – connections Open Ports>>> Local Address Remote Address Pid 4.5.6.7:1047 4.3.2.104:4242 1484 896 135 6 Wed May 27 20:39:59 2009 1032 1027 17 Wed May 27 20:40:13 2009 1096 1900 17 Wed May 27 20:40:14 2009 1484 1047 6 Wed May 27 20:49:18 2009 < 908 -> 135 TCP > 896 -> 135 TCP 9,11c9,11 < 992 -> 1032 TCP > 1484 avmont -> 1047 TCP C:INDOWSvmont.exe 14,15c14,16 < 992 -> 138 UDP < 908 -> 445 UDP > 1484 avmont -> 137 UDP C:INDOWSvmont.exe > 0 System -> 138 UDP > 896 -> 445 UDP
  • 38. Page 38 Memory/Static Binary Analysis – ssdeep ssdeep info>>> 1536:RVt4qqO5FjciL3KBupEAbAX/e9SP+IaiOW:eu5tciL3KApRbAz+Ia1W,"abod.exe" 768:ruBNNTLa973GMVkIZqqnO5FDvcTsvJesUJDSP+f4/cF1oGoiOWK:YVt4qqO5FjcSe9SP+JaiOW, "/data/forensics/abod.exe-XPSP2-files/0c596000-abod.exe“ -------------------------------------------------------------------------------- ssdeep info>>> 1536:0BlSTT+JwGgVXGsOkCMGVLwaQyafnSI0OYRr:0BYNlVXGsOtPwFtfm, "1b1e067fdb0f2a44a50d9e290022b9ed.exe" 1b1e067fdb0f2a44a50d9e290022b9ed.exe matches e933dbd16c9509418a2212c9d62c7976.exe (80) 3072:0zhQO2dw847UiImHkwebMPK4wRE4pRThKt/94:09QbViEwEM94TThKt14, "/data/forensics/1b1e067fdb0f2a44a50d9e290022b9ed.exe-XPSP2-files/0ca74000-sandnet.exe" /data/forensics/1b1e067fdb0f2a44a50d9e290022b9ed.exe-XPSP2-files/0ca74000-sandnet.exe matches /data/forensics/e933dbd16c9509418a2212 c9d62c7976.exe-XPSP2-files/007bc000-sandnet.exe (96)
  • 39. Page 39 Static Binary Analysis – binhash BinHash info>>> File: [/forensics/exes/abod.exe] b826d0f222242c1e48f4e1ebe778a534 PE Phdr: af86103672ba3bba2d21f2691465520f PE Opt Hdr: f8ea55a399eeec409874af01ca0cf01d Import [1] Offset: (f570) Size: (180): 93f613363a9cb87c3a20e3f2e1fc47b7 Import [12] Offset: (f000) Size: (608): eafa58275a218a26f92631bf75b10b8f [0] (.text) (VirtualAddress: 00001000) (PtrToData: 00001000) (SizeOfData: 0000e000) Shdr: aaa4cacbb1cc38713961cc2e5931b982 Shdr Data: f571948f8203e66d09c87b00ae748c8d [1] (.rdata) (VirtualAddress: 0000f000) (PtrToData: 0000f000) (SizeOfData: 00002000) Shdr: 46aa637bbc2c0335c427f6ca42021df9 Shdr Data: 3b10f3f4c6012e87d46686464575926c [2] (.data) (VirtualAddress: 00011000) (PtrToData: 00011000) (SizeOfData: 00003000) Shdr: cff63d398711731f58eee390a6ce8513 Shdr Data: 71cc6a0ff1c18b313d21f1f03229738e
  • 40. Page 40 Static Binary Analysis – packerid.py Packer info>>> [['Armadillo v1.71'], ['Microsoft Visual C++ v5.0/v6.0 (MFC)'], ['Microsoft Visual C++']]
  • 41. Page 41 Static Binary Analysis – Volatility malfind.py* # # lsass.exe (Pid: 676) # + VAD node @821bfb00 Start 00c60000 End 00c6ffff Tag VadS Flags 18 + VAD node @8236b208 Start 00c80000 End 00c96fff Tag VadS Flags 18 - Status: disassembling with pydasm... 0xc80000 call 0x567d 0xc80005 retn 0x8 0xc80008 push ecx 0xc80009 push esi 0xc8000a call 0x1582 Found 2 suspicious Vad entries
  • 44. Page 44 More Future Work
  • 45. Questions? E-mail: jac@att.com or jclausing@isc.sans.org Page 45
  • 46. SANS Mentor Class – SEC 508 (Forensics) For those of you from central OH (or folks you work with), I’ll be facilitating another mentor class in the fall. Thursday evenings from 6:30-8:30PM in Reynoldsburg, OH running 10 Sep-12 Nov. http://www.sans.org/mentor/details.php?nid=19458 Page 46