WEB安全实战(一)SQL盲注
前言
背景
问题
技术描写叙述
解决方式
<span style="font-family:Comic Sans MS;font-size:12px;"><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.test.dao.TAcntMapper">
<resultMap id="BaseResultMap" type="com.test.entity.TAcnt">
<id column="SYS_ID" jdbcType="DECIMAL" property="sysId" />
<result column="OBJ_ID" jdbcType="VARCHAR" property="objId" />
<result column="OBJ_NAME" jdbcType="VARCHAR" property="objName" />
<result column="OBJ_DESCRIPTION" jdbcType="VARCHAR" property="objDescription" />
<result column="CREATOR" jdbcType="VARCHAR" property="creator" />
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
<result column="UPDATE_OPERATOR" jdbcType="VARCHAR" property="updateOperator" />
<result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
<result column="CLIENT_CHK_FLAG" jdbcType="DECIMAL" property="clientChkFlag" />
<result column="CELL_PHONE" jdbcType="VARCHAR" property="cellPhone" />
<result column="REG_EMAIL" jdbcType="VARCHAR" property="regEmail" />
<result column="GENDER" jdbcType="DECIMAL" property="gender" />
<result column="QQ_NO" jdbcType="VARCHAR" property="qqNo" />
<result column="WEB_URL" jdbcType="VARCHAR" property="webUrl" />
</resultMap> <sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
SYS_ID , OBJ_ID , OBJ_NAME , OBJ_DESCRIPTION , CREATOR , CREATE_TIME , UPDATE_OPERATOR , UPDATE_TIME , CLIENT_CHK_FLAG , CELL_PHONE , REG_EMAIL , GENDER , QQ_NO , WEB_URL </sql> <sql id="From_join">
from T_ACNT
</sql> <select id="selectByExample" parameterType="com.test.entity.TAcntCriteria" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
<include refid="From_join" />
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select> <select id="selectByPrimaryKey" parameterType="BigDecimal" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
<include refid="From_join" />
where SYS_ID = #{sysId,jdbcType=DECIMAL}
</select> <delete id="deleteByExample" parameterType="com.test.entity.TAcntCriteria"> delete from T_ACNT
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete> <insert id="insert" parameterType="com.test.entity.TAcnt">
insert into T_ACNT ( OBJ_ID , OBJ_NAME , OBJ_DESCRIPTION , CREATOR , CREATE_TIME , UPDATE_OPERATOR , UPDATE_TIME , CLIENT_CHK_FLAG , CELL_PHONE , REG_EMAIL , GENDER , QQ_NO , WEB_URL )
values ( #{objId,jdbcType=VARCHAR} , #{objName,jdbcType=VARCHAR} , #{objDescription,jdbcType=VARCHAR} , #{creator,jdbcType=VARCHAR} , #{createTime,jdbcType=TIMESTAMP} , #{updateOperator,jdbcType=VARCHAR} , #{updateTime,jdbcType=TIMESTAMP} , #{clientChkFlag,jdbcType=DECIMAL} , #{cellPhone,jdbcType=VARCHAR} , #{regEmail,jdbcType=VARCHAR} , #{gender,jdbcType=DECIMAL} , #{qqNo,jdbcType=VARCHAR} , #{webUrl,jdbcType=VARCHAR} )
</insert> <select id="countByExample" parameterType="com.test.entity.TAcntCriteria" resultType="java.lang.Integer">
select count(*)
<include refid="From_join" />
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select> <update id="updateByExample" parameterType="map">
update T_ACNT
set OBJ_ID = #{record.objId,jdbcType=VARCHAR}
, OBJ_NAME = #{record.objName,jdbcType=VARCHAR}
, OBJ_DESCRIPTION = #{record.objDescription,jdbcType=VARCHAR}
, CREATOR = #{record.creator,jdbcType=VARCHAR}
, CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP}
, UPDATE_OPERATOR = #{record.updateOperator,jdbcType=VARCHAR}
, UPDATE_TIME = #{record.updateTime,jdbcType=TIMESTAMP}
, CLIENT_CHK_FLAG = #{record.clientChkFlag,jdbcType=DECIMAL}
, CELL_PHONE = #{record.cellPhone,jdbcType=VARCHAR}
, REG_EMAIL = #{record.regEmail,jdbcType=VARCHAR}
, GENDER = #{record.gender,jdbcType=DECIMAL}
, QQ_NO = #{record.qqNo,jdbcType=VARCHAR}
, WEB_URL = #{record.webUrl,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update> <update id="updateByPrimaryKeySelective" parameterType="com.test.entity.TAcnt">
update T_ACNT
<set>
<if test="objId != null">
OBJ_ID = #{objId,jdbcType=VARCHAR},
</if>
<if test="objName != null">
OBJ_NAME = #{objName,jdbcType=VARCHAR},
</if>
<if test="objDescription != null">
OBJ_DESCRIPTION = #{objDescription,jdbcType=VARCHAR},
</if>
<if test="creator != null">
CREATOR = #{creator,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateOperator != null">
UPDATE_OPERATOR = #{updateOperator,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="clientChkFlag != null">
CLIENT_CHK_FLAG = #{clientChkFlag,jdbcType=DECIMAL},
</if>
<if test="cellPhone != null">
CELL_PHONE = #{cellPhone,jdbcType=VARCHAR},
</if>
<if test="regEmail != null">
REG_EMAIL = #{regEmail,jdbcType=VARCHAR},
</if>
<if test="gender != null">
GENDER = #{gender,jdbcType=DECIMAL},
</if>
<if test="qqNo != null">
QQ_NO = #{qqNo,jdbcType=VARCHAR},
</if>
<if test="webUrl != null">
WEB_URL = #{webUrl,jdbcType=VARCHAR},
</if>
</set>
where SYS_ID = #{sysId,jdbcType=DECIMAL}
</update>
</mapper></span>
结束语
WEB安全实战(一)SQL盲注的更多相关文章
- WEB安全番外第四篇--关于SQL盲注
		
