EvilZone
Programming and Scripting => Projects and Discussion => : Kulverstukas November 03, 2011, 09:12:10 PM
-
So I was writing a "program" and I was wondering how could one make a kill-switch for it? Like if I would like to suddenly, for some reason, remove it and everything associated with it.
My first idea was to make the program connect to a server and request, lets say a text file. If text file contains 0 then it does nothing, if it contains 1 then the program wipes itself without a trace. But that would be a major problem for more than 1 user, because then all of the programs would be removed.
Second idea was to make it filter by the IP. When a program is ran, it would connect to the server and put it's IP. Then I could issue a kill-command to some text file, it checks if the IP matches and acts accordingly. But that would also be a major problem with LAN networks where there are more than 1 computer.
I got an idea writing this - what if the program upon execution would generate a unique key, write it somewhere safe, like deep in a registry and then connect to the server and put the IP and the unique key. So when I would like to kill a specific program, I would just issue the unique key for it... but I guess it would be a problem with PC's without internet. Then maybe a timer...?
lolz, I probably answered my own question with the last idea :D
But I'd like to hear other thoughts anyway.
-
I once was working on a program that needed a kill-switch and my idea was to have the program connect to a server and then the server would send a packet and when that packet was received the program would be gone *poof* :P Just like your first idea.
-
You should specify exactly how you'd like to "kill" it(on your end, not user).
If is *program unknown to user* then shouldn't you have access to that piece of code *somehow*, could make an option to del it.
The way I'd modify your solution is:
client: program starts, connect to server.
client: sends info about its system such as hostname[for your sake] and a "unique" identifier.
server: if doesn't exist log; check a list/db to see if lives/dies, send appropriate instructions.
Unique identifier could be ComputerSystemProduct UUID (http://msdn.microsoft.com/en-us/library/windows/desktop/aa394105%28v=vs.85%29.aspx), in powershell:
PS K:\>(Get-WmiObject Win32_ComputerSystemProduct).UUID
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
You can find several other UUIDs on a windows system, or something like a MAC address could also work.
Then maybe a timer...?
If you only need it to run a certain amount of time, then you could delete on a specific date/time.. or an amount of time after first run.
-
yeah that is the problem here. I don't have access to the program. Once it is ran, I can't control it :P
-
Could always hop on the BotNet band wagon and issue commands via an IRC channel.