This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# FILE is a csv dumped from some source, i.e. Azure. Columns formatted like: "DnsRecord","Record","RecordType" | |
FILE="AllAzureDnsRecords10-08-2021-16.csv" | |
NEWFILE="dangling_records.csv" | |
DEADDNS=() | |
for line in $(grep "CNAME" ${FILE}); do | |
TARGET=$(echo ${line} | cut -d, -f2 | sed s/\"//g) | |
CNAME=$(echo ${line} | cut -d, -f1 | sed s/\"//g) | |
echo "Checking ${TARGET}..." | |
RESPONSE=$(host ${TARGET}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dockernuke () { | |
docker stop $(docker ps -a -q) | |
docker rm $(docker ps -a -q) | |
docker rmi $(docker images -a -q) | |
docker system prune -a | |
docker volume prune | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env pwsh | |
# To Run: cf-azure-app-service-restriction.ps1 <ResourceGroup> <FunctionName> | |
# Credit to Praveen Kumar Sreeram, got the basic script from his blog post here and modified it a bit: | |
# https://praveenkumarsreeram.com/2021/04/26/azure-devops-bulk-ip-address-restriction-of-azure-app-service-dynamically-using-powershell/ | |
Param( | |
[Parameter(Mandatory = $true)] | |
[string] $ResourceGroupName, | |
[Parameter(Mandatory = $true)] | |
[string] $WebAppName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rapid7 Scan Request | |
# Sites and their corresponding ID: | |
# ATL = 1 | |
# NYC = 2 | |
# | |
# Scan Engines and their corresponding ID: | |
# ATLSCANNER = 1 | |
# NYCSCANNER = 2 | |
# | |
# Which Scan Engines Go with Which Sites: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credit to @leo60228 | |
curl <YouTube URL> | grep -Po 'y.*g = \K\{.+?}(?=;y)' | jq -r '.args.player_response | fromjson | .streamingData.formats | max_by(.bitrate) | .url' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remove double spacing from a file | |
tr -s '\n' < ${input_file} > ${output_file} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in $(sudo docker images -q) ; do sudo docker image inspect $f | jq '.[0].RepoTags[]' ; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Take a CSV with CVE number in a row, print out CVE using regex. | |
import csv | |
import re | |
reg = 'CVE-\d{4}-\d{4,7}' | |
csvfile = '/Users/dbutterworth/test/VulnerabilityListingExport.csv' | |
with open(csvfile, mode='r') as infile: | |
csvreader = csv.reader(infile) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
instance_id="i-***************" | |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | |
unzip awscliv2.zip | |
sudo ./aws/install | |
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" -o "session-manager-plugin.rpm" | |
sudo yum install session-manager-plugin.rpm -y | |
/usr/local/bin/aws ssm start-session --target $instance_id | |
#Cleanup |