8
8
API_URLS = {
9
9
"subdomain" : "http://api.subdomain.center/?domain=" ,
10
10
"exploit" : "http://api.exploit.observer/?keyword=" ,
11
+ "enrich" : "http://api.exploit.observer/?enrich=True&keyword=" ,
11
12
"auth_subdomain" : "http://api.subdomain.center/beta/?auth={0}&domain=" ,
12
13
"auth_exploit" : "http://api.exploit.observer/beta/?auth={0}&keyword=" ,
14
+ "auth_enrich" : "http://api.exploit.observer/beta/?auth={0}&enrich=True&keyword=" ,
13
15
"russia" : "http://api.exploit.observer/russia/" ,
14
16
"china" : "http://api.exploit.observer/china/" ,
17
+ "watchlist" : "http://api.exploit.observer/watchlist/" ,
15
18
}
16
19
17
20
@@ -33,12 +36,12 @@ def read_key():
33
36
34
37
35
38
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" ]:
37
40
url = API_URLS .get ("auth_" + mode ).format (akey )
38
41
else :
39
42
time .sleep (60 )
40
43
url = API_URLS .get (mode )
41
- if "^" in query :
44
+ if "^" in query and "exploit" in mode :
42
45
if query == "^RU_NON_CVE" :
43
46
url = API_URLS .get ("russia" )
44
47
query = "noncve"
@@ -49,6 +52,11 @@ def query_api(mode, query, output_file=None, cid=None, akey=""):
49
52
query = "noncve"
50
53
mode = "spec_exploit"
51
54
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"
52
60
if not url :
53
61
sys .exit ("Invalid Mode" )
54
62
response = requests .get (url + query ).json ()
@@ -77,6 +85,8 @@ def query_api(mode, query, output_file=None, cid=None, akey=""):
77
85
existing_data = []
78
86
existing_data .extend (response )
79
87
existing_data = list (set (existing_data ))
88
+ elif mode == "enrich" :
89
+ existing_data = response
80
90
elif mode == "exploit" :
81
91
if "entries" in existing_data and len (existing_data ["entries" ]) > 0 :
82
92
for lang in existing_data ["entries" ]:
@@ -127,13 +137,13 @@ def query_api(mode, query, output_file=None, cid=None, akey=""):
127
137
def main ():
128
138
try :
129
139
print ("---------" )
130
- print ("Panthera(P.)uncia [v0.19 ]" )
140
+ print ("Panthera(P.)uncia [v0.20 ]" )
131
141
print ("A.R.P. Syndicate [https://arpsyndicate.io]" )
132
142
print ("---------" )
133
143
134
144
if len (sys .argv ) < 3 :
135
145
sys .exit (
136
- "usage: puncia <mode:subdomain/exploit/bulk/storekey> <query:domain/eoidentifier/jsonfile/apikey> [output_file/output_directory]\n refer: https://github.com/ARPSyndicate/puncia#usage"
146
+ "usage: puncia <mode:subdomain/exploit/enrich/ bulk/storekey> <query:domain/eoidentifier/jsonfile/apikey> [output_file/output_directory]\n refer: https://github.com/ARPSyndicate/puncia#usage"
137
147
)
138
148
139
149
mode = sys .argv [1 ]
@@ -150,6 +160,7 @@ def main():
150
160
if output_file :
151
161
os .makedirs (output_file + "/subdomain/" , exist_ok = True )
152
162
os .makedirs (output_file + "/exploit/" , exist_ok = True )
163
+ os .makedirs (output_file + "/enrich/" , exist_ok = True )
153
164
else :
154
165
sys .exit ("Bulk Mode requires an Output Directory" )
155
166
with open (query , "r" ) as f :
@@ -177,6 +188,17 @@ def main():
177
188
)
178
189
except Exception as ne :
179
190
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 )} " )
180
202
181
203
elif mode == "storekey" :
182
204
store_key (query )
0 commit comments