pyntcli 0.1.107__py3-none-any.whl → 0.1.108__py3-none-any.whl
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.
- pyntcli/__init__.py +1 -1
- pyntcli/commands/burp.py +2 -4
- pyntcli/commands/command.py +2 -5
- pyntcli/commands/har.py +1 -3
- pyntcli/commands/listen.py +3 -5
- pyntcli/commands/newman.py +1 -3
- pyntcli/commands/postman.py +2 -3
- pyntcli/pynt_docker/pynt_container.py +27 -52
- {pyntcli-0.1.107.dist-info → pyntcli-0.1.108.dist-info}/METADATA +1 -1
- {pyntcli-0.1.107.dist-info → pyntcli-0.1.108.dist-info}/RECORD +13 -13
- {pyntcli-0.1.107.dist-info → pyntcli-0.1.108.dist-info}/WHEEL +1 -1
- {pyntcli-0.1.107.dist-info → pyntcli-0.1.108.dist-info}/entry_points.txt +0 -0
- {pyntcli-0.1.107.dist-info → pyntcli-0.1.108.dist-info}/top_level.txt +0 -0
pyntcli/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.108"
|
pyntcli/commands/burp.py
CHANGED
|
@@ -19,8 +19,6 @@ from pyntcli.commands import util, sub_command
|
|
|
19
19
|
from pyntcli.ui import report as cli_reporter
|
|
20
20
|
from pyntcli.transport import pynt_requests
|
|
21
21
|
|
|
22
|
-
PYNT_CONTAINER_INTERNAL_PORT = "5001"
|
|
23
|
-
PYNT_CONTAINER_INTERNAL_PROXY_PORT = "6666"
|
|
24
22
|
|
|
25
23
|
methods = [
|
|
26
24
|
"get",
|
|
@@ -230,8 +228,8 @@ class BurpCommand(sub_command.PyntSubCommand):
|
|
|
230
228
|
container_config = pynt_container.DockerContainerConfig(
|
|
231
229
|
args,
|
|
232
230
|
"proxy",
|
|
233
|
-
pynt_container.
|
|
234
|
-
pynt_container.
|
|
231
|
+
pynt_container.api_port(args.port),
|
|
232
|
+
pynt_container.proxy_port(args.proxy_port),
|
|
235
233
|
)
|
|
236
234
|
|
|
237
235
|
for host in args.captured_domains:
|
pyntcli/commands/command.py
CHANGED
|
@@ -15,9 +15,6 @@ from pyntcli.commands import util, sub_command
|
|
|
15
15
|
from pyntcli.ui import report as cli_reporter
|
|
16
16
|
from pyntcli.transport import pynt_requests
|
|
17
17
|
|
|
18
|
-
PYNT_CONTAINER_INTERNAL_PORT = "5001"
|
|
19
|
-
PYNT_CONTAINER_INTERNAL_PROXY_PORT = "6666"
|
|
20
|
-
|
|
21
18
|
|
|
22
19
|
def command_usage():
|
|
23
20
|
return (
|
|
@@ -148,8 +145,8 @@ class CommandSubCommand(sub_command.PyntSubCommand):
|
|
|
148
145
|
container_config = pynt_container.DockerContainerConfig(
|
|
149
146
|
args,
|
|
150
147
|
"proxy",
|
|
151
|
-
pynt_container.
|
|
152
|
-
pynt_container.
|
|
148
|
+
pynt_container.api_port(args.port),
|
|
149
|
+
pynt_container.proxy_port(args.proxy_port),
|
|
153
150
|
)
|
|
154
151
|
|
|
155
152
|
if args.captured_domains:
|
pyntcli/commands/har.py
CHANGED
|
@@ -8,8 +8,6 @@ from pyntcli.ui import ui_thread
|
|
|
8
8
|
from pyntcli.ui.progress import PyntProgress
|
|
9
9
|
from pyntcli.commands import sub_command, util
|
|
10
10
|
|
|
11
|
-
PYNT_CONTAINER_INTERNAL_PORT = "5001"
|
|
12
|
-
|
|
13
11
|
|
|
14
12
|
def har_usage():
|
|
15
13
|
return (
|
|
@@ -61,7 +59,7 @@ class HarSubCommand(sub_command.PyntSubCommand):
|
|
|
61
59
|
container_config = pynt_container.DockerContainerConfig(
|
|
62
60
|
args,
|
|
63
61
|
"har",
|
|
64
|
-
pynt_container.
|
|
62
|
+
pynt_container.api_port(port),
|
|
65
63
|
)
|
|
66
64
|
|
|
67
65
|
if not os.path.isfile(args.har):
|
pyntcli/commands/listen.py
CHANGED
|
@@ -15,9 +15,6 @@ from pyntcli.commands import util, sub_command
|
|
|
15
15
|
from pyntcli.ui import report as cli_reporter
|
|
16
16
|
from pyntcli.transport import pynt_requests
|
|
17
17
|
|
|
18
|
-
PYNT_CONTAINER_INTERNAL_PORT = "5001"
|
|
19
|
-
PYNT_CONTAINER_INTERNAL_PROXY_PORT = "6666"
|
|
20
|
-
|
|
21
18
|
|
|
22
19
|
def listen_usage():
|
|
23
20
|
return (
|
|
@@ -109,8 +106,9 @@ class ListenSubCommand(sub_command.PyntSubCommand):
|
|
|
109
106
|
container_config = pynt_container.DockerContainerConfig(
|
|
110
107
|
args,
|
|
111
108
|
"proxy",
|
|
112
|
-
pynt_container.
|
|
113
|
-
pynt_container.
|
|
109
|
+
pynt_container.api_port(args.port),
|
|
110
|
+
pynt_container.proxy_port(args.proxy_port),
|
|
111
|
+
)
|
|
114
112
|
|
|
115
113
|
for host in args.captured_domains:
|
|
116
114
|
container_config.docker_arguments += ["--host-targets", host]
|
pyntcli/commands/newman.py
CHANGED
|
@@ -8,8 +8,6 @@ from pyntcli.commands import sub_command, util
|
|
|
8
8
|
from pyntcli.ui import ui_thread
|
|
9
9
|
from pyntcli.ui.progress import PyntProgress
|
|
10
10
|
|
|
11
|
-
PYNT_CONTAINER_INTERNAL_PORT = "5001"
|
|
12
|
-
|
|
13
11
|
|
|
14
12
|
def newman_usage():
|
|
15
13
|
return (
|
|
@@ -60,7 +58,7 @@ class NewmanSubCommand(sub_command.PyntSubCommand):
|
|
|
60
58
|
container_config = pynt_container.DockerContainerConfig(
|
|
61
59
|
args,
|
|
62
60
|
"newman",
|
|
63
|
-
pynt_container.
|
|
61
|
+
pynt_container.api_port(port),
|
|
64
62
|
)
|
|
65
63
|
|
|
66
64
|
if not os.path.isfile(args.collection):
|
pyntcli/commands/postman.py
CHANGED
|
@@ -14,8 +14,6 @@ from pyntcli.pynt_docker import pynt_container
|
|
|
14
14
|
from pyntcli.ui import ui_thread
|
|
15
15
|
from pyntcli.transport import pynt_requests
|
|
16
16
|
|
|
17
|
-
PYNT_CONTAINER_INTERNAL_PORT = "5001"
|
|
18
|
-
|
|
19
17
|
|
|
20
18
|
class PyntPostmanException(Exception):
|
|
21
19
|
pass
|
|
@@ -98,7 +96,8 @@ class PostmanSubCommand(sub_command.PyntSubCommand):
|
|
|
98
96
|
container_config = pynt_container.DockerContainerConfig(
|
|
99
97
|
args,
|
|
100
98
|
"postman",
|
|
101
|
-
pynt_container.
|
|
99
|
+
pynt_container.api_port(args.port),
|
|
100
|
+
)
|
|
102
101
|
|
|
103
102
|
postman_docker = pynt_container.PyntContainerNative(container_config)
|
|
104
103
|
postman_docker.prepare_client()
|
|
@@ -17,8 +17,6 @@ from pyntcli.auth.login import PYNT_ID, PYNT_SAAS, PYNT_BUCKET_NAME, PYNT_PARAM1
|
|
|
17
17
|
PYNT_DOCKER_IMAGE = "ghcr.io/pynt-io/pynt"
|
|
18
18
|
IMAGE_TAGS = ["postman-latest", "newman-latest", "har-latest", "proxy-latest", "v1-latest"]
|
|
19
19
|
|
|
20
|
-
PYNT_CONTAINER_INTERNAL_PORT = "5001"
|
|
21
|
-
|
|
22
20
|
|
|
23
21
|
def create_mount(src, destination, mount_type="bind"):
|
|
24
22
|
return {
|
|
@@ -67,13 +65,20 @@ class PyntBaseContainer():
|
|
|
67
65
|
self.environment = environment
|
|
68
66
|
|
|
69
67
|
|
|
70
|
-
class
|
|
71
|
-
def __init__(self,
|
|
72
|
-
self.
|
|
73
|
-
self.dest = dest
|
|
68
|
+
class _PyntDockerPort:
|
|
69
|
+
def __init__(self, port: int, name: str) -> None:
|
|
70
|
+
self.port = port
|
|
74
71
|
self.name = name
|
|
75
72
|
|
|
76
73
|
|
|
74
|
+
def api_port(port: int) -> _PyntDockerPort:
|
|
75
|
+
return _PyntDockerPort(port=port, name="--port")
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def proxy_port(port: int) -> _PyntDockerPort:
|
|
79
|
+
return _PyntDockerPort(port=port, name="--proxy-port")
|
|
80
|
+
|
|
81
|
+
|
|
77
82
|
class PyntDockerImage:
|
|
78
83
|
def __init__(self, name, is_self_managed) -> None:
|
|
79
84
|
self.name = name
|
|
@@ -81,31 +86,16 @@ class PyntDockerImage:
|
|
|
81
86
|
|
|
82
87
|
|
|
83
88
|
class DockerContainerConfig:
|
|
84
|
-
def __init__(self, args: argparse.Namespace, integration_name: str, *port_args:
|
|
89
|
+
def __init__(self, args: argparse.Namespace, integration_name: str, *port_args: _PyntDockerPort):
|
|
85
90
|
self.image = get_image_config(args)
|
|
86
91
|
self.is_detach = True
|
|
87
|
-
self.ports = port_args
|
|
88
|
-
self.docker_arguments = build_docker_args(integration_name, args)
|
|
92
|
+
self.ports: List[int] = [port_arg.port for port_arg in port_args]
|
|
93
|
+
self.docker_arguments = build_docker_args(integration_name, args, port_args)
|
|
89
94
|
self.mounts = get_docker_mounts(args)
|
|
90
95
|
self.env_vars = {PYNT_ID: CredStore().get_tokens(), "PYNT_SAAS_URL": PYNT_SAAS}
|
|
91
96
|
if user_set_all_variables():
|
|
92
97
|
add_env_variables(self.env_vars)
|
|
93
98
|
|
|
94
|
-
ports = {}
|
|
95
|
-
create_network_host = is_network_host()
|
|
96
|
-
for p in port_args:
|
|
97
|
-
if create_network_host:
|
|
98
|
-
self.docker_arguments.append(p.name)
|
|
99
|
-
self.docker_arguments.append(str(p.dest))
|
|
100
|
-
else:
|
|
101
|
-
# `dest` is the host port, `src` is in the container
|
|
102
|
-
ports[str(p.dest)] = int(p.src)
|
|
103
|
-
|
|
104
|
-
if create_network_host:
|
|
105
|
-
self.docker_type = PyntNativeHost(network="host")
|
|
106
|
-
else:
|
|
107
|
-
self.docker_type = PyntDockerDesktopContainer(ports=ports)
|
|
108
|
-
|
|
109
99
|
|
|
110
100
|
def get_image_config(args: argparse.Namespace) -> PyntDockerImage:
|
|
111
101
|
default_image = f'{PYNT_DOCKER_IMAGE}:v1-latest'
|
|
@@ -136,8 +126,8 @@ def user_set_all_variables():
|
|
|
136
126
|
|
|
137
127
|
def add_env_variables(env: dict):
|
|
138
128
|
env["PYNT_BUCKET_NAME"] = PYNT_BUCKET_NAME
|
|
139
|
-
env["PYNT_PARAM1"] = base64.b64encode(PYNT_PARAM1.encode('utf-8'))
|
|
140
|
-
env["PYNT_PARAM2"] = base64.b64encode(PYNT_PARAM2.encode('utf-8'))
|
|
129
|
+
env["PYNT_PARAM1"] = base64.b64encode(PYNT_PARAM1.encode('utf-8')).decode('utf-8')
|
|
130
|
+
env["PYNT_PARAM2"] = base64.b64encode(PYNT_PARAM2.encode('utf-8')).decode('utf-8')
|
|
141
131
|
|
|
142
132
|
|
|
143
133
|
def value_from_environment_variable(key):
|
|
@@ -150,7 +140,7 @@ def value_from_environment_variable(key):
|
|
|
150
140
|
return None
|
|
151
141
|
|
|
152
142
|
|
|
153
|
-
def build_docker_args(integration_name:str, args: argparse.Namespace) ->
|
|
143
|
+
def build_docker_args(integration_name: str, args: argparse.Namespace, port_args: List[_PyntDockerPort]) -> List[str]:
|
|
154
144
|
docker_arguments = [integration_name]
|
|
155
145
|
|
|
156
146
|
if "insecure" in args and args.insecure:
|
|
@@ -176,6 +166,9 @@ def build_docker_args(integration_name:str, args: argparse.Namespace) -> list[st
|
|
|
176
166
|
if "verbose" in args and args.verbose:
|
|
177
167
|
docker_arguments.append("--verbose")
|
|
178
168
|
|
|
169
|
+
for port_arg in port_args:
|
|
170
|
+
docker_arguments += [port_arg.name, str(port_arg.port)]
|
|
171
|
+
|
|
179
172
|
return docker_arguments
|
|
180
173
|
|
|
181
174
|
|
|
@@ -233,18 +226,16 @@ class PyntContainerNative:
|
|
|
233
226
|
for key, value in self.config.env_vars.items():
|
|
234
227
|
env_vars.extend(self.adapt_environment_variable_partial(key, value))
|
|
235
228
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
else:
|
|
243
|
-
docker_type_options.extend([f"--{key}={value}"])
|
|
229
|
+
if is_network_host():
|
|
230
|
+
ports_exposure = ["--network=host"]
|
|
231
|
+
else:
|
|
232
|
+
ports_exposure = []
|
|
233
|
+
for port in self.config.ports:
|
|
234
|
+
ports_exposure.extend(["-p", f"{port}:{port}"])
|
|
244
235
|
|
|
245
236
|
docker_command += mounts
|
|
246
237
|
docker_command += env_vars
|
|
247
|
-
docker_command +=
|
|
238
|
+
docker_command += ports_exposure
|
|
248
239
|
docker_command += [f"{self.config.image.name}"]
|
|
249
240
|
docker_command += args
|
|
250
241
|
|
|
@@ -355,22 +346,6 @@ class PyntContainerNative:
|
|
|
355
346
|
raise PortInUseException(port)
|
|
356
347
|
|
|
357
348
|
|
|
358
|
-
class PyntDockerDesktopContainer:
|
|
359
|
-
def __init__(self, ports) -> None:
|
|
360
|
-
self.ports = ports
|
|
361
|
-
|
|
362
|
-
def get_arguments(self):
|
|
363
|
-
return {"ports": self.ports} if self.ports else {}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
class PyntNativeHost:
|
|
367
|
-
def __init__(self, network) -> None:
|
|
368
|
-
self.network = network
|
|
369
|
-
|
|
370
|
-
def get_arguments(self):
|
|
371
|
-
return {"network": self.network} if self.network else {}
|
|
372
|
-
|
|
373
|
-
|
|
374
349
|
class PyntContainerRegistry:
|
|
375
350
|
_instance = None
|
|
376
351
|
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
ignoreTests/conftest.py,sha256=gToq5K74GtgeGQXjFvXSzMaE6axBYxAzcFG5XJPOXjI,427
|
|
2
2
|
ignoreTests/auth/login.py,sha256=KFlzWhXBAuwdi7GXf16gCB3ya94LQG2wjcSChE149rQ,3798
|
|
3
3
|
ignoreTests/store/cred_store.py,sha256=_7-917EtNC9eKEumO2_lt-7KuDmCwOZFaowCm7DbA_A,254
|
|
4
|
-
pyntcli/__init__.py,sha256=
|
|
4
|
+
pyntcli/__init__.py,sha256=6cTRzL-kb_pCk9korlDDW2gMuTXde7EJUm69qZX7iTg,24
|
|
5
5
|
pyntcli/main.py,sha256=RD0W2_0ogYBCXubo-YewxHYkiIXxNv6NkZOh3n1VujE,5964
|
|
6
6
|
pyntcli/analytics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
pyntcli/analytics/send.py,sha256=0hJ0WJNFHLqyohtRr_xOg5WEXzxHrUOlcePPg-k65Hk,3846
|
|
8
8
|
pyntcli/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
pyntcli/auth/login.py,sha256=TljsRXbEkNI1YUrKm5mlTw4YiecYScYUsit8Z8vstss,5228
|
|
10
10
|
pyntcli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
pyntcli/commands/burp.py,sha256=
|
|
12
|
-
pyntcli/commands/command.py,sha256=
|
|
13
|
-
pyntcli/commands/har.py,sha256=
|
|
11
|
+
pyntcli/commands/burp.py,sha256=kbFFSm5YDrF9CR6u291IpONcfTuEkIfmY4bDgM-lKhk,12069
|
|
12
|
+
pyntcli/commands/command.py,sha256=9GtL-GGLzC6N6ioPztisw3Ce1Sz6lVhlpDJ9k9m3Sbg,10813
|
|
13
|
+
pyntcli/commands/har.py,sha256=v6yWTuxPpXLlEi3yJ7gUDhFFGJZSpNQ3ehl2oaZJ-wc,4202
|
|
14
14
|
pyntcli/commands/id_command.py,sha256=UBEgMIpm4vauTCsKyixltiGUolNg_OfHEJvJ_i5BpJY,943
|
|
15
|
-
pyntcli/commands/listen.py,sha256=
|
|
16
|
-
pyntcli/commands/newman.py,sha256=
|
|
17
|
-
pyntcli/commands/postman.py,sha256=
|
|
15
|
+
pyntcli/commands/listen.py,sha256=3zhzSnoWKbNOcbI117F965MhQz_sHYWJhsrsFp6NP3M,8808
|
|
16
|
+
pyntcli/commands/newman.py,sha256=9FWeYMa9XJOipSQ5Kj5RbkkXkh5mS2VH4UrMQIZXduk,5062
|
|
17
|
+
pyntcli/commands/postman.py,sha256=ExfvG0iLRmK_rHcqIj8itcd3mh2-BdPuQEDm8viLP6Q,4891
|
|
18
18
|
pyntcli/commands/pynt_cmd.py,sha256=T7jee0yw67Zth3lTkSDInCLnbu_IhpNqb7GqnTiTceQ,7012
|
|
19
19
|
pyntcli/commands/root.py,sha256=UtGky7LfbfQ6mELHoNJcdHznFrUVBlhXI47_8QdApfc,4068
|
|
20
20
|
pyntcli/commands/static_file_extensions.py,sha256=PZJb02BI-64tbU-j3rdCNsXzTh7gkIDGxGKbKNw3h5k,1995
|
|
@@ -24,7 +24,7 @@ pyntcli/log/__init__.py,sha256=cOGwOYzMoshEbZiiasBGkj6wF0SBu3Jdpl-AuakDesw,19
|
|
|
24
24
|
pyntcli/log/log.py,sha256=YXCvcCzuhQ5QUT2L02uQEdN_lTCzLEuet4OnLuEnjlM,112
|
|
25
25
|
pyntcli/pynt_docker/__init__.py,sha256=PQIOVxc7XXtMLfEX7ojgwf_Z3mmTllO3ZvzUZTPOxQY,30
|
|
26
26
|
pyntcli/pynt_docker/container_utils.py,sha256=_Onn7loInzyJAG2-Uk6CGpsuRyelmUFHOvtJj4Uzi9A,175
|
|
27
|
-
pyntcli/pynt_docker/pynt_container.py,sha256=
|
|
27
|
+
pyntcli/pynt_docker/pynt_container.py,sha256=FIO-AnLiKyuVRg-hGBgAbBRMdjXkuL98aufQkDzfTaQ,13223
|
|
28
28
|
pyntcli/store/__init__.py,sha256=1fP8cEAQCF_myja3gnhHH9FEqtBiOJ-2aBmUXSKBdFA,41
|
|
29
29
|
pyntcli/store/json_connector.py,sha256=UGs3uORw3iyn0YJ8kzab-veEZToA6d-ByXYuqEleWsA,560
|
|
30
30
|
pyntcli/store/store.py,sha256=Kl_HT9FJFdKlAH7SwAt3g4-bW-r-1ve_u13OPggQai0,2529
|
|
@@ -39,8 +39,8 @@ pyntcli/ui/report.py,sha256=W-icPSZrGLOubXgam0LpOvHLl_aZg9Zx9qIkL8Ym5PE,1930
|
|
|
39
39
|
pyntcli/ui/ui_thread.py,sha256=XUBgLpYQjVhrilU-ofw7VSXgTiwneSdTxm61EvC3x4Q,5091
|
|
40
40
|
tests/test_utils.py,sha256=t5fTQUk1U_Js6iMxcGYGqt4C-crzOJ0CqCKtLkRtUi0,2050
|
|
41
41
|
tests/commands/test_pynt_cmd.py,sha256=BjGFCFACcSziLrNA6_27t6TjSmvdu54wx9njwLpRSJY,8379
|
|
42
|
-
pyntcli-0.1.
|
|
43
|
-
pyntcli-0.1.
|
|
44
|
-
pyntcli-0.1.
|
|
45
|
-
pyntcli-0.1.
|
|
46
|
-
pyntcli-0.1.
|
|
42
|
+
pyntcli-0.1.108.dist-info/METADATA,sha256=g3fwRDelY_rAH-1pwHtwod5k09ZqQVelmyWg6FOpNV8,428
|
|
43
|
+
pyntcli-0.1.108.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
44
|
+
pyntcli-0.1.108.dist-info/entry_points.txt,sha256=kcGmqAxXDttNk2EPRcqunc_LTVp61gzakz0v-GEE2SY,43
|
|
45
|
+
pyntcli-0.1.108.dist-info/top_level.txt,sha256=64XSgBzSpgwjYjEKHZE7q3JH2a816zEeyZBXfJi3AKI,42
|
|
46
|
+
pyntcli-0.1.108.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|