Giter Club home page Giter Club logo

pynetsim's Introduction

PyNetSim

About

PyNetSim is designed to be a replacement for the original INetSim project and an alternative to the excellent FakeNet-NG created by FireEye's FLARE team

PyNetSim's goal is to do dynamically detect protocols and the need for wrapping a connection via SSL/TLS in addition to trying to "speak" malware protocols for collecting network traffic, directing execution via commands sent back and keeping a malware sample running in memory to acquire viable memory dumps

PyNetSim by default only speaks protocols that are used by malware and only attempts to speak enough to deal with malware - it is not currently a viable tool to test our accurate implementations of network protocols by legitimate clients.

PyNetSim should function correctly as a route under Cuckoo Sandbox's per-analysis networking functionality described here http://docs.cuckoosandbox.org/en/latest/installation/host/routing/

PyNetSim was originally presented at FIRST 2017 in San Juan, Puerto Rico. Slides are available in the repository.

PyNetSim is written in Python3 and is currently licensed under the GPLv3 license

Protocol Support

The following protocols are supported

  • UDP and TCP DNS
    • A, AAAA, MX requests currently supported. TXT and special request handling to be added
  • SMTP, SSL both via SMTP-SSL and STARTTLS
  • FTP
  • HTTP, sub-protocols supported
    • Drive DDoS bot
    • Andromeda trojan
  • Default TCP protocol
    • Mirai
    • LizardStresser

Setup

PyNetSim achieves traffic redirection via the REDIRECT target in IPTABLES and by default listens on port 12345 which allows the daemon to be run as a normal user instead of as root

IPTables Setup using an external IP of 192.168.56.101 and a default interface named enp0s3:

sudo iptables -t nat -I PREROUTING --in-interface enp0s3 ! -d 192.168.56.101 -p tcp -j REDIRECT --to-port 12345
sudo iptables -t nat -I PREROUTING --in-interface enp0s3 ! -d 192.168.56.101 -p udp -j REDIRECT --to-port 12345

And the daemon can be run via launching the daemon.py in the root directory

python3 daemon.py

Any traffic that comes in not destined for the original source IP will now get sent to the PyNetSim daemon and all that needs to be done to setup a client to route to pynetsim is to change the default route

route add default gw 192.168.56.101

TODO

There are a number of known issues to be fixed and a number of other features to be added that are in the planning stages. Please submit any issues or feature requests via GitHub

  • Deal with shutdown bug that sometimes prevents a clean shutdown and may temporarily
  • Dynamically generate certificates using the hostname passed in via SNI
  • Fix broken telnet and IRC support
  • Create a UI to dynamically issue commands / sequences of commands to avoid hardcoding
  • Store packets / payloads / connection information for later retrieval
  • Make FTP protocol support more robust
  • More malware protocol support
  • More UDP / TCP protocol support
  • Unit Tests

pynetsim's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.