Using LOKI and its Yara rule set
Last updated
Was this helpful?
Last updated
Was this helpful?
Password: infected
9.1 Using LOKI
As a security analyst, you may need to research various threat intelligence reports, blog postings, etc. and gather information on the latest tactics and techniques used in the wild, past or present. Typically in these readings, IOCs (hashes, IP addresses, domain names, etc.) will be shared so rules can be created to detect these threats in your environment, along with Yara rules. On the flip side, you might find yourself in a situation where you've encountered something unknown, that your security stack of tools can't/didn't detect. Using tools such as Loki, you will need to add your own rules based on your threat intelligence gathers or findings from an incident response engagement (forensics).
As mentioned before, Loki already has a set of Yara rules that we can benefit from and start scanning for evil on the endpoint straightaway.
Navigate to the Loki directory. Loki is located in the tools
.
Run python loki.py -h
to see what options are available.
If you are running Loki on your own system, the first command you should run is --update
. This will add the signature-base
directory, which Loki uses to scan for known evil. This command was already executed within the attached VM.
Navigate to the yara
directory. Feel free to inspect the different Yara files used by Loki to get an idea of what these rules will hunt for.
To run Loki, you can use the following command (note that I am calling Loki from within the file 1 directory)
Scenario: You are the security analyst for a mid-size law firm. A co-worker discovered suspicious files on a web server within your organization. These files were discovered while performing updates to the corporate website. The files have been copied to your machine for analysis. The files are located in the suspicious-files
directory. Use Loki to answer the questions below.
Scan file 1. Does Loki detect this file as suspicious/malicious or benign?
What Yara rule did it match on?
What does Loki classify this file as?
Based on the output, what string within the Yara rule did it match on?
What is the name and version of this hack tool?
Inspect the actual Yara file that flagged file 1. Within this rule, how many strings are there to flag this file?
Scan file 2. Does Loki detect this file as suspicious/malicious or benign?
Inspect file 2. What is the name and version of this web shell?