Skip to content

Instantly share code, notes, and snippets.

View nasbench's full-sized avatar
📚

Nasreddine Bencherchali nasbench

📚
View GitHub Profile

Keybase proof

I hereby claim:

  • I am nasbench on github.
  • I am nasbench (https://keybase.io/nasbench) on keybase.
  • I have a public key ASCERZHjJ7mUyROvWgr41hlUXh_byMkTO918VVCAtXhxbgo

To claim this, I am signing this object:

@nasbench
nasbench / fiddlerPOC.cs
Created June 16, 2022 18:13
A simple fiddler classic extension persistence POC
using System.Diagnostics;
using Fiddler;
[assembly: Fiddler.RequiredVersion("2.3.5.0")]
namespace POCFiddlerDotNet
{
public class PersistencePOC : IFiddlerExtension
{
public PersistencePOC() { }
@nasbench
nasbench / config-adplus.xml
Created November 8, 2022 19:39
Adplus LOLBIN Config Sample
<ADPlus Version='2'>
<Settings>
<Option> FullOnFirst </Option>
<Runmode> Hang </Runmode>
<!--
If you want to run the binary and not dump anything.
Then this can be any process as long as it's running
-->
<ProcessName> notepad.exe </ProcessName>
<OutputDir>C:\temp\</OutputDir>
@nasbench
nasbench / debug-script.txt
Created November 8, 2022 19:44
Debug script example that can be used to trigger cdb.exe LOLBIN as described in https://twitter.com/nas_bench/status/1534957360032120833
as AdpDumpDir C:\logs\20220609_183403_Crash_Mode
.logopen /t "${AdpDumpDir}\ADPlus_log.log"
as AdpOutputDir C:\logs
as AdpDumpDirEsc C:\\logs\\20220609_183403_Crash_Mode
as AdpTimeStamp 20220609_183403
*
*----- OS and Time Information ----
vertarget
*
*
@nasbench
nasbench / Microsoft.NodejsTools.PressAnyKey.md
Created April 11, 2023 14:55
VisualStudio NodejsTools PressAnyKey Arbitrary Binary Execution

Microsoft.NodejsTools.PressAnyKey.exe LOLBIN

This binary can be used as a LOLBIN as described here.

Addtional Info

  • The arguments number must be at least 3
  • The first first argument can be anything (instead of both, normal or abnormal). Since the switch clause doesn't specify a default case. And the flag variable is set to true before the check.
  • The second argument also can be anything and it will be written to the execution path with the contents being the PID of the process File.WriteAllText(args[1], process.Id.ToString());
  • The thrid argument is passed directly to ProcessStartInfo and is executed Process.Start(startInfo);. Hence anything can be called
@nasbench
nasbench / DumpMinitool.md
Created April 12, 2023 00:35
DumpMinitool LOLBIN

DumpMinitool.exe LOLBIN

This binary can be used as a LOLBIN as described here

Addtional Info

  • The arguments flags are meaningless only the order is important. This means as long as you provide exactly 6 flags and their value the binary will still work. Here are the exact positions for reference:
// Usage: --file <fullyResolvedPath> --processId <processId> --dumpType <dumpType>
@nasbench
nasbench / README.md
Last active April 12, 2023 12:45
Malicious CHM Proof of Concept

Malicious CHM - Proof of Concept

Here are the steps to follow in order to create a malicious CHM file. As used by APT37

  • Download the HTML Help Workshop (Htmlhelp.exe) from MSDN. If the link is dead you can use the archive version here
  • Once installed you should have a folder C:\Program Files (x86)\HTML Help Workshop and inside the Microsoft HTML Help Compiler (hhc.exe)
  • We need to create 3 files:
    • Project File .hpp
    • HTML File .htm
  • Table of Contents File .hhc
@nasbench
nasbench / README.md
Created April 14, 2023 14:09
Executing Commands in an Appx Context Via Invoke-CommandInDesktopPackage
@nasbench
nasbench / howto.txt
Created May 5, 2023 10:07 — forked from andrewkroh/howto.txt
Microsoft-Windows-Windows Defender Event Log Message Resources
800, AntiVirus
801, AntiSpyware
802, Antimalware
803, Full
804, Delta
805, Full Scan
806, Quick Scan
807, Custom Scan
808, Remove
809, Quarantine
@nasbench
nasbench / shellBigInt.cs
Created May 6, 2023 22:43 — forked from djhohnstein/shellBigInt.cs
Shellcode Stuffed in BigInteger
sing System;
using System.Diagnostics;
using System.Reflection;
using System.Configuration.Install;
using System.Runtime.InteropServices;
/*
Author: Casey Smith, Twitter: @subTee