Show networks from local db on Google Maps. With search, filtering, and more!

The gear needed for wardriving

21 posts • Page 1 of 2
Hi everyone, my first post here on the forum. A while ago I wanted to see the WiFi networks in my area, and do things like filter on encryption, frequency etc. , but I couldn't find any existing software that did the job as I wanted it to. I also really wanted to learn programming, so for the last year and a half or so I've been occasionally working on a system that takes data generated by the WiGLE app, and overlays it on google maps. Complete with extensive filtering options.

I have a working version live on http://wifikart.net , and source code available at https://github.com/Znerox/wifimap. I've been mostly focused on the technical side of this, so the UI is far from finished. It's designed for 1920x1080 resolution (1280x1024 also works fine), and doesn't scale well on smaller screens.

The system is based on 3 different maps, showing data from 3 different tables on a local MySQL database.
One map shows all the different networks on the map, with search and filtering support.
Another map shows more detailed location info on a specific network, like where the network has been sighted, along with time, and signal strength.
The last map is based on data from airodump-ng (aircrack-ng suite). It shows which networks the client has been connected to, and any router with an SSID matching one the client has been probing for. For privacy reasons I've not included any data about clients on the live map.

If this sounds interesting, please take a look, and come with feedback (UI improvements, features you want to see etc.). I think I have all the core features in place, mostly UI improvements and smaller tweaks left on the front-end. The backend is pretty complicated as well, but I've tried to make it as painless as possible to set up on your own. There is obviously some work left before this is truly ready for "release", and I'd really like some input from fellow wardrivers to hear what you think. Thanks!
Znerox, this is a very cool site! You live in a very beautiful section of the planet.

First suggestion -- drop the Zapf Chancery font. Please :)

The site seems to work well in Safari or Chrome on OS X. The zooming heat-map/bubble display is a nice way to summarize the active APs in an area as you zoom in. First load of the main page seemed to take a couple of minutes to display anything -- I thought I might have to search first, but patience eventually paid off.
I'm getting pretty widely range page-load speeds when I use the individual AP 'Precise Location' and 'Client Info' buttons.
Clients usually takes me to a much zoomed-out view of your island with no further information.
I am not sure I understand the need for the separate 'Location' view. The only information added the info balloon in that view seems to be 'Accuracy' and a 'Date' instead of 'Last Seen' date.

Nice start, I'll poke around a bit more and give some more feedback!
Image
Thanks for the feedback! You don't like comic sans? :lol:

The long load time is strange, for me it takes only a few seconds. The server is located in Norway, so that probably delays it a little bit, if you're halfway around the globe. Edit: I see that when the page is loaded, over 4MB is downloaded in the browser. That is about 35 megabit, so if someone has a 1mb/s connection, it will take at least 35 sec just to download the data. Ideally only gps coordinates and icon url should be transferred on page load, then data on each network when the user clicks the marker, and brings up the info bubble.

As I said I removed all client info from the db, so that's why the page doesn't show any info. I should probably make that clearer on the site.

As for the location view the thought behind it is to make it possible to triangulate networks. Often you'll get somewhere around 5-10 sightings of each network, with the signal strength on each spot. With that, it's possible to make an educated guess on where the router is placed. But the usefulness varies, as some networks doesn't have any data in the "location" table. That's why you get a zoomed in image with no markers on some networks.
Doing a fresh load of the main page, it looks like Safari is loading data for about 90 seconds at an average of 70Kbps. I have a 40 meg DSL connection, so the speed limit must be from your side. After the load finishes, it takes about 10 seconds for Safari to render the 'heat map'. Chrome does the load at the same pace and the render in about 5 seconds.

Once the initial load is done, navigating is very responsive. I can zoom into the University in about 4 clicks and be down to discrete AP balloons and data.
Image
Hi there
Fascinated by this piece of work but I'm failing at the last hurdle-when I try to upload a file I get the message " Sorry, there was an error uploading your file.". I can populate the SQL database from the dbsetup file-but no records ever go in! Looking through some other forums, I think I may be missing an "uploads" directory somewhere-or I have a permission problem?
I can get to the wifimap page (I'm using a Raspberry Pi as the host), I can see my centre where I set it in the file-the bit I cant understand is how these .php scripts get the network and location csv files "into" the database-and then be served by the Apache web server. I know its something simple but I've been wracking my brains for days, trying to work it out, to no avail.Any help would be most welcome :)
That one can be a pain... Once the file is transferred to the server it will be stored in "web_root/tools/php/uploads", and the php script will work on it from there. It seems you need to create that folder yourself, and set permissions to "777" (full permission for every user).

