How to get user location silently?

All about creating websites!
Post Reply
User avatar
z3r0aCc3Ss
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 700
Joined: 23 Jun 2009, 16:00
14
Contact:

How to get user location silently?

Post by z3r0aCc3Ss »

I want to track a particular user's location. How do I do that without letting him know?
I am trying following code, but it asks whether to share the location or not... :(

Code: Select all

<!DOCTYPE html>
<html>
    <head>
		<script>
        	function getUserLocation()
			{
				//check if the geolocation object is supported, if so get position
				if (navigator.geolocation)
					navigator.geolocation.getCurrentPosition(displayLocation, displayError);
				else
					document.getElementById("locationData").innerHTML = "Sorry - your browser doesn't support geolocation!";
			}
			
			function displayLocation(position)
			{
				
				//build text string including co-ordinate data passed in parameter
				var displayText = "User latitude is " + position.coords.latitude + " and longitude is " + position.coords.longitude;
				
				//display the string for demonstration
				document.getElementById("locationData").innerHTML = displayText;
			}
			
			function displayError(error)
			{
				//get a reference to the HTML element for writing result
				var locationElement = document.getElementById("locationData");
				
				//find out which error we have, output message accordingly
				switch(error.code)
				{
					case error.PERMISSION_DENIED:
						locationElement.innerHTML = "Permission was denied";
						break;
					case error.POSITION_UNAVAILABLE:
						locationElement.innerHTML = "Location data not available";
						break;
					case error.TIMEOUT:
						locationElement.innerHTML = "Location request timeout";
						break;
					case error.UNKNOWN_ERROR:
						locationElement.innerHTML = "An unspecified error occurred";
						break;
					default:
						locationElement.innerHTML = "Who knows what happened...";
						break;
				}
			}
        </script>
    </head>
    <body>
    	<input type="button" value="get location" onclick="getUserLocation()"/>
        <div id="locationData">
	        Location data here
        </div>
    </body>
</html>
Any subtle way of doing this?
Beta tester for major RATs, all kinds of stealers and keyloggers.
Learning NMAP

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: How to get user location silently?

Post by ayu »

The only other way that us subtle would be to just grab the users IP together with a timestamp.
"The best place to hide a tree, is in a forest"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Re: How to get user location silently?

Post by bad_brain »

cats wrote:The only other way that us subtle would be to just grab the users IP together with a timestamp.
yes, everything else I can think of would be very intrusive and far away from being stealthy.

the question is: do you mean "tracking" like "following the location while the target is moving" or like "finding out the general IP location"? the first option can't be done without having physical access to the device that should be tracked in order to install software (or by using the standard trojan mails, which is of course the most far away from being stealthy as possible again).

for the latter option I can recommend to utilize the Maxmind GEOip database as it is very accurate from my experience, even in the free version:
http://www.maxmind.com/en/geolocation_landing" onclick="window.open(this.href);return false;
you could use it together with an analytics platform like Piwik which has onboard support for geoip:
http://piwik.org/" onclick="window.open(this.href);return false;
Image

User avatar
z3r0aCc3Ss
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 700
Joined: 23 Jun 2009, 16:00
14
Contact:

Re: How to get user location silently?

Post by z3r0aCc3Ss »

bad_brain wrote:
cats wrote:The only other way that us subtle would be to just grab the users IP together with a timestamp.
yes, everything else I can think of would be very intrusive and far away from being stealthy.

the question is: do you mean "tracking" like "following the location while the target is moving" or like "finding out the general IP location"? the first option can't be done without having physical access to the device that should be tracked in order to install software (or by using the standard trojan mails, which is of course the most far away from being stealthy as possible again).

for the latter option I can recommend to utilize the Maxmind GEOip database as it is very accurate from my experience, even in the free version:
http://www.maxmind.com/en/geolocation_landing" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;
you could use it together with an analytics platform like Piwik which has onboard support for geoip:
http://piwik.org/" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;
I do not want to track moving user. User is only at one location.
The code which I posted gives the latitude and longitude of the user. I want that specifically. Even if that is not possible silently, if I get IP address of that user, it would be fine. Can that be done only via analytics?
Beta tester for major RATs, all kinds of stealers and keyloggers.
Learning NMAP

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Re: How to get user location silently?

Post by bad_brain »

yeup, go for Piwik then. you just have to add the tracking code to the site you want to monitor (just like google analytics), also add the GEOip database (piwik has an option which makes that very easy, just takes a few clicks).

then you can track visitors and see what pages they looked at, their IPs, location, provider, etc......example:

Image
Image

User avatar
z3r0aCc3Ss
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 700
Joined: 23 Jun 2009, 16:00
14
Contact:

Re: How to get user location silently?

Post by z3r0aCc3Ss »

Thank b_b. Ohh, and anyways, I wanna talk to you about that e-cigarette thing.
Where can we chat privately regarding pricing and delivery?
Any IM contact or BB PIN?
Beta tester for major RATs, all kinds of stealers and keyloggers.
Learning NMAP

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Re: How to get user location silently?

Post by bad_brain »

sure, we can meet on IRC, I am quite busy at the moment (I always am, but I have been away for 3 days so I have to catch up with work), so what about friday? around the same time as now?
Image

Post Reply