#!/usr/bin/perl -w
#########################################################################
##
##	FrontPage Xploiter 
##
##	Frontpage Security scanner built entirely in perl. This tool will detect Microsoft web servers providing
##	Frontpage Server extensions with no password or a weak password as defined by the sample or user provided
##	password list. 
##
##	This tool was created for educational purposes only, and should only be used to scan networks and devices you
##	have already obtained permission to assess.
##
##
##	Copyright 2003 Matthew M Shannon (mshannon@fpxploiter.org)
##    	This program is free software; you can redistribute it and/or modify
##    	it under the terms of the GNU General Public License as published by
##    	the Free Software Foundation; either version 2 of the License, or
##    	(at your option) any later version.
##
##    	This program is distributed in the hope that it will be useful,
##    	but WITHOUT ANY WARRANTY; without even the implied warranty of
##    	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##    	GNU General Public License for more details.
##
##    	You should have received a copy of the GNU General Public License
##    	along with this program; if not, write to the Free Software
##    	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

use Getopt::Long;	#Why anyone would do opts another way, I just don't know
use LWP::UserAgent;     # Define the User Agent
use Authen::NTLM;	# Use the NTLM Modules
use Class::Struct;	
	# Well, quite obviously you wanted Perl-Gtk, hey, sometimes GUIs are fun!    
use Gtk;         	# load the Gtk-Perl module
set_locale Gtk;  	# internationalize
init Gtk;  


# Globals
my $I;
my $II; 
my $III; 
my $IVS; 
my $IVE; 
my $false = 0;
my $true = 1;
my @Targets;
my $filename ="/usr/share/fpxploiter/passlst"; #Default password list, came with the application
my $username ="Administrator"; #Default User name, comes with application ;)
my $auth_mess = 'method=open+service%3a4%2e0%2e22e3406&service%5fname=%2f';

struct( Results => {
	IP => '$',	   # IP Address
        WebServer => '$',  # Boolean Web Server
	Fpenabled => '$',  # Boolean Frontpage Enabled
	Fpnopass => '$',   # Boolean Frontpage No Pass
	Fpweakpass => '$' , #Boolean Frontpage Weak Pass
	Password => '$',    # Weak Pass if found
	Platform => '$',    # Version Information
    	Servername => '$'
    });

my @Results_ary = new Results;    
    
#Summary variables to hold final report.

my $webservercnt;
my $frontpagecnt;
my $frontpagenopasscnt;
my $frontpageweakpasscnt;
my $NumOfRows;
my $context_id;





# Build the UserAgent for future access.
$ua = LWP::UserAgent->new(keep_alive=>1);
$ua->agent("fpxploiter/1.00");


# Build the header for future web requests
my $vti_header = HTTP::Headers->new(
	Date 	=> scalar localtime,
	Content_Type => 'application/x-www-form-urlencoded',
	Accept => "auth/sicily",
	Connection => "Keep-Alive",
	'MIME-Version' => '1.0',
	'X-Vermeer-Content-Type' => 'application/x-www-form-urlencoded'	
	);

###################GUI PROCESSING BEGINS#######################################

# Window creation
my $window = new Gtk::Window( "toplevel" );
my $mainwindow = new Gtk::Window ("toplevel");
my $userwindow = new Gtk::Window ("toplevel");

# To display the graphic
$window->realize;
$mainwindow->realize;

# callback registration, for window close events
$window->signal_connect( "delete_event", \&CloseSetTargets ); 
$mainwindow->signal_connect ( "delete_event", \&CloseAppWindow );
$userwindow->signal_connect ( "delete_event", \&CloseSetUser );

# Perl-Gtk Packing boxes  
$ImageBOX = new Gtk::VBox ( $false, 0);
$CommandBOX = new Gtk::HBox( $true, 0);
$UserBOX = new Gtk::VBox ( $false, 0);

# create a new label.
$Separator = new Gtk::Label("-");

