Skip to content

Instantly share code, notes, and snippets.

@shunkp
shunkp / sad
Last active February 16, 2016 03:54
MZ À
@shunkp
shunkp / blah.py
Created September 27, 2015 02:04
def misc300():
# subprocess.call(['D:\\Edumacation\\Tesseract-OCR\\tesseract.exe', 'D:\\JetBrains\\PyCharm Community Edition 3.0\\jre\\jre\\bin\\l\\PycharmProjects\\CTFs\\imgs\\bw.jpg', 'output', '-psm', '8'])
s = requests.Session()
r = s.get("http://ctfquest.trendmicro.co.jp:8080/acf2e28903f698eda9bdefc043b6edc3/signin")
values = {"username": "admin", "password": "admin", "fuel_csrf_token": r.cookies['fuel_csrf_token']}
r = s.post("http://ctfquest.trendmicro.co.jp:8080/acf2e28903f698eda9bdefc043b6edc3/signin", data=values)
r = s.get("http://ctfquest.trendmicro.co.jp:8080/acf2e28903f698eda9bdefc043b6edc3/challenge")
print(r.text)
while True:
import requests
from time import sleep
def challenge3(bURL, passwd):
values = {'username': 'admin', 'password': passwd}
r = requests.post(bURL, data=values)
result = r.text.split('<h1>')[1].split('</h1>')[0]
return (result, r.elapsed.microseconds)
from urllib.request import *
from urllib.parse import *
import string
# check admin password via sql injection + substr
# return True if we are able to login (ie. character is a match), False otherwise
def challenge2(bURL, pos, char):
headers = {}
headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0'
headers['Accept-Language'] = 'en-GB,en;q=0.5'
import socket
from fractions import gcd
from sympy import *
from sympy.parsing.sympy_parser import parse_expr
import math
import urllib.request
import urllib.parse
def parse_num(eq):
if ''.join(eq).count("_") > 0:
from hashlib import sha1
import itertools
import time
chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
match = 'ff7b948953ac'
i = 1
start = time.time()
while True:
gen = itertools.combinations_with_replacement(chars,i)
@shunkp
shunkp / gist:f036aa1169706c9d2b77
Last active August 29, 2015 14:16
calculuswhyy
import socket
from fractions import gcd
from sympy import *
from sympy.parsing.sympy_parser import parse_expr
def gcd3(a,b,c):
return gcd(gcd(a,b),c)
def solve_x(eq1,eq2):
e1f = eq1.split(' ')

Keybase proof

I hereby claim:

  • I am shunkp on github.
  • I am pshunk (https://keybase.io/pshunk) on keybase.
  • I have a public key whose fingerprint is C6A9 70B1 FB5A D365 C7D9 8745 5267 3671 5843 99EE