Giter VIP home page Giter VIP logo

attack-graphs's Introduction

 Coverage Status

Attack-graphs

Description

Attack graphs illustrate ways in which an adversary can exploit vulnerabilities to break into a system. System administrators evaluate attack graphs to find where their system’s weaknesses might be and to decide which security measures should be taken in order to defend their systems.

Our product helps security administrators reason about the risk posed to the various system components and to evaluate adversarial and defense strategies when signs of compromise have been found. For the future, this tool should be made available to anyone who wants to monitor and solve network vulnerability issues.

Install

To install the dependecies:

apt-get install libboost-all-dev -y
apt-get install libpcap-dev -y
apt-get install libpq-dev -y
sudo python3 setup.py install
make
npm install
cd database && python3 load.py -r

Run tests:

make test
sudo python3 setup.py test

The inference engine depends on mulval. Please follow the instructions for installation from here. To run the inference engine, you need to set the following path variables: (in case they are not set, the module will try some default paths)

MULVALROOT=<mulval_path>
XSB_DIR=<xsb_path>

Running the main application

The package needs elevated privileges as it runs the NIC in promiscuous mode.

Running a master node:

sudo python3 service.py master

Running a slave node:

sudo python3 service.py slave [master-ip]

Package options:

usage: service.py [-h] [-m MASTER] [-p PORT] [-i INTERFACE] [-s SIMULATION]
                  [-f FILTER] [-v] [-b] [-t BATCH_THREADS]
                  type

positional arguments:
  type                  The type of node run: 'master' or 'slave'

optional arguments:
  -h, --help            show this help message and exit
  -m MASTER, --master MASTER
                        Specify master IP for connecting a slave.
  -p PORT, --port PORT  Specify port for runnning a slave.
  -i INTERFACE, --interface INTERFACE
                        The network interface listened to.
  -s SIMULATION, --simulation SIMULATION
                        To run a simulated network from a network
                        configuration file use this flag.
  -f FILTER, --filter FILTER
                        Specify a mask for filtering the packets. (e.g.
                        '10.1.1.1/16' would keep packets starting with '10.1')
  -v, --verbose         Set the logging level to DEBUG.
  -b, --benchmark       Disables database and inference engine for
                        benchmarking.
  -t BATCH_THREADS, --batch_threads BATCH_THREADS
                        Number of threads that should run host discovery. (default is single-threaded)

Running on a simulated network:

sudo python3 service.py master -s [simulation-config]

The configuration files for the simulated network should be placed inside the folder simulation/confs. The simulation module looks only for the files inside simulation/confs. For an example configuration see simulation/confs/simple.json:

sudo python3 service.py master -s simple.json

Python CLI

Once the main application is running you can try to use individual component using interactive Python cli:

python3 service/cli.py

CLI options:

  -h, --help            show this help message and exit
  --echo ECHO [ECHO ...]
                        Usual echo command.
  --exit                Exit.
  --quit                Exit.
  --gen                 Send a request to the inference engine.
  --vul VUL VUL         Send a request to the database service for a
                        vulnerability. The first argument is the product. The
                        second argument is the version.
  --priv PRIV PRIV      Send a request to the database service for privilege
                        level escalation for a vulnerability. The first
                        argument is the product. The second argument is the
                        version. (e.g. `priv windows_2000 *`)
  --graph               Send a request to the local graph service.
  --packet              Send a request to the local sniffer service.

Benchmarks

To run benchmarks:

sudo python3 simulation/benchmarks.py

The simulations are run on random overlay topologies with fixed number of nodes and edges. Random packets get generated whenever the simulation module connection gets a call within a fixed timeout of 0.5 seconds, whereas the scans are generated within a timeout of 3 seconds.

Results of the simulations can be found in the folder simulation/res and were generated on a single machine.

Front-end

Staring the graphical user interface:

npm start

attack-graphs's People

Contributors

adicatana avatar danalex97 avatar isailaandrei avatar johnny90 avatar maurizio-zen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

attack-graphs's Issues

