Changing from i3 to dwm - tidied ip bin folder
This commit is contained in:
		
							parent
							
								
									265a3ad84e
								
							
						
					
					
						commit
						8ced2f42f5
					
				
					 47 changed files with 254 additions and 245 deletions
				
			
		
							
								
								
									
										49
									
								
								bin/dmenu/rofi-reverse-shells
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										49
									
								
								bin/dmenu/rofi-reverse-shells
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,49 @@
 | 
			
		|||
#!/usr/bin/env bash
 | 
			
		||||
#
 | 
			
		||||
#   Use dmenu to pick a reverse shell
 | 
			
		||||
#
 | 
			
		||||
#   Requirements:
 | 
			
		||||
#     dmenu, xsel
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
SHELLS="$(dirname $0)/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)
 | 
			
		||||
 | 
			
		||||
	echo -n "$reverseShell" | /usr/bin/xclip -i -selection clipboard
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# display displays :)
 | 
			
		||||
display
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue