Skip to content
StalkPhish
Thomas Damonneville··2 min read

Using PhishingKit-Yara-Rules with ClamAV

Title card over a foggy forest: "Using PhishingKit-Yara-rules with ClamAV", StalkPhish

As a reminder, the PhishingKit-Yara-Rules project is a free and open source project which provides several dozen phishing kit detection rules contained in zip archives. You can find these rules on GitHub: https://github.com/t4d/PhishingKit-Yara-Rules

We have already covered the creation and use of Phishing Kit Yara rules in a previous post (see Using the PhishingKit-Yara-Rules project for phishing kits detection and triage).

Specifically, these are rules intended for the detection and sorting of archives of phishing kits.

GitHub page of the t4d/PhishingKit-Yara-Rules repository: 73 commits, GPL-3.0 licence, rule files such as PK_1and1_Ionos.yar

PhishingKit-Yara-Rules project GitHub page

We covered how to use the PhishingKit-Yara-Search project to use these rules, as well as VirusTotal’s use of these rules.

But do you know you can use these rules with ClamAV too?

Using PhishingKit-Yara-Rules with ClamAV

As many threat analysts, we often embed the free antivirus engine ClamAV in our analysis stacks. First, because it’s always good to check files you are manipulating during a threat analysis, and because this antivirus is free (big thanks to the dev community!).

ClamAV logo

Since the 0.99b (yes… it was 2015) you can use Yara rules to scan files in a directory, using the clamscan binary with -d argument, you force to use Yara rules as database.

First, you need to clone the rules repository:

$ git clone https://github.com/t4d/PhishingKit-Yara-Rules

Then you ‘just’ have to declare the directory of your Yara rules following the -d argument, then follow the directory you have to scan:

$ clamscan -d /data/tools/yara-phishing/rules/ /tmp/Stalkphish_phishing-kits/

The clamscan binary do what it have to do, and you just have to catch the report for the result:

clamscan output: phishing kit archives flagged with YARA.PK_* rules, including PK_XFinity_slim, and a scan summary of 300 files in 42 seconds

ClamAV scan result with PhishingKit-Yara-Rules

Yes, two lines of code, no more :)

Going further

To scan your own collections at scale, PhishingKit-Yara-Search uses the same rules, and StalkPhish.io applies them to every kit it collects to identify its kit family. You can also follow our news on LinkedIn.

Enjoy!

Related articles

Phishing campaigns move fast. So should you.

Start with a free search, or talk to us about API access and custom intelligence for your brand.