This file contains 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
#!/bin/bash | |
TARGET="$1" | |
nmap -n -sV -Pn -pT:138,U:137 --script=smb-enum-shares,smb-enum-domains,smb-enum-domains,smb-os-discovery,smb-vuln* ${TARGET} |
This file contains 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
#/bin/bash | |
# Make your argument: '<user>@<server>' | |
USR_AT_SRVR="$1" | |
ssh -D 8000 -C -N ${USR_AT_SRVR} | |
# Now just visit your server in a web browser on port 8000 and you should have localhost access via ssh! |
This file contains 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
#Check if the account exists. | |
If($Results.Count -eq 0) | |
{ | |
Write-Warning "The SamAccountName '$UserName' cannot find. Please make sure that it exists." | |
} | |
Else | |
{ | |
Foreach($Result in $Results) | |
{ | |
$DistinguishedName = $Result.Properties.Item("DistinguishedName") |
This file contains 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
#!/bin/bash | |
# Use the OSX smbutil to query a file of IPs | |
# use 'lookup' instead of 'status' to get IPs from Netbi names | |
file="$1" | |
while read -r line; do | |
smbutil status "$line" |
This file contains 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
#!/bin/bash | |
# Find a list of strings in OG_LIST in OTHER LIST; export to FINAL_LIST | |
OG_LIST=$1 | |
OTHER_LIST=$2 | |
FINAL_LIST=$3 | |
diff -iEwBay --strip-trailing-cr $OG_LIST $OTHER_LIST | grep -v "|" | grep -v "<" | grep -v ">" | awk '{print $1 " " $2}' > $FINAL_LIST |
This file contains 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
#!/bin/bash | |
declare -a domain_list=( $(aws route53domains list-domains | jq -r .Domains[].DomainName) ) | |
for domain in "${domain_list[@]}" | |
do | |
# Returns date in unix timestamp | |
date_unix=$(aws route53domains get-domain-details --domain-name ${domain} | jq -r .ExpirationDate) | |
date -r ${date_unix} | |
done |
This file contains 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
#!/bin/bash | |
# Gather AWS Domain info | |
declare -a domain_list=( $(aws route53domains list-domains | jq -r .Domains[].DomainName) ) | |
for domain in "${domain_list[@]}" | |
do | |
echo ${domain} | |
echo "Admin Contact:" |
This file contains 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
def dumpClean(obj): | |
""" | |
Recursive function to clean the output of deeply nested dicts/lists | |
""" | |
if type(obj) == dict: | |
for k, v in obj.items(): | |
# if the object has an iterable attribute; keep pulling it apart | |
if hasattr(v, '__iter__'): | |
print("%s : %s" % (k, dumpClean(v))) | |
else: |
This file contains 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
####################### | |
## Github Cheatsheet ## | |
####################### | |
# Git Global Setup # | |
git config --global user.name "Cole Hocking" | |
git config --global user.email "<my-email-addr>" | |
# Token Authentication # | |
( Settings --> <> Developer Settings --> Personal Access Tokens) |
This file contains 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
#!/bin/bash | |
# Installation script to load homebrew | |
# -- Cole Hocking | |
# ----------------------------------------------------------------------------- | |
# Verify Homebrew installation for package management | |
# Docs: https://brew.sh/ | |
go_brew() { | |
echo "Checking for Homebrew package management tool..." |