source: trunk/plugins/nikto_apache_expect_xss.plugin @ 240

Revision 240, 1.7 KB checked in by sullo, 3 years ago (diff)

Plugin & DB header standardization

  • Property svn:keywords set to Id
Line 
1#VERSION,2.00
2# $Id$
3###############################################################################
4#  Copyright (C) 2008 CIRT, Inc.
5#
6#  This program is free software; you can redistribute it and/or
7#  modify it under the terms of the GNU General Public License
8#  as published by the Free Software Foundation; version 2
9#  of the License only.
10#
11#  This program is distributed in the hope that it will be useful,
12#  but WITHOUT ANY WARRANTY; without even the implied warranty of
13#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14#  GNU General Public License for more details.
15#
16#  You should have received a copy of the GNU General Public License
17#  along with this program; if not, write to the Free Software
18#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19###############################################################################
20# PURPOSE:
21# Test Apache's expect header XSS
22###############################################################################
23sub nikto_apache_expect_xss_init
24{
25   my $id =
26   {
27      name         => "apache_export_xss",
28      full_name    => "Apache Expect XSS",
29      author       => "Sullo",
30      description  => "Checks whether the web servers has a cross-site scripting vulnerability through the Expect: HTTP header",
31      scan_method  => \&nikto_apache_expect_xss,
32      copyright    => "2008 CIRT Inc."
33   };
34   return $id;
35}
36
37sub nikto_apache_expect_xss
38{
39   my ($mark) = @_;
40   my %headers=('Expect', '<script>alert(xss)</script>');
41   (my $RES, $CONTENT) = nfetch($mark,"/", "GET", "", \%headers);
42
43   if ($CONTENT =~ /<script>alert\(xss\)<\/script>/)
44   {
45      add_vulnerability($mark, "Apache is vulnerable to XSS via the Expect header", 999974, 27487);
46   }
47}
48
491;
Note: See TracBrowser for help on using the repository browser.