Python-Honeypot icon indicating copy to clipboard operation
Python-Honeypot copied to clipboard

Api for running modules

Open spiderxm opened this issue 2 years ago • 0 comments

Description

Added an API for getting details of running modules. This will work when we run our APIs via python ohp.py --start-api-server. But will not work with docker-compose up. For that we need to enable docker in docker to run docker commands from running containers. Looking for its solutions

Motivation and Context

To add a panel in Python-Honepot UI with details of running modules.

Reviewers

@dhirensr

How Has This Been Tested?

It has been tested locally.

GET http://localhost:5001/api/core/running/modules

[
    {
        "Command": "\"/bin/sh -c 'service…\"",
        "CreatedAt": "2022-07-27 21:49:43 +0530 IST",
        "ID": "b5760a5cc113",
        "Image": "ohp_ftpserver_weak_password",
        "Labels": "desktop.docker.io/binds/0/SourceKind=hostFile,desktop.docker.io/binds/0/Target=/root,desktop.docker.io/binds/0/Source=/Users/mrigankanand/PycharmProjects/Python-Honeypot/tmp/ohp_ftp_weak_container/",
        "LocalVolumes": "0",
        "Mounts": "/host_mnt/User…",
        "Names": "ohp_ftpserver_weak_password",
        "Networks": "ohp_internet",
        "Ports": "0.0.0.0:21->21/tcp",
        "RunningFor": "2 hours ago",
        "Size": "3B (virtual 293MB)",
        "State": "running",
        "Status": "Up 2 hours"
    }
]

Screenshots (if appropriate):

Screenshot 2022-07-27 at 11 47 26 PM

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Other

Checklist

  • [x] I have followed the Contributor Guidelines.
  • [x] The code has been thoroughly tested in my local development environment with flake8 and pylint.
  • [x] The code is Python 3 compatible.
  • [x] The code follows the PEP8 styling guidelines with 4 spaces indentation.
  • [x] I have added the relevant documentation.
  • [x] My branch is up-to-date with the Upstream master branch.

spiderxm avatar Jul 27 '22 18:07 spiderxm