If you're interested, line 43-121 in tools/network_import.php is where the magic happens. The data is read from the file, and is used to manipulate the table in the db. While line 425-482 in wifimap/js/index.js is where the client receives an xml file with the network info. That part is achieved by wifimap/php/genxml.php connecting directly to the database, querying the data being asked for by the client, and returning it neatly packaged in an xml file. (Don't ask my how the xml part works, based on code taken from Google Developers). Let me know what you think when you get it running! and don't be afraid to pm me if you got any questions :D
Thanks for the reply-so I created a uploads dir in /var/www/html/tools/php/ -and heh presto, I can see the files appearing in the folder-:-)
I then hit the update field in database-but when I look at the sql table, no records appear :-( The column structure from file to database looks correct-when I look at the apache logs, I see the script button being hit-but not much else. So it looks like I now need to find out why the database isn't being populated....
#Update-looking at the error log, there is obviously a permission error with whatever user I have in phpmyadmin set-up, when it is writing to the SQL database-tried a few things but no luck...
[Tue Aug 30 10:54:02.952327 2016] [:error] [pid 1303] [client 192.168.50.12:59195] PHP Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'MYSQL_USERNAME'@'localhost' (using password: YES) in /var/www/html/tools/php/location_import.php on line 43, referer: http://192.168.50.19/tools/
[Tue Aug 30 10:54:02.952657 2016] [:error] [pid 1303] [client 192.168.50.12:59195] PHP Warning: mysqli_set_charset(): Couldn't fetch mysqli in /var/www/html/tools/php/location_import.php on line 46, referer: http://192.168.50.19/tools/
I'm using my MACbook and phpmyadmin to upload the files (which is the 192.168.50.12 client, 192.168.50.19 is the Pi hosting the SQL database)-just need some help and I should be sorted-tried a few thing in the "Privileges" section but no joy!

cheers
cabs
It seems I forgot to add a few crucial steps in the readme :roll:
The problem is the script has no real credentials to log in with

Code: Select all

Access denied for user 'MYSQL_USERNAME'@'localhost'
You need to enter your username/password for the mysql user the php script will be logging in as. I would name a user "wifimap" and give it full privileges to the "wifimap" db, and no global privileges. There are four different dbinfo.php files, located in
  1. web_root/tools/php/
  2. web_root/wifimap/php
  3. web_root/wifimap/location/php
  4. web_root/wifimap/clients/php
This is an education in SQL, which I've never ventured into before-so that's a plus :D
The wifimap user seems to have fixed the auth problem-when I upload and then update, no PHP errors-which were there before. But here's the weird thing...
Network and location csv still dont populate into the DB-but the client side csv (from aircrack) does! So still not seeing anything on the map-anything else I can look at?

cheers
cabs
After you press "Upload file", is any text printed out in the tab? When it's all done it should print out some statistics, or at least give an error message. You could try logging in to phpMyAdmin, and checking under "Status", if everything is working you should see the actual sql queries as they are being run.
Good question-on the client import side, I get 105 records imported-and I do-DB looks great.On the network and the location side, all I get is "script completed". I'm guessing the lack of further information is a bad thing :?

cheers

cabs
How many networks are in the file? how long does it take to complete? If you're up for it you could try to debug and see if you spot any errors. Ctrl+Shift+I in chrome/windows. I suspect any errors would show up under "Console", if there are php errors it might not show anything. The problem is probably on the server end (not a problem with the files). But if you want you could pm me a link to download the files you are trying to import, and I'll see if there's any reason it would fail.
Will do with the suggestions-PM sent with sample from each file with headers

cheers

cabs
So been playing with this again this morning :-) Points for peeps to note:

