前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Sqlmap自动切换代理

Sqlmap自动切换代理

作者头像
Jumbo
发布2019-11-08 10:32:01
2.2K0
发布2019-11-08 10:32:01
举报
文章被收录于专栏:中国白客联盟中国白客联盟

大家经常可能遇到,用sqlmap跑某些注入的时候,因为网络、waf等问题造成被拦截、跑失败等情况。

因此下面这个脚本可以做到sqlmap自动切换代理,防止被ban。

使用教程如下

1、在ips.txt中存入可用的代理,格式如下

1.1.1.1:1080

2.2.2.2:9988

3.3.3.3:1100

2、运行脚本

python sqlmap_auto_proxy.py

3、sqlmap设置代理

sqlmap -u "http://www.chinabaiker.com/index.php?id=inject" --proxy=http://127.0.0.1:50007

即可在跑注入时,自动切换代理。

部分代码如下

代码语言:javascript
复制
def tcp_mapping_request(local_conn, remote_ip, remote_port):        while True:        remote_conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)        try:            remote_conn.settimeout(3)            remote_conn.connect((remote_ip, remote_port))        except Exception:            logger.error('Unable to connect to the remote server.')            continue        threading.Thread(target=tcp_mapping_worker, args=(local_conn, remote_conn)).start()        threading.Thread(target=tcp_mapping_worker, args=(remote_conn, local_conn)).start()        return

def tcp_mapping_worker(conn_receiver, conn_sender):    while True:        try:            data = conn_receiver.recv(PKT_BUFF_SIZE)        except Exception:            logger.debug('Connection closed.')            break        if not data:            logger.info('No more data is received.')            break        try:            conn_sender.sendall(data)        except Exception:            logger.error('Failed sending data.')            break

脚本地址:

https://github.com/Jumbo-WJB/sqlmap_auto_proxy

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2019-11-06,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 中国白客联盟 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档