# create text entry boxen
$FirstOctat = new Gtk::Entry(3);
$SecondOctat = new Gtk::Entry(3);
$ThirdOctat = new Gtk::Entry(3);
$FourthOctatStart = new Gtk::Entry(3);
$FourthOctatEnd = new Gtk::Entry(3);

#####BUILD CommandBOX#####

$OkBUTTON = new Gtk::Button( "     Ok     " );
$CancelBUTTON = new Gtk::Button ( "   Cancel   ");

####Host Entry Table#####

$hostTABLE = new Gtk::Table( 1, 5, $true);
$hostTABLE->attach_defaults ($FirstOctat,1,2,0,1);
$hostTABLE->attach_defaults ($SecondOctat,2,3,0,1);
$hostTABLE->attach_defaults ($ThirdOctat,3,4,0,1);
$hostTABLE->attach_defaults ($FourthOctatStart,4,5,0,1);
$hostTABLE->attach_defaults ($Separator,5,6,0,1);
$hostTABLE->attach_defaults ($FourthOctatEnd,6,7,0,1);
$hostTABLE->set_col_spacings(5);
$hostTABLE->set_usize(225,22);


####BUILD TABLE#####

$CommandTABLE = new Gtk::Table(1, 2, $true );
$CommandTABLE->attach_defaults( $CancelBUTTON, 0,1 , 0,1);
$CommandTABLE->attach_defaults( $OkBUTTON,1,2,0,1);
$CommandBOX->pack_start ($CommandTABLE, $false, $false, 0);

#####BUILD USER WINDOW####

$UserOkBUTTON = new Gtk::Button( "     Ok     " );
$UserCancelBUTTON = new Gtk::Button ( "   Cancel   ");
$UserCancelBUTTON->signal_connect( "clicked", \&CloseSetUser );
$UserOkBUTTON->signal_connect( "clicked", \&HandleSetUser );
$UserENTRY = new Gtk::Entry(14);
$UserTABLE = new Gtk::Table(2, 2, $true );
$UserTABLE->attach_defaults( $UserENTRY, 0,2 , 0,1);
$UserTABLE->attach_defaults( $UserCancelBUTTON, 0,1 , 1,2);
$UserTABLE->attach_defaults( $UserOkBUTTON,1,2,1,2);
$UserBOX->pack_start ($UserTABLE, $false, $false, 0);
$userwindow->add($UserBOX);
$userwindow->set_title("Enter username..");
$UserTABLE->show();
$UserENTRY->show();
$UserCancelBUTTON->show();
$UserOkBUTTON->show();
$userwindow->set_usize(300,50);
$UserBOX->show();

#####BUTTON COMMANDS######

$CancelBUTTON->signal_connect( "clicked", \&CloseSetTargets );
$OkBUTTON->signal_connect( "clicked", \&HandleWindow );

# Pack the Hbox
$ImageBOX->pack_start($hostTABLE,$false,$false,0);
$ImageBOX->pack_start($CommandBOX,$false,$false,0);


####BUILD MAIN WINDOW FOR APPLICATION######

$mainwindow->signal_connect('destroy',sub{Gtk->exit(0);});
$mainwindow->set_usize(870,620);
my @mainwindowmenu_items = ( { path        => '/_File',
		  	   type        => '<Branch>' },
		  	 { path        => '/File/Set _Targets',
		  	   accelerator => '<control>T',
		  	   callback    => \&SetTargets },
			 { path        => '/File/Start S_can',
		  	   accelerator => '<control>C',
		  	   callback    => \&Scan },
		  	 { path        => '/File/Set _Password List',
		  	   accelerator => '<control>P',
		  	   callback    => \&SetPassLst },
			 { path        => '/File/Set _User',
		  	   accelerator => '<control>U',
		  	   callback    => \&SetUser },
			 { path        => '/File/_Save Log',
		  	   accelerator => '<control>S',
		  	   callback    => \&log_file },
		  	 { path        => '/File/Quit',
		  	   callback    => sub { Gtk->exit( 0 ); }},
		  	 { path        => '/_Help',
		  	   type        => '<LastBranch>' },
		  	 { path        => '/_Help/About' });

