From 9e62f03264e9e4ef5671dc89647e820960d3550e Mon Sep 17 00:00:00 2001
From: Ayush Singh <26509147+g147@users.noreply.github.com>
Date: Wed, 1 Jan 2025 15:26:02 +0530
Subject: [PATCH] puncia[0.26]
---
README.md | 17 +++++++++++------
puncia/__main__.py | 34 +++++++++++++++++++++++++++-------
setup.py | 2 +-
3 files changed, 39 insertions(+), 14 deletions(-)
diff --git a/README.md b/README.md
index db3c14e..e80ba24 100644
--- a/README.md
+++ b/README.md
@@ -26,14 +26,15 @@ Puncia utilizes two of our intelligent APIs to gather the results -
1. Store an API key (storekey) - `puncia storekey `
2. Query Domains (subdomain) - `puncia subdomain `
-3. Query Exploit & Vulnerability Identifiers (exploit)
+3. Query Replica Domains (replica) - `puncia replica `
+4. 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 `
- Vulnerability & Exploit Identifers Watchlist (^WATCHLIST_IDES) - `puncia exploit ^WATCHLIST_IDES `
- Vulnerable Technologies Watchlist (^WATCHLIST_TECH) - `puncia exploit ^WATCHLIST_TECH `
- [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)
+5. Enrich CVE/GHSA Identifiers (enrich) - `puncia enrich `
+6. Multiple Queries (bulk/sbom)
- Bulk Input JSON File Format - `puncia bulk `
```
@@ -42,6 +43,10 @@ Puncia utilizes two of our intelligent APIs to gather the results -
"domainA.com",
"domainB.com"
],
+ "replica": [
+ "domainA.com",
+ "domainB.com"
+ ],
"exploit": [
"eoidentifierA",
"eoidentifierB"
@@ -54,7 +59,7 @@ 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 `
-6. External Import
+7. External Import
```
import puncia
@@ -81,6 +86,6 @@ Puncia utilizes two of our intelligent APIs to gather the results -
## More from [A.R.P. Syndicate](https://www.arpsyndicate.io)
+- [VEDAS Advisories](https://vedas.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)
\ No newline at end of file
+- [Attack Surface Management](https://asm.arpsyndicate.io)
\ No newline at end of file
diff --git a/puncia/__main__.py b/puncia/__main__.py
index 3fa0f38..d55ce5c 100755
--- a/puncia/__main__.py
+++ b/puncia/__main__.py
@@ -7,9 +7,11 @@
API_URLS = {
"subdomain": "https://api.subdomain.center/?domain=",
+ "replica": "https://api.subdomain.center/?engine=octopus&domain=",
"exploit": "https://api.exploit.observer/?keyword=",
"enrich": "https://api.exploit.observer/?enrich=True&keyword=",
"auth_subdomain": "https://api.subdomain.center/beta/?auth={0}&domain=",
+ "auth_replica": "https://api.subdomain.center/beta/?auth={0}&engine=octopus&domain=",
"auth_exploit": "https://api.exploit.observer/beta/?auth={0}&keyword=",
"auth_enrich": "https://api.exploit.observer/beta/?auth={0}&enrich=True&keyword=",
"russia": "https://api.exploit.observer/russia/",
@@ -35,7 +37,7 @@ def read_key():
def query_api(mode, query, output_file=None, cid=None, apikey=""):
- if len(apikey) > 0 and mode in ["exploit", "subdomain", "enrich"]:
+ if len(apikey) > 0 and mode in ["exploit", "subdomain", "enrich", "replica"]:
url = API_URLS.get("auth_" + mode).format(apikey)
else:
time.sleep(25)
@@ -63,7 +65,7 @@ def query_api(mode, query, output_file=None, cid=None, apikey=""):
cid = "Vulnerable Technologies Watchlist"
if not url:
sys.exit("Invalid Mode")
- retries = 3
+ retries = 1
counter = 0
response = {}
while counter <= retries:
@@ -74,12 +76,15 @@ def query_api(mode, query, output_file=None, cid=None, apikey=""):
except:
print("An exception happened while requesting: " + query)
counter = counter + 1
- time.sleep(60)
+ time.sleep(30)
if not response or len(response) == 0:
print("Null response from the API for: " + query)
return
if mode in ["spec_exploit"]:
- os.system("rm " + output_file)
+ try:
+ os.remove(output_file)
+ except:
+ pass
for reurl in response:
query_api(
"exploit",
@@ -94,7 +99,7 @@ def query_api(mode, query, output_file=None, cid=None, apikey=""):
if os.path.isfile(output_file):
with open(output_file, "r") as f:
existing_data = json.load(f)
- if mode == "subdomain":
+ if "subdomain" in mode or "replica" in mode:
if len(existing_data) == 0:
existing_data = []
existing_data.extend(response)
@@ -172,13 +177,13 @@ def add_component(name, version):
def main():
try:
print("---------")
- print("Panthera(P.)uncia [v0.25]")
+ print("Panthera(P.)uncia [v0.26]")
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]
@@ -199,6 +204,7 @@ def main():
sys.exit("jsonfile as query input required for bulk mode")
if output_file:
os.makedirs(output_file + "/subdomain/", exist_ok=True)
+ os.makedirs(output_file + "/replica/", exist_ok=True)
os.makedirs(output_file + "/exploit/", exist_ok=True)
os.makedirs(output_file + "/enrich/", exist_ok=True)
else:
@@ -223,6 +229,20 @@ def main():
except Exception as ne:
sys.exit(f"Error: {str(ne)}")
continue
+ if "replica" in input_file:
+ for bulk_query in input_file["replica"]:
+ try:
+ rdata = query_api(
+ "replica",
+ bulk_query,
+ output_file + "/replica/" + bulk_query + ".json",
+ apikey=apikey,
+ )
+ if len(rdata) > 0:
+ print(json.dumps(rdata, indent=4, sort_keys=True))
+ except Exception as ne:
+ sys.exit(f"Error: {str(ne)}")
+ continue
if "exploit" in input_file:
for bulk_query in input_file["exploit"]:
try:
diff --git a/setup.py b/setup.py
index 917ab50..60285b5 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
setup(
name="puncia",
- version="0.25",
+ version="0.26",
author="A.R.P. Syndicate",
author_email="ayush@arpsyndicate.io",
keywords="subdomains subdomain exploits exploit sbom cyclonedx arpsyndicate panthera uncia puncia snow leopard",