[Perl] SMF FORM HASH CRACKER

A25414N

Professional
Messages
243
Reputation
8
Reaction score
20
Points
18
Code:
#!/usr/bin/perl
 
use Digest::SHA1 'sha1_hex';
$user=$ARGV[0]; 
$q=$ARGV[1]; 
print "\r\n---------SMF FORM HASH CRACKER [Welcome to www.vul.kr]---------- \r\n";
print "usage $0 username hash \r\n";
$e=0;
if($user&&$q) {
foreach $i (1..10) {
	print "[ ] Message--> Attempting $i letter passwords...\n";
	foreach $1 ('a'..'z','A'..'Z',0..9) {
		if ($i == 1) {
			if ($e == 0) { if (sha1_hex($user.$1) eq $q) { print "[!] Solution-> $1\n";exit; } } else { 
 
if (md5_hex($1) eq $q) { print "[!] Solution-> $1\n"; exit; } }
		}
		else {
			foreach $2 ('a'..'z','A'..'Z',0..9) {
				if ($i == 2) {
					if ($e == 0) { if (sha1_hex($user.$1.$2) eq $q) { print "[!] Solution-> $1
 
$2\n"; exit; } } else { if (md5_hex($1.$2) eq $q) { print "[!] Solution-> $1$2\n"; exit; } }
				}
				else {
					foreach $3 ('a'..'z','A'..'Z',0..9) {
						if ($i == 3) {
							if ($e == 0) { if (sha1_hex($user.$1.$2.$3) eq $q) { print 
 
"[!] Solution-> $1$2$3\n"; exit; } } else { if (md5_hex($1.$2.$3) eq $q) { print "[!] Solution-> $1$2$3\n";	
 
exit; } }
						}
						else {
							foreach $4 ('a'..'z','A'..'Z',0..9) {
								if ($i == 4) { 
									if ($e == 0) { if (sha1_hex
 
($user.$1.$2.$3.$4) eq $q) { print "[!] Solution-> $1$2$3$4\n"; exit; } } else { if (md5_hex($1.$2.$3.$4) eq $q) { 
 
print "[!] Solution-> $1$2$3$4\n"; exit; } }
								}
								else {
									foreach $5 ('a'..'z','A'..'Z',0..9) {
										if ($i == 5) { 
											if ($e == 0) { if (sha1_hex
 
($user.$1.$2.$3.$4.$5) eq $q) { print "[!] Solution-> $1$2$3$4$5\n"; exit; } } else { if (md5_hex($1.$2.$3.$4.$5) eq 
 
$q) { print "[!] Solution-> $1$2$3$4$5\n"; exit; } }
										}
										else {
											foreach $6 
 
('a'..'z','A'..'Z',0..9) {
												if ($i == 6) { if 
 
($e == 0) { if (sha1_hex($user.$1.$2.$3.$4.$5.$6) eq $q) { print "[!] Solution-> $1$2$3$4$5$6\n"; exit; } } else { 
 
if (md5_hex($1.$2.$3.$4.$5.$6) eq $q) { print "[!] Solution-> $1$2$3$4$5$6\n"; exit; } }
												}
												else {
													foreach $7 
 
('a'..'z','A'..'Z',0..9) {
														if 
 
($i == 7) { 
 
 
if ($e == 0) { if (sha1_hex($user.$1.$2.$3.$4.$5.$6.$7) eq $q) { print "[!] Solution-> $1$2$3$4$5$6$7\n"; exit; } } 
 
else { if (md5_hex($1.$2.$3.$4.$5.$6.$7) eq $q) { print "[!] Solution-> $1$2$3$4$5$6$7\n"; exit; } }
														}
														else 
 
{
 
 
foreach $8 ('a'..'z','A'..'Z',0..9) {
 
 
	if ($i == 8) {
 
 
		if ($e == 0) { if (sha1_hex($user.$1.$2.$3.$4.$5.$6.$7.$8) eq $q) { print "[!] Solution-> $1$2$3$4
 
$5$6$7$8\n"; exit; } } else { if (md5_hex($1.$2.$3.$4.$5.$6.$7.$8) eq $q) { print "[!] Solution-> $1$2$3$4$5$6$7$8
 
\n"; exit; } }
 
 
	}
 
 
	else {
 
 
		foreach $9 ('a'..'z','A'..'Z',0..9) {
 
 
			if ($i == 9) { 
 
 
				if ($e == 0) { if (sha1_hex($user.$1.$2.$3.$4.$5.$6.$7.$8.$9) eq $q) { print "[!] 
 
Solution-> $1$2$3$4$5$6$7$8$9\n"; exit; } } else { if (md5_hex($1.$2.$3.$4.$5.$6.$7.$8.$9) eq $q) { print "[!] 
 
Solution-> $1$2$3$4$5$6$7$8$9\n"; exit; } }
 
 
			}
 
 
			else {
 
 
				if ($i == 10) {
 
 
					foreach $10 ('a'..'z','A'..'Z',0..9) {
 
 
						if ($e == 0) { if (sha1_hex($user.$1.$2.$3.$4.$5.$6.$7.$8.$9.$10) eq 
 
$q) { print "[!] Solution-> $1$2$3$4$5$6$7$8$9$10\n"; exit; } } else { if (md5_hex($1.$2.$3.$4.$5.$6.$7.$8.$9.$10) 
 
eq $q) { print "[!] Solution-> $1$2$3$4$5$6$7$8$9$10\n"; exit; } }
 
 
					}
 
 
				}
 
 
				else {
 
 
					print "[!] Error-> Brute-force failed. Please either increase the range or 
 
replace your alphabet\n";
 
 
					exit;
 
 
				}
 
 
			}
 
 
		}
 
 
	}
 
 
}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}}
 
Top