$MainWindowBOX = new Gtk::VBox( $false, 1 );
$MainWindowBOX->border_width( 1 );



# Create the ScrolledWindow for the Listbox
$list_scrolled_win = new Gtk::ScrolledWindow( undef, undef );
$list_scrolled_win->set_usize( 150, 570 );
$list_scrolled_win->set_policy( 'automatic', 'automatic' );


#Create Result List

# Create list box
@titles = ( 'IP Address', 'Web Server', 'Frontpage Enabled', 'FP Version', 'Server Name', 'xploitable','Weak Password','Secured' );
$ResultList = new_with_titles Gtk::CList( @titles );
$list_scrolled_win->add( $ResultList );
$ResultList->set_column_width( 0, 100 );
$ResultList->set_column_width( 1, 100 );
$ResultList->set_column_width( 2, 135 );
$ResultList->set_column_width( 3, 100 );
$ResultList->set_column_width( 4, 100 );
$ResultList->set_column_width( 5, 75 );
$ResultList->set_column_width( 6, 100 );
$ResultList->set_column_width( 7, 100 );
$ResultList->set_selection_mode( 'multiple' );
$ResultList->set_shadow_type( 'none' );
#$ResultList->signal_connect( "select_row", \&ResultList_Selection_made );

$Statusbar = new Gtk::Statusbar(); 
$context_id = $Statusbar->get_context_id( "fpXploiter Status" );

# Create the menu bar
$MainWindowMENUBAR = create_menu_bar( $mainwindow );
$MainWindowBOX->pack_start( $MainWindowMENUBAR, $false, $true, 0 );
$MainWindowBOX->pack_start( $list_scrolled_win, $false, $false,0 );
$MainWindowBOX->pack_start( $Statusbar, $false, $false, 0 );
$mainwindow->add( $MainWindowBOX );





######## FILE DIALOG ###########

$file_dialog = new Gtk::FileSelection( "Save Log File..." );
$file_dialog->signal_connect( "destroy", sub { Gtk->exit( 0 ); } );

# Connect the ok_button to file_ok_sel function
$file_dialog->ok_button->signal_connect( "clicked",
					 \&Save_log_sel,
					 $file_dialog );

# Connect the cancel_button to destroy the widget
$file_dialog->cancel_button->signal_connect( "clicked",
					     sub { Gtk->exit( 0 ); } );

$pass_dialog = new Gtk::FileSelection( "Select Password list file..." );
$pass_dialog->signal_connect( "destroy", \&ClosePassLst );

# Connect the ok_button to file_ok_sel function
$pass_dialog->ok_button->signal_connect( "clicked",
					 \&Pass_List_sel,
					 $pass_dialog );
					 
$pass_dialog->ok_button->signal_connect( "clicked",
					 \&ClosePassLst,
					 $pass_dialog );					     
# Set it to default in case no one changes it.
$pass_dialog->set_filename("passlst");     
					     

&HandleWindow;

# Gtk event loop
main Gtk;

# Should never get here
exit( 0 );



#####SUB FUNCTIONS######
sub SetTargets{

# Show the Hbox
$OkBUTTON->show();
$CancelBUTTON->show();
$CommandTABLE->show();
$hostTABLE->show();
$CommandBOX->show();
$ImageBOX->show();

#show the AuthenBOX
$FirstOctat->show();
$SecondOctat->show();
$ThirdOctat->show();
$FourthOctatStart->show();
$Separator->show();
$FourthOctatEnd->show();
$window->border_width( 15 );
$window->title("Select Targets..");

$window->add( $ImageBOX );
$window->show();

}

sub log_file
{
# Open Save Log dialog

$file_dialog->show();

$file_dialog->set_filename("xploiter.log");
}

