Spring 2020 Project 2 Writeup-1
Spring 2020 Project 2 Writeup-1
A Helpful Suggestion:
Make sure you have a main computer with sufficient horsepower to run the outer VM. Since you will be
running a VM inside of a VM at the same time, you will find that 4 GB of RAM is probably insufficient to
power the machines with any speed; you probably want 8 GB at minimum.
$ cd /home/ubuntu/Desktop/setup-folder
$ ./setup-cuckoo.sh
6. Import the Windows XP VM into the VirtualBox that is already installed inside the Ubuntu VM.
o Start the VirtualBox GUI inside the VM.
o Using the GUI, import the OVA in the VM
▪ The OVA is located at /home/ubuntu/Desktop/setup-folder
▪ If it asks you to upgrade VirtualBox inside the VM, say NO. Do NOT upgrade
VirtualBox.
▪ In the GUI go to the File menu and select “Import Appliances”
▪ Follow the GUI instructions to import the OVA listed above.
▪ Exit the VirtualBox GUI.
7. The terminal program in Ubuntu is tabbed. You will need three tabs for the following instructions,
or else open three different Terminal windows. The important thing is for there to be three
simultaneous terminals open. In tab one, start the Windows XP VM as follows:
$ rdesktop 192.168.56.1:3389
9. This will open a VM window that you can work in. You want to verify that the VM starts cleanly
and that there are no windows on the desktop
o You will be in good shape on the verify if a command prompt appears stating “Starting
agent on 0.0.0.0:8000…”
o You MUST minimize this window (leave it open but not visible) in order for you to see the
contents of the desktop for your Cuckoo runs.
▪ Be warned, this is a tricky operation due to how the pointer appears
▪ You may find it easier to put the pointer on the command prompt button in the
taskbar, right clicking it, and choosing “Minimize”.
10. In tab three of the terminal window, execute the following commands:
$ cd /home/ubuntu/Desktop/setup-folder
$ VBoxManage snapshot "WindowsXPSP3" take "XP1" --pause
$ VBoxManage controlvm "WindowsXPSP3" poweroff
$ VBoxManage snapshot "WindowsXPSP3" restore "XP1"
$ ./setup-firewall.sh
$ mv ./cuckoo ../
These commands will take a snapshot of the Windows XP VM that Cuckoo can use over and
over to start from the same location. This process will cause the rdesktop window to disappear
and close; this is normal and expected. The last two commands will set up the external firewall to
our specs for Phase 1 and move the Cuckoo folder to its main location we will use.
$ cd /home/ubuntu/Desktop/setup-folder
$ ./config.sh
o DO NOT UPDATE ANY SOFTWARE IN THE VM. Doing so can cause it to break.
o Do not let any Cuckoo task run longer than the suggested 10 minutes
o There are two key folders to track for this project, “cuckoo” and “malware”. They are both
on the Desktop after installation. The “cuckoo” folder contains the application and will do
the work for you for the project. The “malware” folder contains the malware for the
various phases of the project.
Phase One: Run the first set of malware correctly - (10 points)
Note: This task is to get your feet wet running Cuckoo. All you will be doing at this point is learning
how to submit Cuckoo tasks and verifying that they succeed.
$ cd Desktop
$ ./cuckoo/cuckoo.py
$ cd Desktop
$ python ./cuckoo/utils/submit.py --timeout 600 ./malware/Phase1
o This particular command tells Cuckoo to run all malware contained in the folder
"./malware/Phase1" on a virtual machine (we only have one, so we don’t care about
specifying this) for maximum time of 600 seconds (10 minutes).
o Note that it may take Cuckoo a long time to analyze the data generated by the
malware sample, so running all of the malware may take somewhere between 1 and 2
hours total.
GT CS 6035: Introduction to Information Security
4. To check up on its progress, look at the output generated in the first tab of Terminal (where
Cuckoo is running). You will see some warnings every now and again. Don't worry, these
warnings are by design. However, you should not see any errors.
5. Wait for Cuckoo to finish analyzing all 4 pieces of malware. The terminal will say "Task #4:
analysis report completed".
6. In the second tab start the Cuckoo report web server.
o Run the following command:
$ python ./cuckoo/utils/web.py
o This will start the web service for Cuckoo which will allow you to view the results of the
Cuckoo analysis.
7. Open Firefox and navigate to the URL "localhost:8080"
8. On this webpage click "Browse" at the top of the page and you will see the results of
Cuckoo's analysis organized nicely for you.
o Expand the Ubuntu VM's screen size and Firefox's window size within the Ubuntu VM
so that you can see the "Browse" link
9. Read and become familiar with these reports. You will use their contents later in PhaseII.
10. Not all malware will run for 10 minutes. There are various reasons for this but you only need
to know that 10 minutes is a maximum duration, not a fixed duration.
Hint: Look at the API/system call sequence under each process generated by the malware sample
and determine what malware is doing. Note that each Cuckoo report may contain multiple
processes with many different system call sequences. If any of the behaviors are seen (or
attempted, not necessarily succeeded) in any process in the report, then that malware has
attempted that behavior. This is, of course, not completely practical, as legitimate applications
may perform the same actions in a benign fashion. We are not concerned with differentiating the
two currently, but it is some food for thought.
Clarification for attempted: We mean by “attempted” that a specific action was attempted but failed.
By “specific” we mean that it is clear which action is attempted. If you have a registry key, for
instance, that is unambiguous (like, say, it is used only to set a startup option), but it fails to
change the key, that is an attempt for our purposes. But if you have a more generic registry key
that governs multiple settings, we don’t know for sure which key or keys it is attacking and so the
action would not count as an “attempt”.
BEHAVIORS: on the website for this project, please for each of the four malwares whether it
demonstrates the following behaviors. Please note that there is no guarantee every behavior will
be checked this particular term. You will be graded incorrect if you do not check a demonstrated
behavior; you will be graded incorrect if you check a behavior that was not checked. Each
malware is worth a total of 10 points for 40 points for all four.
When using hints you will encounter that the same API functions can end with either a W or an A.
This is a standard practice in the Windows API, and this document explains the difference (either
one could in theory be present in the wild): https://docs.microsoft.com/en-
us/windows/desktop/intl/unicode-in-the-windows-api
GT CS 6035: Introduction to Information Security
Just check the box for the letter below if a particular malware shows the following behaviors:
C. Lowers Windows alert level for risky files that are downloaded or run (e.g., .exe, .bat, .vbs,
etc.)
a. Hint: https://support.microsoft.com/en-us/kb/883260 (look for the “Inclusion list for low,
moderate, and high risk file types” section)
D. Displays message on Desktop to taunt user that they have been infected
a. HINT – look at the screenshots
b. Taunting = an actual message to the user; things like blank message boxes are NOT
taunting
L. Checks for its privileges (this isn’t inherently malicious, but the malware possibly performs
some different behaviors if it has the proper permissions to do so)
a. Hint: https://msdn.microsoft.com/en-
us/library/windows/desktop/aa379180(v=vs.85).aspx
O. Potentially monitors messages before they appear in a window to the user (possible
GT CS 6035: Introduction to Information Security
reconnaissance)
a. Hint: Similar to choices (M) and (N)
● Malware Eight
○ This malware's activity is triggered on some day in the month of March in the year 2004.
Your job is to find what day it shows the most activity on. Submit your answer as a digit
(e.g., 1, 2, 3, etc.).
○ Hint: Write a script that submits the malware at every day in the month at 2PM (because
of some offset timings with the virtual machine). Letting the malware run for 180 seconds
should be enough time to show its intended behavior. Brute-force the solution. To find out
how to run the malware at a specific time, read Cuckoo's documentation
(http://docs.cuckoosandbox.org/en/latest/).
● Malware Nine
○ This malware's activity is triggered after a certain amount of time has passed since it was
executed. In essence, it delays its activities in order to evade analysis by malware
analysis environments that employ fixed-time executions on its malware (which is a
majority of malware analysis engines today).
○ Your job is to find out how many milliseconds the malware delays its initial activities.
Submit your answer as a number (e.g., 1234, 234532, 352373, etc.)
○ Hint: Look at the system call sequence. What's the first attempt to delay execution at the
start of the program?
Phase Four: Analyzing steps taken to run malware safely (35 Points)
There are various ways to run malware in a safe environment. Running the malware inside of a virtual
machine is a good start. That pretty much covers the system-side of things, but what about the network-
side? We can use firewall rules in order to prohibit the malware from spreading throughout our network,
sending spam, etc. We can even rate-limit the network connection
(http://askubuntu.com/questions/20872/how-do-i-limit-internet-bandwidth) so that if a DDoS attack is
used by our malware, we won't cause too much harm to the rest of the Internet. Your job is to read and
interpret the firewall rules we've employed on our malware analysis system (the Ubuntu VM).
Questions:
1. What IP address CIDRs are not allowed to be communicated with by our malware?
a. Hint: Cuckoo uses the IP addresses 192.168.56.1 and 192.168.56.101 to connect the
malware to the Internet.
2. What IP address is all email traffic forwarded to?
3. Do the rules accept SSH connections? (yes or no)
4. Do the rules allow the analysis machine to be ping'd on the eth0 interface? (yes or no)
5. Why do the rules drop outbound connections to ports 135, 139, and 445? (Pick your letter answer
from the choices below)
A. They are primarily used by malware to send spam.
B. They are primarily used by malware to propagate.
C. They are primarily used by malware to launch DoS attacks.
D. They are primarily used by malware to detect themselves being analyzed.
• Hint: Google these port numbers. They are well-known to be used by Windows malware.
• Hint2: http://www.berghel.net/col-edit/digital_village/dec-05/dv_12-05.php
Reflection:
Well cool. Now you've got some experience under your belt with analyzing malware. For this project
you used an analysis tool that does the analysis for you. In practice, entire teams of people are
devoted to work on a single malware executable at a time to debug it, disassemble it and study
its binary, perform static analysis techniques, dynamic analysis techniques, and other techniques
not included in Cuckoo to thoroughly understand what the malware is doing. Luckily for you, it
takes an enormous amount of time to perfect/improve the skills of malware analysis, so we didn't
require it for this project. However, to give you a scale of how much work this all takes, consider
that antivirus companies receive somewhere on the order of 250,000 samples of (possible)
malware. We had you analyze 7 binaries. Imagine the types of systems needed to handle this
amount of malware and study them thoroughly enough for that day, because the next day they're
going to receive 250,000 new samples. If a malware analysis engine is unable to analyze a piece
of malware within a day, they've already lost to malware authors. Also consider that not all of the
250,000 samples will be malicious. According to [1], as many as 3-30% may be benign!
Another way to look at the size issue of malware analysis, consider this paper [2] where the authors
discovered that notorious malware samples had actually been submitted months, even years
before the malware was detected and classified as malicious in the wild.
Remember, analyzing malware is a delicate and potentially dangerous act. Please be cautious and
use good practices when analyzing malware in the future. If you let malware run for too long, you
may be contributing to the problem and may be contacted by the FBI (and other authorities) as a
result of this unintentional malicious contribution. At Georgia Tech, researchers, professors, and
graduate students are able to analyze malware in controlled environments and have been given
permission by the research community to perform these analyses long-term. We make efforts to
contact the general research community and Georgia Tech's OIT Department to inform them that
we are running malware so they won't raise red flags if they detect malicious activity coming out
of our analysis servers.
References:
[1] Rossow, Christian, Christian J. Dietrich, Chris Grier, Christian Kreibich, Vern Paxson, Norbert
Pohlmann, Herbert Bos, and Maarten Van Steen. "Prudent Practices for Designing Malware
Experiments: Status Quo and Outlook." In Security and Privacy (SP), 2012 IEEE Symposium on,
65–79. IEEE, 2012. http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=6234405.
[2] Graziano, Mariano, Davide Canali, Leyla Bilge, Andrea Lanzi, and Davide Balzarotti. “Needles in
a Haystack: Mining Information from Public Dynamic Analysis Sandboxes for Malware
Intelligence.” In 24th USENIX Security Symposium (USENIX Security 15). USENIX Association.
Accessed September 23, 2015.
https://www.usenix.org/system/files/conference/usenixsecurity15/sec15-paper-graziano.pdf.
Also, note the mutexes you found in the malware (the DDoS’ing mutexes). Did you notice the
malware displaying any DDoS behaviors? There’s a reason you didn’t. It’s because these
mutexes do not belong to these samples of malware. Essentially the malware source is trying to
trick the (novice) malware analyst into thinking it’s one sample of malware, when it’s really
another.
In PhaseIII, we modified real-world malware source code to create real triggers seen in other real-
world malware. We designed it this way because it's nicer if we can control and determine the
malware's behavior by modifying its source.
Be careful if you ever get your hands on malware source code. We always make sure we read and
fully understand malware source code before we compile and run it. Remember, safety is the
number one priority in malware analysis.
If you're interested in reading more information about researching malware, we recommend you read
"The Art of Computer Virus Research and Defense" by Peter Szor. It's known in the research
community as a must-read for those interested in studying malware.