Kamil Rizatdinov
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # NCS Lab 10 ## Team Egor Osokin Kamil Rizatdinov Rufina Talalaeva ## Cooperation Since this task was really hard for us, our team cooperated with the team of **Danil Usmanov**, **Max Kureikin** and **Olga Chernukhina**. It is essential to be mentioned that 5 of us are Mac OS users. To solve this task we decided to install Ubuntu 20, VirtualBox, Cuckoo and all packages on one Windows laptop with enough RAM that we have and use it in turn. ## Task 1 - Preparation 1. **Prepare and install a sandboxing solution Сuckoo.** We followed the [tutorial](https://utopianknight.com/malware/cuckoo-installation-on-ubuntu-20/) you provided in order to install cuckoo. We replaced the `eth0` network interface with `enp0s2`, as this was the appropriate one. 2. **Use any virtualization environment, better to use the latest version. Oracle VirtualBox is the default choice.** We installed VirtualBox for this lab. 3. **Create a Virtual Machine (for example, Windows 7 SP1 x64) and set up it with your sandboxing solution. Make sure that VM uses a HOST ONLY network adapter.** We used the [.ova file of Windows 7 x64](https://drive.google.com/file/d/1ZyYzkHR_F_cqCgdc1C8WemIVhqtQ5wjg/view) that you provided. Thanks a lot! We forgot to turn on the virtualization on our laptop, that's why got this mistake, but solved it successfully. ![](https://i.imgur.com/qRUQwLT.png) After setting up everything together, we finally were able to run sandboxing solutions: ![](https://i.imgur.com/lpUbuuj.png) ## Task 2 - Let’s get some malware 1. **Download some malware/ransomware from the Internet (for example, TheZoo repo). Please be careful when you run them, THESE ARE REAL MALWARE.** We decided to use [TheZoo repo](https://github.com/ytisf/theZoo). 3. **Select at least two malware that you want to analyse in the sandbox VM that you prepared in the Task 1.** We did running of the following ones: * [Ransomware.Petya](https://github.com/ytisf/theZoo/tree/68817f0afd70dbdc94e81372162e5bfce062c5da/malwares/Binaries/Ransomware.Petya) * [Ransomware.TeslaCrypt](https://github.com/ytisf/theZoo/tree/68817f0afd70dbdc94e81372162e5bfce062c5da/malwares/Binaries/Ransomware.TeslaCrypt) * [Ransomware.WannaCry](https://github.com/ytisf/theZoo/tree/68817f0afd70dbdc94e81372162e5bfce062c5da/malwares/Binaries/Ransomware.WannaCry) ## Task 3 - Sandbox Analysis ### Ransomware.Petya 1. **See what kind of traces, artifact, connection does your sandbox VM manage to detect.** Petya infected result: ![](https://i.imgur.com/zIc0UdO.png) ![](https://i.imgur.com/NZKIa4H.png) Petya report: ![](https://i.imgur.com/5UXfjbZ.png) ![](https://i.imgur.com/tOgUUZP.png) ![](https://i.imgur.com/B2jgg2q.png) ![](https://i.imgur.com/ikQsYG4.png) ![](https://i.imgur.com/N4aIC1O.png) ![](https://i.imgur.com/8PcjpoT.png) ![](https://i.imgur.com/YpwYHgo.png) ![](https://i.imgur.com/t4Y1tqr.png) ![](https://i.imgur.com/bUYGm19.png) ![](https://i.imgur.com/vnMGiEf.png) P.S. We didn't understand why Cuckoo report showed only 2.4 out of 10 points, what means that there are only signs of malicious behaviour. However we saw what this malware did with the OS, and it's very dangerous. 2. **Try to analyze the behavior of the malware, and then try to write about what the malware does and what is the goal of the malware.** We can understand from the running proccess that Petya causes the operating system to trigger a Bluescreen of Death stopping any process at that point and shutting the operating system down. Once the system has been shut down and restarted the ransomware encrypts the Master Boot Record and we see this red screen with the request to purchase the key in the darknet to get the encypted files back. 3. **Does the malware have some sandbox detection? If yes, try to defeat/detect the techniques that are used for that.** Petya does not have any sandbox detection, because it ran till the end successfully. 4. **Try to use other online tools (for example, any.run , hybrid analysis, ...), figure out if these online platforms will manage to detect more artifacts than what you have found.** We performed hybrid analysis. [Here](https://tinyurl.com/y3fy2v7e) you can find a report. Here we can see that a lot of Anti-Virus systems have detected that it is really dangerous malware. ![](https://i.imgur.com/aYjqi2B.png) Here we can see the techniques that have been used to detect the malware. ![](https://i.imgur.com/vrkdXGG.png) On this screen we can see what this malware does with the computer. We can see that it interacts and writes to the primary disk partition. ![](https://i.imgur.com/IeGh46V.png) ### TeslaCrypt 1. **See what kind of traces, artifact, connection does your sandbox VM manage to detect.** TeslaCrypt running proccess: Script running: ![](https://i.imgur.com/aPe1AMs.png) ![](https://i.imgur.com/U8KI8O6.png) Restart of the operating system: ![](https://i.imgur.com/plRmNbL.png) We can see that everything is okay and no files are corrupted: ![](https://i.imgur.com/2w1a0jt.png) Cuckoo didn't produce any reports, so we used: Report forced generation using `cuckoo process cuckoo1` (report generation started at 23:50 and ended in 00:27): ![](https://i.imgur.com/oJUNA9v.png) Despite of no suspicious behavior was mentioned by us, the Cuckoo report assessed the malware as dangerous one - `6/10 points`: * We can see basic information: ![](https://i.imgur.com/5ZuaRKP.png) * Connection with Tor Hidden Services, Stopping the Firewall,injected processes and etc. ![](https://i.imgur.com/SetcLeY.png) ![](https://i.imgur.com/BBub34R.png) * Analyzer Log ![](https://i.imgur.com/QVtWONu.png) * suspicious strings=> we can conduct that this is file encryption and demanding the money. ![](https://i.imgur.com/vmXdVf0.png) ![](https://i.imgur.com/KwplS2D.png) * From network analysis we did not find anything suspicious: ![](https://i.imgur.com/UEBwBSN.png) ![](https://i.imgur.com/ZxTmgFD.png) ![](https://i.imgur.com/0x9dkzI.png) ![](https://i.imgur.com/QGcf02C.png) * inject exes ![](https://i.imgur.com/u1h9laA.png) In addition, we had problems with memory lack:( : ![](https://i.imgur.com/jMOQQ7d.png) ![](https://i.imgur.com/ZIrQrLw.png) 2. **Try to analyze the behavior of the malware, and then try to write about what the malware does and what is the goal of the malware.** We wasn't able to see the consequences of the malware, so for this question we used [this](https://easychair.org/publications/open/l6hl) link. The goal of the malware is to encrypt user's files on the hard disk. It has the following process: 1. Encrypt files (some, or all) 2. Change their extensions to an unknown one So, as your files are encrypted, you lost your personal information. Then, after your first opening of a CWD utility, the randomware prints the BTC address to which you should deposit your money. Or, it places a `.txt` file with that address 4. **Does the malware have some sandbox detection? If yes, try to defeat/detect the techniques that are used for that.** As far as we saw, it has the sandbox detection. The core damage of the malware is file encrypting. In example videos like [this](https://www.youtube.com/watch?v=j3_BuduZKcI), all files were encrypted after the running. However, after submitting the ransomware binary to the cuckoo, and a restart of the VM, we didn't find any encrypted files. Out theory – it detected the fact of sandboxing, and didn't perform any actions. As for the defeating, we didn't come up with any ideas and switched to another virus. 5. **Try to use other online tools (for example, any.run , hybrid analysis, ...), figure out if these online platforms will manage to detect more artifacts than what you have found.** We performed hybrid analysis. [Here](https://tinyurl.com/y3cffso8) you can find a report. ![](https://i.imgur.com/fuFiEVH.png) Here we can see the techniques that have been used to detect the malware: ![](https://i.imgur.com/fWLYZ1R.png) On this screen we can see what this malware does with the computer. We can see that it deletes volume snapshots, contacts Tor hidden services and modifies auto-execute functionality by modifying values in regystry, as well as writes data to remote processes. ![](https://i.imgur.com/M1zf9xz.png) ### WannaCry 1. **See what kind of traces, artifact, connection does your sandbox VM manage to detect.** Running WannaCry: ![](https://i.imgur.com/0QpItfO.png) Result of WannaCry: ![](https://i.imgur.com/QyTWxg5.png) ![](https://i.imgur.com/Ejq8Lyz.png) ![](https://i.imgur.com/iI78L4L.png) Cuckoo report: * Basic info, signs of malicious behaviour and again low score - `3.8/10`: ![](https://i.imgur.com/jCZdjt1.png) * Communicating to hosts that in future are marked as dead: ![](https://i.imgur.com/hQ5o6PK.png) ![](https://i.imgur.com/Vtg4wdE.png) * Import of libraries: ![](https://i.imgur.com/weW5EOk.png) 2. **Try to analyze the behavior of the malware, and then try to write about what the malware does and what is the goal of the malware.** As it prints out, the malware encypted files on our VM, and showed it directly to us changing the background image. So, it's a ransomware which encrypts the files, and waits for the money in order to provide user with decryption tool. As we found out in the [report](https://easychair.org/publications/open/l6hl), it also encrypts the canary files. 3. **Does the malware have some sandbox detection? If yes, try to defeat/detect the techniques that are used for that.** As can be seen on the screenshots, the malware wasn't able to detect the sandboxing, and encrypted files on our VM. 5. **Try to use other online tools (for example, any.run , hybrid analysis, ...), figure out if these online platforms will manage to detect more artifacts than what you have found.** We performed hybrid analysis. [Here](https://tinyurl.com/y5789nrq) you can find a report. ![](https://i.imgur.com/p4pn1fa.png) Here we can see the techniques that have been used to detect the malware: ![](https://i.imgur.com/9EW47RY.png) On this screen we can see what this malware does with the computer. We can see that it deletes volume snapshots and disables startup repair, as well as writes data to remote processes. ![](https://i.imgur.com/ZgEzSX8.png) ## Task 4 - Static Analysis 1. **Use any tool for static analysis of your selected malware (for example, Ghidra, IDA, Binary Ninja, Hopper, Radare2, ...).** For this task, we used the following online tools * [https://manalyzer.org/](https://manalyzer.org/) * [Hidrid analysis](https://www.hybrid-analysis.com/) 2. **Try to see if there are some artifacts that dynamic analysis did not manage to find, for example a peace of code that did not run inside the sandbox VM.** As an example, I tool the Petya ransomware from [here](https://github.com/ytisf/theZoo/blob/master/malwares/Binaries/Ransomware.Petya/) #### Manalyzer ![](https://i.imgur.com/XXiZlPY.png) ![](https://i.imgur.com/dY4wsQp.png) ![](https://i.imgur.com/xfR7ZFn.png) For whatever reasons, the web-site concluded it is a PDF. Hovewer, report from VirusTotal clearly stays it is Petya. ![](https://i.imgur.com/M2MWtoV.png) Interesting thing – we can find the all the third-party functions which are used by Petya #### Hybrid Analyzer ![](https://i.imgur.com/ZkZP9vI.png) ![](https://i.imgur.com/nPw2rjP.png) Again, this analyzer rates the file as 100/100 threat score. Consequently, it definetely has some malware database ### Ghidra Static analysis by hand is very hard for us, because Petya's size is too big. We found some system calls, but not many. We find the [way](https://github.com/55-AA/fetch_syscalls) to automate this, but wasn't succeded in the installation step. ![](https://i.imgur.com/EY12G0K.png) 4. **Try to describe which method is better (Sandboxing V.S. Static analysis) is better, and which one is more useful in which case.** Each method fits different requirements, and the final choice should depend on the environment a lot. Let's elaborate on some Pros/Cons of both, which we found out during this lab * Sandboxing * **Pros**: We can see the malware impact in the real time. So, we have an opportunity to analyze the memory and filesystem dump of the machine before it, and after. * **Cons**: Hardware and knowledge requirements. Hard to set up and be sure it works. If sandboxing isn't properly configured, the malware possibly can get over to the host machine * Static * **Pros**: easy if using web-sites. Using them, it can be done in a few clicks. Also, we don't need to run the malware, so no damage will be done by our actions. If we analyze using Ghidra, we can find the functions which were not executed during the dynamic analysis, so we study the virus in details * **Cons**: hard if meant to be done by hands. Really. Analysis of some virus Ghidra requires a great level of education and knowledge. If we use web-sites, the number of details in the report is highly depends on the particular tool, and it's out of our control.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully