One of a kind wargame

Started by gadoxc7779, January 24, 2009, 03:14:52 PM

Previous topic - Next topic
Hi all, rather than try out my little skills on unauthorized systems i decided to search for wargames that permit me to break into there system.

Here is there URL:http://3564020356.org/deserve.htm

This is one of a kind cos i cant seem to get the password to login.

Please any one that can assist I'll be greatfull thanks.

Ah, this is an interesting site. A few tips on this one:

First, view the source of the web-page (in Firefox, hit Ctrl+U). The author of the page hides some information in HTML comments (Between <!-- and --> tags).

This puzzle is about breaking the ciphertext found in the source of the page. Basically, this ciphertext was made by substituting letters. For instance, if we substitute T = M, H = A, and E = L, then THE = MAL. There are several ways of cracking this type of cipher. If we are dealing with a large amount of text, we can write a program to count the frequency of each letter. Then we'd replace the most common letters with the most common letters in English. For instance, in this case, L appears much more often than any other letter in the ciphertext. Then we can assume that L = E, since E is the most common letter in English. Using a table I found at http://en.wikipedia.org/wiki/Letter_frequencies, I wrote the following code to do this substitution for each letter(in Perl):

#!/bin/perl

my $_ = "MAL TIRRUEZF CR MAL RKZYIOL EX MAL OIY UAE RICF \"MAL ACWALRM DYEUPLFWL CR ME DYEU MAIM UL IZL RKZZEKYFLF GH OHRMLZH\"";

my @most_used_wikipedia = ("e","t","a","o","i","n","s","h","r","d","l","c","u","m","w","f","g","y","p","b","v","k","j","x","q","z");

my %letters = ("a",0,"b",0,"c",0,"d",0,"e",0,"f",0,"g",0,"h",0,"i",0,"j",0,"k",0,"l",0,"m",0,"n",0,"o",0,"p",0,"q",0,"r",0,"s",0,"t",0,"u",0,"v",0,"w",0,"x",0,"y",0,"z",0);

while( ($letter, $number) = each( %letters ) ){
	$letters{$letter} = () = $_ =~ m/$letter/gi;
}

print "Cipertext:\n$_\n\n";

# Print out frequency table
print "Frequency Table\n";
foreach my $letter (sort {$letters{$b} <=> $letters{$a}} keys %letters){
   print "$letter $letters{$letter}\t";
}

print "\n\n";

# Guess plaintext based on wikipedia stat attack
print "Wikipedia Statistical Attack\n";
print "=================================\n";
my $wikipedia_attack_plaintext = $_;
my $counter = 0;
foreach my $letter (sort {$letters{$b} <=> $letters{$a}} keys %letters){
	$letter = uc($letter);
	
	$wikipedia_attack_plaintext =~ s/$letter/$most_used_wikipedia[$counter]/g;
	++$counter;
}
print $wikipedia_attack_plaintext;


Unfortunately, since the ciphertext is such a small sentence, this statistical attack results in the phrase, "aoe pnttrisd lt aoe tcshnme ig aoe mnh roi tnld aoe olwoeta fhirbedwe lt ai fhir aona re nse tcssichded yu mutaesu," which is no help. So we move on and try to analyze each two and three letter word. MAL appears multiple times, so I'm going to assume that MAL = THE, since that's fairly common. Then I moved on to the two letter words, trying "IS", "IT", etc. I wrote a program to quickly make changes:
#!/bin/perl

my $ciphertext = "MAL TIRRUEZF CR MAL RKZYIOL EX MAL OIY UAE RICF \"MAL ACWALRM DYEUPLFWL CR ME DYEU MAIM UL IZL RKZZEKYFLF GH OHRMLZH\"";

print "Ciphertext:\n$ciphertext\n\n";
print "Replace what letter with what letter? (syntax: \"letter,replacement\", \"exit\" exits, CASE SENSITIVE)\n\n";

while( 1 ){
	$_ = <STDIN>;
	chomp;
	
	if( /exit/ ){
		exit;
	}
	
	# Check syntax
	if( /^[a-zA-Z],[a-zA-Z]$/ ){
		my ( $regex, $replacement ) = split( /,/ );
		$ciphertext =~ s/$regex/$replacement/g;
	}
	
	print "Ciphertext:\n$ciphertext\n\n";
}


With this program, you should use the syntax "A,z" if you want to replace A with z, i.e. replace uppercase letters with lowercase letters so you won't accidentally replace letters you already replaced. Working with this program for a few minutes, I found the hint for the password.

That was a MASSIVE hint, but if you have problems, come on back. And if you don't have perl, download it! If you're using Windows, google search "ActivePerl". It's awesome.
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.

SMF spam blocked by CleanTalk