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万能适配器base-adapter-helper的源代码分析
项目地址:https://github.com/JoanZapata/base-adapter-helper 1. 功能介绍 1.1. base-adapter-helper base-adapter ...
- OCP读书笔记(3) - 使用RMAN恢复目录
创建恢复目录 在hndx上创建恢复目录:[oracle@oracle admin]$ export ORACLE_SID=hndx[oracle@oracle admin]$ sqlplus / as ...
- 简单的三方登录SDK示例,Android Activity之间数据的传递
先建立Library工程,即普通工程然后在Android的属性勾选Library选项. 这里建立的工程为 mySdk ,Activity名为LoginActivity. LoginActivity代码 ...
- Palindrome Numbers(LA2889)第n个回文数是?
J - Palindrome Numbers Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu ...
- WinCE隐藏显示任务栏,当任务栏隐藏时将其显示,当任务栏显示时将其隐藏(FindWindow,ShowWindow,IsWindowVisible),
HANDLE hWndTaskBar = ::FindWindow(TEXT("HHTaskBar"), NULL); if(::IsWindowVisible(hWndTask ...
- 类是公共,它应该被命名为.java文件声明
当类的设置public时间,,public只要类的文件名必须是相同的,..这种错误可能发生在不同的
- CacheHelper工具类的使用
package com.bbcmart.util; import net.sf.ehcache.Cache; import net.sf.ehcache.CacheManager; import ne ...
- Merging a WPF application into a single EXE(WPF应用程序合并成单个Exe文件)
I always dislike handing off little applications to people. Not because I can’t, but because of the ...
- android关于实现滑动界面
首先要说的是,滑动界面,我们需要一个以上的view切换,实际上可以使用ArrayList<View> pageViews要保存view信息,然后切换 LayoutInflater infl ...
- windows 2003 自动安全设置
@echo offecho.echo.echo.echo 〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓echo.echo.echo windows 2003 自动安全设置程序 echo. ec ...