pyntcli 0.1.88__py3-none-any.whl → 0.1.89__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.88"
1
+ __version__ = "0.1.89"
pyntcli/commands/burp.py CHANGED
@@ -62,7 +62,7 @@ def decode_request(item) -> str:
62
62
  raise e
63
63
 
64
64
 
65
- def replay_req(item, proxy_port):
65
+ def replay_req(session, item, proxy_port):
66
66
  url = item["url"]
67
67
  if not util.is_http_handler(url):
68
68
  return None
@@ -93,6 +93,7 @@ def replay_req(item, proxy_port):
93
93
  body = decoded_req.split("\r\n\r\n")[1]
94
94
  ui_thread.print(ui_thread.PrinterText(f"{url}"))
95
95
  pynt_requests.request_from_xml(
96
+ session=session,
96
97
  method=method,
97
98
  url=url,
98
99
  headers=headers,
@@ -107,10 +108,11 @@ def replay_req(item, proxy_port):
107
108
  def run_burp_xml(doc, proxy_port):
108
109
  items = doc["items"]["item"]
109
110
  ui_thread.print(ui_thread.PrinterText("Creating traffic from xml file"))
111
+ session = pynt_requests.get_new_session()
110
112
  if isinstance(items, dict):
111
- replay_req(item=items, proxy_port=proxy_port)
113
+ replay_req(session, item=items, proxy_port=proxy_port)
112
114
  else:
113
- [replay_req(i, proxy_port=proxy_port) for i in doc["items"]["item"]]
115
+ [replay_req(session, i, proxy_port=proxy_port) for i in doc["items"]["item"]]
114
116
 
115
117
 
116
118
  def parse_xml(xml_path):
@@ -136,6 +138,7 @@ def burp_usage():
136
138
  .with_line("")
137
139
  .with_line("Options:", style=ui_thread.PrinterText.HEADER)
138
140
  .with_line("\t--xml - Path to the xml to run tests on")
141
+ .with_line('\t--captured-domains - Pynt will scan only these domains and subdomains. For all domains write "*"')
139
142
  .with_line("\t--port - Set the port pynt will listen to (DEFAULT: 5001)")
140
143
  .with_line("\t--ca-path - The path to the CA file in PEM format")
141
144
  .with_line("\t--proxy-port - Set the port proxied traffic should be routed to (DEFAULT: 6666)")
@@ -166,10 +169,11 @@ class BurpCommand(sub_command.PyntSubCommand):
166
169
  burp_cmd.add_argument("--xml", help="", default="", required=True)
167
170
  burp_cmd.add_argument("--ca-path", type=str, default="")
168
171
  burp_cmd.add_argument("--report", type=str, default="")
172
+ burp_cmd.add_argument("--captured-domains", nargs="+", help="", default="")
169
173
  burp_cmd.add_argument(
170
174
  "--return-error",
171
175
  choices=["all-findings", "errors-only", "never"],
172
- default="never"
176
+ default="never",
173
177
  )
174
178
  burp_cmd.print_usage = self.print_usage
175
179
  burp_cmd.print_help = self.print_usage
@@ -233,6 +237,10 @@ class BurpCommand(sub_command.PyntSubCommand):
233
237
  args.proxy_port, args.proxy_port, "--proxy-port"
234
238
  ),
235
239
  )
240
+
241
+ for host in args.captured_domains:
242
+ container.docker_arguments += ["--host-targets", host]
243
+
236
244
  if "ca_path" in args and args.ca_path:
237
245
  if not os.path.isfile(args.ca_path):
238
246
  ui_thread.print(
@@ -312,10 +320,10 @@ class BurpCommand(sub_command.PyntSubCommand):
312
320
  )
313
321
 
314
322
  with ui_thread.progress(
315
- "ws://localhost:{}/progress?scanId={}".format(args.port, self.scan_id),
316
- partial(lambda *args: None),
317
- "scan in progress...",
318
- 100,
323
+ "ws://localhost:{}/progress?scanId={}".format(args.port, self.scan_id),
324
+ partial(lambda *args: None),
325
+ "scan in progress...",
326
+ 100,
319
327
  ):
320
328
  html_report = self._get_report(args, "html")
