Skip to content
/ CoVerD Public

Python implementation of CoVerD, a community-based approach for protecting nodes against network crawling attacks, from our Complex Networks 2021 paper.

License

Notifications You must be signed in to change notification settings

Pegayus/CoVerD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoVerD: Community-based Vertex Defense against Crawling Adversaries

This is the code for our paper CoVerD: Community-based Vertex Defense against Crawling Adversaries which appeared in the proceedings of Complex Networks 2021. CoVerD is a community-based approach that protects a given target node against crawling-based attacks in a network. CoVerD surpasses global network protectors on several benchmarks, while maintaining the computation cost close to that of the local network protectors. In this repository, you find both the python implementation for CoVerD and the scripts for reproducing our experiments.

Scripts under src:

  • data_preprocessing.py: Run this script seperately from the rest of the repo to prepare the dataset used by main.py.
  • coverd.py: The code for our algorithm, CoVerD. This script is used by main.py.
  • attacker.py: The local and global perturbation baselines that we have used in the paper to benchmark CoVerD. This script is used by main.py.
  • utils.py: The helper functions used througout the repository.
  • main.py: The main script that invokes all the processing done by the modules above. To reproduce our experiments, you have to run this script as explained below.

Data

  • data/raw: All the dataset are available from SNAP repository. The original datasets are processed using data_preprocessing.py into pickled files. This data will later be used to run a defender and/or attacker on.
  • data/defended: The defended graphs after running all our defender baselines on the raw datasets. Only lastfm data is included in this repository as a sample. The other datasets can be generated by running main.py on corresponding data under data/raw.

Results

A sample result of our experiments in the paper for the lastfm dataset is included under /results directory.

Usage:

Arguments

The implemented attributes for calling main.py are as follows,

  • --name: The name of the dataset.
  • --mode: The mode of action. Possible options are attack and defense.
  • --defend: The set of defenders to use. The implemented defenders are coverd, roam, greedy, nothing (na"ive baseline), betweenness, pagerank, and maxdeg.
  • --attack: The set of attackers to use. The implemented attackers are bfs, dfs, and rw (random walk).
  • --dpath: The path to read the data for defender.
  • --apath: The path to read the data for attacker.
  • --dsave2: The path to save the defense results in.
  • --asave2: The path to save the attack results in.

Sample Usage

Defense mode

python main.py --mode defense --defend coverd roam nothing --name lastfm 

Attack mode

python main.py --mode attack --attack bfs dfs --name lastfm 

About

Python implementation of CoVerD, a community-based approach for protecting nodes against network crawling attacks, from our Complex Networks 2021 paper.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages