From 5192cb9f1abe3df11b5489cf2f445e3da59ca120 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Tue, 26 Mar 2019 07:33:07 +0000 Subject: [PATCH] Adds reverse shells scrips --- i3/configWork | 5 +++ rofi/scripts/rofi-reverse-shells | 64 ++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100755 rofi/scripts/rofi-reverse-shells diff --git a/i3/configWork b/i3/configWork index 828901f5..40e50858 100644 --- a/i3/configWork +++ b/i3/configWork @@ -243,6 +243,11 @@ bindsym $mod+d exec rofi -show drun # Start Rofi as ssh launcher bindsym $mod+Shift+d exec rofi -show ssh + +# E {{{2 +# Generates reverse shells +bindsym $mod+Shift+e exec ~/.dotfiles/rofi/scripts/rofi-reverse-shells + # F {{{2 bindsym control+mod1+f exec thunar diff --git a/rofi/scripts/rofi-reverse-shells b/rofi/scripts/rofi-reverse-shells new file mode 100755 index 00000000..66e1f3b7 --- /dev/null +++ b/rofi/scripts/rofi-reverse-shells @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +# +# Use rofi to pick a reverse shell +# +# Requirements: +# rofi, xsel, rsg (git@github.com:mthbernardes/rsg.git) +# + +SHELLS='/home/jonathan/GitRepos/rsg/shells.txt' + +function notify() { + if [ "$(command -v notify-send)" ]; then + notify-send "$1" "$2" + fi +} + +function getIP(){ + ip route | + grep -oe 'src [^ ]* ' | # Get in the form 'src ipaddress' + awk '{print $2}' | # Get the ip + sort -u | # Get the unique ones + rofi -dmenu -i -p "IP Address" +} + +function getPort() { + rofi -dmenu -p "Port" +} + +function getReverseShell() { + ip="$1" + port="$2" + cat "$SHELLS" | + sed "s/\[IPADDR\]/$ip/g" | + sed "s/\[PORT\]/$port/g" | + rofi -dmenu -i -p "Reverse Shell" | + cut -d'|' -f2- +} + +function display() { + ip=$(getIP) + port=$(getPort) + reverseShell=$(getReverseShell $ip $port) + + + #reverseShell=$( echo "$reverseShell" | sed "s/\[IPADDR\]/$ip/g" | sed "s/\[PORT\]/$port/g" ) + + echo -n "$reverseShell" | /usr/bin/xclip -i -selection clipboard + #emoji=$(cat "$UNICODE_FILE" | grep -v '^[[:space:]]*$') + #line=$(echo "$emoji" | rofi -dmenu -i -p Unicode -kb-custom-1 Ctrl+c $@) + #exit_code=$? + + #line=($line) + + #if [ $exit_code == 0 ]; then + # xdotool type --clearmodifiers "${line[0]}" + #elif [ $exit_code == 10 ]; then + # echo -n "${line[0]}" | /usr/bin/xclip -i -selection clipboard + + #fi +} + + +# display displays :) +display