<commit_before>#!/usr/bin/env python
# -*- coding: utf8 -*-
import socket
import struct
import telnetlib

def readuntil(f, delim=': '):
    data = ''
    while not data.endswith(delim):
        c = f.read(1)
        assert len(c) > 0
        data += c
    #print data
    return data

p  = lambda v, fmt="<I": struct.pack(fmt, v)
u  = lambda v, fmt="<I": struct.unpack(fmt, v)
u1 = lambda v, fmt="<I": struct.unpack(fmt, v)[0]

def write(m):
    f.write(m + "\n")

def read(size):
    return f.read(size)

def shell(s):
    t = telnetlib.Telnet()
    t.sock = s
    t.interact()
    return

HOST = ""
PORT = ""

s = socket.create_connection((HOST, PORT))
f = s.makefile('rw', bufsize=0)

## exploit here
payload = ""
payload += shellcode

write(shellcode)

print "[+] shell is ready: "
shell(s)<commit_msg>Update pwn-template.py<commit_after>#!/usr/bin/env python
# -*- coding: utf8 -*-
import socket
import struct
import telnetlib

p   = lambda v, fmt="<I": struct.pack(fmt, v)
u   = lambda v, fmt="<I": struct.unpack(fmt, v)
u1  = lambda v, fmt="<I": struct.unpack(fmt, v)[0]
rop = lambda *args: struct.pack('<I'*len(args), *args)

def readuntil(f, delim=': '):
    data = ''
    while not data.endswith(delim):
        c = f.read(1)
        assert len(c) > 0
        data += c
    return data

def write(m):
    f.write(m + "\n")

def read(size):
    return f.read(size)

def shell(s):
    t = telnetlib.Telnet()
    t.sock = s
    t.interact()
    return

HOST = ""
PORT = ""

s = socket.create_connection((HOST, PORT))
f = s.makefile('rw', bufsize=0)

## exploit here
payload = ""
payload += shellcode

write(shellcode)

print "[+] shell is ready: "
shell(s)
{'fraction_non_alphanumeric': 0.179795550210463, 'fraction_numerical': 0.0072158749248346366, 'mean_word_length': 3.0193236714975846, 'pattern_counts': {'":': 6, '<': 10, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1341612', 'n_tokens_mistral': 649, 'n_tokens_neox': 634, 'n_words': 165}