Intentionally Creating a Backdoor to My Desktop PC via USB-Thumbdrive
So I recently had this problem: My NAS and my home server were both down, I was away (at school) and needed to access some files I had on my big desktop pc at home. Normally, this wouldn't be that bad, since there was physically someone in the house I was able to call, but... Well, let's just say I'm incredibly paranoid and my passwords are 32+ alpha-numeric chars with special signs and everything... The “physically present person” was not too amused and eventually (after mistyping for a few of times) gave up. Therefore, the need for me to access my files remotely was born. And since I don't want to save everything to my NAS that I might eventually could potentially need sometime in the future, I want it to work on the local actual files on my desktop pc. So what could I do?
At first, I thought I could simply add a small partition on my local hard drive, which, when booted, would simply do nothing more than to open an ssh login so that I could log into this partition and mount all my other stuff from there (since I do have a VPN connection to my home network). That idea was from a couple of months ago, but I kept on coming back to this idea again and again. Since I was unable to find a good solution on how to make a tiny bit of space on my hard drive (with it already being partitioned and all), I pivoted the idea of a live-iso on an usb stick which in principle does the exact same thing but more temporary and elegantly.
My original “requirements” / ideas for how this system should work were that it should run from a usb stick and take up very little space (my original idea was about 256 MB since that would barely fit on my smallest usb thumb drive). When booted, the system should obtain network access and display the ip address so that you can still access your files when you are away but a non-technical user (or even someone you don't fully trust with your passwords) is physically present.
I've spent today with getting the most simple prototype working. It's not doing a lot, but already displays that this might be a very promising idea. The basic example does the following:
- Automatically boots into a normal (self-compiled) live arch-iso system
- Checks if there is an active internet connection
- If yes: Start an ssh server (passwordless, maybe change later to be more secure)
- if not: put the user into an nmtui prompt to get network working again
- when user exists, do another check if there is a current internet connection
I believe for my use case, this will already work out to be sufficient, as I will be able to instruct whoever is using it on what to do (and how to get networking to work). However, possible improvements could include:
- Better UI / TUI for when there is no internet connection
- User is supposed to be guided through getting internet
- User should not need to type in any commands (in contrast to using iwctl)
- More Security: Add randomly generated password for root ssh login and display that in stdout
- More Remote Options:
- Software is currently assuming a VPN connection to the local network the pc is in or a port forward of ssh port (which would be very bad without a password)
- –> One should add an option to access the data even when completely away without VPN to local network, Options for getting this to work include
- Using a VPS as a common VPN endpoint => Tunnel
- Creating Outbound connection via accessed device to the accessing device (the accessing device needs to be publicly accessible)
- Use a service like ngrok to establish a direct connection between accessing device and accessed device through a server at ngrok (Probably the best option which I have listed).
Nonetheless, this working prototype is more than enough for me for now. If you would be interested in having the original files be submitted to Github (they are not, yet), please feel free so send me a message! Also send me a message if you would generally be interested in the aforementioned additional features. If other people would like them, I might be willing to implement them.
CUL8R! (See You Later)