pyntcli 0.1.83__py3-none-any.whl → 0.1.85__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 CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.83"
1
+ __version__ = "0.1.85"
pyntcli/commands/burp.py CHANGED
@@ -64,6 +64,9 @@ def decode_request(item) -> str:
64
64
 
65
65
  def replay_req(item, proxy_port):
66
66
  url = item["url"]
67
+ if not util.is_http_handler(url):
68
+ return None
69
+
67
70
  decoded_req = decode_request(item)
68
71
 
69
72
  method = decoded_req.split("\r\n")[0].split(" ")[0]
@@ -287,17 +290,29 @@ class BurpCommand(sub_command.PyntSubCommand):
287
290
  ui_thread.print_generator(proxy_docker.stdout)
288
291
 
289
292
  util.wait_for_healthcheck("http://localhost:{}".format(args.port))
293
+ ui_thread.print(ui_thread.PrinterText(
294
+ util.GOT_INITIAL_HEALTHCHECK_MESSAGE,
295
+ ui_thread.PrinterText.INFO,
296
+ ))
297
+
290
298
  self._start_proxy(args)
291
299
 
292
300
  run_burp_xml(doc, args.proxy_port)
293
301
 
294
302
  self._stop_proxy(args)
295
303
 
304
+ ui_thread.print(
305
+ ui_thread.PrinterText(
306
+ "Please wait while we scan and generate the report, it may take a few minutes...",
307
+ ui_thread.PrinterText.INFO,
308
+ )
309
+ )
310
+
296
311
  with ui_thread.progress(
297
- "ws://localhost:{}/progress?scanId={}".format(args.port, self.scan_id),
298
- partial(lambda *args: None),
299
- "scan in progress...",
300
- 100,
312
+ "ws://localhost:{}/progress?scanId={}".format(args.port, self.scan_id),
313
+ partial(lambda *args: None),
314
+ "scan in progress...",
315
+ 100,
301
316
  ):
302
317
  html_report = self._get_report(args, "html")
