Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <?php
  2.  
  3. if (isset($_GET['image'])) {
  4.  
  5. echo $_GET['image'];
  6.  
  7. $url = $_GET['image'];
  8.  
  9. if(@is_array(getimagesize($url))){
  10. $ch = curl_init($url);
  11.  
  12. $dir = './';
  13.  
  14. $file_name = basename($url);
  15.  
  16. $save_file_loc = $dir . $file_name;
  17.  
  18. $fp = fopen($save_file_loc, 'wb');
  19.  
  20. curl_setopt($ch, CURLOPT_FILE, $fp);
  21. curl_setopt($ch, CURLOPT_HEADER, 0);
  22.  
  23. curl_exec($ch);
  24.  
  25. curl_close($ch);
  26.  
  27. fclose($fp);
  28.  
  29. // eval("sshpass -p 'm@k3b0t$' scp -P 2102 $file_name bot@188.40.34.149:/home/bot/qr_images/ 2>&1");
  30.  
  31. try {
  32. shell_exec("sshpass -p m@k3b0t$ scp -o StrictHostKeyChecking=no -P 2102 $file_name bot@188.40.34.149:/home/bot/qr_images/ 2&>1");
  33. }
  34. catch (ParseError $e) {
  35. echo 'Caught exception: '.$e->getMessage()."\n";
  36. }
  37. }
  38. else {
  39. echo "Nothing else to do!";
  40. }
  41. }
  42.  
  43. else {
  44. echo "Nothing to do!";
  45. }
  46.  
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement