From f9999685e8035257607590b3d9625191f1c3b3a0 Mon Sep 17 00:00:00 2001
From: Ayush Singh <26509147+g147@users.noreply.github.com>
Date: Tue, 6 Aug 2024 13:01:52 +0530
Subject: [PATCH] puncia[0.22]
---
README.md | 21 ++++++++++++---------
puncia/__main__.py | 42 +++++++++++++++++++++++++++++++++++-------
setup.py | 2 +-
3 files changed, 48 insertions(+), 17 deletions(-)
diff --git a/README.md b/README.md
index 1ea323b..1eaf9f5 100644
--- a/README.md
+++ b/README.md
@@ -22,14 +22,14 @@ Puncia utilizes two of our intelligent APIs to gather the results -
## Usage
1. Store an API key (storekey) - `puncia storekey `
2. Query Domains (subdomain) - `puncia subdomain `
-3. Query Exploit & Vulnerability Identifiers (exploit) - `puncia exploit `
- - Russian VIDs with no associated CVEs (^RU_NON_CVE)
- - Chinese VIDs with no associated CVEs (^CN_NON_CVE)
- - Daily Vulnerability & Exploit Watchlist (^WATCHLIST)
- - [Supported Vulnerability Identifiers](https://github.com/ARPSyndicate/docs?tab=readme-ov-file#supported-vulnerability-identifiers)
-4. Enrich CVE/GHSA Identifiers (enrich) - `puncia enrich `
-5. Bulk Queries (bulk)- `puncia bulk `
- - Bulk Input JSON File Format
+3. Query Exploit & Vulnerability Identifiers (exploit)
+ - Russian VIDs with no associated CVEs (^RU_NON_CVE) - `puncia exploit ^RU_NON_CVE `
+ - Chinese VIDs with no associated CVEs (^CN_NON_CVE) - `puncia exploit ^CN_NON_CVE `
+ - Daily Vulnerability & Exploit Watchlist (^WATCHLIST) - `puncia exploit ^WATCHLIST `
+ - [Supported Vulnerability Identifiers](https://github.com/ARPSyndicate/docs?tab=readme-ov-file#supported-vulnerability-identifiers) - `puncia exploit `
+4. Enrich CVE/GHSA Identifiers (enrich) - `puncia enrich `
+5. Multiple Queries (bulk/sbom)
+ - Bulk Input JSON File Format - `puncia bulk `
```
{
"subdomain": [
@@ -46,6 +46,8 @@ Puncia utilizes two of our intelligent APIs to gather the results -
]
}
```
+ - [SBOM Input JSON File Format](https://github.com/CycloneDX/bom-examples/blob/master/SBOM/protonmail-webclient-v4-0912dff/bom.json) - `puncia sbom `
+
## Noteworthy Mentions
@@ -56,6 +58,7 @@ Puncia utilizes two of our intelligent APIs to gather the results -
- [Subdomain Enumeration Tool Face-off - 2023 Edition](https://blog.blacklanternsecurity.com/p/subdomain-enumeration-tool-face-off-4e5)
## More from [A.R.P. Syndicate](https://www.arpsyndicate.io)
-- [Attack Surface Management](https://asm.arpsyndicate.io)
- [Open Source Intelligence](https://asm.arpsyndicate.io/intelligence.html)
+- [Attack Surface Management](https://asm.arpsyndicate.io)
+- [Vulnerability Advisories AI](https://advisories.arpsyndicate.io)
- [Free Vulnerability Assessment Report](https://asm.arpsyndicate.io/free-vulnerability-scanning.html)
\ No newline at end of file
diff --git a/puncia/__main__.py b/puncia/__main__.py
index 2b3222c..b1052b1 100755
--- a/puncia/__main__.py
+++ b/puncia/__main__.py
@@ -59,7 +59,11 @@ def query_api(mode, query, output_file=None, cid=None, akey=""):
cid = "Daily Vulnerability & Exploit Watchlist"
if not url:
sys.exit("Invalid Mode")
- response = requests.get(url + query).json()
+ try:
+ response = requests.get(url + query).json()
+ except:
+ print("An exception happened")
+ return
if not response:
print("Null response from the API")
return
@@ -134,16 +138,31 @@ def query_api(mode, query, output_file=None, cid=None, akey=""):
json.dump(existing_data, f, indent=4, sort_keys=True)
+def sbom_process(sbom):
+ fingps = []
+
+ def add_component(name, version):
+ if name and version:
+ fingps.append(f"{name}@{version}")
+
+ metadata_component = sbom.get("metadata", {}).get("component", {})
+ add_component(metadata_component.get("name"), metadata_component.get("version"))
+ components = sbom.get("components", [])
+ for subcom in components:
+ add_component(subcom.get("name"), subcom.get("version"))
+ return fingps
+
+
def main():
try:
print("---------")
- print("Panthera(P.)uncia [v0.21]")
- print("A.R.P. Syndicate [https://arpsyndicate.io]")
+ print("Panthera(P.)uncia [v0.22]")
+ print("A.R.P. Syndicate [https://www.arpsyndicate.io]")
print("---------")
if len(sys.argv) < 3:
sys.exit(
- "usage: puncia [output_file/output_directory]\nrefer: https://github.com/ARPSyndicate/puncia#usage"
+ "usage: puncia [output_file/output_directory]\nrefer: https://github.com/ARPSyndicate/puncia#usage"
)
mode = sys.argv[1]
@@ -151,10 +170,15 @@ def main():
output_file = sys.argv[3] if len(sys.argv) == 4 else None
akey = read_key()
- if mode not in API_URLS and mode != "bulk" and mode != "storekey":
+ if (
+ mode not in API_URLS
+ and mode != "bulk"
+ and mode != "sbom"
+ and mode != "storekey"
+ ):
sys.exit("Invalid Mode")
- if mode == "bulk":
+ if mode == "bulk" or mode == "sbom":
if not os.path.isfile(query):
sys.exit("jsonfile as query input required for bulk mode")
if output_file:
@@ -162,9 +186,13 @@ def main():
os.makedirs(output_file + "/exploit/", exist_ok=True)
os.makedirs(output_file + "/enrich/", exist_ok=True)
else:
- sys.exit("Bulk Mode requires an Output Directory")
+ sys.exit("BULK & SBOM Mode require an Output Directory")
with open(query, "r") as f:
input_file = json.load(f)
+ if mode == "sbom":
+ new_input_file = {"exploit": []}
+ new_input_file["exploit"] = sbom_process(input_file)
+ input_file = new_input_file
if "subdomain" in input_file:
for bulk_query in input_file["subdomain"]:
try:
diff --git a/setup.py b/setup.py
index a2296da..e7820ea 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
setup(
name="puncia",
- version="0.21",
+ version="0.22",
author="A.R.P. Syndicate",
author_email="ayush@arpsyndicate.io",
keywords="subdomains subdomain exploits exploit arpsyndicate panthera uncia puncia snow leopard",