/usr/share/piwi/AlertDetails_XML.pl is in piwi 0.8+20041206-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | #! /usr/bin/perl -w
use strict;
use warnings;
use CGI;
use DBI;
use Classes::User;
package main;
require 'Functions/config.pl';
require 'Functions/db.pl';
require 'Functions/parser.pl';
require 'Functions/web.pl';
require 'Functions/encode.pl';
require 'Functions/FakeFunctions.pl';
require 'Functions/_AlertDetails_XML.pl';
our $CurUser = User->new()->auth();
our %conf = (); # configuration directives
our $cgi = ''; # CGI data
LoadConfig();
print "Pragma: no-cache\n";
print "Expires: -1\n";
print "Cache-Control: no-cache\n";
print "Content-Type: text/html\n\n";
# Open the DB connection :
our $dbh = DB_Open();
# Import CGI parameters :
$cgi = CGI->new();
our $PageTitle = " - Alert's Details (XML/IDMEF)";
ParseComponent( 'CommonHeader' );
ParseComponent( 'Links' );
our $AlertId = int( $cgi->param( 'id' ) );
print<<"EOF";
<a href="AlertDetails$conf{'extension'}?id=$AlertId">Standard</a> /
XML /
<a href="AlertDetails_Packet$conf{'extension'}?id=$AlertId">Packet</a><br>
<br>
EOF
my @Path = ();
my %Exclude = ( 'parent_type', 1, 'parent_ident', 1, 'alert_ident', 1 );
my %Path = ();
my %ResNb = ();
my %Output = ();
local *XMLStruct;
open( XMLStruct, 'Struct.xml' );
while( my $Line = <XMLStruct> )
{
foreach my $Elt ( split( /></, $Line ) )
{
$Elt =~ s/[^A-Za-z\/]//g;
if ( $Elt =~ m/^(\/?)([A-Z]+)$/i )
{
my ( $TagEnd, $Tag ) = ( $1, $2 );
if ( $TagEnd )
{
my $Indent = $#Path;
my $Path = join( '/', @Path );
$Output{$Path} = ' 'x$Indent;
$Output{$Path} .= '</'.$Path[$Indent]."><br>\n";
if ( $ResNb{$Path} )
{
print $Output{$Path};
}
pop @Path;
}
else
{
push @Path, $Tag;
my $Indent = $#Path;
my $Path = join( '/', @Path );
$Output{$Path} = ' 'x$Indent;
$Output{$Path} .= '<'.$Path[$Indent]."><br>\n";
my $Output;
( $ResNb{$Path}, $Output ) = ShowValues( \@Path );
$Output{$Path} .= $Output;
if ( $ResNb{$Path} )
{
print $Output{$Path};
}
}
}
}
}
close( XMLStruct );
undef @Path;
ParseComponent( 'CommonFooter' );
|