Attackers explain how an anti-spam defense became an AI weapon.

You are viewing a single thread.
View all comments View context
6 points

Just make a custom 404 page that returns 13 MBs of junk along with status code 200

How would you go about doing this part? Asking for a friend who’s an idiot, totally not for me.

permalink
report
parent
reply
7 points
*

I use Apache2 and PHP, here’s what I did:

in .htaccess you can set ErrorDocument 404 /error-hole.php https://httpd.apache.org/docs/2.4/custom-error.html

in error-hole.php,

<?php
http_response_code(200);
?>
<p>*paste a string that is 13 megabytes long*</p>

For the string, I used dd to generate 13 MBs of noise from /dev/urandom and then I converted that to base64 so it would paste into error-hole.php

You should probably hide some invisible dead links around your website as honeypots for the bots that normal users can’t see.

permalink
report
parent
reply
2 points

How does this affect a genuine user who experiences a 404 on your site?

permalink
report
parent
reply
3 points
*

I don’t know a lot about this, but I would guess a normal user would like a message, that says something along the lines of “404, couldn’t find what you were looking for.” The status code and the links back to itself as well as the 13 MBs of noise should probably not irritate them. Hidden links should also not irritate normal users.

permalink
report
parent
reply
1 point

They will see a long string of base64 that takes a quarter of a second longer to load then a regular page. If it’s important to you, you can make the base64 string invisible and add some HTML to make it appear as a normal 404 page.

permalink
report
parent
reply
1 point

For the string, I used dd to generate 13 MBs of noise from /dev/urandom and then I converted that to base64 so it would paste into error-hole.php

That string is going to end up being 17MB assuming it’s a utf8 encoded .php file

permalink
report
parent
reply
1 point

idk what to tell you.

ls -lha
-rw-rw-r-- 1 www-data www-data  14M Jan 14 23:05 error-hole.php
permalink
report
parent
reply

Pulse of Truth

!pulse_of_truth@infosec.pub

Create post

Cyber Security news and links to cyber security stories that could make you go hmmm. The content is exactly as it is consumed through RSS feeds and wont be edited (except for the occasional encoding errors).

This community is automagically fed by an instance of Dittybopper.

Community stats

  • 1.3K

    Monthly active users

  • 1.6K

    Posts

  • 1.2K

    Comments

Community moderators