Refactoring

  • Add client
  • Restructure folders as:
    • topology
      • sniffer
        • sniffer
        • sniffer utilities
      • graph
        • graph
        • graph_service
        • populator
      • discovery
        • discovery.py
        • C++ code
    • database
    • inference engine
      - fact engine
      - mulval
      - inference_service
  • Move each service to a [service]_service.py file

Mulval improvements

Finish mulval integration and model new privilege levels:

  • localRoot
  • globalRoot
  • localUser

Update README

  • with parts of presentation
  • with new flags
  • with CLI and front-end snapshots

Travis Build Fails

After we added some integration tests with the database, the Travis build seems to not pass any more at the database loading step.

Database searches

We need to investigate more types of data searches in the in-memory database.

Release v4.3

Add release tag before submitting. Package Wiki with the project before submission.

Concurrency issues

Currently the basic application runs 17 threads on one process. This has to be investigated to yield better results.

Make topologies for presentation

Make topologies for presentation using:

  • GNS3 for topology diagram
  • simulation/conf to run the application

To look:

  • what vulnerabilities to put up
  • how would the attack graph look

NVD files link changed

Hi,

I am installing attack-graphs. I think the links for downloading NVD files are expired.

Here is the error

Starting download of NVD files ...

Starting download of https://static.nvd.nist.gov/feeds/json/cve/1.0/nvdcve-1.0-modified.json.gz
--2023-02-12 23:37:18--  https://static.nvd.nist.gov/feeds/json/cve/1.0/nvdcve-1.0-modified.json.gz
Resolving static.nvd.nist.gov (static.nvd.nist.gov)... 54.85.30.225, 132.163.4.64, 129.6.13.8, ...
Connecting to static.nvd.nist.gov (static.nvd.nist.gov)|54.85.30.225|:443... connected.
HTTP request sent, awaiting response... 404
2023-02-12 23:37:18 ERROR 404: (no description).

ERROR: Downloading of https://static.nvd.nist.gov/feeds/json/cve/1.0/nvdcve-1.0-modified.json.gz failed.
Traceback (most recent call last):
  File "/mnt/c/Users/naftabi/Desktop/AGMulVal/attack-graphs/database/load.py", line 101, in <module>
    parse(file_name)
  File "/mnt/c/Users/naftabi/Desktop/AGMulVal/attack-graphs/database/load.py", line 43, in parse
    with open(os.path.join(DIRECTORY, nvdcve_json)) as data_file:
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/c/Users/naftabi/Desktop/AGMulVal/attack-graphs/database/nvdcve-1.0-2002.json'

Fix coverage

The coverage is calculated from packages, not just from sources...

Front-end data collecting

The data for the front-end is not got from a service, but rather from a file. This should be changed.

Report

Write here what we need for the report.

Clients and CLI

  • Add clients to each present service
  • Update the CLI to use Clients.

CMakeFile

Move to CMakeFile instead of Make to be able to build simpler and be able to use C++ coverage.

Inference Engine

Write and document an initial version of the inference engine.

Error handling - NMAP

Nmap error handling in service/discovery.py seems to be quite bad for the moment.

File indexed.idx not found

Trying to run the following command after which get the following error:

sudo python3 setup.py test
FileNotFoundError: [Errno 2] No such file or directory: '/home/dell/mtech/attack-graphs/database/indexed.idx'

How to resolve?

‘make test’ command error

Trying to run the following command after which get the following error:
root@zkai-virtual-machine:/home/zkai/Documents/attack-graphs-master# make test
wget -O tests/topology/discovery/parser/Catch.hpp https://raw.githubusercontent.com/cyberImperial/Catch2/master/single_include/catch2/catch.hpp
--2020-04-17 12:56:45-- https://raw.githubusercontent.com/cyberImperial/Catch2/master/single_include/catch2/catch.hpp
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 0.0.0.0, ::
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|0.0.0.0|:443... failed: Connection refused.
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|::|:443... failed: Connection refused.
Makefile:17: recipe for target 'catch.o' failed
make: *** [catch.o] Error 4

How to resolve? Thank you!

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.