Skip to content

Instantly share code, notes, and snippets.

View stephenbradshaw's full-sized avatar
:octocat:
Working from home

Stephen Bradshaw stephenbradshaw

:octocat:
Working from home
View GitHub Profile
@stephenbradshaw
stephenbradshaw / executer.cs
Created March 10, 2023 08:13
Simple example of web fetching in memory .Net assembly executer
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Net;
using System.Reflection;
// Compile with:
// Windows: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /out:executer.exe /platform:x64 executer.cs
@stephenbradshaw
stephenbradshaw / extractor.cs
Created April 29, 2022 09:43
C# code for extracting resources from .Net assemblies to auto named files in pwd on disk - handles costura compressed files
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Text;
using System;
// Compile with: csc extractor.cs
@stephenbradshaw
stephenbradshaw / stephenbradshaw.zsh-theme
Created December 21, 2020 02:04
My Oh My Zsh theme
local user='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[green]%}%m%{$reset_color%}'
local pwd='%B%{$fg[blue]%}%~%{$reset_color%}'
local rvm=''
if which rvm-prompt &> /dev/null; then
rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
else
if which rbenv &> /dev/null; then
rvm='%{$fg[green]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}'
fi
fi
@stephenbradshaw
stephenbradshaw / https_server_python3.py
Last active January 2, 2026 03:51
Python 3 Simple HTTPS server (versions for above and below python3.7 and helper script to generate certificate)
#!/usr/bin/env python
import http.server
import ssl
# Create certifcate and key: https://github.com/stephenbradshaw/pentesting_stuff/blob/master/example_code/create_self_signed_https_certs.py
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
context.load_cert_chain(certfile="https_self_signed_cert.pem", keyfile="https_self_signed_key.pem")
httpd = http.server.HTTPServer(('127.0.0.1', 443), http.server.SimpleHTTPRequestHandler)