Hidden Text (bronze, 50p)

Network team has captured a text file from network traffic.
One analyst noticed that the file size does not match the content.
Possibly something is hidden.
Analyze the file and read the secret text.

solution

Looking at the file with cat, nothing seems strange.

$ cat -n secret.txt
1
2
3  The file is like an trojan horse
4  You might see one thing, but there is something invisible hidden in it.
5
6  

But looking at it closer with hexdump, a lot more is revealed.

$ hexdump -vC bronze.hidden-text/secret.txt
00000000  0a 0a 54 68 65 20 66 69  6c 65 20 69 73 20 6c 69  |..The file is li|
00000010  6b 65 20 61 6e 20 74 72  6f 6a 61 6e 20 68 6f 72  |ke an trojan hor|
00000020  73 65 0a 59 6f 75 20 6d  69 67 68 74 20 73 65 65  |se.You might see|
00000030  20 6f 6e 65 20 74 68 69  6e 67 2c 20 62 75 74 20  | one thing, but |
00000040  74 68 65 72 65 20 69 73  20 73 6f 6d 65 74 68 69  |there is somethi|
00000050  6e 67 20 69 6e 76 69 73  69 62 6c 65 20 68 69 64  |ng invisible hid|
00000060  64 65 6e 20 69 6e 20 69  74 2e 0a 0a e2 80 8b e2  |den in it.......|
00000070  80 8d e2 80 8b e2 80 8b  e2 80 8b e2 80 8d e2 80  |................|
00000080  8d e2 80 8b e2 80 8b e2  80 8d e2 80 8d e2 80 8b  |................|
00000090  e2 80 8d e2 80 8d e2 80  8b e2 80 8b e2 80 8b e2  |................|
000000a0  80 8d e2 80 8d e2 80 8b  e2 80 8b e2 80 8b e2 80  |................|
000000b0  8b e2 80 8d e2 80 8b e2  80 8d e2 80 8d e2 80 8b  |................|
000000c0  e2 80 8b e2 80 8d e2 80  8d e2 80 8d e2 80 8b e2  |................|
000000d0  80 8b e2 80 8d e2 80 8b  e2 80 8b e2 80 8b e2 80  |................|
000000e0  8b e2 80 8b e2 80 8b e2  80 8d e2 80 8d e2 80 8b  |................|
000000f0  e2 80 8d e2 80 8b e2 80  8b e2 80 8d e2 80 8b e2  |................|
00000100  80 8d e2 80 8d e2 80 8d  e2 80 8b e2 80 8b e2 80  |................|
00000110  8d e2 80 8d e2 80 8b e2  80 8b e2 80 8d e2 80 8d  |................|
00000120  e2 80 8d e2 80 8b e2 80  8d e2 80 8b e2 80 8b e2  |................|
00000130  80 8b e2 80 8d e2 80 8b  e2 80 8b e2 80 8b e2 80  |................|
00000140  8b e2 80 8b e2 80 8b e2  80 8d e2 80 8d e2 80 8d  |................|
00000150  e2 80 8b e2 80 8d e2 80  8d e2 80 8d e2 80 8b e2  |................|
00000160  80 8d e2 80 8d e2 80 8b  e2 80 8d e2 80 8b e2 80  |................|
00000170  8b e2 80 8b e2 80 8b e2  80 8d e2 80 8d e2 80 8b  |................|
00000180  e2 80 8d e2 80 8b e2 80  8b e2 80 8d e2 80 8b e2  |................|
00000190  80 8d e2 80 8d e2 80 8d  e2 80 8b e2 80 8d e2 80  |................|
000001a0  8b e2 80 8b e2 80 8b e2  80 8d e2 80 8d e2 80 8b  |................|
000001b0  e2 80 8b e2 80 8d e2 80  8b e2 80 8d e2 80 8b e2  |................|
000001c0  80 8d e2 80 8d e2 80 8d  e2 80 8b e2 80 8b e2 80  |................|
000001d0  8d e2 80 8d e2 80 8b e2  80 8d e2 80 8d e2 80 8d  |................|
000001e0  e2 80 8b e2 80 8b e2 80  8b e2 80 8b e2 80 8b e2  |................|
000001f0  80 8d e2 80 8d e2 80 8b  e2 80 8b e2 80 8b e2 80  |................|
00000200  8b e2 80 8d e2 80 8b e2  80 8d e2 80 8d e2 80 8b  |................|
00000210  e2 80 8b e2 80 8b e2 80  8d e2 80 8d e2 80 8b e2  |................|
00000220  80 8d e2 80 8d e2 80 8b  e2 80 8b e2 80 8d e2 80  |................|
00000230  8b e2 80 8d e2 80 8b e2  80 8b e2 80 8d e2 80 8b  |................|
00000240  e2 80 8d e2 80 8d e2 80  8b e2 80 8d e2 80 8b e2  |................|
00000250  80 8d e2 80 8d e2 80 8d  e2 80 8b e2 80 8b e2 80  |................|
00000260  8d e2 80 8b e2 80 8b e2  80 8d e2 80 8d e2 80 8b  |................|
00000270  e2 80 8d e2 80 8d e2 80  8d e2 80 8d e2 80 8b e2  |................|
00000280  80 8d e2 80 8d e2 80 8d  e2 80 8d e2 80 8b e2 80  |................|
00000290  8b e2 80 8b 0a                                    |.....|

File contains a lot of \xe2\x80\x8d, which represents ZERO WIDTH SPACE and \xe2\x80\x8b, which represents ZERO WIDTH JOINER.

Using various tools for zero width space steganography, didn't lead to anything.

As there are only two characters and all character size is divisible by 8, an idea came to convert those characters to binary.

$ cat -n secret.txt | sed -e 's/\xe2\x80\x8b/0/g' -e 's/\xe2\x80\x8d/1/g'
2
3  The file is like an trojan horse
4  You might see one thing, but there is something invisible hidden in it.
5
6  0100011001101100011000010110011100100000011010010111001100111010001000000111011101101000011010010111010001100101011100110111000001100001011000110110010100101101011100100110111101111000

Converting those binary numbers to decimals and then to characters, gives the flag.

$ python3 -c 'import re; print("".join([chr(int(i,2)) for i in re.findall(".{8}", "0100011001101100011000010110011100100000011010010111001100111010001000000111011101101000011010010111010001100101011100110111000001100001011000110110010100101101011100100110111101111000")]))'
Flag is: whitespace-rox