Skip to content

Instantly share code, notes, and snippets.

@gr0s4b1
gr0s4b1 / Get-PSHistory.ps1
Last active September 25, 2025 00:41
This script retrieves PowerShell console history for all users on a Windows machine, saving it to a timestamped filename based on the hostname. It handles history file locations, supports UNC paths, suppresses errors, and provides organized output to a text file.
function Get-PSHistory {
<#
.SYNOPSIS
Get PowerShell console history for all users on the machine.
.DESCRIPTION
This function retrieves the PowerShell console history for all users on the machine. It searches for the PSReadline history file for each user and collects the command history. If no history file is found, it indicates that no history was found for that user.
.PARAMETER SuppressErrors
Specifies whether to suppress errors when accessing user's history file. If this switch is provided, any errors encountered while accessing the history file will be silently ignored.
@jhaddix
jhaddix / cloud_metadata.txt
Last active October 13, 2025 08:38 — forked from BuffaloWill/cloud_metadata.txt
Cloud Metadata Dictionary useful for SSRF Testing
## AWS
# from http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-categories
http://169.254.169.254/latest/user-data
http://169.254.169.254/latest/user-data/iam/security-credentials/[ROLE NAME]
http://169.254.169.254/latest/meta-data/iam/security-credentials/[ROLE NAME]
http://169.254.169.254/latest/meta-data/ami-id
http://169.254.169.254/latest/meta-data/reservation-id
http://169.254.169.254/latest/meta-data/hostname
http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key
@magnetikonline
magnetikonline / dumprequest.php
Last active March 21, 2025 08:29
PHP script to dump full HTTP request to file (method, HTTP headers and body).
<?php
// https://gist.github.com/magnetikonline/650e30e485c0f91f2f40
class DumpHTTPRequestToFile {
public function execute($targetFile) {
$data = sprintf(
"%s %s %s\n\nHTTP headers:\n",
$_SERVER['REQUEST_METHOD'],
$_SERVER['REQUEST_URI'],
$_SERVER['SERVER_PROTOCOL']