koi-handler 0.12.5__tar.gz → 0.12.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {koi_handler-0.12.5/src/koi_handler.egg-info → koi_handler-0.12.6}/PKG-INFO +1 -5
- {koi_handler-0.12.5 → koi_handler-0.12.6}/pyproject.toml +2 -11
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/main.py +10 -11
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/mcp/server.py +106 -79
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/ui.py +9 -4
- {koi_handler-0.12.5 → koi_handler-0.12.6/src/koi_handler.egg-info}/PKG-INFO +1 -5
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi_handler.egg-info/SOURCES.txt +0 -1
- koi_handler-0.12.5/src/koi_handler.egg-info/requires.txt +0 -5
- {koi_handler-0.12.5 → koi_handler-0.12.6}/LICENSE +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/setup.cfg +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/listener.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/mcp/__init__.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/mcp/schema.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/blueprint.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/download.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/duplicate.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/get_processes.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/get_users.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/ligolo.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/loader.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/network_enum.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/peas.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/populate_win.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/secrets_dump.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/sharphound.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/ssh_persist.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/sysinfo.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/upload.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/upload64.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/wifi_enum.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/modules/winscalate.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/session.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/tunnel/__init__.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/tunnel/agent_payload.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/tunnel/engine/__init__.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/tunnel/engine/__main__.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/tunnel/engine/agent.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/tunnel/engine/packet.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/tunnel/engine/proxy.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/tunnel/engine/stack.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/tunnel/engine/tcp.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/tunnel/engine/transport.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/tunnel/engine/tun.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/tunnel/manager.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/__init__.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/bash_obfuscate.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/cache.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/cli.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/config.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/config_ui.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/connect/__init__.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/connect/base.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/connect/ntlm.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/connect/ssh.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/connect/winrm.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/connect/wsman.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/constants.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/detect.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/interact.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/logger.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/models.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/obfuscate_ui.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/payloads.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/powerupgrade.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/ps_obfuscate.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/tcp.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/terminal.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi/utils/tls.py +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi_handler.egg-info/dependency_links.txt +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi_handler.egg-info/entry_points.txt +0 -0
- {koi_handler-0.12.5 → koi_handler-0.12.6}/src/koi_handler.egg-info/top_level.txt +0 -0
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: koi-handler
|
|
3
|
-
Version: 0.12.
|
|
3
|
+
Version: 0.12.6
|
|
4
4
|
Summary: Reverse shell listener
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
License-File: LICENSE
|
|
7
|
-
Requires-Dist: mcp>=2.0
|
|
8
|
-
Requires-Dist: uvicorn>=0.30
|
|
9
|
-
Requires-Dist: starlette>=0.40
|
|
10
|
-
Provides-Extra: mcp
|
|
11
7
|
Dynamic: license-file
|
|
@@ -4,19 +4,10 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "koi-handler"
|
|
7
|
-
version = "0.12.
|
|
7
|
+
version = "0.12.6"
|
|
8
8
|
description = "Reverse shell listener"
|
|
9
9
|
requires-python = ">=3.10"
|
|
10
|
-
dependencies = [
|
|
11
|
-
"mcp>=2.0",
|
|
12
|
-
"uvicorn>=0.30",
|
|
13
|
-
"starlette>=0.40",
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
[project.optional-dependencies]
|
|
17
|
-
# Kept as an empty alias so `pipx install "koi-handler[mcp]"` still resolves for
|
|
18
|
-
# anyone with it in a script or doc; the deps now live in core.
|
|
19
|
-
mcp = []
|
|
10
|
+
dependencies = []
|
|
20
11
|
|
|
21
12
|
[project.scripts]
|
|
22
13
|
koi = "koi.main:main"
|
|
@@ -7,7 +7,7 @@ import sys
|
|
|
7
7
|
|
|
8
8
|
from koi.listener import Listener
|
|
9
9
|
from koi.utils.config import CONFIG
|
|
10
|
-
from koi.utils.ui import notify, display_art, print_payloads, __version__
|
|
10
|
+
from koi.utils.ui import notify, display_art, print_payloads, __version__, _PKG_NAME
|
|
11
11
|
from koi.utils.obfuscate_ui import run_obfuscate_ui
|
|
12
12
|
from koi.utils.logger import review as _review
|
|
13
13
|
from koi.utils.logger import clear_log as _clear_log
|
|
@@ -104,14 +104,18 @@ def _print_version() -> None:
|
|
|
104
104
|
if latest == local:
|
|
105
105
|
print(dim("up to date"))
|
|
106
106
|
else:
|
|
107
|
-
|
|
107
|
+
if _PKG_NAME == "koi":
|
|
108
|
+
hint = dim("sudo apt update && sudo apt upgrade koi")
|
|
109
|
+
else:
|
|
110
|
+
hint = dim("pipx upgrade koi-handler")
|
|
111
|
+
print(f"\n{accent(f'v{latest}')} is available!\n{hint}")
|
|
108
112
|
except Exception:
|
|
109
113
|
print(dim(" could not check for updates"))
|
|
110
114
|
|
|
111
115
|
|
|
112
116
|
def main():
|
|
113
117
|
parser = argparse.ArgumentParser(
|
|
114
|
-
description="koi
|
|
118
|
+
description="koi, multi-session reverse shell listener",
|
|
115
119
|
add_help=False,
|
|
116
120
|
)
|
|
117
121
|
parser.add_argument("-h", "--help", action=_ArtHelpAction, help="show this help message and exit")
|
|
@@ -198,12 +202,7 @@ def main():
|
|
|
198
202
|
keep_history=args.keep_history, no_log=not args.logging)
|
|
199
203
|
|
|
200
204
|
if args.mcp:
|
|
201
|
-
from koi.mcp.server import KoiMCPServer
|
|
202
|
-
|
|
203
|
-
if missing := missing_dependencies():
|
|
204
|
-
notify('error', f"MCP dependencies missing: {', '.join(missing)}")
|
|
205
|
-
notify('status', "Reinstall to restore them: pipx install --force koi-handler")
|
|
206
|
-
sys.exit(1)
|
|
205
|
+
from koi.mcp.server import KoiMCPServer
|
|
207
206
|
|
|
208
207
|
listener.mcp_server = KoiMCPServer(
|
|
209
208
|
listener,
|
|
@@ -226,7 +225,7 @@ def main():
|
|
|
226
225
|
|
|
227
226
|
def koireview():
|
|
228
227
|
parser = argparse.ArgumentParser(
|
|
229
|
-
description="koireview
|
|
228
|
+
description="koireview, review a recorded Koi session",
|
|
230
229
|
add_help=False,
|
|
231
230
|
)
|
|
232
231
|
parser.add_argument("-h", "--help", action=_ArtHelpAction, help="show this help message and exit")
|
|
@@ -261,7 +260,7 @@ def koireview():
|
|
|
261
260
|
|
|
262
261
|
def obfuscator():
|
|
263
262
|
parser = argparse.ArgumentParser(
|
|
264
|
-
description="koifuscator
|
|
263
|
+
description="koifuscator, payload obfuscator",
|
|
265
264
|
add_help=False,
|
|
266
265
|
)
|
|
267
266
|
parser.add_argument("-h", "--help", action=_ArtHelpAction, help="show this help message and exit")
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
"""MCP server over HTTP,
|
|
1
|
+
"""MCP server over HTTP, stdlib only: no external SDK needed."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
import asyncio
|
|
6
5
|
import base64
|
|
7
6
|
import contextlib
|
|
7
|
+
import hmac
|
|
8
8
|
import io
|
|
9
9
|
import json
|
|
10
10
|
import logging
|
|
11
11
|
import ntpath
|
|
12
12
|
import posixpath
|
|
13
13
|
import secrets
|
|
14
|
+
import socketserver
|
|
14
15
|
import sys
|
|
15
16
|
import threading
|
|
16
17
|
import time
|
|
18
|
+
from http.server import BaseHTTPRequestHandler, HTTPServer
|
|
17
19
|
from pathlib import Path
|
|
18
20
|
from typing import TYPE_CHECKING, Any, Dict, List, Optional
|
|
19
21
|
|
|
@@ -62,13 +64,7 @@ _EXEC_ONLY_TOOLS = {
|
|
|
62
64
|
"koi_session_write", "koi_session_read", "koi_session_signal",
|
|
63
65
|
}
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
def missing_dependencies() -> List[str]:
|
|
69
|
-
import importlib.util
|
|
70
|
-
|
|
71
|
-
return [n for n in _REQUIRED_PACKAGES if importlib.util.find_spec(n) is None]
|
|
67
|
+
_PROTOCOL_VERSIONS = ("2025-06-18", "2025-03-26", "2024-11-05")
|
|
72
68
|
|
|
73
69
|
|
|
74
70
|
def _cap(text: str) -> tuple[str, bool]:
|
|
@@ -141,17 +137,19 @@ def _uptime(since: Optional[float]) -> Optional[str]:
|
|
|
141
137
|
def _version() -> str:
|
|
142
138
|
from importlib.metadata import PackageNotFoundError, version
|
|
143
139
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
140
|
+
for candidate in ("koi-handler", "koi"):
|
|
141
|
+
try:
|
|
142
|
+
return version(candidate)
|
|
143
|
+
except PackageNotFoundError:
|
|
144
|
+
continue
|
|
145
|
+
return "unknown"
|
|
148
146
|
|
|
149
147
|
|
|
150
148
|
def _tool(name: str, description: str, properties=None, required=None, annotations=None) -> Dict[str, Any]:
|
|
151
149
|
schema: Dict[str, Any] = {"type": "object", "properties": properties or {}}
|
|
152
150
|
if required:
|
|
153
151
|
schema["required"] = required
|
|
154
|
-
tool: Dict[str, Any] = {"name": name, "description": description, "
|
|
152
|
+
tool: Dict[str, Any] = {"name": name, "description": description, "inputSchema": schema}
|
|
155
153
|
if annotations:
|
|
156
154
|
tool["annotations"] = annotations
|
|
157
155
|
return tool
|
|
@@ -896,82 +894,111 @@ class KoiMCPServer:
|
|
|
896
894
|
"keys (e.g. ctrl_c) with koi_session_signal."
|
|
897
895
|
)
|
|
898
896
|
|
|
899
|
-
def
|
|
900
|
-
|
|
901
|
-
|
|
897
|
+
def _dispatch(self, method: str, params: Optional[Dict[str, Any]]) -> Optional[Dict[str, Any]]:
|
|
898
|
+
if method == "initialize":
|
|
899
|
+
client_version = (params or {}).get("protocolVersion", _PROTOCOL_VERSIONS[0])
|
|
900
|
+
version = client_version if client_version in _PROTOCOL_VERSIONS else _PROTOCOL_VERSIONS[0]
|
|
901
|
+
return {
|
|
902
|
+
"protocolVersion": version,
|
|
903
|
+
"capabilities": {"tools": {"listChanged": False}, "resources": {"listChanged": False}},
|
|
904
|
+
"serverInfo": {"name": "koi", "version": _version(), "title": "Koi"},
|
|
905
|
+
"instructions": self._instructions(),
|
|
906
|
+
}
|
|
902
907
|
|
|
903
|
-
|
|
904
|
-
return
|
|
908
|
+
if method == "tools/list":
|
|
909
|
+
return {"tools": self._list_tools()}
|
|
905
910
|
|
|
906
|
-
|
|
911
|
+
if method == "tools/call":
|
|
912
|
+
name = (params or {}).get("name", "")
|
|
913
|
+
arguments = (params or {}).get("arguments") or {}
|
|
907
914
|
try:
|
|
908
|
-
text =
|
|
909
|
-
self.call_tool, params.name, params.arguments or {}
|
|
910
|
-
)
|
|
915
|
+
text = self.call_tool(name, arguments)
|
|
911
916
|
except Exception as exc:
|
|
912
|
-
return
|
|
913
|
-
content
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
return
|
|
917
|
+
return {
|
|
918
|
+
"content": [{"type": "text", "text": f"{type(exc).__name__}: {exc}"}],
|
|
919
|
+
"isError": True,
|
|
920
|
+
}
|
|
921
|
+
return {"content": [{"type": "text", "text": text}]}
|
|
917
922
|
|
|
918
|
-
|
|
919
|
-
return
|
|
920
|
-
resources=[types.Resource(**r) for r in self.list_resources()]
|
|
921
|
-
)
|
|
923
|
+
if method == "resources/list":
|
|
924
|
+
return {"resources": self.list_resources()}
|
|
922
925
|
|
|
923
|
-
|
|
924
|
-
uri =
|
|
925
|
-
text =
|
|
926
|
-
return
|
|
927
|
-
contents=[types.TextResourceContents(uri=uri, mime_type="text/plain", text=text)]
|
|
928
|
-
)
|
|
926
|
+
if method == "resources/read":
|
|
927
|
+
uri = (params or {}).get("uri", "")
|
|
928
|
+
text = self.read_resource(str(uri))
|
|
929
|
+
return {"contents": [{"uri": str(uri), "mimeType": "text/plain", "text": text}]}
|
|
929
930
|
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
)
|
|
941
|
-
inner = server.streamable_http_app(streamable_http_path="/mcp", host=self.host)
|
|
942
|
-
|
|
943
|
-
async def app(scope, receive, send):
|
|
944
|
-
scope_type = scope.get("type")
|
|
945
|
-
if scope_type == "http":
|
|
946
|
-
from starlette.responses import JSONResponse
|
|
947
|
-
|
|
948
|
-
headers = dict(scope.get("headers") or [])
|
|
949
|
-
provided = headers.get(b"authorization", b"").decode(errors="replace")
|
|
950
|
-
if not secrets.compare_digest(provided, f"Bearer {self.token}"):
|
|
951
|
-
await JSONResponse({"error": "unauthorized"}, status_code=401)(
|
|
952
|
-
scope, receive, send
|
|
953
|
-
)
|
|
954
|
-
return
|
|
955
|
-
elif scope_type != "lifespan":
|
|
956
|
-
return
|
|
957
|
-
await inner(scope, receive, send)
|
|
931
|
+
if method.startswith("notifications/"):
|
|
932
|
+
return None
|
|
933
|
+
|
|
934
|
+
raise ValueError(f"Method not found: {method}")
|
|
935
|
+
|
|
936
|
+
def _handle_jsonrpc(self, body: bytes) -> Optional[bytes]:
|
|
937
|
+
try:
|
|
938
|
+
msg = json.loads(body)
|
|
939
|
+
except (json.JSONDecodeError, UnicodeDecodeError):
|
|
940
|
+
return json.dumps({"jsonrpc": "2.0", "id": None, "error": {"code": -32700, "message": "Parse error"}}).encode()
|
|
958
941
|
|
|
959
|
-
|
|
942
|
+
req_id = msg.get("id")
|
|
943
|
+
method = msg.get("method", "")
|
|
944
|
+
params = msg.get("params")
|
|
945
|
+
|
|
946
|
+
if req_id is None and method.startswith("notifications/"):
|
|
947
|
+
self._dispatch(method, params)
|
|
948
|
+
return None
|
|
949
|
+
|
|
950
|
+
try:
|
|
951
|
+
result = self._dispatch(method, params)
|
|
952
|
+
except ValueError as exc:
|
|
953
|
+
return json.dumps({"jsonrpc": "2.0", "id": req_id, "error": {"code": -32601, "message": str(exc)}}).encode()
|
|
954
|
+
except Exception as exc:
|
|
955
|
+
return json.dumps({"jsonrpc": "2.0", "id": req_id, "error": {"code": -32603, "message": f"{type(exc).__name__}: {exc}"}}).encode()
|
|
956
|
+
|
|
957
|
+
if result is None:
|
|
958
|
+
return None
|
|
959
|
+
|
|
960
|
+
return json.dumps({"jsonrpc": "2.0", "id": req_id, "result": result}).encode()
|
|
960
961
|
|
|
961
962
|
def _serve(self) -> None:
|
|
963
|
+
mcp_server = self
|
|
964
|
+
|
|
965
|
+
class _Handler(BaseHTTPRequestHandler):
|
|
966
|
+
def log_message(self, fmt, *args):
|
|
967
|
+
pass
|
|
968
|
+
|
|
969
|
+
def do_POST(self):
|
|
970
|
+
if self.path != "/mcp":
|
|
971
|
+
self.send_error(404)
|
|
972
|
+
return
|
|
973
|
+
auth = self.headers.get("Authorization", "")
|
|
974
|
+
if not hmac.compare_digest(auth, f"Bearer {mcp_server.token}"):
|
|
975
|
+
self.send_error(401)
|
|
976
|
+
return
|
|
977
|
+
length = int(self.headers.get("Content-Length", 0))
|
|
978
|
+
body = self.rfile.read(length) if length else b""
|
|
979
|
+
resp = mcp_server._handle_jsonrpc(body)
|
|
980
|
+
if resp is None:
|
|
981
|
+
self.send_response(204)
|
|
982
|
+
self.end_headers()
|
|
983
|
+
return
|
|
984
|
+
self.send_response(200)
|
|
985
|
+
self.send_header("Content-Type", "application/json")
|
|
986
|
+
self.send_header("Content-Length", str(len(resp)))
|
|
987
|
+
self.end_headers()
|
|
988
|
+
self.wfile.write(resp)
|
|
989
|
+
|
|
990
|
+
def do_GET(self):
|
|
991
|
+
self.send_error(405)
|
|
992
|
+
|
|
993
|
+
def do_DELETE(self):
|
|
994
|
+
self.send_error(405)
|
|
995
|
+
|
|
996
|
+
class _ThreadedHTTP(socketserver.ThreadingMixIn, HTTPServer):
|
|
997
|
+
daemon_threads = True
|
|
998
|
+
|
|
962
999
|
try:
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
config = uvicorn.Config(
|
|
966
|
-
self._build_app(),
|
|
967
|
-
host=self.host,
|
|
968
|
-
port=self.port,
|
|
969
|
-
log_level="error",
|
|
970
|
-
access_log=False,
|
|
971
|
-
)
|
|
972
|
-
server = uvicorn.Server(config)
|
|
973
|
-
server.install_signal_handlers = lambda: None
|
|
974
|
-
asyncio.run(server.serve())
|
|
1000
|
+
httpd = _ThreadedHTTP((self.host, self.port), _Handler)
|
|
1001
|
+
httpd.serve_forever()
|
|
975
1002
|
except Exception as exc:
|
|
976
1003
|
from koi.utils.ui import notify
|
|
977
1004
|
|
|
@@ -19,10 +19,15 @@ RST = "\033[0m"
|
|
|
19
19
|
DIM = "\033[2m"
|
|
20
20
|
BOLD = "\033[1m"
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
_PKG_NAME: str = "dev"
|
|
23
|
+
__version__: str = "dev"
|
|
24
|
+
for _candidate in ("koi-handler", "koi"):
|
|
25
|
+
try:
|
|
26
|
+
__version__ = importlib.metadata.version(_candidate)
|
|
27
|
+
_PKG_NAME = _candidate
|
|
28
|
+
break
|
|
29
|
+
except importlib.metadata.PackageNotFoundError:
|
|
30
|
+
continue
|
|
26
31
|
|
|
27
32
|
_SPINNER_FRAME_DELAY = 0.08
|
|
28
33
|
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: koi-handler
|
|
3
|
-
Version: 0.12.
|
|
3
|
+
Version: 0.12.6
|
|
4
4
|
Summary: Reverse shell listener
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
License-File: LICENSE
|
|
7
|
-
Requires-Dist: mcp>=2.0
|
|
8
|
-
Requires-Dist: uvicorn>=0.30
|
|
9
|
-
Requires-Dist: starlette>=0.40
|
|
10
|
-
Provides-Extra: mcp
|
|
11
7
|
Dynamic: license-file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|