sub Save_log_sel
{

my $filename = $file_dialog->get_filename();

# Open the file, if we can't let's die with dignity

open (OUT, ">$filename") or die "Can't write to $filename - $!";

# Print header information

print OUT "fpXploiter Log\n\n\n";

print OUT "Number of Hosts scanned: $NumOfRows\n";
print OUT "Number of Web Servers Detected: $webservercnt\n";
print OUT "Number of Web Servers running Frontpage: $frontpagecnt\n";
print OUT "Number of Frontpage Servers with NO PASSWORD: $frontpagenopasscnt\n";
print OUT "Number of Frontpage Servers with WEAK PASSWORDS: $frontpageweakpasscnt\n\n";

print OUT "IP Address\tWeb Server\tFrontpage Enabled\tFP Version\tServer Name\txploitable\tWeak Password\tSecured\n\n";
 
# Put together a for loop to print the results

for ($cnt=0;$cnt<=$NumOfRows;$cnt++)
{
	for ($column = 0; $column <= 7; $column++){
		$lineitem = $ResultList->get_text( $cnt, $column );
		print OUT "$lineitem\t";
	}		
	print OUT "\n";
} 
	
close OUT;
$file_dialog->hide();
}

sub create_menu_bar
{
   my ( $window ) = @_;
   my $menubar;
   my $item_factory;
   my $accel_group;
   $accel_group = new Gtk::AccelGroup();
   $item_factory = new Gtk::ItemFactory( 'Gtk::MenuBar',
					 '<main>',
					 $accel_group );

   $item_factory->create_items( @mainwindowmenu_items );
   $window->add_accel_group( $accel_group );
   # Finally, return the actual menu bar created by the item factory.
   #*menubar = gtk_item_factory_get_widget (item_factory, "&lt;main>");
   return ( $item_factory->get_widget( '<main>' ) );
}

### Callback function to close the window
sub CloseAppWindow
  {
    Gtk->exit( 0 );
    return $false;
  }

sub ResetHeaders
{
	$vti_header = HTTP::Headers->new(
	Date 	=> scalar localtime,
	Content_Type => 'application/x-www-form-urlencoded',
	Accept => "auth/sicily",
	Connection => "Keep-Alive",
	'MIME-Version' => '1.0',
	'X-Vermeer-Content-Type' => 'application/x-www-form-urlencoded');
}

sub SetPassLst
{
	$pass_dialog->set_filename("passlst");
	$pass_dialog->show();

}

sub SetUser
{
	$UserENTRY->set_text($username);
	$userwindow->show();
}

sub CloseSetUser
{
	$userwindow->hide();
}

sub Pass_List_sel
{

	$filename = $file_dialog->get_filename();

	$pass_dialog->hide();
	$Statusbar->pop( $context_id ); 
	$Statusbar->push( $context_id, 'Password list set' ); 
}

sub ClosePassLst
{
	$pass_dialog->hide();
}


sub checkNet
{
	
for $_ (@_){
	if (/[A-Z][a-z][1-254]/)
	{
		$StatusLABEL = "All Octats must be number between 1 and 254";
		return $false;
	
	}
	return $true;
}
  
}

sub checkMath
{
# Let's hope this doesn't fail, come'on guys, do the math!

if ($_[0] > $_[1]){
	# You've failed basic math
	$StatusLABEL = "Start must be before end, doh!";
	return $false;
	
}
return $true;
}

sub HandleWindow
{
	$MainWindowBOX->show();
	$MainWindowMENUBAR->show();
	$mainwindow->set_title("Frontpage Vulnerability Scanner");
	$list_scrolled_win->show();
	$ResultList->show();
	$Statusbar->show();
	$mainwindow->show();
	$window->hide();
	$Statusbar->push( $context_id, 'Select File->Set Targets to begin' );
	$ResultList->clear();

	#Clear Report Variables
	$webservercnt = 0;
	$frontpagecnt = 0;
	$frontpagenopasscnt = 0;
	$frontpageweakpasscnt = 0;
}

sub CloseSetTargets
{
	$window->hide();
}


