Skip to content

Commit 67f575b

Browse files
committed
puncia[0.20]
1 parent 4258c53 commit 67f575b

File tree

3 files changed

+51
-23
lines changed

3 files changed

+51
-23
lines changed

README.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,33 @@ Puncia utilizes two of our intelligent APIs to gather the results - <br>
2020
2. From Source - `pip3 install .`<br>
2121

2222
## Usage
23-
1. Query Domains - `puncia subdomain <domain> <output-file>`
24-
2. Query Exploit & Vulnerability Identifiers - `puncia exploit <eoidentifier> <output-file>`
23+
1. Store an API key (storekey) - `puncia storekey <api-key>`
24+
2. Query Domains (subdomain) - `puncia subdomain <domain> <output-file>`
25+
3. Query Exploit & Vulnerability Identifiers (exploit) - `puncia exploit <eoidentifier> <output-file>`
2526
- Russian VIDs with no associated CVEs (^RU_NON_CVE)
2627
- Chinese VIDs with no associated CVEs (^CN_NON_CVE)
28+
- Daily Vulnerability & Exploit Watchlist (^WATCHLIST)
2729
- [Supported Vulnerability Identifiers](https://github.com/ARPSyndicate/docs?tab=readme-ov-file#supported-vulnerability-identifiers)
28-
3. Bulk Queries - `puncia exploit <json-file> <output-directory>`<br>
29-
4. Store an API key - `puncia storekey <api-key>`<br>
30-
31-
### Bulk Input JSON Format
32-
```
33-
{
34-
"subdomain": [
35-
"domainA.com",
36-
"domainB.com"
37-
],
38-
"exploit": [
39-
"eoidentifierA",
40-
"eoidentifierB"
41-
]
42-
}
43-
```
30+
4. Enrich CVE/GHSA Identifiers (enrich) - `puncia enrich <eoidentifier> <output-file>`
31+
5. Bulk Queries (bulk)- `puncia bulk <json-file> <output-directory>`<br>
32+
- Bulk Input JSON File Format
33+
```
34+
{
35+
"subdomain": [
36+
"domainA.com",
37+
"domainB.com"
38+
],
39+
"exploit": [
40+
"eoidentifierA",
41+
"eoidentifierB"
42+
],
43+
"enrich": [
44+
"eoidentifierA",
45+
"eoidentifierB"
46+
]
47+
}
48+
```
49+
<br>
4450
4551
## Noteworthy Mentions
4652
- [Around 1000 exploitable cybersecurity vulnerabilities that MITRE & NIST ‘might’ have missed but China or Russia didn’t.](https://blog.arpsyndicate.io/over-a-1000-vulnerabilities-that-mitre-nist-might-have-missed-but-china-or-russia-did-not-871b2364a526)

puncia/__main__.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
API_URLS = {
99
"subdomain": "http://api.subdomain.center/?domain=",
1010
"exploit": "http://api.exploit.observer/?keyword=",
11+
"enrich": "http://api.exploit.observer/?enrich=True&keyword=",
1112
"auth_subdomain": "http://api.subdomain.center/beta/?auth={0}&domain=",
1213
"auth_exploit": "http://api.exploit.observer/beta/?auth={0}&keyword=",
14+
"auth_enrich": "http://api.exploit.observer/beta/?auth={0}&enrich=True&keyword=",
1315
"russia": "http://api.exploit.observer/russia/",
1416
"china": "http://api.exploit.observer/china/",
17+
"watchlist": "http://api.exploit.observer/watchlist/",
1518
}
1619

1720

@@ -33,12 +36,12 @@ def read_key():
3336

3437

3538
def query_api(mode, query, output_file=None, cid=None, akey=""):
36-
if len(akey) > 0 and mode in ["exploit", "subdomain"]:
39+
if len(akey) > 0 and mode in ["exploit", "subdomain", "enrich"]:
3740
url = API_URLS.get("auth_" + mode).format(akey)
3841
else:
3942
time.sleep(60)
4043
url = API_URLS.get(mode)
41-
if "^" in query:
44+
if "^" in query and "exploit" in mode:
4245
if query == "^RU_NON_CVE":
4346
url = API_URLS.get("russia")
4447
query = "noncve"
@@ -49,6 +52,11 @@ def query_api(mode, query, output_file=None, cid=None, akey=""):
4952
query = "noncve"
5053
mode = "spec_exploit"
5154
cid = "Chinese VIDs with no associated CVEs"
55+
if query == "^WATCHLIST":
56+
url = API_URLS.get("watchlist")
57+
query = ""
58+
mode = "spec_exploit"
59+
cid = "Daily Vulnerability & Exploit Watchlist"
5260
if not url:
5361
sys.exit("Invalid Mode")
5462
response = requests.get(url + query).json()
@@ -77,6 +85,8 @@ def query_api(mode, query, output_file=None, cid=None, akey=""):
7785
existing_data = []
7886
existing_data.extend(response)
7987
existing_data = list(set(existing_data))
88+
elif mode == "enrich":
89+
existing_data = response
8090
elif mode == "exploit":
8191
if "entries" in existing_data and len(existing_data["entries"]) > 0:
8292
for lang in existing_data["entries"]:
@@ -127,13 +137,13 @@ def query_api(mode, query, output_file=None, cid=None, akey=""):
127137
def main():
128138
try:
129139
print("---------")
130-
print("Panthera(P.)uncia [v0.19]")
140+
print("Panthera(P.)uncia [v0.20]")
131141
print("A.R.P. Syndicate [https://arpsyndicate.io]")
132142
print("---------")
133143

134144
if len(sys.argv) < 3:
135145
sys.exit(
136-
"usage: puncia <mode:subdomain/exploit/bulk/storekey> <query:domain/eoidentifier/jsonfile/apikey> [output_file/output_directory]\nrefer: https://github.com/ARPSyndicate/puncia#usage"
146+
"usage: puncia <mode:subdomain/exploit/enrich/bulk/storekey> <query:domain/eoidentifier/jsonfile/apikey> [output_file/output_directory]\nrefer: https://github.com/ARPSyndicate/puncia#usage"
137147
)
138148

139149
mode = sys.argv[1]
@@ -150,6 +160,7 @@ def main():
150160
if output_file:
151161
os.makedirs(output_file + "/subdomain/", exist_ok=True)
152162
os.makedirs(output_file + "/exploit/", exist_ok=True)
163+
os.makedirs(output_file + "/enrich/", exist_ok=True)
153164
else:
154165
sys.exit("Bulk Mode requires an Output Directory")
155166
with open(query, "r") as f:
@@ -177,6 +188,17 @@ def main():
177188
)
178189
except Exception as ne:
179190
sys.exit(f"Error: {str(ne)}")
191+
if "enrich" in input_file:
192+
for bulk_query in input_file["enrich"]:
193+
try:
194+
query_api(
195+
"enrich",
196+
bulk_query,
197+
output_file + "/enrich/" + bulk_query + ".json",
198+
akey=akey,
199+
)
200+
except Exception as ne:
201+
sys.exit(f"Error: {str(ne)}")
180202

181203
elif mode == "storekey":
182204
store_key(query)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="puncia",
5-
version="0.19",
5+
version="0.20",
66
author="A.R.P. Syndicate",
77
author_email="[email protected]",
88
keywords="subdomains subdomain exploits exploit arpsyndicate panthera uncia puncia snow leopard",

0 commit comments

Comments
 (0)