How to create a autorun.inf file that pings to a certain ip?
In the moment the drive containing the autorun.inf is plugged in the pc, it should automatically ping to a server outside its network
- oyubirLv 63 years agoFavorite Answer
I guess it is the same question I've already answered yesterday (if not, that is a surprising coincidence, since yesterday the question was "how to ping to a server when a USB key is inserted").
Whatever, the answer is still the same. You can't.
As Chris said, no autorun for USB drives. And even drives who still read autorun.inf, that is only to choose icon and label that will appear in the "autoplay" menu. That menu needs a user activation (so, forget silent pinging of a certain IP whenever your buddy plugged in a USB drive).
And the configuration (what item in the autoplay menu is chosen) has to be on the PC, not on the removable drive.
So, in short: you can't (or still can't, if you are the same that asked the other question yesterday).
And the reason why you can't is... precisely to prevent people to do what you want to do.
The only solutions to ping an IP whenever a drive is inserted are
1) Phish the user into doing it (obvious method: a beautiful "double click here for free porn".bat file on the drive. But you can't be more subtle. The point is you need to convince the user of the PC to launch the script him/herself
2) Installing first on the PC (and not on the removable drive, as "autorun" implies) a script, running into background, polling constantly for the drive, and ping the IP when the drive is inserted
3) Using a specific hardware as a drive. For example, a USB drive that is also a "fake USB keyboard". That could then launch whatever you want, by using shortcuts and command lines (not exactly silently, since a window will appear were you "type" the command. But since this fake keryboard could be way faster than a human, that will just appear as a flashing, window, that the user wont be able to read)
It is often said that spies have such devices. But you wont find some at your local Wallmart. Technically, there is nothing hard in it. You could do it easily with an arduino. But to have a small compact key that's look like a drive is something out of reach for the average McGyver.
Maybe some chinese websites have some. Afterall, they shamelessly and openly sell hidden camera specifically designed to take pictures under girls skirts. So why not keyloggers and "fake keyboard" devices.
But, well, short answer: you can't.
- 3 years ago
Enter the following command: ping ipaddress (replace ipaddress with the IP to be pinged)
If you want the output to be saved to a file, re-write the command as follows: ping ipaddress >> C:\(path to the file).
Save your file as ping.bat
When saving, save your file as “All files” not as .txt.
Launch it by double-clicking or call it from Command prompt (for example, if it’s in Documents, enter C:\Users\username\Documents\ping.bat).
- ChrisLv 73 years ago
USB drives don't support autorun, for security reasons.