sub HandleSetUser
{
	$username = $UserENTRY->get_text();
	$userwindow->hide();
	$Statusbar->pop( $context_id ); 
	$Statusbar->push( $context_id, "User Account $username set" ); 
}
### Callback function to login to FrontPage Server 
sub GetnCheck
{
	$I = $FirstOctat->get_text();
	$II = $SecondOctat->get_text();
	$III = $ThirdOctat->get_text();
	$IVS = $FourthOctatStart->get_text();
	$IVE = $FourthOctatEnd->get_text();
	
	if (checkNet($I,$II,$III,$IVS,$IVE) == $false)
	{
		return $false;
	}

	if (checkMath($IVS, $IVE) == $false)
	{
		return $false;
	}

	return $true;
}	
	
	
	
#Build Array Table of IPs to test
sub GetIPAdds
{	
	$NumOfRows = 0;
	$tot = ($IVE - $IVS); 
	for ($cnt = 0; $cnt <= $tot; $cnt++)
	{
		$IV = $IVS + $cnt;
		$IP = "$I" . '.' . "$II" . '.' . "$III" . '.' . "$IV";
		$Targets[$cnt] = $IP;
	}
	
	$cnt = 0;
	
	for $_ (@Targets){
		if (/[1-9]/){
			$ResultList->append($_);
			$cnt++;
			$NumOfRows++;
		}
	}
	return $true;
}

#Test for webserver
sub WebServerTest
{	
	
	$Statusbar->pop( $context_id ); 
	$Statusbar->push( $context_id, "Scanning for Web Servers..." ); 
	
	$tot = ($IVE - $IVS);
	for ($cnt = 0; $cnt <= $tot; $cnt++)
	{
		
  		# Create a request
 		my $req = HTTP::Request->new(HEAD => "http://$Targets[$cnt]/");

  		# Pass request to the user agent and get a response back
		my $res = $ua->request($req);

  		# Check the outcome of the response
  		if ($res->is_success) {
				$Results_ary[$cnt]->{"IP"}= $Targets[$cnt];
				$Results_ary[$cnt]->{"WebServer"} = "Yes";
				$Results_ary[$cnt]->{"Fpenabled"} = "";
				$Results_ary[$cnt]->{"Fpnopass"} = "";
				$Results_ary[$cnt]->{"Fpweakpass"} = "";
				$Results_ary[$cnt]->{"Password"} = "";  
				$Results_ary[$cnt]->{"Platform"} = "";
				$Results_ary[$cnt]->{"ServerName"} = "";
				UpdateResultsWeb($cnt,$true);
				&FrontpageTest;
			
		}
		else {
			$code = $res->code();
			if ($code =~ /403/){
				$Results_ary[$cnt]->{"IP"}= $Targets[$cnt];
				$Results_ary[$cnt]->{"WebServer"} = "Yes";
				$Results_ary[$cnt]->{"Fpenabled"} = "";
				$Results_ary[$cnt]->{"Fpnopass"} = "";
				$Results_ary[$cnt]->{"Fpweakpass"} = "";
				$Results_ary[$cnt]->{"Password"} = "";  
				$Results_ary[$cnt]->{"Platform"} = "";
				$Results_ary[$cnt]->{"ServerName"} = "";
				UpdateResultsWeb($cnt,$true);
				&FrontpageTest
				
			}
			else{
				$Results_ary[$cnt]->{"IP"}= $Targets[$cnt];
				$Results_ary[$cnt]->{"WebServer"} = "No";
				$Results_ary[$cnt]->{"Fpenabled"} = "";
				$Results_ary[$cnt]->{"Fpnopass"} = "";
				$Results_ary[$cnt]->{"Fpweakpass"} = "";
				$Results_ary[$cnt]->{"Password"} = "";  
				$Results_ary[$cnt]->{"Platform"} = "";
				$Results_ary[$cnt]->{"ServerName"} = "";
				UpdateResultsWeb($cnt,$false);
				
			}
		}
		Gtk->main_iteration while ( Gtk->events_pending );
	}
	$NumOfRows=$cnt;
	return $true;
}

			
#Test all IPs for active FP _vti_inf.html file
sub FrontpageTest
{	
		$Statusbar->pop( $context_id ); 
		$Statusbar->push( $context_id, 'Testing for Frontpage....' ); 
	
		
  		# Create a request
 		my $req = HTTP::Request->new(GET => "http://$Targets[$cnt]/_vti_inf.html");

  		# Pass request to the user agent and get a response back
		my $res = $ua->request($req);

  		# Check the outcome of the response
  		if ($res->is_success) {
		
			# Has Frontpage Server Extensions running
			$logindata = $res->content;
			$logindata =~ /FPVersion=(.*)\n/g;
			$platform = $1;
			if ($logindata =~ /.exe/g) {
				print ("Apache\n");
				$Results_ary[$cnt]->{"Fpenabled"}= "Yes, Apache, Unsupported";
				UpdateResultsFrontPage($cnt,$false);
				return $true;
			}
			
			$Results_ary[$cnt]->{"Fpenabled"}= "Yes";
			$Results_ary[$cnt]->{"Platform"}= $platform;
			UpdateResultsFrontPage($cnt,$true);
			&FPnoPasswd;
		}
		else {
			UpdateResultsFrontPage($cnt,$false);
		}
		Gtk->main_iteration while ( Gtk->events_pending );
	
	return $true;
}

			
#Successful IPs, test for FP w/no password
	
