MCPcopy Create free account
hub / github.com/SpecterOps/DeepPass2 / hit_api_request

Function hit_api_request

test/testDeeppass2.py:14–46  ·  view source on GitHub ↗
(row)

Source from the content-addressed store, hash-verified

12
13
14def hit_api_request(row):
15
16 try:
17 response = httpx.post(
18 "http://localhost:5000/api/deeppass2",
19 data = row["document"],
20 headers={"Content-Type": "text/plain; charset=utf-8"},
21 )
22
23 if response.status_code == 200:
24 json_response = response.json()
25 print(json_response)
26 try:
27 row["BERT"] = json_response["Success"][1]["BERT_secrets"][0]["secret"]
28
29 except Exception as e:
30 row["BERT"] = ["No Secret"]
31
32
33 try:
34 row["LLM"] = json_response["Success"][2]["LLM_scanning"][0]["Extracted_Credentials"]
35 except Exception as e:
36 row["LLM"] = ["No Secret"]
37
38 else:
39 row["LLM"] = ["API-FAIL"]
40 row["BERT"] = ["API-FAIL"]
41 except Exception as e:
42 row["LLM"] = ["API-TIMED-OUT"]
43 row["BERT"] = ["API-TIMED-OUT"]
44 print(e)
45
46 return row
47
48
49def _string_overlap_ratio(s1, s2, min_ratio=0.5):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected