
EmptyBottle
🔑 Friends with Aera23
- Apr 10, 2025
- 1,134
blend
basically, this piece of code writes (credentials) to a file if inserted into a login form at the code level (something only a rogue admin or someone with write access to a site's code can do)
- file_put_contents (writing function)
- . The example uses .htaccessPassword because .htaccess* files are typically hidden from public view with both Apache and nginx
- $_POST['u'] can be a username entry field
- ^^^ is a separator, optional.
- $_POST['pw'] can be a password
- \n is a new line (so you don't get all the data in one line)
- 8 = FILE_APPEND (don't overwrite, write as if one adds to a diary)
PS: There is a reason I use unique passwords (and save to encrypted password manager on Firefox)... log resistance (can't login to the email I used for signup with any of my SaSu passwords, and vice versa)... and anti phishing (password manager checks domain for me as well)
PS 2: this code doesn't check for blank values, so an attacker will have to grep (search file) for non blank lines before beginning use of their ill-obtained credentials.
PS 3: There is little risk sharing this coz a variant of this has already been used ages ago by hackers on different sites.
Last edited: