python 发包器

python 发包器

今天写个发包器玩玩 以前只是用burp工具去做发包测试,当没有burp的时候也挺尴尬的。。

如果用python的话写起来也挺快的,主要是可以根据自己的需求做改变嘻嘻

#!/usr/bin/python3

import os
import sys,time
import requests
from requests.packages import urllib3

#创建cookie的持久连接
connection = requests.Session()

#访问imperva的登陆界面 证书验证为false
urllib3.disable_warnings()        #清除https的告警信息

f=open(".\\发包器payload.txt","r",encoding="utf-8")
#print("你想读到第几行???")
#a=int(input())
b=0

date = {                                                          #定义包体信息
    "age":22,
    "name":"zet"
}

headers = {                                                       #定义包头信息
    "Cookie":"security_level=0; acopendivids=swingset,jotto,phpbb2,redmine; acgroupswithpersist=nada; PHPSESSID=ejktn0f0a6hdbjs2g1rn6ics56"
}

for i in f:
    #print("payload is :"+ i.strip())
    qingqiouneirong = 'http://192.168.1.63/bWAPP/sqli_1.php?title=%s&action=search' %i        #请求的地址%s代表payload放置的位置
    response1=connection.get(qingqiouneirong,verify=False,headers=headers)       #制造请求 是否带包头包体里的参数
    #print(response1.text)                       #获取返回内容
    #response_code=response1.status_code          #获取返回码
    #print(response_code)
    #print(response1.text)
    '''
    if response_code == 200:        #判断是否拦截根据情况进行编写
        print(i)
    '''
    time.sleep(0)           #限制频率
    b +=1
    if b==f:
        break
print("ok")

发包器的payload.txt放到同级目录下就可以了。

猜你喜欢

转载自blog.csdn.net/qq_38656841/article/details/85126710