This is a simple slackbot to post successful SSH logins to a slack channel to help you keep track of server access.
Create an incoming webhook for your slack community.
Create /etc/ssh/sshslack.sh
| import requests | |
| import json | |
| import gzip | |
| import os | |
| import codecs | |
| import time | |
| from datetime import timedelta | |
| start = time.time() | |
| count = 0 |
| import csv | |
| import os | |
| import re | |
| import requests | |
| import subprocess | |
| import time | |
| from datetime import timedelta | |
| from more_itertools import unique_everseen | |
| start = time.time() |
| import csv | |
| import re | |
| import requests | |
| import time | |
| import os | |
| from datetime import timedelta | |
| from more_itertools import unique_everseen | |
| from operator import itemgetter | |
| start = time.time() |
| Owner/Container1 | |
| Total: 23 (UNKNOWN: 0, LOW: 3, MEDIUM: 13, HIGH: 7, CRITICAL: 0) | |
| Owner/Container2 | |
| Total: 16 (UNKNOWN: 0, LOW: 2, MEDIUM: 12, HIGH: 2, CRITICAL: 0) | |
| Owner/Container3 | |
| Total: 85 (UNKNOWN: 0, LOW: 7, MEDIUM: 44, HIGH: 24, CRITICAL: 10) | |
| Owner/Container4 |
| # Add `~/bin` to the `$PATH` | |
| export PATH="$HOME/bin:$PATH"; | |
| # Load the shell dotfiles, and then some: | |
| # * ~/.path can be used to extend `$PATH`. | |
| # * ~/.extra can be used for other settings you don’t want to commit. | |
| for file in ~/.{path,bash_prompt,exports,aliases,functions,extra}; do | |
| [ -r "$file" ] && [ -f "$file" ] && source "$file"; | |
| done; | |
| unset file; |
| #!/bin/bash | |
| #Script to Scan All Sites Found With A Simple NMAP Scan With Burp. | |
| sites=$(nmap "$1" --open 443 --resolve-all --open -oG - | awk 'NR!=1 && /open/{print $2}') | |
| for site in $sites | |
| do | |
| curl -vgw "\\n" 'http://127.0.0.1:1337/v0.1/scan' -d '{"urls":["'"$site"'"]}' > /dev/null 2>&1 | |
| printf "Scanning %s with burp.\\n" "$site" | |
| done |
| #!/bin/bash | |
| for url in $(cat domains.txt) | |
| do | |
| if curl --output /dev/null --silent --head --fail "$url"; then | |
| printf "$url \\n" | |
| else | |
| : | |
| fi | |
| done |
| #!/bin/bash | |
| #Simple Script To Scan All Public Bounty Sites With Burp 2.0 | |
| sites=$(curl https://raw.githubusercontent.com/arkadiyt/bounty-targets-data/master/data/domains.txt) | |
| for site in $sites | |
| do | |
| curl -vgw "\\n" 'http://127.0.0.1:1337/v0.1/scan' -d '{"urls":["'"$site"'"]}' | |
| done |
This is a simple slackbot to post successful SSH logins to a slack channel to help you keep track of server access.
Create an incoming webhook for your slack community.
Create /etc/ssh/sshslack.sh
| #!/bin/bash | |
| set -e | |
| set -u | |
| clear | |
| ami="ami-10e00b6d" | |
| size="t2.medium" | |
| today=$(date +"%m-%d-%y-%H%M") | |
| localip=$(curl -s https://ipinfo.io/ip) |