Skip to content

Instantly share code, notes, and snippets.

View ducnhse130201's full-sized avatar

PeterJson ducnhse130201

View GitHub Profile
<?
echo "pwned";
?>
@ducnhse130201
ducnhse130201 / crypto2_solve_matess3r4.py
Created April 28, 2019 00:13
crypto2_solve_matess3r4
from telnetlib import *
import json
import hashlib
from Crypto.Util.number import *
from libnum import *
r = Telnet('125.235.240.166', 13337)
def get_key():
data = json.loads(r.read_until("\n").strip())
@ducnhse130201
ducnhse130201 / crypto1_solve_matess3r4.py
Created April 28, 2019 00:12
crypto1_solve_matess3r4
from telnetlib import *
import json
from libnum import *
r = Telnet('125.235.240.166', 13338)
def get_pub():
r.read_until("Your choice: ")
@ducnhse130201
ducnhse130201 / solve_maplstory.py
Created January 10, 2019 12:17
solve_maplstory
import requests
import string
from hashlib import *
phpsessid = 't6f6errrlbpc4ldos3jdtdf6or'
sess_file = '/var/lib/php/sessions/sess_' + phpsessid
_role = '8e1c59c3fdd69afbc97fcf4c960aa5c5e919e7087c07c91cf690add608236cbe' # user role
def settting(name):
s = requests.Session()
@ducnhse130201
ducnhse130201 / solve_sqliclassninja.py
Created January 10, 2019 12:17
solve_sqliclassninja
import requests
def query(q):
s = requests.Session()
url = 'http://localhost:7002/?query1=' + q
r = s.get(url)
if r.text.count('Success') == 4:
return True
else:
return False
@ducnhse130201
ducnhse130201 / ed25519.py
Created December 16, 2018 02:48
matesS3R2(fake_tictactoe)
# https://ed25519.cr.yp.to/python/ed25519.py
import hashlib
b = 256
q = 2**255 - 19
l = 2**252 + 27742317777372353535851937790883648493
def H(m):
return hashlib.sha512(m).digest()
@ducnhse130201
ducnhse130201 / math_master.py
Created December 16, 2018 02:47
matesS3R2(math_master.py)
from telnetlib import *
r = Telnet('125.235.240.166', 12346)
r.read_until('r = ')
r_ = int(r.read_until(' and ').strip(' and '))
r.read_until('p = ')
p = int(r.read_until('\n').strip())
@ducnhse130201
ducnhse130201 / cookie_gen_solve.py
Created December 16, 2018 02:46
matesS3R2(cookie_gen_solve.py)
@ducnhse130201
ducnhse130201 / CryptoX_solve.sage
Created December 16, 2018 02:45
matesS3R2(CryptoX_solve.sage)
from sage.all import *
from Crypto.Util.number import *
#Common Modulus attack
def common_modulus_attack(c1,c2,e1,e2,n):
print '-----------------------------------Starting Common modulus attack ...----------------------------'
g,a,b = xgcd(e1,e2)
print a,b
c1 = pow(c1,a,n)
c2 = pow(c2,b,n)
@ducnhse130201
ducnhse130201 / aes_return(solve).py
Created October 15, 2018 05:21
aes_return(solve).py
from Crypto.Cipher import AES
import binascii
def xor(a, b):
""" Returns a new byte array with the elements xor'ed. """
return bytes(i^j for i, j in zip(a, b))
def bytes2matrix(text):
""" Converts a 16-byte array into a 4x4 matrix. """
return [list(text[i:i+4]) for i in range(0, len(text), 4)]