FileZilla stores the recently accessed servers passwords inside XML file, So I've made this script to parse that XML file and display the password in CMD window or export it to file.
#!/usr/bin/perl use strict; use warnings; use XML::Simple; print "What do you want to do: \n"; print "1 - Display Stored Passwords\n"; print "2 - Export stored passwords\n"; print "3 - Exit\n"; chomp(my $OPTION = <STDIN>); while ($OPTION !~m/^[123]$/) { print "Wrong option selected, Please choose 1, 2 or 3: "; chomp($OPTION = <STDIN>); } if ( $OPTION == 3) { exit; }elsif ( $OPTION == 2 ) { print "Enter file name: "; chomp(my $File = <STDIN>); if (-e $File ) { print "File already exists, replace it? [Y,N]"; chomp(my $Answer = <STDIN>); while ($Answer!~m/^[YyNn]/) { print "Please answer Yes or NO: "; chomp($Answer = <STDIN>); } if ($Answer=~m/^[Nn]/ ) { exit; } } my @Passwords = ShowPasswords(); open(F,">$File"); print F @Passwords; close(F); print "Your password were saved to $File\n"; }else{ print ShowPasswords(); } sub ShowPasswords { my $APP_DATA = $ENV{'APPDATA'}; if (!-e "$APP_DATA/FileZilla/recentservers.xml" ) { print "No stored passwords found!"; }else{ my @List; my @Servers; my $xml = XML::Simple->new; my $data = $xml->XMLin("$APP_DATA/FileZilla/recentservers.xml" +); if (ref $data eq 'ARRAY' ) { @Servers = @{ $data->{'RecentServers'}->{'Server'} }; }else{ @Servers = $data->{'RecentServers'}->{'Server'}; } foreach my $Server (@Servers) { push @List, sprintf("%-30s%20s%20s\n",$Server->{'Host'},$S +erver->{'User'},$Server->{'Pass'}); } return @List; } }
|
|---|