The dbsetup file which "makes" the SQL database has columns which I dont see in my captures-the clients one has about 6 columns, whereas mine has about 15! (captured from latest version of aircrack). Network and location seem fine (one of my captures had a hidden column, which I couldn't see in my text editor-more on that later)
I still cant upload data into the network or location tables-BUT i can do it manually, using the phpmyadmin Import function-so there seems to be (still) some sort of disconnect between the php script and the SQL side of things
When I do get all 3 tables populated (I had to to play around with my client csv, to match up with the pre-formatted dbsetup one (and even then drop a few colunms that I couldn't see for the import to work), I still cant get anything to show up in the map-what I do see in /var/log/apache2/error.log is the following:
[Tue Aug 30 22:02:13.148362 2016] [:error] [pid 1636] [client 192.168.50.11:55084] PHP Notice: Use of undefined constant wpa_wps_network - assumed 'wpa_wps_network' in /var/www/html/wifimap/php/genxml.php on line 132, referer: http://192.168.50.19/wifimap/
[Tue Aug 30 22:02:13.148444 2016] [:error] [pid 1636] [client 192.168.50.11:55084] PHP Notice: Use of undefined constant open_network - assumed 'open_network' in /var/www/html/wifimap/php/genxml.php on line 147, referer: http://192.168.50.19/wifimap/
[Tue Aug 30 22:02:13.148530 2016] [:error] [pid 1636] [client 192.168.50.11:55084] PHP Notice: Use of undefined constant wep_network - assumed 'wep_network' in /var/www/html/wifimap/php/genxml.php on line 147, referer: http://192.168.50.19/wifimap/
[Tue Aug 30 22:02:13.148619 2016] [:error] [pid 1636] [client 192.168.50.11:55084] PHP Notice: Use of undefined constant open_network - assumed 'open_network' in /var/www/html/wifimap/php/genxml.php on line 164, referer: http://192.168.50.19/wifimap/
[Tue Aug 30 22:02:13.148710 2016] [:error] [pid 1636] [client 192.168.50.11:55084] PHP Notice: Use of undefined constant wep_network - assumed 'wep_network' in /var/www/html/wifimap/php/genxml.php on line 164, referer: http://192.168.50.19/wifimap/
[Tue Aug 30 22:02:13.148800 2016] [:error] [pid 1636] [client 192.168.50.11:55084] PHP Notice: Use of undefined constant open_network - assumed 'open_network' in /var/www/html/wifimap/php/genxml.php on line 181, referer: http://192.168.50.19/wifimap/
[Tue Aug 30 22:02:13.148886 2016] [:error] [pid 1636] [client 192.168.50.11:55084] PHP Notice: Use of undefined constant open_network - assumed 'open_network' in /var/www/html/wifimap/php/genxml.php on line 198, referer: http://192.168.50.19/wifimap/
[Tue Aug 30 22:02:13.148968 2016] [:error] [pid 1636] [client 192.168.50.11:55084] PHP Notice: Use of undefined constant open_network - assumed 'open_network' in /var/www/html/wifimap/php/genxml.php on line 215, referer: http://192.168.50.19/wifimap/
[Tue Aug 30 22:02:13.149057 2016] [:error] [pid 1636] [client 192.168.50.11:55084] PHP Notice: Use of undefined constant wep_network - assumed 'wep_network' in /var/www/html/wifimap/php/genxml.php on line 215, referer: http://192.168.50.19/wifimap/
[Tue Aug 30 22:02:13.149140 2016] [:error] [pid 1636] [client 192.168.50.11:55084] PHP Notice: Use of undefined constant wpa_wps_network - assumed 'wpa_wps_network' in /var/www/html/wifimap/php/genxml.php on line 215, referer: http://192.168.50.19/wifimap/
Not sure what this is but the call to the webserver is screwing up something.I wont give up on this :-) but there is more to getting this working on a standalone machine than meets the eye!

cheers

cabs
Don't worry too much about it. What you're describing here sounds normal. The php scripts aren't just blindly reading from the files and writing it to the database, there is a lot of stuff going on behind the scenes. The php notice from the log doesn't break anything, it correctly assumes that it's a variable. I've sent you a pm.

21 posts • Page 1 of 2

Return to “Net Hugging Hardware and Software”

Who is online

Users browsing this forum: No registered users and 10 guests