321
329
  html_report_path = os.path.join(
@@ -39,12 +39,12 @@ def add_host_ca(ca_path):
39
39
  cert_data = open(ca_path, "rb").read()
40
40
 
41
41
  cafile = certifi.where()
42
- ca_chain = open(cafile, 'rb').read()
42
+ ca_chain = open(cafile, "rb").read()
43
43
 
44
44
  bundle_path = os.path.join(tempfile.gettempdir(), "bundle.pem")
45
45
  with open(bundle_path, "wb") as f:
46
46
  f.write(ca_chain)
47
- f.write(b'\n')
47
+ f.write(b"\n")
48
48
  f.write(cert_data)
49
49
 
50
50
  verify = bundle_path
@@ -62,5 +62,16 @@ def put(url, data=None, **kwargs):
62
62
  return requests.put(url, data=data, verify=verify, **kwargs)
63
63
 
64
64
 
65
- def request_from_xml(method, url, proxies=None, data=None, **kwargs):
66
- return requests.request(method=method, url=url, data=data, verify=False, proxies=proxies, **kwargs)
65
+ def get_new_session():
66
+ s = requests.session()
67
+ s.max_redirects = 500
68
+
69
+ return s
70
+
71
+
72
+ def request_from_xml(
73
+ session: requests.Session, method, url, proxies=None, data=None, **kwargs
74
+ ):
75
+ return session.request(
76
+ method=method, url=url, data=data, verify=False, proxies=proxies, **kwargs
77
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyntcli
3
- Version: 0.1.88
3
+ Version: 0.1.89
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
@@ -1,11 +1,11 @@
1
- pyntcli/__init__.py,sha256=z3tdRNeN2w75cDNIzvfmZ76HO3oZkxihdKKzDRqb2Ow,23
1
+ pyntcli/__init__.py,sha256=PY93tkOmcPlWKkwp9BLM87U29v6noa-gTaI98NliUTA,23
2
2
  pyntcli/main.py,sha256=eJFpT-haLVQAYP71_ZHjNaA5iG2wvDXy8km84GU0Mwo,6009
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=O-KKyp6kcbTeHMEKsABlLQfI6rFqz229pef53UkpGlQ,11840
8
+ pyntcli/commands/burp.py,sha256=A56AD9Cx-JmzrsHyVHEj4OQzFaXYQRIi_svU8HtBl5Y,12240
9
9
  pyntcli/commands/command.py,sha256=0lCMxXIyj3vAd8NfeQ2Ik1WhV8RHq17cwwaQn2isRzQ,10411
10
10
  pyntcli/commands/har.py,sha256=pl-qPZE6yOlLrruZ2bGiDkEpEVkLmnxb68bRxgzdszg,4120
11
11
  pyntcli/commands/id_command.py,sha256=UBEgMIpm4vauTCsKyixltiGUolNg_OfHEJvJ_i5BpJY,943
@@ -27,7 +27,7 @@ pyntcli/store/json_connector.py,sha256=UGs3uORw3iyn0YJ8kzab-veEZToA6d-ByXYuqEleW
27
27
  pyntcli/store/store.py,sha256=9KwalOd1EA1VtYwr9oJgBsPgUYakX5uyif_sNXGQ614,1917
28
28
  pyntcli/store/store_connector.py,sha256=w4LzcpRZesUZL1f63RmLlWEFRtJ6Y6rcS6PkkGtO4MA,357
29
29
  pyntcli/transport/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
- pyntcli/transport/pynt_requests.py,sha256=KiEG3hNcwY7DLIJDCq-7LIPq54yYQcDBhHe3KhpqRTc,1563
30
+ pyntcli/transport/pynt_requests.py,sha256=e-km_PonlrnQ2jwZHcCfNuv4laFWpaJjH-_f4Fge26M,1700
31
31
  pyntcli/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
32
  pyntcli/ui/progress.py,sha256=RrnO_jJNunoyupylakmWmHOEPw3lh99OHpKBzL6OBiE,1008
33
33
  pyntcli/ui/pynt_errors.py,sha256=00UprD4tFViREv7kuXGQ99PAKGTpXYixxi3Ndeoeiew,689
@@ -36,8 +36,8 @@ pyntcli/ui/ui_thread.py,sha256=4YzpO5dDrWpbTovMdHvv9ZQdLFJamZEAKXjF9rIIIoQ,5039
36
36
  tests/conftest.py,sha256=gToq5K74GtgeGQXjFvXSzMaE6axBYxAzcFG5XJPOXjI,427
37
37
  tests/auth/test_login.py,sha256=KFlzWhXBAuwdi7GXf16gCB3ya94LQG2wjcSChE149rQ,3798
38
38
  tests/store/test_cred_store.py,sha256=_7-917EtNC9eKEumO2_lt-7KuDmCwOZFaowCm7DbA_A,254
39
- pyntcli-0.1.88.dist-info/METADATA,sha256=8-E1WzSYJbsxxHp1v3Qpyw8DDpQnN3KYHUL4E3-OO24,463
40
- pyntcli-0.1.88.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
41
- pyntcli-0.1.88.dist-info/entry_points.txt,sha256=kcGmqAxXDttNk2EPRcqunc_LTVp61gzakz0v-GEE2SY,43
42
- pyntcli-0.1.88.dist-info/top_level.txt,sha256=u9MDStwVHB7UG8PUcODeWCul_NvzL2EzoLvSlgwLHFs,30
43
- pyntcli-0.1.88.dist-info/RECORD,,
39
+ pyntcli-0.1.89.dist-info/METADATA,sha256=p-7mBPbyYjorg8Ksfw8-X64mbgRuaU4wcGkxcYL16No,463
40
+ pyntcli-0.1.89.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
41
+ pyntcli-0.1.89.dist-info/entry_points.txt,sha256=kcGmqAxXDttNk2EPRcqunc_LTVp61gzakz0v-GEE2SY,43
42
+ pyntcli-0.1.89.dist-info/top_level.txt,sha256=u9MDStwVHB7UG8PUcODeWCul_NvzL2EzoLvSlgwLHFs,30
43
+ pyntcli-0.1.89.dist-info/RECORD,,