『壹』 想用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)