Skip to content

Instantly share code, notes, and snippets.

Avatar

Wenlei Zhu zTrix

View GitHub Profile
@zTrix
zTrix / solve_realism.py
Created Oct 29, 2017
CSAW CTF 2017 realism writeup
View solve_realism.py
#!/usr/bin/env python3
from z3 import *
def int2bytes(a: int) -> bytes:
return a.to_bytes(16, byteorder='little')
def combine128(a, b):
return (a << 64) | b
@zTrix
zTrix / crackme2000_solver.py
Created May 2, 2017
One script solve all crackme2000 in defcon ctf quals 2017
View crackme2000_solver.py
#!/usr/bin/env python2
import os, sys
import string
import subprocess
prefix = 'enlightenment' # change this to solve other crackme2000 challenges
def bf(bp):
flag = ''
@zTrix
zTrix / morset.py
Created Apr 19, 2016
morset writeup
View morset.py
#!/usr/bin/env python2
#-*- coding:utf-8 -*-
import os, sys
from zio import *
import hashlib
CODE = {'A': '.-', 'B': '-...', 'C': '-.-.',
'D': '-..', 'E': '.', 'F': '..-.',
'G': '--.', 'H': '....', 'I': '..',
@zTrix
zTrix / visa-state.py
Last active Feb 7, 2021
A simple script to check US Visa state
View visa-state.py
#!/usr/bin/env python2
import os, sys, datetime, re, urllib, httplib, time
reload(sys)
sys.setdefaultencoding('utf8')
if not sys.stdout.isatty():
import codecs
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
sys.stderr = codecs.getwriter('utf8')(sys.stderr)
View keybase.md

Keybase proof

I hereby claim:

  • I am zTrix on github.
  • I am ztrix (https://keybase.io/ztrix) on keybase.
  • I have a public key whose fingerprint is 9E33 0001 3142 0C8E F350 9A75 1FF6 A1EC B1A5 2EEF

To claim this, I am signing this object:

View letterpress.py
#!/usr/bin/env python
import os, sys
di = open(sys.argv[1], 'r')
letters = sys.argv[2]
musthave = None
if len(sys.argv) > 3:
musthave = sys.argv[3]
@zTrix
zTrix / test.py
Created Nov 9, 2013
pyuv segfault demo code
View test.py
import os, sys, random, threading
def execute(host):
while True:
io = zio((ip, 21712))
io.read_until('READY')
io.write('something something')
io.close()
@zTrix
zTrix / traintrain.py
Created Mar 24, 2013
iCTF 2013 traintrain decompiled source code
View traintrain.py
# 2013.03.24 13:33:58 CST
#Embedded file name: ./traintrain.py
import sys
import os
import getopt
import BaseHTTPServer
import urlparse
import socket
import cgi
import logging
@zTrix
zTrix / gist:4643599
Created Jan 26, 2013
facebook Hacker Cup 2013 quals 45
View gist:4643599
#!/usr/bin/env python
import os, sys
f = open(sys.argv[1], 'r')
T = int(f.readline())
def next(ary, start):
j = start
@zTrix
zTrix / echo_server.js
Created Apr 4, 2011
Node js echo server
View echo_server.js
var net=require("net");
var sys=require("sys");
var server=net.createServer(function(socket){
socket.pipe(socket);
});
server.listen(3601,null);