33
44class shodan_enterprise (BaseModule ):
55 watched_events = ["IP_ADDRESS" ]
6- produced_events = ["OPEN_TCP_PORT" , "TECHNOLOGY" , "OPEN_UDP_PORT" , "ASN" , "VULNERABILITY " ]
6+ produced_events = ["OPEN_TCP_PORT" , "TECHNOLOGY" , "OPEN_UDP_PORT" , "ASN" , "FINDING " ]
77 flags = ["passive" , "safe" ]
88 meta = {
99 "created_date" : "2026-01-27" ,
@@ -71,7 +71,7 @@ async def handle_event(self, event):
7171 "ASN" ,
7272 parent = event ,
7373 tags = host .get ("tags" ) or [],
74- context = f"Shodan API { ip } request and find ASN" ,
74+ context = f"{{module}} queried Shodan API for { ip } and found ASN" ,
7575 )
7676
7777 if "data" not in host :
@@ -91,7 +91,7 @@ async def handle_event(self, event):
9191 "TECHNOLOGY" ,
9292 parent = event ,
9393 tags = data .get ("tags" ) or [],
94- context = f"Shodan API { ip } request and find TECHNOLOGY: { technology } " ,
94+ context = f"{{module}} queried Shodan API for { ip } and found TECHNOLOGY: { technology } " ,
9595 )
9696
9797 for technology in data .get ("cpe23" , []):
@@ -101,7 +101,7 @@ async def handle_event(self, event):
101101 "TECHNOLOGY" ,
102102 parent = event ,
103103 tags = data .get ("tags" ) or [],
104- context = f"Shodan API { ip } request and find TECHNOLOGY: { technology } " ,
104+ context = f"{{module}} queried Shodan API for { ip } and found TECHNOLOGY: { technology } " ,
105105 )
106106
107107 # TECHNOLOGY Additional Formats
@@ -116,7 +116,7 @@ async def handle_event(self, event):
116116 "TECHNOLOGY" ,
117117 parent = event ,
118118 tags = data .get ("tags" ) or [],
119- context = f"Shodan API { ip } request and find TECHNOLOGY: { data ['product' ]} " ,
119+ context = f"{{module}} queried Shodan API for { ip } and found TECHNOLOGY: { data ['product' ]} " ,
120120 )
121121
122122 if "http" in data :
@@ -130,7 +130,7 @@ async def handle_event(self, event):
130130 "TECHNOLOGY" ,
131131 parent = event ,
132132 tags = tags ,
133- context = f"Shodan API { ip } request and find TECHNOLOGY: { technology } " ,
133+ context = f"{{module}} queried Shodan API for { ip } and found TECHNOLOGY: { technology } " ,
134134 )
135135
136136 # OPEN_TCP_PORT, OPEN_UDP_PORT Extraction
@@ -141,20 +141,20 @@ async def handle_event(self, event):
141141 "OPEN_TCP_PORT" ,
142142 parent = event ,
143143 tags = data .get ("tags" ) or [],
144- context = f"Shodan API { ip } request and find OPEN_TCP_PORT: { data .get ('port' )} " ,
144+ context = f"{{module}} queried Shodan API for { ip } and found OPEN_TCP_PORT: { data .get ('port' )} " ,
145145 )
146146 elif data ["transport" ] == "udp" :
147147 await self .emit_event (
148148 self .helpers .make_netloc (ip , data .get ("port" )),
149149 "OPEN_UDP_PORT" ,
150150 parent = event ,
151151 tags = data .get ("tags" ) or [],
152- context = f"Shodan API { ip } request and find OPEN_UDP_PORT: { data .get ('port' )} " ,
152+ context = f"{{module}} queried Shodan API for { ip } and found OPEN_UDP_PORT: { data .get ('port' )} " ,
153153 )
154154 else :
155155 self .warning (f"Unknown transport { data ['transport' ]} " )
156156
157- # VULNERABILITY Extraction
157+ # FINDING Extraction
158158 if "vulns" in data :
159159 for cve , vuln_data in data ["vulns" ].items ():
160160 cvss = vuln_data .get ("cvss" , 0 )
@@ -163,14 +163,16 @@ async def handle_event(self, event):
163163 key = lambda x : severity_map [x ],
164164 )
165165 vuln = {
166+ "name" : "Shodan - Possible Vulnerabilities" ,
166167 "host" : data .get ("ip_str" ),
167168 "severity" : severity ,
168169 "description" : cve ,
170+ "confidence" : "LOW"
169171 }
170172 await self .emit_event (
171173 vuln ,
172- "VULNERABILITY " ,
174+ "FINDING " ,
173175 parent = event ,
174176 tags = [],
175- context = f"Shodan API { ip } request and find VULNERABILITY { cve } " ,
177+ context = f"{{module}} queried Shodan API for { ip } and found FINDING { cve } " ,
176178 )
0 commit comments