一.SQL盲注: 看不到回显的,无法从返回直接读取到数据库内容的对数据的猜解,属于盲注. 二.第一种--基于布尔类型的盲注: 这种很简单,最典型的例子,就是挖SQL注入的时候常用的: ''' http ...
 - Web系统常见安全漏洞及解决方案-SQL盲注
		
关于web安全测试,目前主要有以下几种攻击方法: 1.XSS 2.SQL注入 3.跨目录访问 4.缓冲区溢出 5.cookies修改 6.Htth方法篡改(包括隐藏字段修改和参数修改) 7.CSRF ...
 - 小白日记42:kali渗透测试之Web渗透-SQL盲注
		
SQL盲注 [SQL注入介绍] SQL盲注:不显示数据库内建的报错信息[内建的报错信息帮助开发人员发现和修复问题],但由于报错信息中提供了关于系统的大量有用信息.当程序员隐藏了数据库内建报错信息,替换 ...
 - SQL盲注攻击的简单介绍
		
1 简介 1.1 普通SQL注入技术概述 目前没有对SQL注入技术的标准定义,微软中国技术中心从2个方面进行了描述[1]: (1) 脚本注入式的攻击 (2) 恶意用户输 ...
 - 第九届极客大挑战——Geek Chatroom(sql盲注)
		
首先观察这个web应用的功能,可以任意留言,也可以搜索留言,当然我还用cansina扫描过网站,查看过源码,抓包查看过header等.没发现其他提示的情况下断定这就是个sql注入,可能存在的注入点呢, ...
 - (转)SQL盲注攻击的简单介绍
		
转:http://hi.baidu.com/duwang1104/item/65a6603056aee780c3cf2968 1 简介 1.1 普通SQL注入技术概述 目前没有对SQL ...
 - metinfo小于v6.2.0版本通杀SQL盲注漏洞分析
		
0x01 此漏洞是由于未将decode解码后的数据过滤,而直接带入SQL语句中,从而导致SQL盲注漏洞. 0x02 漏洞分析:此处复现为metinfo6.1.3版本,漏洞最初产生为:/app/syst ...
 - Kali学习笔记43:SQL盲注
		
前面的文章都是基于目标会返回错误信息的情况进行判断是否存在SQL注入 我们可以轻易根据数据库报错信息来猜测SQL语句和注入方式 如果程序员做得比较好,不显示错误信息,这种情况下得SQL注入称为SQL盲 ...
 - [转载]sql 盲注之正则表达式攻击
		
[转载]sql 盲注之正则表达式攻击 -----------------------------------------MYSQL 5+-------------------------------- ...
 
随机推荐
- Android实战开发租赁管理软件(适配UI,数据的存储,多线程下载)课程分享
			
亲爱的网友,我这里有套课程想和大家分享,假设对这个课程有兴趣的,能够加我的QQ2059055336和我联系. 课程内容简单介绍 我们软件是基于移动设备的.所以我们必定的选择了安卓作为我们的开发工具.课 ...
 - 学习日记之命令模式和Effective C++
			
命令模式(Command): 讲一个请求封装为一个对象.从而使你可用不同的请求对客户进行參数化.对请求队列或记录请求日志.以及支持可撤销的操作. 命令模式长处: (1),它能较easy地设计一个命令队 ...
 - WCF(1)----服务创建
			
本例中,我们通过一个关于Camera的服务为例子来说明WCF的开发流程,该服务比较简单,只是用来实现对Camera的添加,枚举,删除等操作. 详细步骤如下: 1:创建一个WCF Service Lib ...
 - Codeforces Round #277.5 (Div. 2)B——BerSU Ball
			
B. BerSU Ball time limit per test 1 second memory limit per test 256 megabytes input standard input ...
 - Inno Setup打包添加和去除管理员权限
			
原文:Inno Setup打包添加和去除管理员权限 添加管理员权限 1.在[Setup]节点添加 PrivilegesRequired=admin 2.进入安装目录,找到文件SetupLdr.e32, ...
 - java读取XML文件的四种方式
			
java读取XML文件的四种方式 Xml代码 <?xml version="1.0" encoding="GB2312"?> <RESULT& ...
 - Android 监听SMS短信
			
当设备接收到一条新的SMS消息时,就会广播一个包括了android.provider.Telephony.SMS_RECEIVED动作的Intent. 注意,这个动作是一个字符串值,SDK 1.0不再 ...
 - Android Fragment使用
			
通常地 fragment做为宿主activity UI的一部分, 被作为activity整个view hierarchy的一部分被嵌入. 有2种方法你能够加入一个fr ...
 - jquery validation remote depends 验证触发条件
			
背景: 1:简介页面的变化: 2:邮箱不能反复 改动页面,邮箱默认带出,但字段上带有remote验证.不能反复,焦点由邮箱输入框失去时.会默认触发remote验证. 介绍完成 watermark/2/ ...
 - (转)SWT的CheckBoxTreeViewer的相关用法
			
最近在项目中需要用到遍历某个目录下所有文件,并按照树形结构展示,同时还需要提供对树形菜单的选择展开等操作.在eclipse中提供了CheckboxTreeViewer组件来满足所需要的功能 下面是需要 ...