Skip to content

enumpwshhist is a Beacon Object File (BOF) that enumerates and finds sensitive information in PowerShell history files.

Notifications You must be signed in to change notification settings

fyxme/enumpwshhistbof

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

enumpwshhist BOF

enumpwshhist is a Beacon Object File (BOF) that enumerates and finds sensitive information in PowerShell history files. This attempts to access the PowerShell history file directory of all users and will grep lines for a number of pre-defined keywords.

The behaviour is the same as the Powershell History netexec SMB Module except you can now run it from your favorite C2 or BOF runner.

enumpwshhist: enumERATE pOwERshELL histORY

Usage

enumpwshhist

Example output

22/01/2025 15:56:46 [danielward] Demon » enumpwshhist
[*] [5E924F7B] Enumerating powershell history for all reachable directories
[+] Send Task to Agent [31 bytes]
[+] Received Output [42 bytes]:
[+] Enumerating powershell history files!

[+] Received Output [736 bytes]:
Evaluating directory: C:\Users\lo\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine
	File found: ConsoleHost_history.txt
	Full path: C:\Users\lo\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt
	Sensitive keywords found:
		[convertto-securestring] $creds = convertto-securestring 'helloworld123' -asplaintext -force
		[credential] $uo = new-object system.manageement.automation.pscredential ('micael.jackson', $creds)
		[credential] $uo = new-object system.manageement.automation.pscredential ('michael.jackson', $creds)
		[credential] $uo = new-object system.management.automation.pscredential ('michael.jackson', $creds)
		[convertto-securestring] $creds = convertto-securestring 'h123elloworld123' -asplaintext -force

[+] Received Output [42 bytes]:
[+] Finished powershell file enumeration!

[*] BOF execution completed

Supported C2s

  • CobaltStrike : load enumpwshhist.cna
  • Havoc : load havoc-enumpwshhist.py

Compilation

The makefile is setup for cross platform compilation using mingw:

make

Credits

  • netexec's powershell history module, which this BOF is based on
  • wsummerhill's enumfiles BOF which has a powershell history module which lists powershell history files. However, only works for the current user only and requires the APPDATA environment variable to be set which is not always the case.

About

enumpwshhist is a Beacon Object File (BOF) that enumerates and finds sensitive information in PowerShell history files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published