Skip to content

Instantly share code, notes, and snippets.

@roninhack
roninhack / proxy.py
Created November 24, 2018 15:25 — forked from scturtle/proxy.py
use opera's built-in VPN as proxy
#!/usr/bin/env python3
import asyncio
from vpn import get_proxy
proxy = port = auth = None
pool = asyncio.Queue(5)
psize = 0
async def process_client(client_reader, client_writer, *, CHUNK=4096):
global psize
@roninhack
roninhack / atomic-size-attack.md
Created December 29, 2018 05:39 — forked from markblundeberg/atomic-size-attack.md
Advisory: secret size attack on cross-chain hash lock smart contracts

Advisory: secret size attack on cross-chain hash lock smart contracts

Dr. Mark B Lundeberg, 2018 Feb 15 bitcoincash:qqy9myvyt7qffgye5a2mn2vn8ry95qm6asy40ptgx2

This security advisory notes a vulnerability in the common construction of cross-chain smart contracts (contracts between distinct cryptocurrencies) through hash locking. I focus on the primary use case in [atomic

@RequiresApi(26)
fun requestUssdUsingTelephonyManager(ussd: String, simSlot: Int) {
val ussd = ussd.replace("%23", Uri.decode("#"))
Log.e("ussd", "requesting for ussd $ussd")
val manager = getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
val handler = Handler()
val callback = object : TelephonyManager.UssdResponseCallback() {
override fun onReceiveUssdResponse(telephonyManager: TelephonyManager, request: String, response: CharSequence) {
super.onReceiveUssdResponse(telephonyManager, request, response) // what if i remove this line
EventBus.getDefault().post(IntentResult(Activity.RESULT_OK, response.toString()))
@roninhack
roninhack / MainActivity.java
Created February 14, 2019 02:56
Android: How to collect the response of a USSD request (Including multi-session requests)
//Get the instance of TelephonyManager
final TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
try {
if (tm != null) {
Class telephonyManagerClass = Class.forName(tm.getClass().getName());
if (telephonyManagerClass != null) {
Method getITelephony = telephonyManagerClass.getDeclaredMethod("getITelephony");
#x86_64 processor march=native m64
cd /root;
sudo yum groupinstall -y "Development Tools"
sudo yum install -y git wget zlib zlib-devel pcre-devel google-perftools google-perftools-devel lua-devel GeoIP-devel
sudo yum install -y make gcc gcc-c++ wget git openssl-devel pcre-devel zlib-devel python python-devel gcc zlib perl libxml2 libxslt
sudo yum install -y autoconf automake libtool make cmake openssl openssl-devel pcre-devel build-essential libpcre3 libpcre3-dev zlib1g-dev unzip git patch
sudo yum install -y cmake gc libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel gperftools gperftools-devel libatomic_ops-devel perl-ExtUtils-Embed
sudo yum install -y gcc-c clang libatomic_ops-devel pcre-devel openssl-devel libxml2-devel libxslt-devel gd-devel GeoIP-devel gperftools-devel perl-devel
sudo yum install -y build-essential libpcre3 libpcre3-dev zlib1g zlib1g-dev
yum install -y build-essential cmake clang