India - Reverse Me & Extract Flag from Packets (rev/network)

Inspecting the wireshark PCAP, there only seems to be one TCP stream. Right click any packet and follow TCP Stream to see the following:
type c:\tmp\flag.txt
1KeGOcMvvKpPbxrNRdyqJmSGh3j+ZCvIT5RKk6lTBkSGBYSYrX7dy3Q/E8wVuQAXNFMs978T1A4qyx7EeX9fvg==We can guess that this is probably some ciphertext we need to decrypt.
Let's look at the DMP we are given:
I found that volatility was unable to work with this file, but WinDbg worked fine. On loading it into WinDbg we can list all modules using lm:
We can guess that the module of interest is probably csg_reversing_network_forensic_challenge or ajccbc_reversing_challenge. Unfortunately the WinDbg .writemem command didn't work successfully. This is because ajccbc_reversing_challenge.dll was not stored contiguously in memory, as we can see using !address -f:MEM_COMMIT to filter by committed virtual memory:
What worked was using the MEX Debugging Extension for WinDbg, and using it to write modules. You can use the following command to dump all DLLs/EXEs:
Apparently the exe was generated as a result of JIT compilation when the dll is run.
Let's analyse the dll using dnspy:
Let's look at the important C# functions:
As we can see from this snippet:
What wireshark captured was the command executed, and the following line was the obfuscated result of executing that command.
Let's look at all the obfuscation:
key: AdvancedDecode("2a5b05310e08081f2b3405031134372a073c1f1c371a2e1c09303b4308393219")
iv: AdvancedDecode("252e0a0a3a1f291c1b343b39212b3c11013d312f08315158")
Upon decoding the key and iv using the xorKey which is simplekey, we can use AES CBC to decrypt the flag:
Last updated