forked from lindsey98/Phishpedia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
53 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,7 @@ | |
## Instructions | ||
Requirements: | ||
- CUDA 11 | ||
- Anaconda installed, please refer to the official installation guide: https://docs.anaconda.com/free/anaconda/install/index.html | ||
|
||
1. Create a local clone of Phishpedia | ||
``` | ||
|
@@ -72,7 +73,7 @@ git clone https://github.com/lindsey98/Phishpedia.git | |
|
||
2. Setup | ||
``` | ||
cd Phishpedia | ||
cd Phishpedia/ | ||
chmod +x ./setup.sh | ||
./setup.sh | ||
``` | ||
|
@@ -84,19 +85,23 @@ conda activate myenv | |
``` | ||
|
||
Run in Python to test a single website | ||
|
||
```python | ||
from phishpedia.phishpedia_main import test | ||
import matplotlib.pyplot as plt | ||
from phishpedia.phishpedia_config import load_config | ||
|
||
url = open("phishpedia/datasets/test_sites/accounts.g.cdcde.com/info.txt").read().strip() | ||
screenshot_path = "phishpedia/datasets/test_sites/accounts.g.cdcde.com/shot.png" | ||
cfg_path = None # None means use default config.yaml | ||
ELE_MODEL, SIAMESE_THRE, SIAMESE_MODEL, LOGO_FEATS, LOGO_FILES, DOMAIN_MAP_PATH = load_config(cfg_path) | ||
ELE_MODEL, SIAMESE_THRE, SIAMESE_MODEL, LOGO_FEATS, LOGO_FILES, DOMAIN_MAP_PATH = load_config(None) | ||
|
||
phish_category, pred_target, plotvis, siamese_conf, pred_boxes = test(url, screenshot_path, | ||
ELE_MODEL, SIAMESE_THRE, SIAMESE_MODEL, LOGO_FEATS, LOGO_FILES, DOMAIN_MAP_PATH) | ||
phish_category, pred_target, plotvis, siamese_conf, pred_boxes = test(url=url, screenshot_path=screenshot_path, | ||
ELE_MODEL=ELE_MODEL, | ||
SIAMESE_THRE=SIAMESE_THRE, | ||
SIAMESE_MODEL=SIAMESE_MODEL, | ||
LOGO_FEATS=LOGO_FEATS, | ||
LOGO_FILES=LOGO_FILES, | ||
DOMAIN_MAP_PATH=DOMAIN_MAP_PATH | ||
) | ||
|
||
print('Phishing (1) or Benign (0) ?', phish_category) | ||
print('What is its targeted brand if it is a phishing ?', pred_target) | ||
|
@@ -106,12 +111,12 @@ plt.imshow(plotvis[:, :, ::-1]) | |
plt.title("Predicted screenshot with annotations") | ||
plt.show() | ||
``` | ||
Or run in the terminal to test a list of sites, copy run.py to your local machine and run | ||
|
||
Or run in bash | ||
``` | ||
python run.py --folder <folder you want to test e.g. phishpedia/datasets/test_sites> --results <where you want to save the results e.g. test.txt> --no_repeat | ||
python run.py --folder <folder you want to test e.g. phishpedia/datasets/test_sites> --results <where you want to save the results e.g. test.txt> | ||
``` | ||
|
||
|
||
## Miscellaneous | ||
- In our paper, we also implement several phishing detection and identification baselines, see [here](https://github.com/lindsey98/PhishingBaseline) | ||
- The logo targetlist described in our paper includes 181 brands, we have further expanded the targetlist to include 277 brands in this code repository | ||
|
@@ -131,4 +136,4 @@ If you find our work useful in your research, please consider citing our paper b | |
``` | ||
|
||
## Contacts | ||
If you have any issues running our code, you can raise an issue or send an email to [email protected], [email protected], and [email protected] | ||
If you have any issues running our code, you can raise an issue or send an email to [email protected], [email protected], and [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters