Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

272 total results found

Request storage account token

Azure - Cheatsheet Metadata Service

# Get OAuth Token TOKEN=$(curl -s "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com" -H Metadata:true | jq -r '.access_token') # Get subscription id SUB=$(curl -s -H Metadata:true --noproxy...

Get AKS node IP

Azure - Cheatsheet Metadata Service

curl -s -H Metadata:true "http://169.254.169.254/metadata/instance?api-version=2017-08-01" | jq -r .network.interface[].ipv4.ipAddress[].privateIpAddress Resource: https://itnext.io/how-a-naughty-docker-image-on-aks-could-give-an-attacker-access-to-your-azure...

Create new role assignment

Azure - Cheatsheet Roles

This will try to assign the assignee the owner role: az role assignment create --assignee <user or service principal> --role "owner" Resource: https://www.xmcyber.com/privilege-escalation-and-lateral-movement-on-azure-part-1/

Show registered features in a table format

Azure - Cheatsheet Features

az feature list -o table  

Find features associated w/ ContainerService

Azure - Cheatsheet Features

az feature list -o table --query "[?contains(name, 'Microsoft.ContainerService')].{Name:name,State:properties.state}" Resource: https://heranonazure.wordpress.com/2019/09/02/secure-api-server-using-authorized-ip-address-ranges/

Azure Powershell Module Cheatsheet

Azure - Cheatsheet

# Azure Product Azure CLI Example CLI PowerShell Module Example PS 1 Syntax az   PowerShell uses a verb-noun pair for the names of cmdlets   2 Log in to Azure az login az login -u johndoe@contoso.com -p VerySecret Az.Accounts ...

While loops

Bash - Cheatsheet

Run for period of time #!/bin/bash runtime="5 minute" endtime=$(date -ud "$runtime" +%s) while [[ $(date -u +%s) -le $endtime ]] do echo "Time Now: `date +%H:%M:%S`" echo "Sleeping for 10 seconds" sleep 10 done Resource: https://www.g...

For loops

Bash - Cheatsheet

Compute md5sum for every item in a directory for i in "$(ls)"; do md5sum "${i}"; done | sort Print 1 through 10 for COUNT in $(seq 1 10); do echo $COUNT sleep 1 done Read data into an array and loop over it mapfile -t buckets < <(aws s3 ls | grep t...

SSH

Bash - Cheatsheet

Encrypt Key openssl rsa -des3 -in key.pem -out encrypted-key.pem # Enter a passphrase mv encrypted-key.pem key.pem chmod 400 key.pem Decrypt Key openssl rsa -in key.pem -out key.open.pem # Enter the passphrase used to encrypt the ke mv key.open.pem key...

Create sudo user non-interactively

Bash - Cheatsheet

Skip the prompts that come with creating a user typically, and give them sudoers privileges. Replace ${USERNAME} with the user you want to create. # The man page explanation for --gecos isn't that intuitive IMO # Basically specifying --gecos "" states you do...

Run function as another user

Bash - Cheatsheet

export -f <function_name> su <user to run function as> -c "bash -c <function_name>"  

Run command as another user

Bash - Cheatsheet

USER=centos runuser -l $USER -c 'whoami' Resource: https://devops.stackexchange.com/questions/10402/running-a-command-as-a-specific-user-on-an-ec2-using-ssm

New Page

Bash - Cheatsheet Unsorted

Exit-on-error mode Put this at the top of your bash script: set -e. If a command returns a nonzero status, the shell will exit. Resources: https://unix.stackexchange.com/questions/97101/how-to-catch-an-error-in-a-linux-bash-script http://linuxcommand.org/lc3...

Create Test Detections

Crowdstrike - Cheatsheet

Original Article We have several test detections that can be run to verify the Falcon sensor is sending detections back to the cloud and that they are being received in a timely manner. If you have a SOC that receives and responds to alerts, it would be advi...

Docker Cheatsheet

Docker - Cheatsheet Main

Installation Ubuntu install_docker(){ sudo apt-get update sudo apt-get install -y \ ca-certificates \ curl \ gnupg \ lsb-release # Add docker's official GPG key sudo mkdir -p /etc/apt/keyrings curl...

Markdown Cheatsheet

Markdown - Cheatsheet

You can use this site to generate the code for you. For example: ## Table of Contents - [Prerequisites](#prerequisites) - [Create](#create) --- ## Prerequisites - Stuff - Things --- ## Create - More stuff - More things Resource: https...

Delete Email From All Mailboxes In Office 365

M365 - Scripts Email Management

For full details please go to the following page Delete Email From All Mailboxes In Office 365 This assumes the following are trueSubject: You must change your bank password nowSent: 05/12/2020 1. Connect to MSOnline in Powershell Import-Module ExchangeOnli...

Wireshark

Packet Capturing - Cheatsheet

Filter where the source ip is not 192.168.1.1 ip.src != 192.168.1.1 Filter where the destination ip is not 192.168.1.1 ip.dst != 192.168.1.1 Find packets with a string in them frame contains <thing to search> For example: frame contains google Resource...