From 5052e21d97e21d0393af2f6eaf78db1d2efdadde Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 7 Dec 2021 13:25:16 -0500 Subject: [PATCH] Island: Remove /api/monkey_control/check_remote_port/ --- CHANGELOG.md | 1 + monkey/monkey_island/cc/app.py | 2 -- .../resources/monkey_control/remote_port_check.py | 14 -------------- 3 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 monkey/monkey_island/cc/resources/monkey_control/remote_port_check.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f5a59bb8..3af52e3b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/). - Max iterations and timeout between iterations config options. #1600 - MITRE ATT&CK configuration screen. #1532 - Propagation credentials from "GET /api/monkey/" endpoint. #1538 +- "GET /api/monkey_control/check_remote_port/" endpoint. #1635 ### Fixed - A bug in network map page that caused delay of telemetry log loading. #1545 diff --git a/monkey/monkey_island/cc/app.py b/monkey/monkey_island/cc/app.py index 376d0221b..5bb4b80bc 100644 --- a/monkey/monkey_island/cc/app.py +++ b/monkey/monkey_island/cc/app.py @@ -30,7 +30,6 @@ from monkey_island.cc.resources.island_mode import IslandMode from monkey_island.cc.resources.local_run import LocalRun from monkey_island.cc.resources.log import Log from monkey_island.cc.resources.monkey import Monkey -from monkey_island.cc.resources.monkey_control.remote_port_check import RemotePortCheck from monkey_island.cc.resources.monkey_control.started_on_island import StartedOnIsland from monkey_island.cc.resources.monkey_control.stop_agent_check import StopAgentCheck from monkey_island.cc.resources.monkey_download import MonkeyDownload @@ -173,7 +172,6 @@ def init_api_resources(api): api.add_resource(PropagationCredentials, "/api/propagationCredentials") api.add_resource(RemoteRun, "/api/remote-monkey", "/api/remote-monkey/") api.add_resource(VersionUpdate, "/api/version-update", "/api/version-update/") - api.add_resource(RemotePortCheck, "/api/monkey_control/check_remote_port/") api.add_resource(StartedOnIsland, "/api/monkey_control/started_on_island") api.add_resource(StopAgentCheck, "/api/monkey_control/") api.add_resource(ScoutSuiteAuth, "/api/scoutsuite_auth/") diff --git a/monkey/monkey_island/cc/resources/monkey_control/remote_port_check.py b/monkey/monkey_island/cc/resources/monkey_control/remote_port_check.py deleted file mode 100644 index 06e49b145..000000000 --- a/monkey/monkey_island/cc/resources/monkey_control/remote_port_check.py +++ /dev/null @@ -1,14 +0,0 @@ -import flask_restful -from flask import request - -from monkey_island.cc.services.remote_port_check import check_tcp_port - - -class RemotePortCheck(flask_restful.Resource): - - # Used by monkey. can't secure. - def get(self, port): - if port and check_tcp_port(request.remote_addr, port): - return {"status": "port_visible"} - else: - return {"status": "port_invisible"}