‘壹’ 想用python抓包(keep APP),进而修改数据,得到伪造的结果,有什么具体方案吗
用fiddler抓包,获取post的地址,然后伪造表单,用requests.post()把表单内容发过去试试。
‘贰’ 如何能让 Python 实时获取到抓包的结果
fiddler 可以写 js 脚本
burpsuite 可以写 python 脚本
mitmproxy
anyproxy
在 rule 里用 nodejs (懂点 js 应该都能驾驭) 处理所有数据
也可以把数据 post 到你自定义的 api 里(这样就不限定语言了)
BTW,我目前是在 android 机器里安装 anyproxy,监听到特定 app 的特定请求后,在 nodejs 里清洗数据,json 化后添加到远程 redis 队列,后台处理队列的有 python 也有 php
‘叁’ python2.7 怎么进行抓包和解包
1、抓包,可以下载winpcapy 或者自己加载winpcap动态库
2、解包,使用dpkt解析
参考程序,基于进程抓包QPA工具
‘肆’ mac用什么python抓包工具
常用的抓包工具有两种:Charles和Fiddler
两者的区别:Charles不分平台,可用于Mac、windows和linux,而fiddler只能用于windows
共同点:可以抓到PC端的请求,手机设置代理后也可以抓到手机上的请求,也可以修改请求数据和返回数据
‘伍’ python爬虫怎么抓包
方案:
自己通过request库手动编写
使用python的爬虫库scrapy
最推荐的一种:使用python的爬虫库scrapy
推荐理由:
成熟度最高的框架,没有之一
利用成熟产品,避免重复“造轮子”,可以更快速的构建项目
‘陆’ 如何利用python2.7实现网页的抓包拦包改包功能有没有范例
登陆其实就是将账号密码之类的POST到那个网站的服务器。你可以通过抓包看到你点击登陆时发的POST包。那么你用python也模拟发一个一样的包给服务器,就实现了模拟登陆呗。
‘柒’ 如何能让 Python 实时获取到抓包的结果
fiddler 可以写 js 脚本
burpsuite 可以写 python 脚本
‘捌’ 求告知Python3可以用的网络抓包模块
用socket抓包是用RAW模式。不过不一定能开启成功。
你可以调用一个包winpcap,这个包有python的接口,着名的抓包工具wireshark也是用的这个包。
至于python3支持不支持呢?原则上,应该支持了。只需要找一找。 不过为什么坚持 用python3,这东西还没有成熟。2年内都用不上。 大公司没有用python3的。linux上缺省的python就是python2。
90%的软件都在用python2,不知道哪个老师坚持要讲python3,python3还是一个过渡语言,没有几年发展很难有大的应用市场。而且目前也看不出与python2的明显优势
开源市场又不是微软,说必须windows升级,不然我不支持。开源市场是用户喜欢用,它就存在,不喜欢用,你花再多精力开发,也是白做无用功。
python3目前也就是一个软件包怕自己被淘汰也支持一下。大部分软件包不理采它。特别是一些好的软件。本身体系庞大 ,没有时间精力去折腾这个。
只支持python2.5的包是不可能的。好的包,特别是winpcap一定会支持python2.7的。
‘玖’ 如何用Python爬取数据
方法/步骤
在做爬取数据之前,你需要下载安装两个东西,一个是urllib,另外一个是python-docx。
7
这个爬下来的是源代码,如果还需要筛选的话需要自己去添加各种正则表达式。
‘拾’ python3.2 下的抓包库。。无论是pypcap还是scapy。貌似都没有py3的版本。。跪求一个可以python3用
有一个py3kcap是pycap的封装版本,可以用于python3版本。
给你一个使用的示例代码:
#!/usr/bin/env python3.2
import ctypes,sys
from ctypes.util import find_library
#pcap = ctypes.cdll.LoadLibrary("libpcap.so")
pcap = None
if(find_library("libpcap") == None):
print("We are here!")
pcap = ctypes.cdll.LoadLibrary("libpcap.so")
else:
pcap = ctypes.cdll.LoadLibrary(find_library("libpcap"))
# required so we can access bpf_program->bf_insns
"""
struct bpf_program {
u_int bf_len;
struct bpf_insn *bf_insns;}
"""
class bpf_program(ctypes.Structure):
_fields_ = [("bf_len", ctypes.c_int),("bf_insns", ctypes.c_void_p)]
class sockaddr(ctypes.Structure):
_fields_=[("sa_family",ctypes.c_uint16),("sa_data",ctypes.c_char*14)]
class pcap_pkthdr(ctypes.Structure):
_fields_ = [("tv_sec", ctypes.c_long), ("tv_usec", ctypes.c_long), ("caplen", ctypes.c_uint), ("len", ctypes.c_uint)]
pkthdr = pcap_pkthdr()
program = bpf_program()
# prepare args
snaplen = ctypes.c_int(1500)
#buf = ctypes.c_char_p(filter)
optimize = ctypes.c_int(1)
mask = ctypes.c_uint()
net = ctypes.c_uint()
to_ms = ctypes.c_int(100000)
promisc = ctypes.c_int(1)
filter = bytes(str("port 80"), 'ascii')
buf = ctypes.c_char_p(filter)
errbuf = ctypes.create_string_buffer(256)
pcap_close = pcap.pcap_close
pcap_lookupdev = pcap.pcap_lookupdev
pcap_lookupdev.restype = ctypes.c_char_p
#pcap_lookupnet(dev, &net, &mask, errbuf)
pcap_lookupnet = pcap.pcap_lookupnet
#pcap_t *pcap_open_live(const char *device, int snaplen,int promisc, int to_ms,
#char *errbuf
pcap_open_live = pcap.pcap_open_live
#int pcap_compile(pcap_t *p, struct bpf_program *fp,const char *str, int optimize,
#bpf_u_int32 netmask)
pcap_compile = pcap.pcap_compile
#int pcap_setfilter(pcap_t *p, struct bpf_program *fp);
pcap_setfilter = pcap.pcap_setfilter
#const u_char *pcap_next(pcap_t *p, struct pcap_pkthdr *h);
pcap_next = pcap.pcap_next
# int pcap_compile_nopcap(int snaplen, int linktype, struct bpf_program *program,
# const char *buf, int optimize, bpf_u_int32 mask);
pcap_geterr = pcap.pcap_geterr
pcap_geterr.restype = ctypes.c_char_p
#check for default lookup device
dev = pcap_lookupdev(errbuf)
#override it for now ..
dev = bytes(str("wlan0"), 'ascii')
if(dev):
print("{0} is the default interface".format(dev))
else:
print("Was not able to find default interface")
if(pcap_lookupnet(dev,ctypes.byref(net),ctypes.byref(mask),errbuf) == -1):
print("Error could not get netmask for device {0}".format(errbuf))
sys.exit(0)
else:
print("Got Required netmask")
handle = pcap_open_live(dev,snaplen,promisc,to_ms,errbuf)
if(handle is False):
print("Error unable to open session : {0}".format(errbuf.value))
sys.exit(0)
else:
print("Pcap open live worked!")
if(pcap_compile(handle,ctypes.byref(program),buf,optimize,mask) == -1):
# this requires we call pcap_geterr() to get the error
err = pcap_geterr(handle)
print("Error could not compile bpf filter because {0}".format(err))
else:
print("Filter Compiled!")
if(pcap_setfilter(handle,ctypes.byref(program)) == -1):
print("Error couldn't install filter {0}".format(errbuf.value))
sys.exit(0)
else:
print("Filter installed!")
if(pcap_next(handle,ctypes.byref(pkthdr)) == -1):
err = pcap_geterr(handle)
print("ERROR pcap_next: {0}".format(err))
print("Got {0} bytes of data".format(pkthdr.len))
pcap_close(handle)