This commit is contained in:
YuruC3 2025-08-08 09:46:15 +02:00
parent 93ac65e87a
commit a2950a7c14
2 changed files with 11 additions and 0 deletions

View File

@ -87,6 +87,7 @@ def process_flow(i, entry):
.field("dstMask", inEntry["DST_MASK"])
.field("dstCntr", ermWhatTheCountry(str(inEntry["IPV4_DST_ADDR"])))
.field("srcCntr", ermWhatTheCountry(str(inEntry["IPV4_SRC_ADDR"])))
.tag("ISP", ermWhatTheISP(str(inEntry["IPV4_SRC_ADDR"])))
)
print("----------------")

View File

@ -14,5 +14,15 @@ def ermWhatTheCountry(inpIpAddress: Annotated[str, "Some IP address that ya want
except Exception as errrrrr:
return f"Error: {errrrrr}"
def ermWhatTheISP(inpIpAddress: Annotated[str, "Some IP address that ya want to get ISP for"]):
try:
skibidi = ip2loc_db.get_all(inpIpAddress)
#return rec.country_long # Full country name, e.g. "Sweden"
return skibidi.isp
except Exception as errrrrr:
return f"Error: {errrrrr}"
#print(ermWhatTheCountry("65.109.142.32"))