
1、 什么是WebApp Pentesting
WebApp Pentesting,由PentesterLab出品。官方給自己的定義是一個簡單又十分有效學習滲透測試的演練平台。它提供諸多的漏洞系統以供網絡安全發燒友進行測試和讓黑闊們更加深刻地且透徹理解“漏洞”。
跟傳統的DVWA和WebGoat等Web演練平台不同,WebApp Pentesting提供Web漏洞練習平台的系統封裝包,這有點不同於DVWA等需要自己去搭建服務器。你不但可以針對常見Web漏洞,例如SQL注入、XSS、文件包含、文件上傳進行練習,而且還可以對系統進行系統滲透提權。這種打包完善的攻防演練系統,在我國優秀的網絡安全資訊網站Freebuf一篇文章《十大滲透測試演練系統》中提到過的十個演練系統中,只有exploit-wa才有類似的功能。怎樣?面對如此有趣的演練系統,是不是有點躍躍欲試呢?不急不急,就讓小編慢慢道來…( ̄▽ ̄)
2、WebApp Pentesting有什么特色。
除了系統漏洞和Web漏洞雙結合之外,WebApp Pentesting有兩個特別突出的優點。一個是下載之后部署十分簡便。只需配置好網絡設置和一個service apache2 start命令就成功開啟了系統。二是內容新穎,除了上文提到的傳統的Web漏洞之外,LDAP attacks、XML attacts都是很新的內容哦。
WebApp Pentesting 的設計人員通過對大量的Web應用的漏洞進行總結,這個演練系統的多數題目,都是基於實戰的,在這個演練系統中,設計者更加強調的是對方法思路的思考而不是簡單而低效地枚舉或者是單純地用工具去攻擊。官方自詡他們的項目至今還沒被超越過,當然,是馬是驢,還需要要拉出來溜溜…<( ̄ ﹌  ̄)>
3、怎么使用WebApp Pentesting
到WebApp Pentesting項目的網站上下載LiveCD版的iso文件,只需幾步簡單的安裝就可以了,熟悉Linux系統的朋友,配置網絡也十分輕松,最后開啟apache服務器就能進入演練系統了。
當你看到如下頁面時。說明你已經成功配置WebApp Pentesting了 ( ̄ˇ ̄) :
界面十分簡單,相信有着一個聰明小腦袋的各位,一看就會知道怎么用的。好了,實例就不講解了,答案在官方給出的使用手冊上有,而且使用手冊上還仔細講解了Web滲透測試的基礎知識和總結了一些經常用到的方法,非常不錯喲。祝大家使用愉快~~~ <( ̄) ̄)>
WebApp Pentesting項目網址:
https://pentesterlab.com/web_for_pentester.html
WebApp Pentesting使用手冊及答案詳解:
https://pentesterlab.com/web_for_pentester/web_for_pentester.pdf
PentesterLab的首頁以及他們其他的項目:
https://pentesterlab.com/exercises
喜歡這個項目卻不知道如何開始入手玩起來的同學,可以參考我們的實戰教程:《Web滲透測試攻略 [一]》《Web滲透測試攻略 [二]》
PentesterLab推出了一個滲透師的學習課程,看了一下感覺挺有條理,可以順着這個學習路徑鞏固知識或者從新學習.
課程地址 ———— http://pentesterlab.com/bootcamp/
課程總共分為15周,這里我也以其為區分,這個學習路徑我感覺還是非常不錯的.
0x01 Week 1 – Linux and scripting
—————————————————————
參考列表:
Hypertext Transfer Protocol – http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
Domain Name System – http://en.wikipedia.org/wiki/Domain_Name_System
Whois – http://en.wikipedia.org/wiki/Whois
Network socket – http://en.wikipedia.org/wiki/Network_socket
實踐:
安裝Linux:挑選一款虛擬機軟件(Vbox,VM)並安裝Linux,可以使用類似Ubuntu這樣的傳統發行版.
學習基本的腳本語言: 從Ruby (Try Ruby: http://tryruby.org/)、Python (Online: http://repl.it/languages/Python) 或者 Perl 中挑選一門,學習語法和他的數據類型.這是一個持之以恆的過程.
—————————————————————
0x02 Week 2 – HTTP
—————————————————————
參考列表:
TCP/IP – http://en.wikipedia.org/wiki/Internet_protocol_suite
Secure Sockets Layer – http://en.wikipedia.org/wiki/Secure_Sockets_Layer
實踐:
在虛擬機中安裝Apache,使用VIM更改主站的首頁,並通過瀏覽器訪問這個頁面.
更改你的Host文件,使其可以用vulnerable這個名稱訪問到.
使用HTTP庫(比如使用Ruby的net/http)寫一個HTTP客戶端來接收你當前站點的返回包.
使用Socket寫一個HTTP客戶端來接收你當前站點的返回包.
下載BurpSuite並訪問一個站點,看看發送了神馬請求返回了什么數據.
—————————————————————
0x03 Week 3 – PHP and DNS
—————————————————————
參考列表:
Learn about virtual hosting – http://en.wikipedia.org/wiki/Virtual_hosting
and how to setup vhosts with Apache – http://httpd.apache.org/docs/2.2/vhosts/name-based.html
Zone transfer – http://www.digininja.org/projects/zonetransferme.php
實踐:
PHP基礎:
在你之前裝過Apache的虛擬機中安裝PHP,寫一個腳本響應有參數的URL,比如訪問http://vulnerable/hello.php?name=Louis將返回”Hello Louis”.
安裝MySQL並寫一個能響應SQL查詢的腳本,比如article.php?id=1可以返回a book而article.php?id=2可以返回a computer.
寫一個頁面使用POST方式向其自己傳輸數據.
DNS and whois:
在虛擬機中安裝命令行工具 dig.
找出PentesterLab所屬的Name server,Mail server,並且找出www.pentesterlab.com的真實IP地址
使用whois工具找出pentesterlab.com域名擁有者的注冊信息.
—————————————————————
0x04 Week 4 – SSL
—————————————————————
參考列表:
SQL injection – http://en.wikipedia.org/wiki/SQL_injection
Remote File Inclusion – http://en.wikipedia.org/wiki/Remote_file_inclusion
實踐:
配置SSL – 在你的Webserver使用HTTPS
玩轉SSL –
用HTTP庫寫一個SSL客戶端
用Socket寫一個SSL客戶端
使用socat工具建立 socket<->ssl-socket連接來訪問你之前寫的腳本.
—————————————————————
0x05 Week 5 – SQL injection & Local File Include
—————————————————————
參考列表:
MIME – http://en.wikipedia.org/wiki/MIME
實踐:
跟隨《SQL injection to Shell》這篇文章學習
https://pentesterlab.com/exercises/from_sqli_to_shell/
跟隨《PHP Include And Post Exploitation》這篇文章學習
https://pentesterlab.com/exercises/php_include_and_post_exploitation/
—————————————————————
0x06 Week 6 – More SQL injection
—————————————————————
參考列表:
Antisec Movement – http://en.wikipedia.org/wiki/Antisec_Movement
DHCP – http://en.wikipedia.org/wiki/DHCP
FTP – http://en.wikipedia.org/wiki/FTP
Request for Comments – http://en.wikipedia.org/wiki/Request_for_Comments
實踐:
學習《SQL injection to Shell》編寫腳本(使用Burp幫助調試)
https://pentesterlab.com/exercises/from_sqli_to_shell/
實踐《SQL injection to shell》在Postgres的數據庫環境下,不要對着PDF做
https://pentesterlab.com/exercises/from_sqli_to_shell_pg_edition/
檢查你在Week3所寫的PHP代碼是否有漏洞(SQL檢索數據那部分)
—————————————————————
0x07 Week 7 – FTP and traffic analysis
—————————————————————
參考列表:
Phrack – http://en.wikipedia.org/wiki/Phrack
Phrack: Happy Hacking – http://phrack.org/issues.html?issue=68&id=7#article
Phrack profile on FX – http://phrack.org/issues.html?issue=68&id=2#article
實踐:
安裝和使用WireShark –
檢查你寫的HTTP客戶端的通信(使用”Follow TCP Stream”)和HTTPS客戶端的同學(檢查SSL握手包)
FTP –
在虛擬機中安裝FTP服務
使用Socket寫一個FTP客戶端
—————————————————————
0x08 Week 8 – Linux review and Code Exec
—————————————————————
參考列表:
Iptables – http://en.wikipedia.org/wiki/Iptables
Internet Control Message Protocol – http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol
Cryptography – http://en.wikipedia.org/wiki/Cryptography
Cryptographic hash function – http://en.wikipedia.org/wiki/Cryptographic_hash_functions
實踐:
學習《Introduction to Linux Host Review》
https://pentesterlab.com/exercises/linux_host_review/
學習《CVE-2012-1823: PHP CGI》
https://pentesterlab.com/exercises/cve-2012-1823/
—————————————————————
0x09 Week 9 – Linux review and Code Exec
—————————————————————
參考列表:
C (programming language) – http://en.wikipedia.org/wiki/C_(programming_language)
Nmap – http://en.wikipedia.org/wiki/Nmap
Setuid – http://en.wikipedia.org/wiki/Setuid
實踐:
HTTP服務
寫一個HTTP服務(使用fork來處理更多的連接)
Connect to your HTTP server with your browser and check the requests done by your browser
Iptables學習
如果Iptable開啟了那么在你的虛擬機中關閉它
使用Iptables組織ICMP請求,使用Ping來檢查它是否工作
—————————————————————
0x10 Week 10 – Nmap and Crypto Attacks
—————————————————————
參考列表:
Wifi – http://en.wikipedia.org/wiki/Wifi
WEP – http://en.wikipedia.org/wiki/Wired_Equivalent_Privacy
WAP – http://en.wikipedia.org/wiki/Wi-Fi_Protected_Access
實踐:
Nmap
使用Nmap掃描你虛擬機打開的端口
使用Nmap掃描你虛擬機打開的端口,但是前提是使用Iptables阻止了ICMP請求的情況下
使用Iptable來關閉一個打開的端口,使用Nmap來檢測是否有效
找一個本地的會議(Ruxmon, 2600…)去瞅瞅
學習《CVE-2008-1930: WordPress 2.5 Cookie Integrity Protection Vulnerability》
https://pentesterlab.com/exercises/cve-2008-1930/
—————————————————————
0x11 Week 11 – WIFI
—————————————————————
參考列表:
Environment Variables – https://wiki.archlinux.org/index.php/Environment_Variables
Network Time Protocol – http://en.wikipedia.org/wiki/Network_Time_Protocol
SMB – http://en.wikipedia.org/wiki/Server_Message_Block
實踐:
設立一個WEP加密方式的WIFI熱點,然后破掉他的Key
學習《Rack Cookies and Commands Injection》
https://pentesterlab.com/exercises/rack_cookies_and_commands_injection/
—————————————————————
0x12 Week 12 – Linux Exploitation
—————————————————————
參考列表:
Memory management – http://en.wikipedia.org/wiki/Memory_management
Stack – http://en.wikipedia.org/wiki/Call_stack
Stack protection – http://en.wikipedia.org/wiki/Stack_protection
實踐:
下載並搞定Nebula(http://exploit-exercises.com/nebula)的levels 00到04
從exploit-exercises(http://exploit-exercises.com/)
—————————————————————
0x13 Week 13 – SSL Pinning and Linux Exploitation
—————————————————————
參考列表:
Public key pinning – https://www.imperialviolet.org/2011/05/04/pinning.html
Your app shouldn’t suffer SSL’s problems – http://www.thoughtcrime.org/blog/authenticity-is-broken-in-ssl-but-your-app-ha/
Guardian’s StrongTrustManager Vulnerabilities – http://www.thoughtcrime.org/blog/strongtrustmanager-mitm/
實踐:
下載並搞定Nubla的levels 05到09,從exploit-exercises
學習《From SQL injection to SHELL 2》
https://pentesterlab.com/exercises/from_sqli_to_shell_II/
—————————————————————
0x14 Week 14 – Web For Pentester
—————————————————————
參考列表:
閱讀 Web For Pentester – https://pentesterlab.com/exercises/web_for_pentester/
實踐:
搞定Nebula的levels 10到14,從exploit-exercises
做《Web For Pentester》中的練習
—————————————————————
0x15 Week 15 – Web For Pentester II
—————————————————————
參考列表:
實踐:
搞定Nebula的levels 15到19,從exploit-exercises
做《Web For Pentester II》中的練習
https://pentesterlab.com/exercises/web_for_pentester_II/
—————————————————————
作者推薦的一些書籍
—————————————————————
技術書籍:
《The Art of Software Security Assessment: Identifying and Preventing Software Vulnerabilities》
《The Web Application Hacker’s Handbook: Discovering and Exploiting Security Flaws》
《Hacking: The Art of Exploitation, 2nd Edition》
《The Tangled Web: A Guide to Securing Modern Web Applications》
…
非技術書記:
《Underground》
《Exploding the Phone: The Untold Story of the Teenagers and Outlaws who Hacked Ma Bell》
《The Pleasure of Finding Things Out: The Best Short Works of Richard P. Feynman (Helix Books)》
…
—————————————————————