All Projects → Messi-Q → AMEVulDetector

Messi-Q / AMEVulDetector

Licence: other
Smart Contract Vulnerability Detection From Pure Neural Network to Interpretable Graph Feature and Expert Pattern Fusion (IJCAI-21 Accepted)

Programming Languages

python
139335 projects - #7 most used programming language
solidity
1140 projects

Projects that are alternatives of or similar to AMEVulDetector

GNNSCVulDetector
Smart Contract Vulnerability Detection Using Graph Neural Networks (IJCAI-20 Accepted)
Stars: ✭ 42 (+82.61%)
Mutual labels:  smart-contracts, vulnerability-detection
rgb-node
RGB node for both servers and mobiles
Stars: ✭ 70 (+204.35%)
Mutual labels:  smart-contracts
activeledger
Activeledger is a powerful distributed ledger technology.
Stars: ✭ 17 (-26.09%)
Mutual labels:  smart-contracts
hardhat-dependency-compiler
📦 Compile Solidity sources directly from NPM dependencies
Stars: ✭ 19 (-17.39%)
Mutual labels:  smart-contracts
permissions test
An EOSIO smart contract for testing the permission system
Stars: ✭ 12 (-47.83%)
Mutual labels:  smart-contracts
kaizen-cli
🌐🛠 Kaizen is a powerful framework combine all the blockchain technologies to help you easily develop and deploy dapps
Stars: ✭ 33 (+43.48%)
Mutual labels:  smart-contracts
bodhi-core
Smart Contracts for the Bodhi Prediction Market
Stars: ✭ 32 (+39.13%)
Mutual labels:  smart-contracts
idex-contracts-whistler
IDEX 2.0 smart contracts
Stars: ✭ 43 (+86.96%)
Mutual labels:  smart-contracts
dfk
Interact with the contracts of DefiKingdoms
Stars: ✭ 74 (+221.74%)
Mutual labels:  smart-contracts
syscoin
Syscoin is a crypto currency that is universally merge-mineable and offers a unique variety of services including decentralized identities, asset token issuance platform capabilities directly on the blockchain and trustless 0-counterparty interoptibility with the Ethereum blockchain
Stars: ✭ 152 (+560.87%)
Mutual labels:  smart-contracts
orbs-starter-kit
The starting point for writing a new application on Orbs platform
Stars: ✭ 19 (-17.39%)
Mutual labels:  smart-contracts
SQL Injection Payload
SQL Injection Payload List
Stars: ✭ 62 (+169.57%)
Mutual labels:  vulnerability-detection
clp-contracts
AMM and Continous Liquidity Provider smart contracts on NEAR blockchain
Stars: ✭ 25 (+8.7%)
Mutual labels:  smart-contracts
avain
A Modular Framework for the Automated Vulnerability Analysis in IP-based Networks
Stars: ✭ 56 (+143.48%)
Mutual labels:  vulnerability-detection
ShonyDanza
A customizable, easy-to-navigate tool for researching, pen testing, and defending with the power of Shodan.
Stars: ✭ 86 (+273.91%)
Mutual labels:  vulnerability-detection
nft-contracts
Open-source NFT contracts used by buildship.dev
Stars: ✭ 60 (+160.87%)
Mutual labels:  smart-contracts
grunt-retire
Grunt plugin for retire.
Stars: ✭ 89 (+286.96%)
Mutual labels:  vulnerability-detection
NSE-scripts
NSE scripts to detect CVE-2020-1350 SIGRED and CVE-2020-0796 SMBGHOST, CVE-2021-21972, proxyshell, CVE-2021-34473
Stars: ✭ 105 (+356.52%)
Mutual labels:  vulnerability-detection
Smart-Contract-Security-Audits
Certified Smart Contract Audits (Ethereum, Hyperledger, xDAI, Huobi ECO Chain, Binance Smart Chain, Fantom, EOS, Tezos) by Chainsulting
Stars: ✭ 325 (+1313.04%)
Mutual labels:  smart-contracts
interbit
To the end of servers
Stars: ✭ 23 (+0%)
Mutual labels:  smart-contracts

AMEVulDetector

This repo is a python implementation of our AMEVulDetector for smart contract vulnerability detection, which combines the global graph feature and local expert patterns.

Overview

The overall architecture of our proposed method is illustrated in the Figure, which consists of three components: (a) a local expert pattern extraction tool, which extracts vulnerability-specific expert patterns from the code; (b) a graph construction and normalization module, which transforms the source code into a global semantic graph; and (c) an attentive multi-encoder network that combines expert patterns and the graph feature for vulnerability detection and outputs explainable weights.

Citation

Please use this citation if you want to cite our paper or codebase in your paper:

@inproceedings{liu2021smart,
  title={Smart Contract Vulnerability Detection: From Pure Neural Network to Interpretable Graph Feature and Expert Pattern Fusion},
  author={Liu, Zhenguang and Qian, Peng and Wang, Xiang and Zhu, Lei and He, Qinming and Ji, Shouling},
   booktitle={IJCAI},
  pages={2751--2759},
  year={2021}
}

Required Packages

  • python 3 or above
  • TensorFlow 2.0 or above
  • sklearn for model evaluation
  • numpy 1.18 or above

Run the following script to install the required packages.

pip install --upgrade pip
pip install tensorflow==2.0
pip install scikit-learn
pip install numpy==1.18

Dataset

We empirically evaluate our proposed method on two benchmark datasets, namely Ethereum smart contract (ESC) and VNT Chain smart contract (VSC). Following Zhuang et al., 2020, we conduct experiments for reentrancy and timestamp dependence vulnerability on ESC, and evaluate infinite loop vulnerability on VSC.

The specific description of the two datasets can be found in Zhuang et al., 2020, while the datasets and source code are released on Github.

More details for the dataset instruction can be found on our dataset page at Smart-Contract-Dataset, which is continuously improving.

Getting started

  • To run program, use this command: python AMEVulDetector.py.
  • Also, you can use specific hyper-parameters to train the model. All the hyper-parameters can be found in parser.py.

Examples:

python AMEVulDetector.py
python AMEVulDetector.py --model EncoderWeight --lr 0.002 --dropout 0.2 --epochs 100 --batch_size 32

Case Study

We further present a case study in the following Figure, where the withdraw function is a real-world smart contract function that is vulnerable to reentrancy vulnerability. Particularly, we characterize the function code as both the global graph and three local patterns for reentrancy (respectively corresponding to the enoughBalance, callValueInvoc, balanceDeduction), which are shown in the left of the following figure. Intuitively, The weights of the global graph feature and each local pattern feature are illustrated in the right of the following figure, where our system is able to clearly explain the reasons behind our prediction.

Reference

  1. Zhuang, Yuan and Liu, Zhenguang and Qian, Peng, et al. Smart Contract Vulnerability Detection using Graph Neural Network. IJCAI, 2020. GNNSCVulDetector
  2. Qian P, Liu Z, He Q, et al. Towards automated reentrancy detection for smart contracts based on sequential models. 2020. ReChecker
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].