Skip to content

Commit 00858cc

Browse files
Added support for district, ASN and AS
1 parent a53b251 commit 00858cc

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## IP2Location Nmap script
22

3-
This IP2Location Nmap script provides a fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, station name, mcc, mnc, mobile brand, elevation, usage type, address type and IAB category from IP address by using the IP2Location Lua Package.
3+
This IP2Location Nmap script provides a fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, station name, mcc, mnc, mobile brand, elevation, usage type, address type, IAB category, district, autonomous system number (ASN) and autonomous system (AS) from IP address by using the IP2Location Lua Package.
44

55
The database will be updated on a monthly basis for greater accuracy. Free LITE databases are available at <https://lite.ip2location.com/> upon registration.
66

@@ -50,4 +50,4 @@ Indicates the path of the database file to use.
5050

5151
# Copyright
5252

53-
Copyright (C) 2022 by IP2Location.com, [support@ip2location.com](mailto:support@ip2location.com)
53+
Copyright (C) 2023 by IP2Location.com, [support@ip2location.com](mailto:support@ip2location.com)

ip-geolocation-ip2location.nse

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ local nmap = require "nmap"
33
local stdnse = require "stdnse"
44

55
description = [[
6-
Use IP2Location geolocation database to lookup the geolocation information with IP2Location Lua Package. It can be used to determine country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation, usage type, address type and IAB category that any IP address or hostname originates from. https://www.ip2location.com
6+
Use IP2Location geolocation database to lookup the geolocation information with IP2Location Lua Package. It can be used to determine country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation, usage type, address type, IAB category, district, autonomous system number (ASN) and autonomous system (AS) that any IP address or hostname originates from. https://www.ip2location.com
77
88
The database will be updated on a monthly basis for greater accuracy. Free LITE databases are available at https://lite.ip2location.com/ upon registration.
99
@@ -43,6 +43,9 @@ Both IPv4 and IPv6 are supported.
4343
-- usagetype: N/A
4444
-- addresstype: N/A
4545
-- category: N/A
46+
-- district: N/A
47+
-- asn: N/A
48+
-- as: N/A
4649

4750
author = "IP2Location"
4851
license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
@@ -166,5 +169,20 @@ action = function(host,port)
166169
else
167170
print("category: " .. result.category)
168171
end
172+
if ((result.district) == "This parameter is unavailable for selected data file. Please upgrade the data file.") then
173+
print("district: N/A")
174+
else
175+
print("district: " .. result.district)
176+
end
177+
if ((result.asn) == "This parameter is unavailable for selected data file. Please upgrade the data file.") then
178+
print("asn: N/A")
179+
else
180+
print("asn: " .. result.asn)
181+
end
182+
if ((result.as) == "This parameter is unavailable for selected data file. Please upgrade the data file.") then
183+
print("as: N/A")
184+
else
185+
print("as: " .. result.as)
186+
end
169187

170188
end

0 commit comments

Comments
 (0)