Skip to content

Instantly share code, notes, and snippets.

@githubfoam
githubfoam / Active Directory Cheat Sheet
Last active November 8, 2024 22:54
Active Directory Cheat Sheet
----------------------------------------------------------------------------------------------------
#The Active Directory Administrative Center (ADAC)
dsac (cmd)
dsac (pwsh)
----------------------------------------------------------------------------------------------------
Extracting password hashes from the NTDS.dit and SYSTEM files is typically performed for security and forensic purposes. These files are part of the Windows operating system and contain user account information and password hashes. There are several tools and techniques that can be used to perform this extraction:
Mimikatz:
Mimikatz is a popular open-source tool for post-exploitation tasks, including extracting password hashes from Windows systems.
@githubfoam
githubfoam / powerCLI cheat sheet
Last active February 2, 2026 13:13
powerCLI cheat sheet
------------------------------------------------------------------------------------------------------------------------------------
Get-Help Get-Snapshot
Get-Help XXX (cmdlet)
REMARKS
To see the examples, type: "get-help Get-Snapshot -examples".
For more information, type: "get-help Get-Snapshot -detailed".
For technical information, type: "get-help Get-Snapshot -full".
For online help, type: "get-help Get-Snapshot -online"
@githubfoam
githubfoam / cisco switch cheat sheet
Last active November 22, 2026 12:37
cisco switch cheat sheet
-------------------------------------------------------------------------------------------------------------------------------------
#CLI Shortcut Keystrokes
Ctrl+Shift+6 Cancels whatever it's currently doing
Ctrl+C Exits config mode
Ctrl+Z Applies current command & returns to priv. EXEC mode
Ctrl+U Erases anything on current prompt line
Tab Completes abbrev­iated command
Up Arrow Automa­tically re-types last command
@githubfoam
githubfoam / hpe aruba switch cheat sheet
Last active September 18, 2026 09:20
hpe aruba switch cheat sheet
--------------------------------------------------------------------------------------------------------------------
show <TAB> see parameter list to show command
? list of commands
To re-execute a command,use the redo command
alias <name> <command> #Thealiascommandisexecutedfromthecurrentconfigurationcontext
no alias <name> <command
press [Tab] after typing "t",the available command options that begin with "t"
switch(config)#t
@githubfoam
githubfoam / jenkins cheat sheet
Last active September 19, 2025 13:36
jenkins cheat sheet
--------------------------------------------------------------------------------------------------------------------
(remote linux)
1. Create a Dedicated User on the Agent Machine
User Account: root (or a user with sudo privileges)
Commands:
sudo useradd -m -d /home/jenkins-runner -s /bin/bash jenkins-runner
sudo passwd jenkins-runner # Set a password for the user (optional but useful for troubleshooting)
@githubfoam
githubfoam / powershell cheat sheet
Last active August 11, 2026 13:03
powershell cheat sheet
=========================================================================================================
#powershell editor in windows
PowerShell ISE,Visual Studio Code,Notepad++
==========================================================================================================
Example 3: Modify your prompt function
This command changes the prompt function so that it displays the time before the path.
PowerShell
Set-Item -Path function:prompt -Value {'PS '+ (Get-Date -Format t) + " " + (Get-Location) + '> '}
@githubfoam
githubfoam / vmware esxi cheat sheet
Last active July 19, 2023 06:35
vmware esxi cheat sheet
-------------------------------------------------------------------------------------------------------------------
#ChatGPT
explain how to use VMWare WorkspaceOne to Increase automation capabilities of the cyber detection
ChatGPT
VMware Workspace ONE is an integrated platform that combines unified endpoint management (UEM) and endpoint security capabilities. While it doesn't directly increase automation capabilities for cyber detection, it provides a centralized management and security framework that can be leveraged to enhance automation in the overall cybersecurity operations. Here's an overview of how you can utilize VMware Workspace ONE to improve automation capabilities in cyber detection:
Endpoint Management: Workspace ONE allows you to manage a wide range of endpoints, including mobile devices, desktops, laptops, and virtual machines. By enrolling and configuring these endpoints within the Workspace ONE console, you establish a centralized management framework for all your devices.
Endpoin
@githubfoam
githubfoam / nagios_core_experience
Last active August 15, 2023 12:13
nagios_core_experience
--------------------------------------------------------------------------------------------------------------------
#ChatGTP
#parent child relationship between hosts
Define the parent host: In this example, we'll define SwitchA as the parent host. We can define this in the Nagios configuration file by adding the following line:
define host{
use generic-switch
host_name SwitchA
alias Switch A
@githubfoam
githubfoam / windows_osquery
Last active September 11, 2023 18:16
windows_osquery
PS C:\Users\Administrator> osqueryi
Using a virtual database. Need help, type '.help'
#search for all local user accounts that exist on a machine
osquery> SELECT * FROM users WHERE username NOT LIKE '\_%' ESCAPE '\';
#shows the top 10 memory hogs running on a system.
SELECT pid, name,
ROUND((total_size * '10e-7'), 2) AS memory_used
FROM processes
@githubfoam
githubfoam / macos_osquery
Last active July 15, 2021 10:18
macos_osquery
#all local user accounts that exist on a machine
SELECT * FROM users WHERE username NOT LIKE '\_%' ESCAPE '\';
# finds all users who have actual login shells
SELECT * FROM users WHERE shell NOT LIKE '%false' AND shell NOT LIKE '%true';
#listening ports
SELECT p.name, address, port, family, protocol,
COALESCE(NULLIF(pos.path,''), p.path) AS path
FROM listening_ports AS pos