303
318
  html_report_path = os.path.join(
@@ -161,6 +161,10 @@ class CommandSubCommand(sub_command.PyntSubCommand):
161
161
  ui_thread.print_generator(proxy_docker.stdout)
162
162
 
163
163
  util.wait_for_healthcheck("http://localhost:{}".format(args.port))
164
+ ui_thread.print(ui_thread.PrinterText(
165
+ util.GOT_INITIAL_HEALTHCHECK_MESSAGE,
166
+ ui_thread.PrinterText.INFO,
167
+ ))
164
168
 
165
169
  if args.captured_domains:
166
170
  ui_thread.print(
pyntcli/commands/har.py CHANGED
@@ -92,6 +92,13 @@ class HarSubCommand(sub_command.PyntSubCommand):
92
92
  healthcheck = partial(
93
93
  util.wait_for_healthcheck, "http://localhost:{}".format(port)
94
94
  )
95
+
96
+ healthcheck()
97
+ ui_thread.print(ui_thread.PrinterText(
98
+ util.GOT_INITIAL_HEALTHCHECK_MESSAGE,
99
+ ui_thread.PrinterText.INFO,
100
+ ))
101
+
95
102
  ui_thread.print_generator(ui_thread.AnsiText.wrap_gen(har_docker.stdout))
96
103
 
97
104
  with ui_thread.progress(
@@ -140,6 +140,10 @@ class ListenSubCommand(sub_command.PyntSubCommand):
140
140
  ui_thread.print_generator(proxy_docker.stdout)
141
141
 
142
142
  util.wait_for_healthcheck("http://localhost:{}".format(args.port))
143
+ ui_thread.print(ui_thread.PrinterText(
144
+ util.GOT_INITIAL_HEALTHCHECK_MESSAGE,
145
+ ui_thread.PrinterText.INFO,
146
+ ))
143
147
 
144
148
  self._start_proxy(args)
145
149
 
@@ -114,13 +114,20 @@ class NewmanSubCommand(sub_command.PyntSubCommand):
114
114
  healthcheck = partial(
115
115
  util.wait_for_healthcheck, "http://localhost:{}".format(port)
116
116
  )
117
+
118
+ healthcheck()
119
+ ui_thread.print(ui_thread.PrinterText(
120
+ util.GOT_INITIAL_HEALTHCHECK_MESSAGE,
121
+ ui_thread.PrinterText.INFO,
122
+ ))
123
+
117
124
  ui_thread.print_generator(ui_thread.AnsiText.wrap_gen(newman_docker.stdout))
118
125
 
119
126
  with ui_thread.progress(
120
- "ws://localhost:{}/progress".format(port),
121
- healthcheck,
122
- "scan in progress...",
123
- 100,
127
+ "ws://localhost:{}/progress".format(port),
128
+ healthcheck,
129
+ "scan in progress...",
130
+ 100,
124
131
  ):
125
132
  while newman_docker.is_alive():
126
133
  time.sleep(1)
@@ -104,6 +104,10 @@ class PostmanSubCommand(sub_command.PyntSubCommand):
104
104
  ui_thread.print_generator(postman_docker.stdout)
105
105
 
106
106
  util.wait_for_healthcheck("http://localhost:{}".format(args.port))
107
+ ui_thread.print(ui_thread.PrinterText(
108
+ util.GOT_INITIAL_HEALTHCHECK_MESSAGE,
109
+ ui_thread.PrinterText.INFO,
110
+ ))
107
111
 
108
112
  for scan_id in self.scan_id_generator(args.port):
109
113
  html_report = self.get_report(args.port, "html", scan_id)
@@ -0,0 +1,167 @@
1
+ STATIC_FILE_EXTENSIONS = [
2
+ '.css',
3
+ '.js',
4
+ '.jpg',
5
+ '.jpeg',
6
+ '.png',
7
+ '.gif',
8
+ '.svg',
9
+ '.ico',
10
+ '.html',
11
+ '.woff',
12
+ '.woff2',
13
+ '.ttf',
14
+ '.eot',
15
+ '.otf',
16
+ '.map',
17
+ '.json',
18
+ '.xml',
19
+ '.txt',
20
+ '.csv',
21
+ '.pdf',
22
+ '.doc',
23
+ '.docx',
24
+ '.xls',
25
+ '.xlsx',
26
+ '.ppt',
27
+ '.pptx',
28
+ '.mp3',
29
+ '.mp4',
30
+ '.avi',
31
+ '.mov',
32
+ '.wmv',
33
+ '.flv',
34
+ '.wav',
35
+ '.zip',
36
+ '.tar',
37
+ '.gz',
38
+ '.7z',
39
+ '.rar',
40
+ '.exe',
41
+ '.msi',
42
+ '.apk',
43
+ '.dmg',
44
+ '.iso',
45
+ '.img',
46
+ '.bin',
47
+ '.deb',
48
+ '.rpm',
49
+ '.sh',
50
+ '.bat',
51
+ '.cmd',
52
+ '.ps1',
53
+ '.py',
54
+ '.java',
55
+ '.c',
56
+ '.cpp',
57
+ '.h',
58
+ '.hpp',
59
+ '.cs',
60
+ '.php',
61
+ '.rb',
62
+ '.pl',
63
+ '.go',
64
+ '.swift',
65
+ '.kt',
66
+ '.ts',
67
+ '.html',
68
+ '.css',
69
+ '.js',
70
+ '.json',
71
+ '.xml',
72
+ '.yaml',
73
+ '.yml',
74
+ '.md',
75
+ '.rst',
76
+ '.txt',
77
+ '.csv',
78
+ '.tsv',
79
+ '.xls',
80
+ '.xlsx',
81
+ '.ods',
82
+ '.odt',
83
+ '.doc',
84
+ '.docx',
85
+ '.ppt',
86
+ '.pptx',
87
+ '.pdf',
88
+ '.zip',
89
+ '.tar',
90
+ '.gz',
91
+ '.7z',
92
+ '.rar',
93
+ '.apk',
94
+ '.exe',
95
+ '.msi',
96
+ '.dmg',
97
+ '.iso',
98
+ '.img',
99
+ '.bin',
100
+ '.deb',
101
+ '.rpm',
102
+ '.sh',
103
+ '.bat',
104
+ '.cmd',
105
+ '.ps1',
106
+ '.py',
107
+ '.java',
108
+ '.c',
109
+ '.cpp',
110
+ '.h',
111
+ '.hpp',
112
+ '.cs',
113
+ '.php',
114
+ '.rb',
115
+ '.pl',
116
+ '.go',
117
+ '.swift',
118
+ '.kt',
119
+ '.ts',
120
+ '.html',
121
+ '.css',
122
+ '.js',
123
+ '.json',
124
+ '.xml',
125
+ '.yaml',
126
+ '.yml',
127
+ '.md',
128
+ '.rst',
129
+ '.txt',
130
+ '.csv',
131
+ '.tsv',
132
+ '.xls',
133
+ '.xlsx',
134
+ '.ods',
135
+ '.odt',
136
+ '.doc',
137
+ '.docx',
138
+ '.ppt',
139
+ '.pptx',
140
+ '.pdf',
141
+ '.zip',
142
+ '.tar',
143
+ '.gz',
144
+ '.7z',
145
+ '.rar',
146
+ '.apk',
147
+ '.exe',
148
+ '.msi',
149
+ '.dmg',
150
+ '.iso',
151
+ '.img',
152
+ '.bin',
153
+ '.deb',
154
+ '.rpm',
155
+ '.sh',
156
+ '.bat',
157
+ '.cmd',
158
+ '.ps1',
159
+ '.py',
160
+ '.java',
161
+ '.c',
162
+ '.cpp',
163
+ '.h',
164
+ '.hpp',
165
+ '.cs',
166
+ '.php',
167
+ ]
pyntcli/commands/util.py CHANGED
@@ -8,14 +8,23 @@ import webbrowser
8
8
  import json
9
9
  import pyntcli.log.log as log
10
10
 
11
+ from pyntcli.commands.static_file_extensions import STATIC_FILE_EXTENSIONS
11
12
  from pyntcli.pynt_docker import pynt_container
12
13
  from pyntcli.ui import report
13
14
  from pyntcli.transport import pynt_requests
14
15
 
15
-
16
16
  logger = log.get_logger()
17
17
 
18
18
 
19
+ def is_http_handler(url):
20
+ path = url.split("/")[-1]
21
+ for ext in STATIC_FILE_EXTENSIONS:
22
+ if ext in path:
23
+ return False
24
+
25
+ return True
26
+
27
+
19
28
  def find_open_port() -> int:
20
29
  with socket.socket() as s:
21
30
  s.bind(('', 0))
@@ -24,6 +33,7 @@ def find_open_port() -> int:
24
33
 
25
34
  HEALTHCHECK_TIMEOUT = 60
26
35
  HEALTHCHECK_INTERVAL = 0.1
36
+ GOT_INITIAL_HEALTHCHECK_MESSAGE = "Got initial pynt server health check"
27
37
 
28
38
 
29
39
  def wait_for_healthcheck(address):
@@ -31,6 +41,7 @@ def wait_for_healthcheck(address):
31
41
  while start + HEALTHCHECK_TIMEOUT > time.time():
32
42
  try:
33
43
  res = pynt_requests.get(address + "/healthcheck")
44
+ logger.debug("Health check response: {}".format(res.status_code))
34
45
  if res.status_code == 418:
35
46
  return
36
47
  except:
@@ -66,7 +77,7 @@ def create_default_file_mounts(args):
66
77
  json_report_path = os.path.join(os.getcwd(), "pynt_results.json")
67
78
 
68
79
  mounts = []
69
- with open(html_report_path, "w",encoding="utf-8"), open(json_report_path, "w",encoding="utf-8"):
80
+ with open(html_report_path, "w", encoding="utf-8"), open(json_report_path, "w", encoding="utf-8"):
70
81
  mounts.append(pynt_container.create_mount(json_report_path, "/etc/pynt/results/results.json"))
71
82
  mounts.append(pynt_container.create_mount(html_report_path, "/etc/pynt/results/results.html"))
72
83
 
pyntcli/main.py CHANGED
@@ -66,6 +66,9 @@ def logout():
66
66
  def main():
67
67
  print_header()
68
68
  try:
69
+ if len(argv) == 1:
70
+ pynt_cmd.root.usage()
71
+ return
69
72
  if argv[1] == "logout":
70
73
  logout()
71
74
  return
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyntcli
3
- Version: 0.1.83
3
+ Version: 0.1.85
4
4
  Summary: Command line utility to handle all of Pynt's different integrations
5
5
  Author-email: Pynt-io <support@pynt.io>
6
6
  Project-URL: Homepage, https://pynt.io
7
7
  Requires-Python: >=3.7
8
8
  Requires-Dist: docker
9
9
  Requires-Dist: rich
10
- Requires-Dist: requests >=2.28.2
10
+ Requires-Dist: requests ==2.31.0
11
11
  Requires-Dist: pem
12
12
  Requires-Dist: certifi >=2017.4.17
13
13
  Requires-Dist: logzio-python-handler >=4.1.0
@@ -1,21 +1,22 @@
1
- pyntcli/__init__.py,sha256=YNVbuQj-JrlVU3yGuccLkZ5P-L-37tQUcshGno0Ijlo,23
2
- pyntcli/main.py,sha256=wg2Is1ckRCb3EwsLFshDsbPKvntPOR7sDB2Nq-DW4wk,5689
1
+ pyntcli/__init__.py,sha256=wY2suKf-e8VDtbBWRFlwNkTJ9Nff03BK8zzI8EWGc48,23
2
+ pyntcli/main.py,sha256=5L3FXlkaxen79P5NPl72K0fmLMsk-Kjq_yjjlsxFkI8,5769
3
3
  pyntcli/analytics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  pyntcli/analytics/send.py,sha256=pJOyOWl3g_Vm9apKK3LzNVqsnC6zsWA1bCK3ZegbLpc,3637
5
5
  pyntcli/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  pyntcli/auth/login.py,sha256=TljsRXbEkNI1YUrKm5mlTw4YiecYScYUsit8Z8vstss,5228
7
7
  pyntcli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- pyntcli/commands/burp.py,sha256=2FqLc65SjuXdenUS1ggC6dGRU_iSA52Ft_8OnfGsm_8,11193
9
- pyntcli/commands/command.py,sha256=0O7Za_cjT6vDkDfM0OTMPB6DLI3U1r1R7lXQydz7458,9495
10
- pyntcli/commands/har.py,sha256=mSCbTUnxQrKzJd-dAWoc6Tkw6tU1LDH7Ha1w2ylrrrg,3654
8
+ pyntcli/commands/burp.py,sha256=dSwFo_55b9e3YSaYh3SgPIIkR-zwmPf-FCn7qxodMHk,11645
9
+ pyntcli/commands/command.py,sha256=uvvxLXGHHmVdfKyazoyN5scY7OBw2wUJ6bOPH-SSSFI,9643
10
+ pyntcli/commands/har.py,sha256=o6GnRnLCXwoxucO3NPRl3MP4aNoJ37bhfU08Oq6KEbg,3846
11
11
  pyntcli/commands/id_command.py,sha256=UBEgMIpm4vauTCsKyixltiGUolNg_OfHEJvJ_i5BpJY,943
12
- pyntcli/commands/listen.py,sha256=JoDo3BirYf9f3Fr21qAQ7kIDmLbM5cuFzQtf8RQ_nhs,8484
13
- pyntcli/commands/newman.py,sha256=y0KolwMgsvoqPz2mp0QRug_qNr-ftOZbu_tN7h4bH7I,4826
14
- pyntcli/commands/postman.py,sha256=GWq4NJJ_9WdFiXk5rv2nTyMM27w50XLh4LKkuuWpw4I,4721
12
+ pyntcli/commands/listen.py,sha256=Q6T_YGH1-DEu7lRxnTcAzWrb0xwooim4KM67PHaQGBI,8632
13
+ pyntcli/commands/newman.py,sha256=v1XOEvM8l59fVW3IjeeQPhcOTVPfOEJ_ni0_i87Mucs,5034
14
+ pyntcli/commands/postman.py,sha256=VTi5qrMlCZ7mTQJ9KZ-t__K08RHnMnfjEnco9IXzGOc,4869
15
15
  pyntcli/commands/pynt_cmd.py,sha256=KOl9guUtesO2JcMM5nPKKkjnK6F9HV4jHHcoUk4KVhw,2825
16
16
  pyntcli/commands/root.py,sha256=dmgdzoFuf5LkwrkwvWf1MtlwTBgsVpS85Yr_cQCVuGA,3291
17
+ pyntcli/commands/static_file_extensions.py,sha256=PZJb02BI-64tbU-j3rdCNsXzTh7gkIDGxGKbKNw3h5k,1995
17
18
  pyntcli/commands/sub_command.py,sha256=GF3-rE_qk2L4jGPFqHLm9SdGINmu3EakhjJTFyWjRms,374
18
- pyntcli/commands/util.py,sha256=NJBJk4tKzrWmilYdo-7CROH5IXKl0UQAPKaMzRZtxm8,2827
19
+ pyntcli/commands/util.py,sha256=spTI_3z-fd0q7o1htvl-mw9-yKbO2ZESDAL-AsgWCb0,3217
19
20
  pyntcli/log/__init__.py,sha256=cOGwOYzMoshEbZiiasBGkj6wF0SBu3Jdpl-AuakDesw,19
20
21
  pyntcli/log/log.py,sha256=cWCdWmUaAwePwdhYDcgNMEG9d9RM34sGahxBCYEdv2Y,1069
21
22
  pyntcli/pynt_docker/__init__.py,sha256=PQIOVxc7XXtMLfEX7ojgwf_Z3mmTllO3ZvzUZTPOxQY,30
@@ -35,8 +36,8 @@ pyntcli/ui/ui_thread.py,sha256=OVTbiIFMg2KgxAvHf7yy86xGm4RVS2vj_VYZkMi-SRY,4956
35
36
  tests/conftest.py,sha256=gToq5K74GtgeGQXjFvXSzMaE6axBYxAzcFG5XJPOXjI,427
36
37
  tests/auth/test_login.py,sha256=KFlzWhXBAuwdi7GXf16gCB3ya94LQG2wjcSChE149rQ,3798
37
38
  tests/store/test_cred_store.py,sha256=_7-917EtNC9eKEumO2_lt-7KuDmCwOZFaowCm7DbA_A,254
38
- pyntcli-0.1.83.dist-info/METADATA,sha256=XcLyBCUa_7GOUyGDqDBpGeWC5M-i1C4DM1CoWtCL7ok,463
39
- pyntcli-0.1.83.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
40
- pyntcli-0.1.83.dist-info/entry_points.txt,sha256=kcGmqAxXDttNk2EPRcqunc_LTVp61gzakz0v-GEE2SY,43
41
- pyntcli-0.1.83.dist-info/top_level.txt,sha256=u9MDStwVHB7UG8PUcODeWCul_NvzL2EzoLvSlgwLHFs,30
42
- pyntcli-0.1.83.dist-info/RECORD,,
39
+ pyntcli-0.1.85.dist-info/METADATA,sha256=hAEzszpQdHQ9E10oXo6pKK2XMpgPqTz9r4DISaACCLw,463
40
+ pyntcli-0.1.85.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
41
+ pyntcli-0.1.85.dist-info/entry_points.txt,sha256=kcGmqAxXDttNk2EPRcqunc_LTVp61gzakz0v-GEE2SY,43
42
+ pyntcli-0.1.85.dist-info/top_level.txt,sha256=u9MDStwVHB7UG8PUcODeWCul_NvzL2EzoLvSlgwLHFs,30
43
+ pyntcli-0.1.85.dist-info/RECORD,,