攻擊流程:
- 找出對方有開啟什麼服務
- 檢查人家架設的服務有沒有可利用的已知漏洞
- 利用漏洞,想辦法拿到 Shell
Nmap
1 |
|
-A
: 強力掃描–sT
: 完整 TCP 掃描-sS
: TCP 掃描 (只靠發送 SYN 判斷 [Half TCP])-sU
: UDP 掃描-p
: 精確的 port(範圍) 掃描--open
: 只回傳 open 的人-oG
: 回傳好 grep 的結果掃描所有 port
1
2
3nmap –p 1-65535 192.168.0.1
nmap –p– 192.168.0.1
nmap -sC -sS -p0-65535 sandbox.local掃描所有常見的 port
1
2nmap –F 192.168.0.1
nmap --top-ports 1000 192.168.0.1掃描 UDP port
1
nmap –sU –p 80,130,255 192.168.0.1
- Top ports
1
sudo nmap -sU --top-ports=20 --version-all 10.11.1.111
Netcat
用 nc 找有開啟 port
1
nc -v -z -n -w 1 10.2.2.22 1-1000 2>&1 >> 22.tcpdump
偷看服務資訊
1
2
3
4> nc -nv 10.11.1.71 22
(UNKNOWN) [10.11.1.71] 22 (ssh) open
SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2列除網頁上所有的
href
連結1
curl 10.11.1.71 -s -L | grep "title\|href" | sed -e 's/^[[:space:]]*//'
Rustscan
很快的掃 Port 工具
1 |
|
-t
: set scan timeout (default: 1500ms)-u
: auto scale ulimit-r
: port range-p
: specific ports (e.g.80,443,8080
)-g
: output greppable format (output only ports)
Cutycapt
- Show
nmap
result as capture picture
1 |
|
—-url
: Specify the target web site--out
: Specify the name of the output file
Whois
1 |
|
Netcraft
recon-ng
自動蒐集資料的小工具 - 可額外安裝套件
1 |
|
show hosts
- Check the target states.load
- enter the moduleinfo
- check module’s usageback
- return from module to home page
好用套件
檢查子網域套件 -
recon/domains-hosts/google_site_web
1
2
3
4
5
6
7
8
9
10
11
12
13
14# search for module
marketplace search github
# peek info
marketplace info recon/domains-hosts/google_site_web
# install module
marketplace install recon/domains-hosts/google_site_web
# load - to switch to this module
modules load recon/domains-hosts/google_site_web
# return to Homepage
back檢查 IP 位置套件
1
2
3marketplace install recon/hosts-hosts/resolve
modules load recon/hosts-hosts/resolve
run
SSL Server Test
Google Hacking
site:
- in what domainfiletype:
- filetype:HTML, filetype:PDFext:
- extensionintitle:
- Get keyword in title ex: “Index of”, “parent directory” (FTP)