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 pwn | |
import json | |
import curses | |
address = ("socket.cryptohack.org", 13421) | |
connection = pwn.connect(address[0], address[1]) | |
connection.recvline() | |
def createEncryptCommand() -> str: | |
return "{\"option\":\"encrypt\"}" |
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
var intent = XiaomiUtilities.getPermissionManagerIntent(applicationContext) | |
if (intent != null) { | |
try { | |
startActivity(intent) | |
} catch (e: Exception) { | |
try { | |
intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS) | |
intent.data = Uri.parse("package:" + applicationContext.packageName) | |
startActivity(intent) | |
} catch (e: Exception) { |
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
val isMIUI = XiaomiUtilities.isMIUI() | |
val isShowWhenLocked= XiaomiUtilities.isCustomPermissionGranted(context, XiaomiUtilities.OP_SHOW_WHEN_LOCKED) | |
val isExactAlarm = XiaomiUtilities.isCustomPermissionGranted(context, XiaomiUtilities.OP_EXACT_ALARM) |
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 android.annotation.SuppressLint; | |
import android.annotation.TargetApi; | |
import android.app.AppOpsManager; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.text.TextUtils; | |
import java.lang.reflect.Method; | |
// MIUI. Redefining Android. |
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 json | |
from ptCrypt.Math.base import xor | |
message = b"\x00" * 16 | |
payload1 = json.dumps({"action": "tag", "message": message.hex()}) | |
print(payload1) | |
tag = input("tag >> ") | |
iv = bytes.fromhex(json.loads(tag)["iv"]) | |
ct = bytes.fromhex(json.loads(tag)["ct"]) |
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 json | |
# Step 1: Generate tag t | |
payload1 = json.dumps({"action": "tag", "message": (b"\x00" * 16).hex()}) | |
print(payload1) | |
# Step 2: Use tag t to generate new message | |
tag = input("tag >> ") | |
payload2 = json.dumps({"action": "verify", "message": (b"\x00" * 16).hex() + tag, "tag": tag}) | |
print(payload2) |
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/python3 | |
import socket | |
import json | |
from Crypto.Cipher import AES | |
from Crypto.Random import get_random_bytes | |
# Read the flag from a file | |
FLAG = "" | |
with open('flag.txt') as f: |
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/python3 | |
import socket | |
import json | |
from Crypto.Cipher import AES | |
from Crypto.Random import get_random_bytes | |
# Read the flag from a file | |
FLAG = "" | |
with open('flag.txt') as f: |
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 os | |
import hashlib | |
def main(): | |
while True: | |
command = input("bash-4.2$ ") | |
checkInput(command) | |
os.system(command) |
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 xorBytes(b1, b2): | |
res = b"" | |
for i in range(max(len(b1), len(b2))): | |
res += bytes([b1[i % len(b1)] ^ b2[i % len(b2)]]) | |
return res | |
crib = b"actf{" | |
ctext = bytes.fromhex("ae27eb3a148c3cf031079921ea3315cd27eb7d02882bf724169921eb3a469920e07d0b883bf63c018869a5090e8868e331078a68ec2e468c2bf13b1d9a20ea0208882de12e398c2df60211852deb021f823dda35079b2dda25099f35ab7d218227e17d0a982bee7d098368f13503cd27f135039f68e62f1f9d3cea7c") | |
for i in range(len(ctext) - 5): | |
offset = ctext[i: i + 5] | |
key = xorBytes(offset, crib) |
NewerOlder