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
# Took from SO | |
def egcd(a, b): | |
if a == 0: | |
return (b, 0, 1) | |
g, y, x = egcd(b%a,a) | |
return (g, x - (b//a) * y, y) | |
def modinv(a, m): | |
g, x, y = egcd(a, m) | |
if g != 1: |
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
enc_flag = '1d14273b1c27274b1f10273b05380c295f5f0b03015e301b1b5a293d063c62333e383a20213439162e0037243a72731c22311c2d261727172d5c050b131c433113706b6047556b6b6b6b5f72045c371727173c2b1602503c3c0d3702241f6a78247b253d7a393f143e3224321b1d14090c03185e437a7a607b52566c6c5b6c034047'.decode('hex') | |
# print len(enc_flag) | |
key = [i for i in range(10)] | |
flag = [chr(i) for i in range(len(enc_flag))] | |
m = [] | |
for a in range(len(key)): | |
i = a | |
for b in range(len(flag)/len(key)): |
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 | |
import socket | |
import threading | |
from hashlib import * | |
import SocketServer | |
import random | |
from flag import flag | |
host, port = '0.0.0.0', 33337 | |
BUFF_SIZE = 1024 |
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 random | |
from gmpy2 import * | |
from message import mes | |
from secret import m,n,c | |
assert "ISITDTU" in mes | |
s = [] | |
for i in mes: | |
x = (m* ord(i) + c) % n |
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
from hashlib import md5 | |
from base64 import b64decode | |
from base64 import b64encode | |
from Crypto.Cipher import AES | |
from time import ctime | |
from Secret import __SECRET__ | |
import os | |
BLOCK_SIZE = 16 |
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
from random import randint | |
from sys import argv, stdout | |
from fastecdsa.curve import P256 | |
from fastecdsa.point import Point | |
from mathutil import p256_mod_sqrt, mod_inv | |
def gen_point(): | |
P = P256.G | |
d = randint(2, P256.q) | |
e = mod_inv(d, P256.q) |
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
from pwn import * | |
import sys, os | |
def strxor(a,b): | |
return ''.join([chr(ord(x)^ord(y)) for (x,y) in zip(a,b)]) | |
records = '''I do nothing. | |
I'm a chat bot. | |
I'm from Vietnam. | |
My name is ChatBot. |
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 python2 | |
from gmpy2 import powmod, is_prime | |
from flag import FLAG | |
import sys | |
from hashlib import sha256 | |
from os import urandom | |
import sys | |
def write_to_file(num): |
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 python3 | |
import sys, hashlib | |
def decrypt_password(user, pass_enc): | |
key = hashlib.md5(user + b"283i4jfkai3389").digest() | |
passw = "" | |
for i in range(0, len(pass_enc)): | |
passw += chr(pass_enc[i] ^ key[i % len(key)]) | |
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
function name: (null) | |
number of ops: 39 | |
compiled vars: !0 = $flag, !1 = $_box, !2 = $magic | |
line #* E I O op fetch ext return operands | |
------------------------------------------------------------------------------------- | |
3 0 E > ASSIGN !0, 'FLAG+HERE' | |
5 1 NOP | |
13 2 NOP | |
21 3 NOP | |
33 4 NOP |