Skip to content

Instantly share code, notes, and snippets.

View mikeabreu's full-sized avatar

Michael Abreu mikeabreu

View GitHub Profile
@mikeabreu
mikeabreu / get_certs.sh
Last active September 23, 2019 01:49
Certificate Transparency Bash Functions
#!/bin/bash
# Add these functions to your .bashrc or .zshrc and use from your terminal.
get_certs_domains() {
# Credit goes to Ronnie Flathers, taken from https://twitter.com/ropnop/status/972151279463124994
curl -s https://crt.sh\?q\=%25.$1 | awk -v pattern="<TD>.*$1" '$0 ~ pattern {gsub("<[^>]*>","");gsub(//,""); print}' | sort -u
}
get_certs() {
curl -s https://crt.sh\?q\=%25.$1 | awk '/\?id=[0-9]*/{nr[NR]; nr[NR+1]; nr[NR+3]; nr[NR+4]}; NR in nr' | sed 's/<TD style="text-align:center"><A href="?id=//g' | sed 's#">[0-9]*</A></TD>##g' | sed 's#<TD style="text-align:center">##g' | sed 's#</TD>##g' | sed 's#<TD>##g' | sed 's#<A style=["a-z: ?=0-9-]*>##g' | sed 's#</A>##g' | sed 'N;N;N;s/\n/\t\t/g'
}
$dir=(Join-Path -Path $ENV:USERPROFILE -ChildPath "sysinternals")
New-Item -Path $dir -ItemType Directory -ErrorAction "SilentlyContinue"
$sysinternals = Invoke-WebRequest -Uri 'https://live.sysinternals.com'
$sysinternals | %{$_.Links.Href} | %{$_.substring(1)} | %{curl "https://live.sysinternals.com/$_" -OutFile "$dir\$_"}
#!/bin/bash
###############################################################################
# Author: Mike Abreu
###############################################################################
main() {
display_message $CBLUE "[*] System Update Starting."
display_message $CORANGE "[+] Updating Aptitude Repositories:${CGREEN} sudo apt-get update"
sudo apt-get update
#!/bin/bash
# SLACK_WEBHOOK=$(printenv YOUR_SLACK_WEBHOOK)
SLACK_WEBHOOK="<INSERT_YOUR_SLACK_WEBHOOK>"
f_send_slack() {
SLACK_TEXT="$@"
SLACK_JSON="""payload={
\"channel\": \"#general\",
\"username\": \"your-slack-bot\",
\"icon_emoji\": \":monkey_face:\",
\"text\": \"${SLACK_TEXT}\"