This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |