Skip to content

Commit

Permalink
puncia[0.22]
Browse files Browse the repository at this point in the history
  • Loading branch information
g147 committed Aug 6, 2024
1 parent 033f3b6 commit f999968
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 17 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ Puncia utilizes two of our intelligent APIs to gather the results - <br>
## Usage
1. Store an API key (storekey) - `puncia storekey <api-key>`
2. Query Domains (subdomain) - `puncia subdomain <domain> <output-file>`
3. Query Exploit & Vulnerability Identifiers (exploit) - `puncia exploit <eoidentifier> <output-file>`
- 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 <eoidentifier> <output-file>`
5. Bulk Queries (bulk)- `puncia bulk <json-file> <output-directory>`<br>
- 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 <output-file>`
- Chinese VIDs with no associated CVEs (^CN_NON_CVE) - `puncia exploit ^CN_NON_CVE <output-file>`
- Daily Vulnerability & Exploit Watchlist (^WATCHLIST) - `puncia exploit ^WATCHLIST <output-file>`
- [Supported Vulnerability Identifiers](https://github.com/ARPSyndicate/docs?tab=readme-ov-file#supported-vulnerability-identifiers) - `puncia exploit <eoidentifier> <output-file>`
4. Enrich CVE/GHSA Identifiers (enrich) - `puncia enrich <cve-id/ghsa-id> <output-file>`
5. Multiple Queries (bulk/sbom)
- Bulk Input JSON File Format - `puncia bulk <json-file> <output-directory>`
```
{
"subdomain": [
Expand All @@ -46,6 +46,8 @@ Puncia utilizes two of our intelligent APIs to gather the results - <br>
]
}
```
- [SBOM Input JSON File Format](https://github.com/CycloneDX/bom-examples/blob/master/SBOM/protonmail-webclient-v4-0912dff/bom.json) - `puncia sbom <json-file> <output-directory>`
<br>
## Noteworthy Mentions
Expand All @@ -56,6 +58,7 @@ Puncia utilizes two of our intelligent APIs to gather the results - <br>
- [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)
42 changes: 35 additions & 7 deletions puncia/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -134,37 +138,61 @@ 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 <mode:subdomain/exploit/enrich/bulk/storekey> <query:domain/eoidentifier/jsonfile/apikey> [output_file/output_directory]\nrefer: https://github.com/ARPSyndicate/puncia#usage"
"usage: puncia <mode:subdomain/exploit/enrich/bulk/sbom/storekey> <query:domain/eoidentifier/jsonfile/apikey> [output_file/output_directory]\nrefer: https://github.com/ARPSyndicate/puncia#usage"
)

mode = sys.argv[1]
query = sys.argv[2]
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:
os.makedirs(output_file + "/subdomain/", exist_ok=True)
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:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="puncia",
version="0.21",
version="0.22",
author="A.R.P. Syndicate",
author_email="[email protected]",
keywords="subdomains subdomain exploits exploit arpsyndicate panthera uncia puncia snow leopard",
Expand Down

0 comments on commit f999968

Please sign in to comment.