X-1803

This is the place for ALL of the user submitted challenges. If you create a little challenge/mission/riddle/whatever, post it here.
Forum rules
Do not post missions that you did NOT create without proper citing.

X-1803

Post by Turn on Wed Jun 10, 2015 9:23 am
([msg=88429]see X-1803[/msg])

Greetings, X-1803!
We are glad to see you finished your last assignment in a hasty manner. We are in dire need of your help again!
There is an upcoming group of cyber criminals who appear to have some heavy funding and knowledge wrapped under their belt. While you were working on project Night-Hawk 91, we assigned you a new partner for this case. Your new partner is X-7743, who has already began the initial process of tracking down as much information of these cyber terrorist as possible. X-7743 managed to gain access to one of their computers and managed to gain further access throughout the system using the victim to pivot within the network. With the knowledge and wealth of this criminal group, it's only a matter of time before they notice the intrusion. To keep things sweet and simple, here is your mission....
Below this message, you should have an attachment file. This file includes several large numbers, 200 of them to be exact. According to the research done by X-7743, these number will change daily. These numbers play a crucial role for the criminals, and here is why. The criminals only communicate through a secret service, which is accessed by providing a specific password. As you probably guessed, these numbers have something to do with that password. According to your partner, we need to get the sum of all the numbers in the attachment, and then get the md5 value of the sum. This should be our password to the secure system, and then we can gather the intel we need to go forth. There is a catch however. Your solution to this problem needs to be quick, in fact we need your program to find the solution to this in under 7 seconds.

Data Attachment
Sha256 Sum: 4ad762f86a4303498d73dbd1c2b15360e213ebbc005294c5160c14f97d737e4a
Last edited by Turn on Wed Jun 17, 2015 4:21 am, edited 3 times in total.
Social Engineering:
<cen> .lua print ('Tsyn 9.47.-u 3 12 5')
* slickery has quit (User has been banned from HackThisSite (Attempting to use a SpyBot))
* cen has quit (User has been banned from HackThisSite (Attempting to use a SpyBot))
User avatar
Turn
Poster
Poster
 
Posts: 120
Joined: Tue Feb 17, 2015 5:42 am
Blog: View Blog (0)


Re: X-1803

Post by sysopfb on Wed Jun 10, 2015 4:39 pm
([msg=88440]see Re: X-1803[/msg])

Code: Select all
import System.IO
import System.Environment
import Control.Monad
import Data.Char

main = do
   xargs <- getArgs
   let fname = head xargs
   contents <- readFile fname
   (putStr . show) $ sum' contents
   where sum' = sum . (map digitToInt) . (filter (/= '\n'))


Code: Select all
ghc -O2 -o out out.hs



Code: Select all
root@root# time ./out data.txt |md5sum
e36faa67b652be13f25f05ec739f4e21  -

real   0m1.309s
user   0m1.288s
sys   0m0.020s
sysopfb
New User
New User
 
Posts: 17
Joined: Tue Sep 09, 2014 9:36 pm
Blog: View Blog (0)


Re: X-1803

Post by ghost107 on Wed Jun 10, 2015 4:53 pm
([msg=88442]see Re: X-1803[/msg])

First time seeing someone post something in Haskel, nice.
User avatar
ghost107
Poster
Poster
 
Posts: 321
Joined: Wed Jul 02, 2008 7:57 am
Blog: View Blog (0)


Re: X-1803

Post by sysopfb on Wed Jun 10, 2015 7:05 pm
([msg=88445]see Re: X-1803[/msg])

Apparently I didn't read the problem correctly.

New version adds each number from the file instead of each digit in the file


Code: Select all
import System.IO
import System.Environment
import Control.Monad
import Data.Char

main = do
   --putStrLn "Filename?"
   xargs <- getArgs
   let fname = head xargs
   contents <- readFile fname
   (putStr . show) . sum . (map readInt) $ lines contents
   where readInt = read :: String -> Integer


This takes too long to finish though because haskell does large number precision

So.. I'll cheat with bash

Code: Select all
root@root# time BLEH=$(paste -sd+ data.txt | bc | sed 's/[^0-9]*//g'); echo -n $BLEH | sed s/\ //g |md5sum

real   0m1.766s
user   0m1.828s
sys   0m0.044s
1783ee6b8c0648d0443e5c5cc45c90be  -
sysopfb
New User
New User
 
Posts: 17
Joined: Tue Sep 09, 2014 9:36 pm
Blog: View Blog (0)


Re: X-1803

Post by Turn on Thu Jun 11, 2015 5:47 am
([msg=88459]see Re: X-1803[/msg])

Great work, sysopfb. The hash checks out.
Also, +1 for writing code in Haskell



sysopfb wrote:Apparently I didn't read the problem correctly.


Actually, is seems you did. I should have read over my presentation of this challenge before posting it. I did say 'the sum of all the digits' instead of 'the sum of all the numbers'
This has been updated. Thank you
Social Engineering:
<cen> .lua print ('Tsyn 9.47.-u 3 12 5')
* slickery has quit (User has been banned from HackThisSite (Attempting to use a SpyBot))
* cen has quit (User has been banned from HackThisSite (Attempting to use a SpyBot))
User avatar
Turn
Poster
Poster
 
Posts: 120
Joined: Tue Feb 17, 2015 5:42 am
Blog: View Blog (0)


Re: X-1803

Post by boriz666 on Wed Jun 17, 2015 5:04 am
([msg=88549]see Re: X-1803[/msg])

Greetings,
thanks for another good challenge, although it is a bit more bruteforce than intended.
And its in my favorite language perl!

Code: Select all

#!/usr/bin/perl
use Math::BigInt;
use Math::BigInt::FastCalc;
use Digest::MD5 qw(md5 md5_hex md5_base64);
open FIL,"<challenge.txt";

my $huge = Math::BigInt->new(0);

while (<FIL>) {
foreach my $nr ( m/\d+/gi ) {
   $huge->badd($nr);
}
}

close FIL;
print md5_hex( $huge->as_int() ) . "\n";




Timing:

Code: Select all
time ./solve.pl
1783ee6b8c0648d0443e5c5cc45c90be

real    0m1.567s
user    0m1.535s
sys     0m0.031s

boriz666
Experienced User
Experienced User
 
Posts: 99
Joined: Tue Mar 24, 2015 11:53 am
Blog: View Blog (0)



Return to User Submitted

Who is online

Users browsing this forum: No registered users and 0 guests