sub FPnoPasswd
{
		$Statusbar->pop( $context_id ); 
		$Statusbar->push( $context_id, 'Testing for No Password...' ); 
	
  		# Create a request
		$login_req_mess = 'method=server+version%3a4%2e0%2e2%2e4715.';
		my $login_req = HTTP::Request->new(POST=> "http://$Targets[$cnt]/_vti_bin/shtml.dll/_vti_rpc",$vti_header,$login_req_mess);
		my $login_res = $ua->request($login_req);
		
  		# Check the outcome of the response
  		if ($login_res->is_success) {
			
			$login_req = HTTP::Request->new(POST => "http://$Targets[$cnt]/_vti_bin/_vti_aut/author.dll",$vti_header,$auth_mess);
			my $login_res = $ua->request($login_req);
			
			if ($login_res->is_success){
			
				#Frontpage, no password required.
				
				$logindata = $login_res->content;
				$logindata =~ /SR\|http:(.*)\n/;
				$servername = "http:$1";
				$Results_ary[$cnt]->{"Fpnopass"}= "No Pass!";
				$Results_ary[$cnt]->{"ServerName"}= $servername;
				UpdateResultsNoPasswd($cnt,$true,$servername);
			}
			else {
				#Try with pass
				$Results_ary[$cnt]->{"Fpnopass"}= "No";
				UpdateResultsNoPasswd($cnt,$false);
				&FPweakPasswd;
			
			}
			
			
		}

		else {
				#Try with pass
				$Results_ary[$cnt]->{"Fpnopass"}= "No";
				UpdateResultsNoPasswd($cnt,$false);
				&FPweakPasswd;
			
		}
			Gtk->main_iteration while ( Gtk->events_pending );
	return $true;
}

	

	
#Remaining IPs, test for FP w/weak password
sub FPweakPasswd
{
		$Statusbar->pop( $context_id ); 
		$Statusbar->push( $context_id, 'Testing Weak Passwords...' ); 

	open (PWLIST, "<$filename") or die "Can't open file $filename\n";
	
	
		# Handle password requests
		while (<PWLIST>) {
			$password=$_;
			chop ($password);
			ntlm_user("$username");
			ntlm_password("$password");
			$initial_str = ntlm;
			Gtk->main_iteration while ( Gtk->events_pending );
			&ResetHeaders;
			
  			# Create a request
			$login_req_mess = 'method=server+version%3a4%2e0%2e2%2e4715.';
			my $login_req = HTTP::Request->new(POST => "http://$Targets[$cnt]/_vti_bin/shtml.dll/_vti_rpc",$vti_header,$login_req_mess);
			my $login_res = $ua->request($login_req);

  			# Check the outcome of the response
  			if ($login_res->is_success) {
			
			$vti_header->header(Authorization => "Negotiate $initial_str");
			
			$login_req = HTTP::Request->new(POST => "http://$Targets[$cnt]/_vti_bin/_vti_aut/author.dll",$vti_header,$auth_mess);
			
			my $login_res = $ua->request($login_req);
			
				if ($login_res->is_error){
							
					$login_res->header('WWW-Authenticate')=~ /Negotiate\s(.*)/;
					$login_res->header('Connection' => 'Keep-Alive');
					$auth_hash=$1;
			
					$final_str=ntlm($auth_hash);
					$vti_header = HTTP::Headers->new(
						Date => scalar localtime,
						Content_Type => 'application/x-www-form-urlencoded',
						Accept =>'auth/sicily',
						Authorization => "Negotiate $final_str",
						'MIME-Version' => '1.0',
						Connection => 'Keep-Alive',
						'X-Vermeer-Content-Type' => 'application/x-www-form-urlencoded');
					$login_req = HTTP::Request->new(POST => "http://$Targets[$cnt]/_vti_bin/_vti_aut/author.dll",$vti_header,$auth_mess);
					$login_res = $ua->request($login_req);
					ntlm_reset;
					if ($login_res->is_success){
						$logindata = $login_res->content;
						$logindata =~ /SR\|http:(.*)\n/;
						$servername = "http:$1";
						$Results_ary[$cnt]->{"ServerName"}= $servername;
						$Results_ary[$cnt]->{"Fpweakpass"}= "Yes";
						$Results_ary[$cnt]->{"Fpnopass"}= "Weak Password";
						$Results_ary[$cnt]->{"Password"}= $password;
						UpdateResultsWeakPasswd($cnt,$true,$password);
						return $true;
					}
					else {
						$Results_ary[$cnt]->{"Fpweakpass"} = "No";
						UpdateResultsWeakPasswd($cnt,$false);
					}
				}
			}
		}
		Gtk->main_iteration while ( Gtk->events_pending );
	
	$Statusbar->pop( $context_id ); 
	$Statusbar->push( $context_id, 'Scanning Completed' ); 
	return $true;

}
	

	
#Use HASH Table for results
sub UpdateResultsWeb
{
	if ($_[1] == $true) {
	$ResultList->set_text($_[0],1,"yes");
	$webservercnt++;
	return $true;
	}
	else{
	$ResultList->set_text($_[0],1,"no");
	return $false;
	}
}
sub UpdateResultsFrontPage
{
	if ($_[1] == $true) {
	$ResultList->set_text($_[0],2,"yes");
	$frontpagecnt++;
	return $true;
	}
	else{
	$ResultList->set_text($_[0],2,"no");
	return $false;
	}
}
sub UpdateResultsNoPasswd
{
	if ($_[1] == $true) {
	$ResultList->set_text($_[0],5,"yes");
	$ResultList->set_text($_[0],4,$_[2]);
	$frontpagenopasscnt++;
	return $true;
	}
	else{
	$ResultList->set_text($_[0],5,"no");
	return $false;
	}
}
sub UpdateResultsWeakPasswd
{
	if ($_[1] == $true) {
	$ResultList->set_text($_[0],5,"yes");
	$ResultList->set_text($_[0],6,$_[2]);
	$ResultList->set_text($_[0],7,"Weak Password Found!");
	$frontpageweakpasscnt++;
	return $true;
	}
	else{
	$ResultList->set_text($_[0],7,"No Weak Password");
	return $false;
	}
}
	

sub Scan
{
	# Old Get and check to make sure we're dealing with the good input.
	&GetnCheck;
	
	# Handle the Window processing, make sure we've got love.
	&HandleWindow;
	
	# Processes the Octets into IPs.
	&GetIPAdds;
	
	# Test the webserver.
	&WebServerTest;

}


# END 

