`
huayu0815
  • 浏览: 57945 次
  • 性别: Icon_minigender_1
  • 来自: 河南
文章分类
社区版块
存档分类
最新评论

复杂SQLMAP

 
阅读更多
<sqlMap namespace="tt">

    <sql id="ips_subcount_st">
        (select count(*) from 
        <iterate property="tableName" conjunction="union" open="(" close=")" > 
             select * from  $tableName[]$
        </iterate> t11 
        where 
            t11.$groupBy$=t1.$groupBy$ and
             serverity <![CDATA[ > ]]>${serverity_high})
        as highServeCount ,
         
         (select count(*)  from  
         <iterate property="tableName" conjunction="union" open="(" close=")" > 
             select * from  $tableName[]$
        </iterate> t11  
         where 
             t11.$groupBy$=t1.$groupBy$ and
             serverity <![CDATA[ > ]]>${serverity_low} and
            serverity <![CDATA[ <= ]]>${serverity_high}) 
         as midServeCount ,
         
        (select count(*)  from  
        <iterate property="tableName" conjunction="union" open="(" close=")" > 
             select * from  $tableName[]$
        </iterate> t11 
          where 
          t11.$groupBy$=t1.$groupBy$ and
           serverity <![CDATA[ <= ]]>${serverity_low}) 
        as lowServeCount ,
    </sql>
    
    
    <select id="t_Ips"  parameterClass="java.util.HashMap" 
        resultClass="com.***.Ips">
        select 
        t1.neId as neId,
        t2.neName as neName,
        t2.sn as sn,
        t3.name as ifName,
        t1.srcIp as srcIp,
        t1.dstIp  as dstIp,
        t1.sigName as sigName,
        t1.serverity as serverity,
        <isEqual property="groupBy"  compareValue="ifName">
            (select count(*) from 
            <iterate property="tableName" conjunction="union" open="(" close=")" > 
                 select * from  $tableName[]$
            </iterate> t11 
            where 
                t11.ifId=t1.ifId and
                 serverity <![CDATA[ > ]]>${serverity_high})
            as highServeCount ,
             
             (select count(*)  from  
             <iterate property="tableName" conjunction="union" open="(" close=")" > 
                 select * from  $tableName[]$
            </iterate> t11  
             where 
                 t11.ifId=t1.ifId and
                 serverity <![CDATA[ > ]]>${serverity_low} and
                serverity <![CDATA[ <= ]]>${serverity_high}) 
             as midServeCount ,
             
            (select count(*)  from  
            <iterate property="tableName" conjunction="union" open="(" close=")" > 
                 select * from  $tableName[]$
            </iterate> t11 
              where 
              t11.ifId=t1.ifId  and
               serverity <![CDATA[ <= ]]>${serverity_low}) 
            as lowServeCount ,
        </isEqual>
        <isEqual property="groupBy"  compareValue="neId">
            <include refid="ips_subcount_st" />
        </isEqual>
        <isEqual property="groupBy"  compareValue="srcIp">
            <include refid="ips_subcount_st" />
        </isEqual>
        <isEqual property="groupBy"  compareValue="dstIp">
            <include refid="ips_subcount_st" />
        </isEqual>
        
        <isNotEqual property="groupBy"  compareValue="ifName">
        <isNotEqual property="groupBy"  compareValue="neId">
        <isNotEqual property="groupBy"  compareValue="srcIp">
        <isNotEqual property="groupBy"  compareValue="dstIp">
<!-- 这个地方不这样搞一下的话,会导致resultClass中的三个属性没有值,会出错。 -->
            0 as highServeCount,
            0 as midServeCount,
            0 as lowServeCount,
        </isNotEqual>
        </isNotEqual>
        </isNotEqual>
        </isNotEqual>
        
        sum(t1.sponsorNum) as sponsorNum ,
        sum(t1.victimNum) as victimNum,    
        t2.domainId as groupId,
        t6.domainName as groupName,
        t1.insertTstamp  as timestamp  
        from  
        <iterate property="tableName" conjunction="union" open="(" close=")" > 
                 select * from  $tableName[]$
         </iterate> t1 
         left join ( select neId,neName,sn,domainId from h_db.t_NeInfo) t2 on (t1.neId=t2.neId )                      
         left join (select neId,ifId,name from h_db.t_IfInfo) t3 on (t1.neId=t3.neid and t1.ifId=t3.ifId)
         left join (select domainId,domainName from  h_db.t_Domain) t6 on t2.domainId=t6.domainId 
        <dynamic prepend="WHERE">
            <isGreaterThan prepend="AND" property="neId" compareValue="0">
                 t1.neId=#neId:INTEGER# 
            </isGreaterThan>         
            <isGreaterThan prepend="AND" property="groupId" compareValue="0">
                 t2.domainId=#groupId:INTEGER# 
            </isGreaterThan> 
            <isNotEmpty prepend="AND" property="ifName">
                 t3.name=#ifName#  
            </isNotEmpty>        
            <isNotEmpty prepend="AND" property="neList">
                 t1.neId in 
                 <iterate property="neList" conjunction="," open="(" close=")" > 
                  #neList[]# 
                 </iterate>
            </isNotEmpty>
            <isNotEmpty prepend="AND" property="groupList">
                 t2.domainId in 
                 <iterate property="groupList" conjunction="," open="(" close=")" > 
                  #groupList[]# 
                 </iterate>
            </isNotEmpty>    
            <isNotEmpty prepend="AND" property="beginTime">
            t1.insertTstamp<![CDATA[ >= ]]>#beginTime:TIMESTAMP# 
            </isNotEmpty>
            <isNotEmpty prepend="AND" property="endTime">
            t1.insertTstamp<![CDATA[ <= ]]>#endTime:TIMESTAMP# 
            </isNotEmpty>
        </dynamic>
        <isNotEmpty  property="groupBy">
            group by $groupBy$
        </isNotEmpty>
        <isNotEmpty  property="orderBy">
             order by  $orderBy$ 
        </isNotEmpty>
        <isGreaterThan  property="topN" compareValue="0">
            limit #topN:INTEGER#
        </isGreaterThan>
    </select>
</sqlMap>

分享到:
评论

相关推荐

    sqlmap中文版本(和谐渗透小组专用)

    上述是一个SQL注入的简单地例子,然而在实际过程中,SQL注入比这要复杂的多。在我们的渗透测试中,大多数时候我们有一个非常紧凑的计划表,所以这个时候我们需要一个自动化的攻击来为我们进行注入攻击。 SQLMAP就是...

    sqli-exploiter:利用sqlmap找不到SQL注入漏洞的工具

    它是高度可定制的,并且仅在非常复杂的注入情况下才会失败。 但是,当它确实失败时,请使用它。 享受! -蒂姆(@ lanmaster53)Tomes 入门 安装依赖项: pip install -r REQUIREMENTS.txt 编辑config.py文件并...

    SQLmapPivot:SQLmapPivot用于将SQLmap与需要编程过程的复杂SQL注入链接

    SQLmapPivot SQLmapPivot用于将SQLmap与需要编程过程的复杂SQL注入链接。例子当您必须使用AES加密注入或使用奇怪的基数对其进行编码时,可以使用SQLmapPivot。 当您有验证码要与OCR一起破解时,也可以使用...

    超轻量压缩传输js2java rpc框架(XtZPStream v1.0)

    该接口继承与“com.ibatis.sqlmap.client.event.RowHandler” 因此很容易将ibatis的数据流逐行输出给浏览器,从而实现非常友好的数据加载方式 6、支持回调全异步(观察者模式):所有的过程调用都采用异步方式, ...

    iBatis SQL Maps开发指南.pdf

    &lt;sqlMap&gt;元素 SQL Map XML映射文件 Mapped Statements Statement的类型 SQL 语句 自动生成的主键 存储过程 parameterClass parameterMap Inline Parameter简介 resultClass resultMap cacheModel xmlResultName ...

    iBATIS实战

    1.4.3 复杂的键和关系 21 1.4.4 数据模型的去规范化或过度规范化 22 1.4.5 瘦数据模型 23 1.5 小结 24 第2章 iBATIS是什么 26 2.1 映射SQL语句 27 2.2 iBATIS如何工作 29 2.2.1 iBATIS之于小型、简单系统 30 2.2.2 ...

    AppFramework_V1.0

    NHibernate实现了纯对象化的ORMap,在屏蔽数据库差异、面向对象方面做的非常好,但在访问与操作海量数据时其性能表现较差,也不易实现复杂的查询统计功能。NHibernate适合那些数据量不大、性能要求不高、复杂度不高...

    AppFramework_V1.0_New

    NHibernate实现了纯对象化的ORMap,在屏蔽数据库差异、面向对象方面做的非常好,但在访问与操作海量数据时其性能表现较差,也不易实现复杂的查询统计功能。NHibernate适合那些数据量不大、性能要求不高、复杂度不高...

    AppFramework数据库访问组件_代码生成插件_V1.1.rar

    NHibernate实现了纯对象化的ORMap,在屏蔽数据库差异、面向对象方面做的非常好,但在访问与操作海量数据时其性能表现较差,也不易实现复杂的查询统计功能。NHibernate适合那些数据量不大、性能要求不高、复杂度不高...

    SQL注入攻击与防御(安全技术经典译丛)

     1.2.2 一种较复杂的架构  1.3 理解SQL注入  1.4 理解SQL注入的产生过程  1.4.1 构造动态字符串  1.4.2 不安全的数据库配置  1.5 本章小结  1.6 快速解决方案  1.7 常见问题解答 第2章 SQL注入测试 ...

    SQL注入攻击与防御

    1.2.2 一种较复杂的架构 4 1.3 理解SQL注入 5 1.4 理解SQL注入的产生过程 10 1.4.1 构造动态字符串 10 1.4.2 不安全的数据库配置 16 1.5 本章小结 18 1.6 快速解决方案 18 1.7 常见问题解答 19 第2章 SQL注入测试 ...

    xorm:xorm是一个简单而强大的Go语言ORM库,通过它可以使数据库操作非常正确。本库是基于原版xorm的定制增强版本,为xorm提供类似ibatis的配置文件及动态SQL支持,支持AcitveRecord操作

    本库的相关定制功能是为了解决更简单的进行复杂SQL调用和某些特殊业务需求场景而开发的。本定制版ORM相关核心功能和原版保持一致,会跟随原版xorm更新。定制功能采用针对原版的弱侵入性代码实现。特性支持Struct和...

    iBATIS 帮助文档

    &lt;sqlMap&gt;元素........................................................................................................................15 SQL Map XML映射文件.................................................

    springmybatis

    (再加一条,其实大家可以看官方的教程更好些:http://mybatis.github.io/mybatis-3/,而且如果英文不是很好的那就看中文的:http://mybatis.github.io/mybatis-3/zh/sqlmap-xml.html) 写在这个系列前面的话: 以前...

Global site tag (gtag.js) - Google Analytics