code-philia / Dynaphish

Dynaphish: A complementary module for any reference-based phishing detector with BrandKnowledgeExpansion and WebInteraction
11 stars 1 forks source link

DynaPhish

Official repository for "Knowledge Expansion and Counterfactual Interaction for Reference-Based Phishing Detection". Published in USENIX Security 2023.

![Dialogues](https://img.shields.io/badge/DynaPD\_Benchmark\_Size-6K-green?style=flat-square) ![Dialogues](https://img.shields.io/badge/MyXdriver-Released-green?style=flat-square)

DynaPD 6K Phishing Kits Online VersionDynaPD 6K Phishing Kits Source CodeWebInteraction Driver: MyXdriverPaperWebsiteCitation

Introduction

Existing reference-based phishing detectors:

In this work, we propose a framework called DynaPhish, as a complementary module for all reference-based phishing detectors. Our contributions lie in three folds:

Framework

Dynaphish consists of the following steps:

Project Structure

|_ knowledge_expansion: Knowledge Expansion Module
  |_ brand_knowledge_online.py: Knowledge Expansion Class
|_ field_study_logo2brand: testing scripts
  |_ configs_template.yaml: configuration file for the models
  |_ dynaphish_main.py: main script

Setup

Requirements

Implemented and tested on Ubuntu 16.04 and 20.04, CUDA 11.1, cuDNN 10.1. Should work on other Debian-based systems as well.

  1. Install the required packages by

    chmod +x setup.sh
    export ENV_NAME="dynaphish" && ./setup.sh

    This script will create a new conda environment called dynaphish.

  2. Update the configuration file for the knowledge expansion module

    chmod +x update_config.sh
    ./update_config.sh
  3. Create a google cloud service account, set the billing details

    • Create a project, enable "Custom Search API", "Cloud Vision API"
    • For "Custom Search API", get the API Key and Search Engine ID following this guide.
    • Create a blank txt file in the directory "knowledge_expansion/api_key.txt", copy and paste your API Key and Search Engine ID into the txt file like the following:
      [YOUR_API_KEY]
      [YOUR_SEARCH_ENGINE_ID]
    • For "Cloud Vision API", download the JSON key following this guide, save the JSON file under "knowledge_expansion/discoverylabel.json"
  4. The main script is field_study_logo2brand/dynaphish_main.py

    conda activate dynaphish
    python -m field_study_logo2brand.dynaphish_main --folder [folder_to_test, e.g. datasets/test_sites] 

Citation

If you find our work useful, please consider citing our paper :)

@inproceedings {291106,
    author = {Ruofan Liu and Yun Lin and Yifan Zhang and Penn Han Lee and Jin Song Dong},
    title = {Knowledge Expansion and Counterfactual Interaction for {Reference-Based} Phishing Detection},
    booktitle = {32nd USENIX Security Symposium (USENIX Security 23)},
    year = {2023},
    isbn = {978-1-939133-37-3},
    address = {Anaheim, CA},
    pages = {4139--4156},
    url = {https://www.usenix.org/conference/usenixsecurity23/presentation/liu-ruofan},
    publisher = {USENIX Association},
    month = aug,
}

Contacts

I you encounter any issues in code deployment, please reach us via Email or create an issue in the repository: liu.ruofan16@u.nus.edu, lin_yun@sjtu.edu.cn