From 4bef7a241756ef786477028aa84761d80ad5859a Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Thu, 4 Jul 2024 14:44:57 +0900 Subject: [PATCH 1/4] Create portscan.py --- plugins/portscan.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 plugins/portscan.py diff --git a/plugins/portscan.py b/plugins/portscan.py new file mode 100644 index 0000000..47692be --- /dev/null +++ b/plugins/portscan.py @@ -0,0 +1,34 @@ +#!/usr/bin/python3 +# +# portscan.py +# NMAP port scanning wrapper for Caterpillar Proxy +# +# Caterpillar Proxy - The simple web debugging proxy (formerly, php-httpproxy) +# Namyheon Go (Catswords Research) +# https://github.com/gnh1201/caterpillar +# Created at: 2022-01-26 (github.com/gnh1201/welsonjs) +# Updated at: 2024-07-04 +# +import sys +import nmap +import json + +from base import Extension + +class PortScanner(Extension): + def __init__(self): + self.type = "rpcmethod" + self.method = "discover_ports_by_hosts" + self.exported_methods = [] + + def dispatch(self, type, id, params, conn): + hosts = params['hosts'] + binpath = params['binpath'] + + #result = nm.scan(hosts=hosts, arguments='-T5 -sV -p21-25,80,139,443,445,1883,2179,2323,3389,7547,8080,8443,8883') + result = nm.scan(hosts=hosts, arguments='-T5 -sV -p0-65535 --max-retries 0') + + return result; + +if __name__ == "__main__": + main(sys.argv) From 7d5d997881dc73eca5b917ce14e9c10f5d49d54d Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Thu, 4 Jul 2024 14:46:40 +0900 Subject: [PATCH 2/4] Update portscan.py --- plugins/portscan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/portscan.py b/plugins/portscan.py index 47692be..112028c 100644 --- a/plugins/portscan.py +++ b/plugins/portscan.py @@ -18,7 +18,7 @@ from base import Extension class PortScanner(Extension): def __init__(self): self.type = "rpcmethod" - self.method = "discover_ports_by_hosts" + self.method = "scan_ports_by_hosts" self.exported_methods = [] def dispatch(self, type, id, params, conn): From 823c97015f163246c178ed728b0f0f8376d983e0 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Thu, 4 Jul 2024 15:00:58 +0900 Subject: [PATCH 3/4] Update server.py --- server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 11b4649..a221916 100644 --- a/server.py +++ b/server.py @@ -7,7 +7,7 @@ # Namyheon Go (Catswords Research) # https://github.com/gnh1201/caterpillar # Created at: 2022-10-06 -# Updated at: 2024-06-20 +# Updated at: 2024-07-04 # import argparse @@ -502,6 +502,8 @@ if __name__== "__main__": #Extension.register(importlib.import_module("plugins.fediverse").Fediverse()) #Extension.register(importlib.import_module("plugins.container").Container()) #Extension.register(importlib.import_module("plugins.wayback").Wayback()) - + #Extension.register(importlib.import_module("plugins.bio").Bio()) + #Extension.register(importlib.import_module("plugins.nmap").PortScanner()) + # start Caterpillar start() From 32af8bd70187343cf35b47c48257981c31d9d642 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Thu, 4 Jul 2024 15:02:51 +0900 Subject: [PATCH 4/4] Rename portscan.py to nmap.py --- plugins/{portscan.py => nmap.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename plugins/{portscan.py => nmap.py} (100%) diff --git a/plugins/portscan.py b/plugins/nmap.py similarity index 100% rename from plugins/portscan.py rename to plugins/nmap.py