Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
from socket import *
if __name__ == "__main__":
s = socket(AF_INET, SOCK_STREAM)
s.connect(('127.0.0.1', 9000))
s.send('Sock Client Send\n')
s.close()
# -*- coding: utf-8 -*-
from socket import *
if __name__ == "__main__":
s = socket(AF_INET, SOCK_STREAM)
s.bind(("127.0.0.1", 9000))
s.listen(1)
conn, addr = s.accept()
recv_data = conn.recv(1024)
print 'Received Data : ' + recv_data
# -*- coding: utf-8 -*-
import hashlib
if __name__ == "__main__":
m = hashlib.md5("hello".encode("UTF-8"))
data = (m.hexdigest())
print data
from itertools import product
chars = '0123456789QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm' # Chars Dictionary
for length in range(1, 5): # length 1 to 4
to_attempt = product(chars, repeat=length)
for attempt in to_attempt:
brute = ''.join(attempt)
print brute
# -*- coding: utf-8 -*-
import sys, collections
if __name__ == "__main__":
f = open(sys.argv[1], "rb")
text = f.read()
count = collections.Counter(text)
print count
# -*- coding: utf-8 -*-
import sys
def decode(alphabet,ciphertext,key):
dic={}
for i in range(0,len(key)):
dic[key[i]]=alphabet[i]
plaintext=""
for l in ciphertext:
# -*- coding: utf-8 -*-
if __name__ == "__main__":
data = "test"
encode_string = data.encode('base64') # Base64 Encoding
print "encode string :", encode_string
decode_string = encode_string.decode('base64') # Base64 Decoding
print "decode string :", decode_string
# -*- coding: utf-8 -*-
from pytesser import *
if __name__ == "__main__":
print image_file_to_string("fonts_test.png")
#define _WIN32_WINNT 0x0501
#include <windows.h>
#include <stdio.h>
BOOL anti_debug()
{
return IsDebuggerPresent();
}
#define _WIN32_WINNT 0x0501
#include <windows.h>
#include <stdio.h>
BOOL anti_debug()
{
BOOL result;
CheckRemoteDebuggerPresent(GetCurrentProcess(), &result);
return result;
}