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
p = """.rodata:08048880 db 0DBh | |
.rodata:08048881 db 1Dh | |
.rodata:08048882 db 0 | |
.rodata:08048883 db 0 | |
.rodata:08048884 db 0E1h | |
.rodata:08048885 db 1Dh | |
.rodata:08048886 db 0 | |
.rodata:08048887 db 0 | |
.rodata:08048888 db 0F5h | |
.rodata:08048889 db 1Dh |
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 Crypto.Util.number import * | |
import random | |
flag = 'Hidden' | |
def egcd(a, b): | |
if a == 0: | |
return (b, 0, 1) | |
else: | |
g, y, x = egcd(b % a, a) | |
return (g, x - (b // a) * y, y) |
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/python2 | |
from Crypto.Cipher import AES | |
import hmac, hashlib | |
import os | |
import sys | |
menu = """Choose one: | |
1. encrypt data | |
2. decrypt data | |
3. quit |