Skip to content

Execution

RedByte edited this page Feb 11, 2024 · 1 revision

This page will describe the command line options available in GraphSpy. For information on how to use the application itself, refer to the GraphSpy Usage section on this wiki.

Quick Start

After installing GraphSpy, running the GraphSpy application with its default configuration is as easy as running it without any arguments.

# Execute GraphSpy with default config
graphspy

   ________                             _________
  /       /  by RedByte1337    __      /        /      vX.X.X
 /  _____/___________  ______ |  |__  /   _____/_____ ______ 
/   \  __\_  __ \__  \ \____ \|  |  \ \_____  \\____ \   |  |
\    \_\  \  | \/  __ \|  |_> |   \  \/        \  |_> \___  |
 \______  /__|  |____  |   __/|___|  /_______  /   ___/ ____|
        \/           \/|__|        \/        \/|__|   \/
                
[*] Utilizing database '/home/redbyte/.gspy/databases/database.db'.
[*] Starting GraphSpy. Open in your browser by going to the url displayed below.

 * Serving Flask app 'GraphSpy.GraphSpy'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5000
Press CTRL+C to quit

From that point, you can access GraphSpy by browsing to http://127.0.0.1:5000.

(The warning message from Flask is normal and can be ignored.)

Custom interface

If you want to run GraphSpy on a custom interface and port, you can use the -i and -p options respectively.

For example, to run GraphSpy on http://192.168.0.10:8080 instead, the following command can be used:

graphspy -i 192.168.0.10 -p 8080

If you want to run GrahpSpy on all interfaces, use -i 0.0.0.0. Once GraphSpy is successfully started, the output will show a list of every interface it is listening on.

graphspy -i 0.0.0.0 -p 8080

WARNING: GraphSpy is intended to be executed and accessed from your local machine through a localhost interface. It is not safe to expose the application on an untrusted network where other people might be able to access it, since there is no authentication built-in! In any case, never make GraphSpy accessible from the internet without restricting access through other means such as a reverse proxy, or source IP whitelist. Unauthorized access to your GraphSpy instance would not only put your system at risk, but also all sensitive information from your targets (such as access and refresh tokens) stored in the GraphSpy database.

Custom database

By default, GraphSpy will initialize and connect to the default database.db. While you can easily create and change between databases from the GraphSpy settings page after launching the application, the -d <database_name> allows you to select which database to connect to on launch.

If no database with the provided name exists yet, GraphSpy will automatically create a new database.

All databases are stored at ~/.gspy/databases/. The folder structure is initialized at the first launch.

# Launch GraphSpy and connect to the acme.db database.
# If it does not exist yet, GraphSpy will create it
graphspy -d acme
# OR
graphspy -d acme.db

Other arguments

To check the other options available in GraphSpy, use the -h flag to display the help message.

graphspy -h                                                                                                                                                                                                                                                                                                            

   ________                             _________
  /       /  by RedByte1337    __      /        /      vX.X.X
 /  _____/___________  ______ |  |__  /   _____/_____ ______ 
/   \  __\_  __ \__  \ \____ \|  |  \ \_____  \\____ \   |  |
\    \_\  \  | \/  __ \|  |_> |   \  \/        \  |_> \___  |
 \______  /__|  |____  |   __/|___|  /_______  /   ___/ ____|
        \/           \/|__|        \/        \/|__|   \/
                
usage: GraphSpy [-h] [-i INTERFACE] [-p PORT] [-d DATABASE] [--debug]

Launches the GraphSpy Flask application

options:
  -h, --help            show this help message and exit
  -i INTERFACE, --interface INTERFACE
                        The interface to bind to. Use 0.0.0.0 for all interfaces. (Default = 127.0.0.1)
  -p PORT, --port PORT  The port to bind to. (Default = 5000)
  -d DATABASE, --database DATABASE
                        Database file to utilize. (Default = database.db)
  --debug               Enable flask debug mode. Will show detailed stack traces when an error occurs.

For more information, see https://github.com/RedByte1337/GraphSpy