Skip to content

Instantly share code, notes, and snippets.

View WangYihang's full-sized avatar
🎯
Focusing

Yihang Wang WangYihang

🎯
Focusing
View GitHub Profile
from __future__ import print_function
import frida
import sys
device = frida.get_device_manager().add_remote_device('127.0.0.1:27042')
session = device.attach(int(sys.argv[1]))
code = '''
Interceptor.attach(Module.findExportByName("libssl-ws.so", "tls1_setup_key_block"), {
onEnter: function(args) {
import random
def solve():
'''
area of unit circle at (0.5, 0.5) = pi * (0.5 ^ 2)
area of unit trangle at (0.5, 0.5) = 1 * 1
the ratio of the number of points that fall in the circle to the number
of all points will approximate the ratio of the area of the circle to
the area of the entire square.
'''

Keybase proof

I hereby claim:

  • I am wangyihang on github.
  • I am wangyihang (https://keybase.io/wangyihang) on keybase.
  • I have a public key ASAgocxodMp98MAOht9nFCua-961GQ0TSG_HjU7IceBnsAo

To claim this, I am signing this object:

@WangYihang
WangYihang / monitor.py
Created July 30, 2021 09:52
URL content monitor
#!/usr/bin/env python3
# encoding: utf-8
import time
import requests
import difflib
'''
1. Config on remote server which runs this script
pip3 install notify-run
import random
def quicksort(data):
'''
quicksort: sort a list via quicksort (recurrsive version)
args:
data: the list to be sort
return:
the sorted list (allocated)
'''
@WangYihang
WangYihang / UDP-PortScanner-via-ICMP-Global-Rate-Limiting.py
Created June 28, 2021 05:11
DNS Cache Poisoning Attack Reloaded: Revolutions with Side Channels
# #!/usr/bin/env python
from scapy.all import *
from faker import Faker
class SAD:
def __init__(self, fdns) -> None:
self.start_port = 0x8000
self.end_port = 0x10000
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
unsigned char upper(unsigned char ch) {
if (ch >= 'a' && ch <= 'z') {
ch ^= 0x20;
}
return ch;
}
def bisection(f, a, b, delta, max_steps):
l = a
r = b
for _ in range(max_steps):
p = (l + r) / 2
print("[{:02d}] {} {} {}".format(_, l, p, r))
s = f(p) * f(l)
if s < 0:
r = p
elif s > 0:
#include <stdio.h>
#include <string.h>
void swap(char* a, int left, int right) {
char t = a[left];
a[left] = a[right];
a[right] = t;
}
void permuation(char* a, int left, int right) {
@WangYihang
WangYihang / timesnapper-license-server.py
Last active August 24, 2021 08:06
TimeSnapper License Server
#!/usr/bin/env python
# encoding:utf-8
import time
import string
import random
from flask import Flask
from flask import Response
app = Flask(__name__)