adminze

Dec 242020
 

Using the below code one can simulate TCP-SYN packets with random payload (may trigger data exfiltration detection). By RFC such packets are invalid and they might be dropped by your firewall or firewalls they traverse:

// more info https://scapy.readthedocs.io/en/latest/usage.html
import random
import string

import time

def get_random_string(length):
  letters = string.ascii_lowercase
  result_str = ''.join(random.choice(letters) for i in range(length))
  //print("Random string of length", length, "is:", result_str)

from scapy.all import *

while True:
  send(IP(dst="1.2.3.4") / TCP(sport=4444,dport=22,flags="S",seq=42) / (bytes(get_random_string(1200))))
  time.sleep(1)