Skip to content

Instantly share code, notes, and snippets.

@Zoxc
Zoxc / injector.cpp
Created June 10, 2012 17:40
DLL Injector for x86/x64
#pragma once
#include <SDKDDKVer.h>
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <windows.h>
#include <tchar.h>
#include <shellapi.h>
#include <string>
#include <sstream>
#include <functional>
import sys
import re
def fnv32a( str ):
hval = 0x811c9dc5
fnv_32_prime = 0x01000193
uint32_max = 2 ** 32
for s in str:
hval = hval ^ ord(s)
hval = (hval * fnv_32_prime) % uint32_max
@willurd
willurd / web-servers.md
Last active July 4, 2024 14:07
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@grugq
grugq / gist:03167bed45e774551155
Last active April 6, 2024 10:12
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@mengzhuo
mengzhuo / hash_djb2.py
Created March 9, 2015 07:40
DJB2 Hash in Python
#!/usr/bin/env python
# encoding: utf-8
def hash_djb2(s):
hash = 5381
for x in s:
hash = (( hash << 5) + hash) + ord(x)
return hash & 0xFFFFFFFF
/*
robin verton, dec 2015
implementation of the RC4 algo
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define N 256 // 2^8
@bkaradzic
bkaradzic / orthodoxc++.md
Last active July 1, 2024 03:54
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@xorrior
xorrior / wmic_cmds.txt
Last active June 18, 2024 18:33
Useful Wmic queries for host and domain enumeration
Host Enumeration:
--- OS Specifics ---
wmic os LIST Full (* To obtain the OS Name, use the "caption" property)
wmic computersystem LIST full
--- Anti-Virus ---
wmic /namespace:\\root\securitycenter2 path antivirusproduct
@jaredcatkinson
jaredcatkinson / Get-InjectedThread.ps1
Last active July 1, 2024 08:32
Code from "Taking Hunting to the Next Level: Hunting in Memory" presentation at SANS Threat Hunting Summit 2017 by Jared Atkinson and Joe Desimone
function Get-InjectedThread
{
<#
.SYNOPSIS
Looks for threads that were created as a result of code injection.
.DESCRIPTION
@nicholasmckinney
nicholasmckinney / rwxHunter.cs
Created May 8, 2017 00:33
Locate a RWX Region in memory in InstallUtil.exe - Copy Shellcode Into It and Execute. Avoid VirtuallAlloc Call
using System;
using System.Net;
using System.Diagnostics;
using System.Reflection;
using System.Configuration.Install;
using System.Runtime.InteropServices;
/*
Author: Casey Smith, Twitter: @subTee
License: BSD 3-Clause