Skip to content

Instantly share code, notes, and snippets.

View 0awawa0's full-sized avatar
👾
Focusing

Alexander 0awawa0

👾
Focusing
View GitHub Profile
import pwn
import json
import curses
CHECKS_COUNT = 15
address = ("socket.cryptohack.org", 13422)
connection = pwn.connect(address[0], address[1])
connection.recvline()
def createEncryptCommand() -> str:
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\"}"
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) {
val isMIUI = XiaomiUtilities.isMIUI()
val isShowWhenLocked= XiaomiUtilities.isCustomPermissionGranted(context, XiaomiUtilities.OP_SHOW_WHEN_LOCKED)
val isExactAlarm = XiaomiUtilities.isCustomPermissionGranted(context, XiaomiUtilities.OP_EXACT_ALARM)
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.
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"])
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)
#!/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:
#!/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:
@0awawa0
0awawa0 / bash.py
Created April 28, 2021 06:08
ImagineCTF Round 9 Salty Task
#!/usr/bin/env python3
import os
import hashlib
def main():
while True:
command = input("bash-4.2$ ")
checkInput(command)
os.system(command)