Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.16 KB | None | 0 0
  1. <?php
  2.  
  3.     require "../config.inc";
  4.    
  5.     $query_search = $conn->prepare("SELECT * FROM CypherIT WHERE HWID = ?");
  6.     $query_search->bind_param("s", $HWID);
  7.     $query_search->execute();
  8.     $query_search->store_result();
  9.     $query_search->fetch();
  10.  
  11.     scanFile();
  12.  
  13.     /*if($query_search->num_rows > 0)
  14.     {
  15.         scanFile();
  16.     }*/
  17.  
  18.     function scanFile()
  19.     {
  20.         $tempname = $_FILES["file"]["tmp_name"];
  21.         $name = $_FILES["file"]["name"];
  22.         $md5 = md5($tempname);
  23.         $dir = "./" . $md5;
  24.         //$fullpath = $dir . "/" . $name;
  25.         $fullpath = "putty.exe";
  26.         mkdir($dir);
  27.         move_uploaded_file($tempname, $fullpath);
  28.  
  29.         $result = initiateRequest(true, $fullpath);
  30.         $fhandle = fopen("logs.txt", "a");
  31.         fwrite($fhandle, "\r\nResult : " . $result . "\r\n" . "Date : " . date("d/m/Y H:i:s") . "\r\n");
  32.         recurseRmdir($dir);
  33.         echo $result;
  34.  
  35.     }
  36.  
  37.     function initiateRequest($postGet=false, $file_path=null){
  38.         $ch = curl_init();
  39.  
  40.         curl_setopt($ch, CURLOPT_URL, 'https://dropmyb.in/upload.php?uploadKey=token');
  41.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  42.  
  43.         $result = curl_exec($ch);
  44.         if (curl_errno($ch)) {
  45.             echo 'Error:' . curl_error($ch);
  46.         }
  47.         curl_close ($ch);
  48.  
  49.       }
  50.  
  51. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement