View Single Post
Old Feb 27th, 2008, 9:14 PM   #5
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,010
Rep Power: 5 lectricpharaoh will become famous soon enough
Re: Can ANYONE Do this?

On a Windows machine, when you connect a device that appears as a 'mass storage device' to the computer, such as a flash disk, media player, phone, etc, it will automatically run software stored on the device, given two conditions. First is that Autoplay is enabled for the logical drive in question, ie the drive letter. This may not be the same assignment between sessions, if the user connects different devices, and is unlikely to be the same between computers. The second is that the device needs an autorun.inf file that specifies what program(s) to run.

This means that it's a simple matter to do this on a Windows-based machine if Autoplay is enabled (it's enabled by default, and many novice users don't change this). Once your program is executed, it can do pretty much whatever it wants, including obtaining the local IP address(es) assigned to the computer. This might be different from the external IP address, if the machine is behind a router, but you can determine that easily enough by parsing the returned data from sites such as whatismyip.org. Alternatively, you can query the router if this is supported, but a direct method probably isn't on many home routers, which leaves parsing a mess of generated HTML for the address, and it will be different for each router model.

Once you have the IP address(es) you need, it's a simple matter to send the data to your destination.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote