Let's get this into Nmap!
Proof-of-concept of mapping IP addresses using Google Static Maps.
Used wrong variable name.
Proof-of-concept of mapping IP addresses using Bing Static Maps.
Improve Bing support to map up to 100 IPs.
Improve geoPlugin error handling when throttled.
Proof-of-concept of exporting IP addresses into a KML file.
Favour table operations over concatenation.
Lots of tweaks, Google, KML, and the lib are ready for real QA.
Bing is functional, need more arg docs.
Bing is ready for QA.
Add geoip use to other geolocation scripts.
@mogigoma This is looking good! There were a couple issues with missing libraries (string, table), and one place where you used query instead of path in an error message return. Use the check script or git hooks to check this stuff.
Of a bit more concern, when I use the KML script with ip-geolocation-geoplugin and then import into mymaps.google.com, it won't show anything with a negative longitude. Is there a standard for this that Google is expecting but Geoplugin is providing differently? Should we be doing some sort of conversion?
For the KML script, if your output is just a message as a string, it's ok to just return that. No need to mess around with stdnse.output_table() or stdnse.format_output. In fact, it's usually incorrect to mix those two.
Try to reduce the number of calls to table.insert in ip-geolocation-map-kml. Create the table with a single string element containing the file header. Insert one element into the table per coordinate: the KML for that point. It can contain newlines, you can format it with string.format, or anything. That is cheaper and cleaner than building a table with 6 times as many elements as necessary.
Overall, this looks great, and I'd like to get it done this week.
Corrected errors discovered by nmap-check.sh.
Add protections against placing invalid values in the geoip registry.
Correct KML to use (lon, lat) unlike others which use (lat, lon).
Simplify result output for string message.
Reduced concatenation and table operations.
I had the Git hook in place but it was failing without me noticing due to reinstalling and not having lua5.2 and pep8 installed. Ran all files through nmap-check.sh, should be good now.
For the KML, swapped lat and lon and added protections in the library against nonsensical GPS coords. KML script now has fewer concats and inserts. Used [[ ... ]] notation and out-dented further than normal to get the KML output to look right, seemed better than lots of \n[sp][sp][sp][sp] to get the indentation correct.
[[ ... ]]
New scripts for geo mapping. Closes #606