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+-------------------------------- ...
随机推荐
- 那些年我们装过的数据库---盘点sqlserver2008安装时遇到的各种的问题(持续更新中)
给自己安过sqlServer2008,也给好多同学安过sqlServer2008,期间遇到了好多不同的另人心烦的问题,在这里整理一下,(涉及到的部分方法是在网上找的,有些也没试过,仅仅是在这里整理一下 ...
- Vim -> 边确认边查找替换
进行简单的全局查找替换的时候,能够使用ex的例如以下命令 :%s/which/what/g 它的使用方法比較简单 % 表示每一行(everyline) s 替换(substitue) which 查找 ...
- Object.wait()的使用方法示例(转)
本文节选自 Effective Java by Joshua Bloch 和 Concurrent Programming in Java by Doug Lea. 1.3 原子数据的同步 java语 ...
- java -D參数简化增加多个jar【简化设置classpath】
1.-D<name>=<value> set a system property 设置系统属性. java命令引入jar时能够-cp參数,但时-cp不能用通配符(多个jar时 ...
- MySql 安装及0基础使用具体解释
1. sudo apt-get install mysql-server, input administrator password , '123' 2. enter mysql promot in ...
- NAT ALG原理
1 NAT ALG简介 普通NAT实现了对UDP或TCP报文头中的的IP地址及端口转换功能,但对应用层数据载荷中的字段无能为力,在许多应用层协议中,比如多媒体协议(H.323.SIP等).F ...
- 【译】ASP.NET MVC 5 教程 - 1:入门
原文:[译]ASP.NET MVC 5 教程 - 1:入门 本教程将教你使用Visual Studio 2013 预览版构建 ASP.NET MVC 5 Web 应用程序 的基础知识.本主题还附带了一 ...
- 最近调试HEVC中码率控制, 发现HM里面一个重大bug
最近调试HEVC中码率控制, 发现里面一个重大bug! 码率控制中有这么一个函数: Int TEncRCGOP::xEstGOPTargetBits( TEncRCSeq* encRCSeq, Int ...
- Keepalived+LVS+Nginx负载均衡之高可用
Keepalived+LVS+Nginx负载均衡之高可用 上一篇写了nginx负载均衡,此篇实现高可用(HA).系统整体设计是采用Nginx做负载均衡,若出现Nginx单机故障,则导致整个系统无法正常 ...
- 利用SVNKit进行版本库的树的导出
public List searchByTree(String userName,String passwd,String SVNServerUrl,String dirUrl){ //这里有点像 s ...