Advertisement
Guest User

Untitled

a guest
Mar 26th, 2011
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 36.18 KB | None | 0 0
  1. #!/opt/local/bin/perl
  2.  
  3. ## Copyright (C) 2011  Cody Dumont (NWN Corp)
  4. ##
  5. ## This program is free software; you can redistribute it and/or
  6. ## modify it under the terms of the GNU General Public License
  7. ## as published by the Free Software Foundation; either version 2
  8. ## of the License, or (at your option) any later version.
  9. ##
  10. ## This program is distributed in the hope that it will be useful,
  11. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. ## GNU General Public License for more details.
  14. ##
  15. ## You should have received a copy of the GNU General Public License
  16. ## along with this program; if not, write to the Free Software
  17. ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. ## This script will parse a Nessus XMLv2 file and put into a spreadsheet
  19. ##
  20. ## Version 0.8
  21.  
  22.  
  23. use strict;
  24. use XML::TreePP;
  25. use Data::Dumper;
  26. use Spreadsheet::WriteExcel::Big;
  27. use Math::Round;
  28.  
  29. our (@vlun_entries,@highvlun,@medvlun,@lowvlun,@nonevlun,@host_scan_data);
  30. our (@WinUserData,@WinUsers,@WinGuestUserData,@PasswordPolicyData);
  31.  
  32. ######  Code contributed by Whinston Antion <Whinston.Antion AT mail.wvu.edu>
  33. my $random_number = rand();
  34. my $now_string = localtime;
  35. my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
  36. my $report_file = sprintf("%4d%02d%02d%02d%02d%02d",($year + 1900),($mon+1),$mday,$hour,$min,$sec);
  37. ######  end contribution
  38.  
  39. sub parse_windows_mgnt
  40. {
  41.     my @WinUserDataSheet;
  42.     my (@policy_entries,@policy_data_entries);
  43.     my @user_data_entries;
  44.     my @guest_data_entries;
  45.  
  46.     foreach my $WinUserData_entry (@WinUserData)
  47.     {
  48.         $WinUserData_entry->{'operating-system'} =~ s/\,//g;
  49.         if ($WinUserData_entry->{'host-ip'} eq "")
  50.         {
  51.             $WinUserData_entry->{'host-ip'} = $WinUserData_entry->{'name'}
  52.         }
  53.         my $header = "$WinUserData_entry->{file}|$WinUserData_entry->{'host-ip'}|$WinUserData_entry->{'host-fqdn'}|$WinUserData_entry->{'netbios-name'}|$WinUserData_entry->{'operating-system'}";
  54.         my @tmp;
  55.         foreach my $entry (@{$WinUserData_entry->{user_report}})
  56.         {
  57.             $entry->{description} =~ s/\r\n|\n|\r|\f/ /g;
  58.             $entry->{plugin_output} =~ s/\r\n|\n|\r|\f/+/g;
  59.             $entry->{plugin_output} =~ s/  - //g;
  60.             $entry->{synopsis} =~ s/\r\n|\n|\r|\f/ /g;
  61.             my $a = "$header|$entry->{-pluginName}|$entry->{description}|$entry->{plugin_output}|$entry->{synopsis}";
  62.             push @WinUserDataSheet, $a;
  63.         }
  64.     }
  65.  
  66.     foreach my $entry (@WinUserDataSheet)
  67.     {
  68.         my @tmp = split /\|/, $entry;
  69.         if($tmp[5] =~ /[P|p]olicy/)
  70.         {
  71.             push @policy_data_entries, $entry
  72.         }
  73.         elsif($tmp[5] =~ /[U|u]ser/)
  74.         {
  75.             push @user_data_entries, $entry
  76.         }
  77.         elsif($tmp[5] =~ /[G|g]uest/)
  78.         {
  79.             push @guest_data_entries, $entry
  80.         }
  81.         else
  82.         {
  83.             print "\n\nWinUserDataSheet is something other that Guest, User, Policiy\n\nHere is the data that was found \"$tmp[5]\"\n\n";
  84.             exit;
  85.         }
  86.     }
  87.  
  88.     foreach my $e (@user_data_entries)
  89.     {
  90.         my @entry = split /\|/, $e;
  91.         if( $entry[7] =~ /\+/)
  92.         {
  93.             my $plugin;
  94.             $entry[7] =~ s/\+\+\+/\+/g;
  95.             $entry[7] =~ s/\+\+/\+/g;
  96.             my @list = split /\+/,$entry[7];
  97.             shift @list;
  98.             shift @list;
  99.             my $cnt = @list;
  100.             $cnt = $cnt - 5;
  101.             if ($entry[5] !~ /group$/)
  102.             {
  103.                 splice @list,$cnt,5;
  104.             }
  105.             if ($entry[5] =~ /group$/)
  106.             {
  107.                 $entry[5] =~ s/\'//g;
  108.                 my @tmp = split / /, $entry[5];
  109.                 my $c = @tmp;
  110.                 $c = $c - 2;
  111.                 my @tmp1 = splice @tmp,$c,2;
  112.                 $plugin = join " ",@tmp1;
  113.                 $plugin = "members of $plugin";
  114.             }
  115.             else
  116.             {
  117.                 my @tmp = split / : /, $entry[5];
  118.                 $plugin = $tmp[1];
  119.             }
  120.  
  121.             foreach my $name (@list)
  122.             {
  123.                 my $type = "Local User";
  124.                 if ($name =~ /\(/)
  125.                 {
  126.                     my @tmp = split / /, $name;
  127.                     $type = pop @tmp;
  128.                     $type =~ s/\(|\)//g;
  129.                     $name = join " ", @tmp;
  130.                 }
  131.                 my $record = "$entry[0],$entry[1],$entry[2],$entry[3],$entry[4],$plugin,$name,$type";
  132.                 push @WinUsers,$record;
  133.             } # end foreach my name
  134.         }# end if + statement
  135.     } # end foreach my $e (@user_data_entries)
  136.  
  137.     foreach my $e (@guest_data_entries)
  138.     {
  139.         my @entry = split /\|/, $e;
  140.         $entry[6] =~ s/\,//g;
  141.         my $record = "$entry[0],$entry[1],$entry[2],$entry[3],$entry[4],$entry[8],$entry[5],$entry[7],$entry[6]";
  142.         push @WinGuestUserData, $record;
  143.     }# end foreach my $e (@guest_data_entries)
  144.     foreach my $e (@policy_data_entries)
  145.     {
  146.         my @entry = split /\|/, $e;
  147.         if( $entry[7] =~ /\+/)
  148.         {
  149.             my $plugin;
  150.             $entry[7] =~ s/\+\+\+/\+/g;
  151.             $entry[7] =~ s/\+\+/\+/g;
  152.             my @list = split /\+/,$entry[7];
  153.             my $record = "$entry[0],$entry[1],$entry[2],$entry[3],$entry[4]";
  154.             foreach (@list)
  155.             {
  156.                 my @tmp = split /: /,$_;
  157.                 if($tmp[1] ne "")
  158.                 {
  159.                     $record ="$record,$tmp[1]";
  160.                 }
  161.             }
  162.             push @PasswordPolicyData,$record;
  163.         }
  164.     } # foreach my $e (@policy_data_entries)
  165. } # end SUB ROUTINE
  166.  
  167. sub check_if_vuln_present
  168. {
  169.     my $vuln = $_[0];
  170.     my $plugin = $vuln->{-pluginID};
  171.     my $severity = $vuln->{-severity};
  172.     my $pluginName = $vuln->{-pluginName};
  173.     $pluginName =~ s/\,//g;
  174.    
  175.     $vuln->{solution} =~ s/\,/\|/g;
  176.     $vuln->{solution} =~ s/\n|\r/\ /g;
  177.     $vuln->{description} =~ s/\,/\|/g;
  178.     $vuln->{description} =~ s/\n|\r/\ /g;
  179.    
  180.     my $bid;
  181.     if (ref $vuln->{bid} eq "ARRAY")
  182.     {
  183.         $bid = join "|", @{$vuln->{bid}}
  184.     }
  185.     elsif (ref $vuln->{bid} eq "")
  186.     {
  187.         $bid = $vuln->{bid}
  188.     }
  189.    
  190.     my $cve;
  191.     if (ref $vuln->{cve} eq "ARRAY")
  192.     {
  193.         $cve = join "|", @{$vuln->{cve}}
  194.     }
  195.     elsif (ref $vuln->{cve} eq "")
  196.     {
  197.         $cve = $vuln->{cve}
  198.     }
  199.    
  200.     my $xref;
  201.     if (ref $vuln->{xref} eq "ARRAY")
  202.     {
  203.         $xref = join "|", @{$vuln->{xref}}
  204.     }
  205.     elsif (ref $vuln->{xref} eq "")
  206.     {
  207.         $xref = $vuln->{xref}
  208.     }
  209.  
  210.     my $file = $_[1];
  211.     my $plugin_cnt = 0;
  212.  
  213.     if ($severity == 0)
  214.     {
  215.         my $plugin_test = grep /$vuln->{-pluginID}/, @nonevlun;
  216.         my @found_plugin = grep /$vuln->{-pluginID}/, @nonevlun;
  217.         print "";
  218.         if ($plugin_test == 0)
  219.         {
  220.             ++$plugin_cnt;
  221.             $plugin = "$plugin\,$severity\,$plugin_cnt\,$pluginName\,$file\,$vuln->{-pluginFamily},$bid,$cve,$xref,$vuln->{solution},$vuln->{description}";
  222.             push @nonevlun, $plugin
  223.         }
  224.         else
  225.         {
  226.             foreach (@nonevlun)
  227.             {
  228.                 my @tmp = split /\,/, $_;
  229.                 if ($tmp[0] eq $vuln->{-pluginID} && $tmp[4] ne $file && $plugin_test == 1)
  230.                 {
  231.                     print "";
  232.                     #++$plugin_cnt;
  233.                     $plugin = "$plugin\,$severity\,$plugin_cnt\,$pluginName\,$file\,$vuln->{-pluginFamily},$bid,$cve,$xref,$vuln->{solution},$vuln->{description}";
  234.                     push @nonevlun, $plugin
  235.                 }
  236.                 elsif ($tmp[0] eq $vuln->{-pluginID} && $tmp[4] eq $file)
  237.                 {
  238.                     ++$tmp[2];
  239.                     $_ = join(",",@tmp);
  240.                     last;
  241.                 }
  242.             } # end foreach
  243.         } #end else for test
  244.     }
  245.     elsif ($severity == 1)
  246.     {
  247.         my $plugin_test = grep /$vuln->{-pluginID}/, @lowvlun;
  248.         my @found_plugin = grep /$vuln->{-pluginID}/, @lowvlun;
  249.         print "";
  250.         if ($plugin_test == 0)
  251.         {
  252.             ++$plugin_cnt;
  253.             $plugin = "$plugin\,$severity\,$plugin_cnt\,$pluginName\,$file\,$vuln->{-pluginFamily},$bid,$cve,$xref,$vuln->{solution},$vuln->{description}";
  254.             push @lowvlun, $plugin
  255.         }
  256.         else
  257.         {
  258.             foreach (@lowvlun)
  259.             {
  260.                 my @tmp = split /\,/, $_;
  261.                 if ($tmp[0] eq $vuln->{-pluginID} && $tmp[4] ne $file && $plugin_test == 1)
  262.                 {
  263.                     print "";
  264.                     #++$plugin_cnt;
  265.                     $plugin = "$plugin\,$severity\,$plugin_cnt\,$pluginName\,$file\,$vuln->{-pluginFamily},$bid,$cve,$xref,$vuln->{solution},$vuln->{description}";
  266.                     push @lowvlun, $plugin
  267.                 }
  268.                 elsif ($tmp[0] eq $vuln->{-pluginID} && $tmp[4] eq $file)
  269.                 {
  270.                     ++$tmp[2];
  271.                     $_ = join(",",@tmp);
  272.                     last;
  273.                 }
  274.             } # end foreach
  275.         } #end else for test
  276.     }
  277.     elsif ($severity == 2)
  278.     {
  279.         my $plugin_test = grep /$vuln->{-pluginID}/, @medvlun;
  280.         my @found_plugin = grep /$vuln->{-pluginID}/, @medvlun;
  281.         print "";
  282.         if ($plugin_test == 0)
  283.         {
  284.             ++$plugin_cnt;
  285.             $plugin = "$plugin\,$severity\,$plugin_cnt\,$pluginName\,$file\,$vuln->{-pluginFamily},$bid,$cve,$xref,$vuln->{solution},$vuln->{description}";
  286.             push @medvlun, $plugin
  287.         }
  288.         else
  289.         {
  290.             foreach (@medvlun)
  291.             {
  292.                 my @tmp = split /\,/, $_;
  293.                 if ($tmp[0] eq $vuln->{-pluginID} && $tmp[4] ne $file && $plugin_test == 1)
  294.                 {
  295.                     print "";
  296.                     #++$plugin_cnt;
  297.                     $plugin = "$plugin\,$severity\,$plugin_cnt\,$pluginName\,$file\,$vuln->{-pluginFamily},$bid,$cve,$xref,$vuln->{solution},$vuln->{description}";
  298.                     push @medvlun, $plugin
  299.                 }
  300.                 elsif ($tmp[0] eq $vuln->{-pluginID} && $tmp[4] eq $file)
  301.                 {
  302.                     ++$tmp[2];
  303.                     $_ = join(",",@tmp);
  304.                     last;
  305.                 }
  306.             } # end foreach
  307.         } #end else for test
  308.     }
  309.     elsif ($severity == 3)
  310.     {
  311.         my $plugin_test = grep /$vuln->{-pluginID}/, @highvlun;
  312.         my @found_plugin = grep /$vuln->{-pluginID}/, @highvlun;
  313.         print "";
  314.         if ($plugin_test == 0)
  315.         {
  316.             ++$plugin_cnt;
  317.             $plugin = "$plugin\,$severity\,$plugin_cnt\,$pluginName\,$file\,$vuln->{-pluginFamily},$bid,$cve,$xref,$vuln->{solution},$vuln->{description}";
  318.             push @highvlun, $plugin
  319.         }
  320.         else
  321.         {
  322.             foreach (@highvlun)
  323.             {
  324.                 my @tmp = split /\,/, $_;
  325.                 if ($tmp[0] eq $vuln->{-pluginID} && $tmp[4] ne $file && $plugin_test == 1)
  326.                 {
  327.                     print "";
  328.                    
  329.                     #++$plugin_cnt;
  330.                     $plugin = "$plugin\,$severity\,$plugin_cnt\,$pluginName\,$file\,$vuln->{-pluginFamily},$bid,$cve,$xref,$vuln->{solution},$vuln->{description}";
  331.                     push @highvlun, $plugin
  332.                 }
  333.                 elsif ($tmp[0] eq $vuln->{-pluginID} && $tmp[4] eq $file)
  334.                 {
  335.                     ++$tmp[2];
  336.                     $_ = join(",",@tmp);
  337.                     last;
  338.                 }
  339.             } # end foreach
  340.         } #end else for test
  341.     }
  342. }
  343.  
  344. my $dir = shift or die print "Please put the direcroty where NESSUS NBE files are located.\n";
  345. opendir DIR, $dir;
  346. our @files = readdir(DIR);
  347. closedir DIR;
  348. my @xml_files = grep {$_ =~ /\.xml|\.XML/} @files;
  349. @xml_files = grep {$_ !~ /^\./} @xml_files;
  350. my @host_data;
  351. foreach my $file (@xml_files)
  352. {
  353.     my $tpp = XML::TreePP->new();
  354.     my $tree = $tpp->parsefile( $file );
  355.     print "Parsing File $file \n\n";
  356.     my @report_data;
  357.  
  358.     if (ref($tree->{NessusClientData_v2}->{Report}->{ReportHost}) eq "HASH")
  359.     {
  360.         push @report_data, $tree->{NessusClientData_v2}->{Report}->{ReportHost};
  361.     }
  362.     elsif (ref($tree->{NessusClientData_v2}->{Report}->{ReportHost}) eq "ARRAY")
  363.     {
  364.         @report_data = @{$tree->{NessusClientData_v2}->{Report}->{ReportHost}};
  365.     }
  366.     foreach my $hostproperties (@report_data)
  367.     {
  368.         my %hash;
  369.         $hash{file} = $file;
  370.         $hash{name} = $hostproperties->{-name};
  371.         my @host;
  372.         if (ref($hostproperties->{HostProperties}->{tag}) eq "HASH")
  373.         {
  374.             push @host, $hostproperties->{HostProperties}->{tag};
  375.         }
  376.         elsif (ref($hostproperties->{HostProperties}->{tag}) eq "ARRAY")
  377.         {
  378.             @host = @{$hostproperties->{HostProperties}->{tag}};
  379.         }
  380.         $hash{host_report} = $hostproperties->{ReportItem};
  381.         foreach my $host (@host)
  382.         {
  383.             $hash{$host->{-name}} = $host->{"#text"};
  384.         } # end - foreach my $host_data (@host_data)
  385.         $hostproperties = \%hash;
  386.     } # end foreach my $hostproperties (@host_data)
  387.     push @host_data, @report_data;
  388.     print "Finished Parsing File $file \n\n";
  389. } # end xml file foreach loop
  390.  
  391. print "\nPrinting the Main Report\n";
  392.  
  393.  
  394.  
  395.  
  396.  
  397. open FILE, ">Nessus_data_report_$report_file.txt";
  398. foreach my $host (@host_data)
  399. {
  400.     my @HostReport;
  401.     print FILE "##############################################################\nHEADER 2 - $host->{name} ";
  402.     if ($host->{'host-fqdn'} ne "")
  403.     {
  404.         print FILE " - $host->{'host-fqdn'}"
  405.     }
  406.     print FILE "\nFILE -> $host->{file} - Place Holder for now I will remove soon\n\n";
  407.     print FILE "OS Guess is $host->{'operating-system'}\n";
  408.    
  409.     if(ref ($host->{host_report}) eq "ARRAY")
  410.     {
  411.         @HostReport = @{$host->{host_report}};
  412.     }
  413.     elsif(ref ($host->{host_report}) eq "HASH")
  414.     {
  415.         push @HostReport,$host->{host_report};
  416.     }
  417.    
  418.    
  419.     foreach my $entry (@HostReport)
  420.     {
  421.         if ($entry->{'-pluginID'} > 0) # || $entry->{'-pluginID'} ne "")
  422.         {
  423.             print FILE "HEADER 3 - $entry->{-pluginName} - $entry->{-port}\/$entry->{-svc_name}\n\nSynopsis\n$entry->{synopsis}\n\nRisk Factor\n$entry->{risk_factor}\n\nSolution\n$entry->{solution}\n\nPlugin Output\n$entry->{plugin_output}\n\n";
  424.         }
  425.     } #End foreach report entry
  426.     print  FILE "-----------------    END - $host->{'host-ip'}\n\n\n";
  427. }
  428. close FILE;
  429.  
  430.  
  431. print "Creating Spreadsheet Data\n";
  432.  
  433. my $highvuln_cnt = 0;
  434. my $medvuln_cnt = 0;
  435. my $lowvuln_cnt = 0;
  436. my $nonevuln_cnt = 0;
  437.  
  438. # Extract Policy Compliance
  439.  
  440. my @PolicyCompliance;
  441. my @policy_data;
  442.  
  443. print "Preparing Hosts Data\n";
  444. foreach my $host (@host_data)
  445. {
  446.     my @HostReport;
  447.     my @ComplianceData;
  448.     my @VulnData;
  449.     my @HostWinUserData;
  450.  
  451.     if(ref ($host->{host_report}) eq "ARRAY")
  452.     {
  453.         @HostReport = @{$host->{host_report}};
  454.     }
  455.     elsif(ref ($host->{host_report}) eq "HASH")
  456.     {
  457.         push @HostReport,$host->{host_report};
  458.     }
  459.     foreach my $h_report (@HostReport)
  460.     {
  461.         if($h_report->{'-pluginFamily'} =~ /Compliance/)
  462.         {
  463.             push @ComplianceData, $h_report;
  464.         }
  465.         elsif($h_report->{'-pluginFamily'} =~ 'Windows : User management')
  466.         {
  467.             push @HostWinUserData, $h_report;
  468.         }
  469.         else
  470.         {
  471.              push @VulnData, $h_report;
  472.         }
  473.     }
  474.     delete $host->{host_report};
  475.     my %t1_hash = %{$host};
  476.     my %t2_hash = %{$host};
  477.     my $policy_host = \%t1_hash;
  478.     my $win_user_host = \%t2_hash;;
  479.  
  480.     if($ComplianceData[0] != "")
  481.     {
  482.         @{$policy_host->{host_report}} = @ComplianceData;
  483.         push @PolicyCompliance, $policy_host;
  484.     }
  485.     @{$host->{host_report}} = @VulnData;
  486.     if($HostWinUserData[0] != "")
  487.     {
  488.         @{$win_user_host->{user_report}} = @HostWinUserData;
  489.         push @WinUserData, $win_user_host;
  490.     }
  491. } # end the Policy Compliance foreach loop
  492.  
  493. # General Vulnerability Report
  494. print "Create General Vulnerability Data\n";
  495. foreach my $host (@host_data)
  496. {
  497.     my @report_data = @{$host->{host_report}};
  498.     my $name = $host->{name};
  499.     if (not defined $host->{'host-fqdn'})
  500.     {
  501.         $host->{'host-fqdn'} = "N/A";
  502.     }
  503.     foreach my $vuln (@report_data)
  504.     {
  505.         if ($vuln->{-severity} == 0)
  506.         {
  507.             ++$nonevuln_cnt;
  508.             if($vuln->{-pluginFamily} eq "" && $vuln->{-pluginName} eq "")
  509.             {
  510.                 $vuln->{-pluginFamily} = "PortScan";
  511.                 $vuln->{-pluginName} = "$vuln->{-svc_name}";
  512.                 $vuln->{-pluginID} = "$vuln->{-protocol}\-$vuln->{-port}";
  513.             }
  514.             print "";
  515.         }
  516.         elsif ($vuln->{-severity} == 1){++$lowvuln_cnt}
  517.         elsif ($vuln->{-severity} == 2){++$medvuln_cnt}
  518.         elsif ($vuln->{-severity} == 3){++$highvuln_cnt}
  519.         else
  520.         {
  521.             print "There is an unknown value in the Severity feild \"$vuln->{-severity}\", The script will exit.";
  522.             exit;
  523.         }
  524.         if ($vuln->{-pluginName} eq "OS Identification")
  525.         {
  526.             #$vuln->{description} = s/\n/ /;
  527.             my @t1 = split /\n/, $vuln->{description};
  528.             my @t2 = split /\:/, $t1[1];
  529.             $vuln->{-pluginName} ="$vuln->{-pluginName} - $t2[1]";
  530.         }
  531.         check_if_vuln_present($vuln,$host->{file}); # ->{-pluginID},$vuln->{-severity},$vuln->{-pluginName}
  532.         my $plugin_name;
  533.         if($vuln->{'-pluginName'} eq "Windows Compliance Checks")
  534.         {
  535.             $plugin_name = $vuln->{description};
  536.         }
  537.         else
  538.         {
  539.             $plugin_name = $vuln->{'-pluginName'};
  540.         }
  541.         my $r = "$host->{file},$host->{name},$host->{'host-fqdn'},$vuln->{'-pluginID'},$vuln->{'-protocol'},$vuln->{'-port'},$vuln->{'-severity'},$vuln->{'-pluginFamily'},$plugin_name";
  542.         push @host_scan_data,$r;
  543.     } # end foreach my $vuln (@report_data)
  544. } # end foreach my $host (@host_data)
  545. print "Creating Policy Compliance Data\n";
  546. foreach my $host (@PolicyCompliance)
  547. {
  548.     my @report_data = @{$host->{host_report}};
  549.     foreach my $vuln (@report_data)
  550.     {
  551.         my %setting;
  552.         if($vuln->{-pluginID} eq "33929")
  553.         {
  554.             $setting{'Name'} = "PCI - $vuln->{-svc_name}";
  555.             $vuln->{description} =~ s/\n/ /g;
  556.             $setting{'Result'} = $vuln->{description};
  557.             $setting{'RemoteValue'} = $vuln->{plugin_output};
  558.             $setting{'ComplianceRequirement'} = $vuln->{synopsis};
  559.         }
  560.         elsif($vuln->{-pluginID} eq "33931")
  561.         {
  562.             $setting{'Name'} = "PCI - $vuln->{-svc_name}";
  563.             $vuln->{description} =~ s/\n/ /g;
  564.             $setting{'Result'} = $vuln->{description};
  565.             $setting{'RemoteValue'} = $vuln->{plugin_output};
  566.             $setting{'ComplianceRequirement'} = $vuln->{synopsis};
  567.         }
  568.         elsif($vuln->{description} =~ /SNMP\\Parameters|SeCEdit|ProtectedRoots|Enum|CurrentVersion\\Policies|CurrentVersion\\Installer|\%SystemRoot\%/)
  569.         {
  570.             my @desc = split /\n/, $vuln->{description};
  571.             $setting{'Name'} = shift @desc;
  572.             my @tmp = split /\:/, $setting{'Name'};
  573.             $setting{'Name'} = $tmp[0];
  574.             $setting{'Result'} = $tmp[1];
  575.             $setting{'Name'} =~ s/\"//g;
  576.             $setting{'Result'} =~ s/\[//g;
  577.             $setting{'Result'} =~ s/\]//g;
  578.             $setting{'Result'} =~ s/ //;
  579.             $setting{'Name'} =~ s/ //;
  580.             undef @tmp;
  581.             $setting{'RemoteValue'} = "Too Many Permissions";
  582.             $setting{'ComplianceRequirement'} = "See Nessus Report";
  583.         }
  584.         elsif($vuln->{-pluginID} =~ /21156|33930|33814|24760/)
  585.         {
  586.             my @desc = split /\n/, $vuln->{description};
  587.             $setting{'Name'} = shift @desc;
  588.             my @tmp = split /\:/, $setting{'Name'};
  589.             $setting{'Name'} = $tmp[0];
  590.             $setting{'Result'} = $tmp[1];
  591.             $setting{'Name'} =~ s/\"//g;
  592.             $setting{'Result'} =~ s/\[//g;
  593.             $setting{'Result'} =~ s/\]//g;
  594.             $setting{'Result'} =~ s/ //;
  595.             $setting{'Name'} =~ s/ //;
  596.             undef @tmp;
  597.             my $should_be_nothing = shift @desc;
  598.             $setting{'RemoteValue'} = shift @desc;
  599.             @tmp = split /\:/, $setting{'RemoteValue'};
  600.             $setting{'RemoteValue'} = $tmp[1];
  601.             $setting{'RemoteValue'} =~ s/\, /\|/g;
  602.             $setting{'RemoteValue'} =~ s/\"//g;
  603.             $setting{'RemoteValue'} =~ s/ //;
  604.             undef @tmp;
  605.             $setting{'ComplianceRequirement'} = shift @desc;
  606.             @tmp = split /\:/, $setting{'ComplianceRequirement'};
  607.             $setting{'ComplianceRequirement'} = $tmp[1];
  608.             $setting{'ComplianceRequirement'} =~ s/\, /\|/g;
  609.             $setting{'ComplianceRequirement'} =~ s/\"//g;
  610.             $setting{'ComplianceRequirement'} =~ s/\]//g;
  611.             $setting{'ComplianceRequirement'} =~ s/\[//g;
  612.             $setting{'ComplianceRequirement'} =~ s/ //;
  613.             undef @tmp;
  614.         }
  615.         else
  616.         {
  617.             print "\n\nNew Policy Plugin - Please FIX Cody\n\n";
  618.             exit;
  619.         }
  620.         my $a = "$host->{file},$host->{name},$host->{'host-fqdn'},$vuln->{'-pluginID'},$vuln->{'-protocol'},$vuln->{'-severity'},$vuln->{'-pluginFamily'},$setting{'Name'},$setting{'Result'},$setting{'RemoteValue'},$setting{'ComplianceRequirement'}";
  621.         push @policy_data, $a;
  622.     } # foreach my $vuln (@report_data)
  623. }  # end foreach my $host (@PolicyCompliance)
  624.  
  625. print "Creating Windows Management Data\n";
  626. parse_windows_mgnt();
  627. print "Creating Nessus Report Spreadsheet\n";
  628. ######################################################  start spreadsheet
  629. my $workbook = Spreadsheet::WriteExcel::Big->new("$dir/nessus_report_$report_file.xls");
  630. my $nonevulns_ctr = 1;
  631. my $lowvulns_ctr = 1;
  632. my $medvulns_ctr = 1;
  633. my $highvulns_ctr = 1;
  634. my $host_scan_data_ctr = 1;
  635. my $policy_data_ctr = 1;
  636. my $WinUsers_ctr = 1;
  637. my $PasswordPolicyData_ctr = 1;
  638. my $WinGuestUserData_ctr = 1;
  639. my $nonevlun_worksheet_ctr = 1;
  640.  
  641. my $host_scan_data_worksheet = $workbook->add_worksheet('host_scan_data');
  642. $host_scan_data_worksheet->write(0, 0, 'File');
  643. $host_scan_data_worksheet->write(0, 1, 'IP Address');
  644. $host_scan_data_worksheet->write(0, 2, 'FQDN');
  645. $host_scan_data_worksheet->write(0, 3, 'Plugin ID');
  646. $host_scan_data_worksheet->write(0, 4, 'Protocol');
  647. $host_scan_data_worksheet->write(0, 5, 'Port');
  648. $host_scan_data_worksheet->write(0, 6, 'Severity');
  649. $host_scan_data_worksheet->write(0, 7, 'Plugin Family');
  650. $host_scan_data_worksheet->write(0, 8, 'Plugin Name');
  651. $host_scan_data_worksheet->freeze_panes('C2');
  652. $host_scan_data_worksheet->autofilter('A1:I1');
  653. $host_scan_data_worksheet->set_column('A:M', 20);
  654.  
  655. my $highvulns_worksheet = $workbook->add_worksheet('highvulns');
  656. $highvulns_worksheet->write(0, 0, 'File');
  657. $highvulns_worksheet->write(0, 1, 'plugin Family');
  658. $highvulns_worksheet->write(0, 2, 'plugin id');
  659. $highvulns_worksheet->write(0, 3, 'plugin Name');
  660. $highvulns_worksheet->write(0, 4, 'count');
  661. $highvulns_worksheet->write(0, 5, 'Bid');
  662. $highvulns_worksheet->write(0, 6, 'CVE');
  663. $highvulns_worksheet->write(0, 7, 'OSVDB');
  664. $highvulns_worksheet->write(0, 8, 'Solution');
  665. $highvulns_worksheet->write(0, 9, 'Description');
  666. $highvulns_worksheet->freeze_panes('C2');
  667. $highvulns_worksheet->autofilter('A1:J1');
  668. $highvulns_worksheet->set_column('A:M', 20);
  669.  
  670. my $nonevlun_worksheet = $workbook->add_worksheet('PortScan');
  671. $nonevlun_worksheet->write(0, 0, 'File');
  672. $nonevlun_worksheet->write(0, 1, 'plugin Family');
  673. $nonevlun_worksheet->write(0, 2, 'plugin id');
  674. $nonevlun_worksheet->write(0, 3, 'plugin Name');
  675. $nonevlun_worksheet->write(0, 4, 'count');
  676. $nonevlun_worksheet->freeze_panes('C2');
  677. $nonevlun_worksheet->autofilter('A1:E1');
  678. $nonevlun_worksheet->set_column('A:M', 20);
  679.  
  680. my $medvulns_worksheet = $workbook->add_worksheet('medvulns');
  681. $medvulns_worksheet->write(0, 0, 'File');
  682. $medvulns_worksheet->write(0, 1, 'plugin Family');
  683. $medvulns_worksheet->write(0, 2, 'plugin id');
  684. $medvulns_worksheet->write(0, 3, 'plugin Name');
  685. $medvulns_worksheet->write(0, 4, 'count');
  686. $medvulns_worksheet->write(0, 5, 'Bid');
  687. $medvulns_worksheet->write(0, 6, 'CVE');
  688. $medvulns_worksheet->write(0, 7, 'OSVDB');
  689. $medvulns_worksheet->write(0, 8, 'Solution');
  690. $medvulns_worksheet->write(0, 9, 'Description');
  691. $medvulns_worksheet->freeze_panes('C2');
  692. $medvulns_worksheet->autofilter('A1:J1');
  693. $medvulns_worksheet->set_column('A:M', 20);
  694.  
  695. my $lowvulns_worksheet = $workbook->add_worksheet('lowvulns');
  696. $lowvulns_worksheet->write(0, 0, 'File');
  697. $lowvulns_worksheet->write(0, 1, 'plugin Family');
  698. $lowvulns_worksheet->write(0, 2, 'plugin id');
  699. $lowvulns_worksheet->write(0, 3, 'plugin Name');
  700. $lowvulns_worksheet->write(0, 4, 'count');
  701. $lowvulns_worksheet->write(0, 5, 'Bid');
  702. $lowvulns_worksheet->write(0, 6, 'CVE');
  703. $lowvulns_worksheet->write(0, 7, 'OSVDB');
  704. $lowvulns_worksheet->write(0, 8, 'Solution');
  705. $lowvulns_worksheet->write(0, 9, 'Description');
  706. $lowvulns_worksheet->freeze_panes('C2');
  707. $lowvulns_worksheet->autofilter('A1:J1');
  708. $lowvulns_worksheet->set_column('A:M', 20);
  709.  
  710. my $policy_worksheet = $workbook->add_worksheet('Policy Compliance');
  711. $policy_worksheet->write(0, 0, 'File');
  712. $policy_worksheet->write(0, 1, 'IP Address');
  713. $policy_worksheet->write(0, 2, 'FQDN');
  714. $policy_worksheet->write(0, 3, 'PluginID');
  715. $policy_worksheet->write(0, 4, 'protocol');
  716. $policy_worksheet->write(0, 5, 'severity');
  717. $policy_worksheet->write(0, 6, 'pluginFamily');
  718. $policy_worksheet->write(0, 7, 'Policy Setting');
  719. $policy_worksheet->write(0, 8, 'Result');
  720. $policy_worksheet->write(0, 9, 'System Value');
  721. $policy_worksheet->write(0, 10, 'Compliance Requirement');
  722. $policy_worksheet->freeze_panes('C2');
  723. $policy_worksheet->autofilter('A1:J1');
  724. $policy_worksheet->set_column('A:M', 20);
  725.  
  726. my $WinUsers_worksheet = $workbook->add_worksheet('WinUsers');
  727. $WinUsers_worksheet->write(0, 0, 'File');
  728. $WinUsers_worksheet->write(0, 1, 'IP Address');
  729. $WinUsers_worksheet->write(0, 2, 'FQDN');
  730. $WinUsers_worksheet->write(0, 3, 'Netbios Name');
  731. $WinUsers_worksheet->write(0, 4, 'OS');
  732. $WinUsers_worksheet->write(0, 5, 'Plugin Name');
  733. $WinUsers_worksheet->write(0, 6, 'Username');
  734. $WinUsers_worksheet->write(0, 7, 'Account type');
  735. $WinUsers_worksheet->freeze_panes('C2');
  736. $WinUsers_worksheet->autofilter('A1:H1');
  737. $WinUsers_worksheet->set_column('A:M', 20);
  738.  
  739. my $WinGuestUserData_worksheet = $workbook->add_worksheet('WinGuestUserData');
  740. $WinGuestUserData_worksheet->write(0, 0, 'File');
  741. $WinGuestUserData_worksheet->write(0, 1, 'IP Address');
  742. $WinGuestUserData_worksheet->write(0, 2, 'FQDN');
  743. $WinGuestUserData_worksheet->write(0, 3, 'Netbios Name');
  744. $WinGuestUserData_worksheet->write(0, 4, 'OS');
  745. $WinGuestUserData_worksheet->write(0, 5, 'Plugin Name');
  746. $WinGuestUserData_worksheet->write(0, 6, 'Description');
  747. $WinGuestUserData_worksheet->write(0, 7, 'Plugin Output');
  748. $WinGuestUserData_worksheet->write(0, 8, 'Synopsis');
  749. $WinGuestUserData_worksheet->freeze_panes('C2');
  750. $WinGuestUserData_worksheet->autofilter('A1:I1');
  751. $WinGuestUserData_worksheet->set_column('A:M', 20);
  752.  
  753. my $PasswordPolicyData_worksheet = $workbook->add_worksheet('PasswordPolicyData');
  754. $PasswordPolicyData_worksheet->write(0, 0, 'File');
  755. $PasswordPolicyData_worksheet->write(0, 1, 'IP Address');
  756. $PasswordPolicyData_worksheet->write(0, 2, 'FQDN');
  757. $PasswordPolicyData_worksheet->write(0, 3, 'Netbios Name');
  758. $PasswordPolicyData_worksheet->write(0, 4, 'OS');
  759. $PasswordPolicyData_worksheet->write(0, 5, 'Minimum password length');
  760. $PasswordPolicyData_worksheet->write(0, 6, 'Password history length');
  761. $PasswordPolicyData_worksheet->write(0, 7, 'Maximum password age (d)');
  762. $PasswordPolicyData_worksheet->write(0, 8, 'Password must meet complexity requirements');
  763. $PasswordPolicyData_worksheet->write(0, 9, 'Minimum password age (d)');
  764. $PasswordPolicyData_worksheet->write(0, 10, 'Forced logoff time (s)');
  765. $PasswordPolicyData_worksheet->write(0, 11, 'Locked account time (s)');
  766. $PasswordPolicyData_worksheet->write(0, 12, 'Time between failed logon (s)');
  767. $PasswordPolicyData_worksheet->write(0, 13, 'Number of invalid logon before locked out (s)');
  768. $PasswordPolicyData_worksheet->freeze_panes('C2');
  769. $PasswordPolicyData_worksheet->autofilter('A1:M1');
  770. $PasswordPolicyData_worksheet->set_column('A:M', 20);
  771.  
  772. my $h_tmp = @host_scan_data;
  773. my $table_cnt = 1;
  774. if($h_tmp > 60000)
  775. {
  776.     my $array_cnt = $h_tmp/60000;
  777.     my @dec = split /\./, $array_cnt;
  778.     if ($dec[1] > 0)
  779.     {
  780.         ++$dec[0]
  781.     }
  782.     $table_cnt = $dec[0];
  783.     $h_tmp = 60000;
  784. }
  785.  
  786. foreach (@host_scan_data)
  787. {
  788.     if ($host_scan_data_ctr == $h_tmp)
  789.     {
  790.         my $table = $table_cnt - 1;
  791.         $host_scan_data_ctr = 1;
  792.         $host_scan_data_worksheet = $workbook->add_worksheet("host_scan_data_$table");
  793.         $host_scan_data_worksheet->write(0, 0, 'File');
  794.         $host_scan_data_worksheet->write(0, 1, 'IP Address');
  795.         $host_scan_data_worksheet->write(0, 2, 'FQDN');
  796.         $host_scan_data_worksheet->write(0, 3, 'Plugin ID');
  797.         $host_scan_data_worksheet->write(0, 4, 'Protocol');
  798.         $host_scan_data_worksheet->write(0, 5, 'Port');
  799.         $host_scan_data_worksheet->write(0, 6, 'Severity');
  800.         $host_scan_data_worksheet->write(0, 7, 'Plugin Family');
  801.         $host_scan_data_worksheet->write(0, 8, 'Plugin Name');
  802.         $host_scan_data_worksheet->freeze_panes('C2');
  803.     }
  804.     my @tmp = split /\,/, $_;
  805.     $host_scan_data_worksheet->write($host_scan_data_ctr, 0, $tmp[0]);
  806.     $host_scan_data_worksheet->write($host_scan_data_ctr, 1, $tmp[1]);
  807.     $host_scan_data_worksheet->write($host_scan_data_ctr, 2, $tmp[2]);
  808.     $host_scan_data_worksheet->write($host_scan_data_ctr, 3, $tmp[3]);
  809.     $host_scan_data_worksheet->write($host_scan_data_ctr, 4, $tmp[4]);
  810.     $host_scan_data_worksheet->write($host_scan_data_ctr, 5, $tmp[5]);
  811.     $host_scan_data_worksheet->write($host_scan_data_ctr, 6, $tmp[6]);
  812.     $host_scan_data_worksheet->write($host_scan_data_ctr, 7, $tmp[7]);
  813.     $host_scan_data_worksheet->write($host_scan_data_ctr, 8, $tmp[8]);
  814.     ++$host_scan_data_ctr;
  815. } # end foreach (@host_scan_data)
  816.  
  817. foreach (@lowvlun)
  818. {
  819.     my @tmp = split /\,/, $_;
  820.     $lowvulns_worksheet->write($lowvulns_ctr, 0, $tmp[4]);
  821.     $lowvulns_worksheet->write($lowvulns_ctr, 1, $tmp[5]);
  822.     $lowvulns_worksheet->write($lowvulns_ctr, 2, $tmp[0]);
  823.     $lowvulns_worksheet->write($lowvulns_ctr, 3, $tmp[3]);
  824.     $lowvulns_worksheet->write($lowvulns_ctr, 4, $tmp[2]);
  825.     $lowvulns_worksheet->write($lowvulns_ctr, 5, $tmp[6]);
  826.     $lowvulns_worksheet->write($lowvulns_ctr, 6, $tmp[7]);
  827.     $lowvulns_worksheet->write($lowvulns_ctr, 7, $tmp[8]);
  828.     $lowvulns_worksheet->write($lowvulns_ctr, 8, $tmp[9]);
  829.     $lowvulns_worksheet->write($lowvulns_ctr, 9, $tmp[10]);
  830.     ++$lowvulns_ctr;
  831. } # end foreach (@lowvlun)
  832.  
  833. foreach (@medvlun)
  834. {
  835.     my @tmp = split /\,/, $_;
  836.     $medvulns_worksheet->write($medvulns_ctr, 0, $tmp[4]);
  837.     $medvulns_worksheet->write($medvulns_ctr, 1, $tmp[5]);
  838.     $medvulns_worksheet->write($medvulns_ctr, 2, $tmp[0]);
  839.     $medvulns_worksheet->write($medvulns_ctr, 3, $tmp[3]);
  840.     $medvulns_worksheet->write($medvulns_ctr, 4, $tmp[2]);
  841.     $medvulns_worksheet->write($medvulns_ctr, 5, $tmp[6]);
  842.     $medvulns_worksheet->write($medvulns_ctr, 6, $tmp[7]);
  843.     $medvulns_worksheet->write($medvulns_ctr, 7, $tmp[8]);
  844.     $medvulns_worksheet->write($medvulns_ctr, 8, $tmp[9]);
  845.     $medvulns_worksheet->write($medvulns_ctr, 9, $tmp[10]);
  846.     ++$medvulns_ctr;
  847. } # end foreach (@medvlun)
  848.  
  849. foreach (@highvlun)
  850. {
  851.     my @tmp = split /\,/, $_;
  852.     $highvulns_worksheet->write($highvulns_ctr, 0, $tmp[4]);
  853.     $highvulns_worksheet->write($highvulns_ctr, 1, $tmp[5]);
  854.     $highvulns_worksheet->write($highvulns_ctr, 2, $tmp[0]);
  855.     $highvulns_worksheet->write($highvulns_ctr, 3, $tmp[3]);
  856.     $highvulns_worksheet->write($highvulns_ctr, 4, $tmp[2]);
  857.     $highvulns_worksheet->write($highvulns_ctr, 5, $tmp[6]);
  858.     $highvulns_worksheet->write($highvulns_ctr, 6, $tmp[7]);
  859.     $highvulns_worksheet->write($highvulns_ctr, 7, $tmp[8]);
  860.     $highvulns_worksheet->write($highvulns_ctr, 8, $tmp[9]);
  861.     $highvulns_worksheet->write($highvulns_ctr, 9, $tmp[10]);
  862.     ++$highvulns_ctr;
  863. } # end foreach (@highvlun)
  864.  
  865.  
  866. foreach (@nonevlun)
  867. {
  868.     my @tmp = split /\,/, $_;
  869.     $nonevlun_worksheet->write($nonevlun_worksheet_ctr, 0, $tmp[4]);
  870.     $nonevlun_worksheet->write($nonevlun_worksheet_ctr, 1, $tmp[5]);
  871.     $nonevlun_worksheet->write($nonevlun_worksheet_ctr, 2, $tmp[0]);
  872.     $nonevlun_worksheet->write($nonevlun_worksheet_ctr, 3, $tmp[3]);
  873.     $nonevlun_worksheet->write($nonevlun_worksheet_ctr, 4, $tmp[2]);
  874.     ++$nonevlun_worksheet_ctr;
  875. } # end foreach (@highvlun)
  876.  
  877. foreach (@policy_data)
  878. {
  879.     my @tmp = split /\,/, $_;
  880.     $policy_worksheet->write($policy_data_ctr, 0, $tmp[0]);
  881.     $policy_worksheet->write($policy_data_ctr, 1, $tmp[1]);
  882.     $policy_worksheet->write($policy_data_ctr, 2, $tmp[2]);
  883.     $policy_worksheet->write($policy_data_ctr, 3, $tmp[3]);
  884.     $policy_worksheet->write($policy_data_ctr, 4, $tmp[4]);
  885.     $policy_worksheet->write($policy_data_ctr, 5, $tmp[5]);
  886.     $policy_worksheet->write($policy_data_ctr, 6, $tmp[6]);
  887.     $policy_worksheet->write($policy_data_ctr, 7, $tmp[7]);
  888.     $policy_worksheet->write($policy_data_ctr, 8, $tmp[8]);
  889.     $policy_worksheet->write($policy_data_ctr, 9, $tmp[9]);
  890.     $policy_worksheet->write($policy_data_ctr, 10, $tmp[10]);
  891.     ++$policy_data_ctr;
  892. } # end foreach (@policy_data)
  893.  
  894. foreach (@WinUsers)
  895. {
  896.     my @tmp = split /\,/, $_;
  897.     $WinUsers_worksheet->write($WinUsers_ctr, 0, $tmp[0]);
  898.     $WinUsers_worksheet->write($WinUsers_ctr, 1, $tmp[1]);
  899.     $WinUsers_worksheet->write($WinUsers_ctr, 2, $tmp[2]);
  900.     $WinUsers_worksheet->write($WinUsers_ctr, 3, $tmp[3]);
  901.     $WinUsers_worksheet->write($WinUsers_ctr, 4, $tmp[4]);
  902.     $WinUsers_worksheet->write($WinUsers_ctr, 5, $tmp[5]);
  903.     $WinUsers_worksheet->write($WinUsers_ctr, 6, $tmp[6]);
  904.     $WinUsers_worksheet->write($WinUsers_ctr, 7, $tmp[7]);
  905.     ++$WinUsers_ctr;
  906. } # end foreach (@WinUsers)
  907.  
  908. foreach (@WinGuestUserData)
  909. {
  910.     my @tmp = split /\,/, $_;
  911.     $WinGuestUserData_worksheet->write($WinGuestUserData_ctr, 0, $tmp[0]);
  912.     $WinGuestUserData_worksheet->write($WinGuestUserData_ctr, 1, $tmp[1]);
  913.     $WinGuestUserData_worksheet->write($WinGuestUserData_ctr, 2, $tmp[2]);
  914.     $WinGuestUserData_worksheet->write($WinGuestUserData_ctr, 3, $tmp[3]);
  915.     $WinGuestUserData_worksheet->write($WinGuestUserData_ctr, 4, $tmp[4]);
  916.     $WinGuestUserData_worksheet->write($WinGuestUserData_ctr, 5, $tmp[5]);
  917.     $WinGuestUserData_worksheet->write($WinGuestUserData_ctr, 6, $tmp[6]);
  918.     $WinGuestUserData_worksheet->write($WinGuestUserData_ctr, 7, $tmp[7]);
  919.     $WinGuestUserData_worksheet->write($WinGuestUserData_ctr, 8, $tmp[8]);
  920.     ++$WinGuestUserData_ctr;
  921. } # foreach (@WinGuestUserData)
  922.  
  923.  
  924. foreach (@PasswordPolicyData)
  925. {
  926.     my @tmp = split /\,/, $_;
  927.     $PasswordPolicyData_worksheet->write($PasswordPolicyData_ctr, 0, $tmp[0]);
  928.     $PasswordPolicyData_worksheet->write($PasswordPolicyData_ctr, 1, $tmp[1]);
  929.     $PasswordPolicyData_worksheet->write($PasswordPolicyData_ctr, 2, $tmp[2]);
  930.     $PasswordPolicyData_worksheet->write($PasswordPolicyData_ctr, 3, $tmp[3]);
  931.     $PasswordPolicyData_worksheet->write($PasswordPolicyData_ctr, 4, $tmp[4]);
  932.     $PasswordPolicyData_worksheet->write($PasswordPolicyData_ctr, 5, $tmp[5]);
  933.     $PasswordPolicyData_worksheet->write($PasswordPolicyData_ctr, 6, $tmp[6]);
  934.     $PasswordPolicyData_worksheet->write($PasswordPolicyData_ctr, 7, $tmp[7]);
  935.     $PasswordPolicyData_worksheet->write($PasswordPolicyData_ctr, 8, $tmp[8]);
  936.     $PasswordPolicyData_worksheet->write($PasswordPolicyData_ctr, 9, $tmp[9]);
  937.     $PasswordPolicyData_worksheet->write($PasswordPolicyData_ctr, 10, $tmp[10]);
  938.     $PasswordPolicyData_worksheet->write($PasswordPolicyData_ctr, 11, $tmp[11]);
  939.     $PasswordPolicyData_worksheet->write($PasswordPolicyData_ctr, 12, $tmp[12]);
  940.     $PasswordPolicyData_worksheet->write($PasswordPolicyData_ctr, 13, $tmp[13]);
  941.     ++$PasswordPolicyData_ctr;
  942. } # end foreach (@PasswordPolicyData)
  943. $workbook->close();
  944.  
  945. print "\n\ncompleted\n\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement