Skip to content

Instantly share code, notes, and snippets.

@mkagenius
mkagenius / update_metadata_pb2.py
Created July 10, 2024 11:32
update_metadata_pb2.py
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: update_metadata.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
@mkagenius
mkagenius / extract_android_ota_payload.py
Created July 10, 2024 11:30
extract_android_ota_payload.py
#!/usr/bin/env python
import hashlib
import os
import os.path
import shutil
import struct
import subprocess
import sys
import zipfile
@mkagenius
mkagenius / chatgpt-cli.js
Created March 25, 2023 09:23
Chat GPT CLI for folks who have API access, `npm install openai` and `npm install @clack/prompts` . Replace keys.
const { intro, isCancel, outro, spinner, text } = require('@clack/prompts');
const prompts = require('@clack/prompts');
const { Configuration, OpenAIApi } = require('openai');
// Set up the OpenAI API client
const configuration = new Configuration({
apiKey: OPENAI_API_KEY,
organization: OPENAI_ORG_ID
});
const openaiClient = new OpenAIApi(configuration);
@mkagenius
mkagenius / output when compiled using g++ and ran like . slash a.out
Last active January 5, 2018 15:52
Spectre.pdf illustrated c++ code verbatim
root@ubuntu:~# ./a.out
Reading 40 bytes:
Reading at malicious_x = 0xffffffffffdfeba8... Unclear: 0x54='T' score=980 (second best: 0x02 score=706)
Reading at malicious_x = 0xffffffffffdfeba9... Unclear: 0x68='h' score=929 (second best: 0x02 score=709)
Reading at malicious_x = 0xffffffffffdfebaa... Unclear: 0x65='e' score=973 (second best: 0x02 score=786)
Reading at malicious_x = 0xffffffffffdfebab... Unclear: 0x20=' ' score=928 (second best: 0x02 score=784)
Reading at malicious_x = 0xffffffffffdfebac... Unclear: 0x4D='M' score=746 (second best: 0x02 score=730)
Reading at malicious_x = 0xffffffffffdfebad... Unclear: 0x61='a' score=978 (second best: 0x02 score=749)
Reading at malicious_x = 0xffffffffffdfebae... Success: 0x67='g' score=39 (second best: 0x02 score=17)
Reading at malicious_x = 0xffffffffffdfebaf... Unclear: 0x69='i' score=972 (second best: 0x02 score=748)
import struct
import socket
import random
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect(('localhost', 1717))
def tryRead() :
flag = False
$ for i in {a..z}; \
do for j in {a..z}; \
do for k in {a..z}; \
do curl "http://sclu.es/3z$i$j$k" -vvv; \
done; done ; done