Have some fun with your attackers 12-06-2013, 09:45 AM
#1
So I have had quite a few hack attempts on my server, and of course the first thing they do is to do some recon by sending a HEAD request to get some information about the web server and the PHP version etc. So yesterday I decided to have some fun.
The PHP version is returned in the X-Powered-By header, but this header is easily modified by using PHP's header() function. So let's have some fun with this.
I added this to the top of my site so it's the very first thing being executed.
What this does is that it changes the X-Powered-By value that is sent when sending a HEAD request to a base64 encoded offensive message. So hopefully I can hit some nerves on someone and really piss them off
The PHP version is returned in the X-Powered-By header, but this header is easily modified by using PHP's header() function. So let's have some fun with this.
I added this to the top of my site so it's the very first thing being executed.
Code:
$insults = array(
'Your birth certificate is an apology from the condom factory',
'Shut up, you\'ll never be the man your mother is',
'You must have been born on a highway cuz thats where most accidents happen',
'It looks like your face caught on fire and someone tried to put it out with a fork',
'You are so ugly that when your mama dropped you off at school she got a fine for littering',
'You\'re so ugly Hello Kitty said goodbye to you.',
'Your family tree is a cactus because everybody on it is a prick',
'If you were twice as smart, you\'d still be stupid',
);
$pos = mt_rand(0,(sizeof($insults)-1));
$xpb = base64_encode($insults[$pos]);
header("X-Powered-By: {$xpb}");What this does is that it changes the X-Powered-By value that is sent when sending a HEAD request to a base64 encoded offensive message. So hopefully I can hit some nerves on someone and really piss them off
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)
![[Image: fa00a00749.jpg]](http://puu.sh/aAFI1/fa00a00749.jpg)