Skip to content
A small course on exploiting and defending neural networks
Python
Branch: master
Clone or download
Kayzaks Updated Article
- Added some references
- Fixed a few grammar errors
- Found out that black irises are super rare and that the typical colors are brown, green and blue. Improved Figure 20 accordingly.
Latest commit 4a3b2cf Nov 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
0_LastLayerAttack Exercises Oct 15, 2019
1_Backdooring Exercises Oct 15, 2019
2_ExtractingInformation Exercises Oct 15, 2019
3_BruteForcing Exercises Oct 15, 2019
4_NeuralOverflow Exercises Oct 15, 2019
5_MalwareInjection Exercises Oct 15, 2019
6_NeuralObfuscation Exercises Oct 15, 2019
7_BugHunter Version 1.0 Nov 16, 2019
8_GPUAttack Exercises Oct 15, 2019
.gitattributes Initial commit Oct 15, 2019
.gitignore Initial commit Oct 15, 2019
Article.pdf Updated Article Nov 17, 2019
LICENSE Initial commit Oct 15, 2019
README.md Fixed Typo Nov 16, 2019

README.md

Hacking Neural Networks: A Short Introduction

Disclaimer: This article and all the associated exercises are for educational purposes only.

This is a short introduction on methods that use neural networks in an offensive manner (bug hunting, shellcode obfuscation, etc.) and how to exploit neural networks found in the wild (information extraction, malware injection, backdooring, etc.).

Most of the methods presented are accompanied by an exercise found in this repo. The full article can be found here in 'Article.pdf' or on arXiv (uploaded soon).


Setup

Python and pip

Download and install Python3 and its package installer pip using a package manager or directly from the website https://www.python.org/downloads/.

Editor

An editor is required to work with the code, preferably one that allows code highlighting for Python. Vim/Emacs will do. As a reference, all exercises were prepared using Visual Studio Code https://code.visualstudio.com/docs/python/python-tutorial.

Packages

  • Keras: Installing Keras can be tricky. We refer to the official installation guide at https://keras.io/#installation and suggest TensorFlow as a backend (using the GPU-enabled version, if one is available on the machine).
  • NumPy and SciPy: NumPy and SciPy are excellent helper packages, which are used throughout all exercises. Following the official SciPy instructions should also install NumPy https://www.scipy.org/install.html.
  • PyCuda: PyCuda is required for the GPU-based attack exercise. If no nVidia GPU is available on the machine, this can be skipped. https://wiki.tiker.net/PyCuda/Installation
  • NLTK: NLTK provides functionalities for natural language processing and is very helpful for some of the exercises. https://www.nltk.org/install.html

The exercises

  • 0 - Last Layer Attack
  • 1 - Backdooring
  • 2 - Extracting Information
  • 3 - Brute Forcing
  • 4 - Neural Overflow
  • 5 - Malware Injection
  • 6 - Neural Obfuscation
  • 7 - Bug Hunting
  • 8 - GPU Attack

For instructions, please read the 'README.md' file in each of the exercise directories.


What else?

The neural networks found in the exercises are based on the examples provided by keras.

Also check out Isao Takaesu's course on Security and Machine Learning.

If you find that there are errors or missing references, feel free to make a PR or contact me.

You can’t perform that action at this time.