Skip to content

Instantly share code, notes, and snippets.

@chrisdavidmiles
Created March 19, 2016 23:23
Show Gist options
  • Save chrisdavidmiles/b0efda5a7b0c85c739ad to your computer and use it in GitHub Desktop.
Save chrisdavidmiles/b0efda5a7b0c85c739ad to your computer and use it in GitHub Desktop.
Instead of disabling or deleting xmlrpc.php in WordPress, replace it with this file, which would serve one of several sarcastic error messages at random.
<?php $possible_messages = [
'Nope',
'Go away',
'Nice try',
'XML-RPC requests on this server have been disabled cuz of people like you. This is why we can\'t have nice things.',
'We don\'t serve your kind here',
'<img src="//i.imgur.com/oeLBdQJ.png">',
'<img src="//i.imgur.com/ZZW6M6P.gif"><hr>Did you really think an xmlrpc.php attack would work on this site?',
'<img src="//i.imgur.com/OkQFngF.png"><hr>Get off my site! (And stop trying to access people\'s xmlrpc.php files.)',
'<img src="//i.imgur.com/RcHkMC7.gif"><hr>No. XML-RPC has been disabled for this site.',
'<img src="//i.imgur.com/1AKViaj.png"><hr>No. XML-RPC has been disabled for this site.',
'<img src="//i.imgur.com/kdTNhuY.jpg"><hr>But seriously, stop. XML-RPC attacks are annoying and you should feel bad.',
'My reaction when someone tries an XML-RPC attack on my site.<hr><img src="//i.imgur.com/Tk3APxs.gif">',
'<img src="//i.imgur.com/ljEqWmk.gif"><hr>Get outta here. XML-RPC has been disabled cuz of people like you.',
'My reaction when someone tries some lazy XML-RPC attack on my site.<hr><img src="//i.imgur.com/IofYoIz.gif">',
'<img src="//i.imgur.com/RWzzFjA.png"><hr>Nope. XML-RPC has been disabled for this site.',
'My reaction when someone tries some lazy XML-RPC attack on my site.<hr><img src="//i.imgur.com/SITsBuA.jpg">',
'My reaction when someone tries some lazy XML-RPC attack on my site.<hr><img src="//i.imgur.com/74CUe1P.png">',
'My reaction when someone tries some lazy XML-RPC attack on my site.<hr><img src="//i.imgur.com/6kqeQll.gif">',
'<img src="//i.imgur.com/bCcFoap.jpg"><hr>Stop. XML-RPC has been disabled on this site cuz of people like you.',
'My reaction when someone tries some lazy XML-RPC attack on my site.<hr><img src="//i.imgur.com/QQPMKoV.gif">',
'My reaction when someone tries some lazy XML-RPC attack on my site.<hr><img src="//i.imgur.com/moFDZH6.png">',
'<img src="//i.imgur.com/jf5UY0k.jpg"><hr>XML-RPC has been disabled for this site. Don\'t even try.',
'My reaction when someone tries some lazy XML-RPC attack on my site.<hr><img src="//i.imgur.com/IgEhZhf.png">',
'My reaction when someone tries some lazy XML-RPC attack on my site.<hr><img src="//i.imgur.com/QJ6cxoA.gif">',
'My reaction when someone tries some lazy XML-RPC attack on my site.<hr><img src="//i.imgur.com/fjiLpcA.jpg">',
'<img src="//i.imgur.com/4aizxP8.jpg">',
'XML-RPC has been disabled on this site.<hr><img src="//i.imgur.com/iuATSiZ.jpg">',
'XML-RPC has been disabled on this site. Go away.<hr><img src="//i.imgur.com/gukzAyD.png">',
'My reaction when someone tries some lazy XML-RPC attack on my site.<hr><img src="//i.imgur.com/vofBgP2.gif">',
'<img src="//i.imgur.com/dovYD9G.png"><hr>XML-RPC has been disabled for this site.',
'Get lost'
];$message = $possible_messages[mt_rand(0, count($possible_messages) - 1)];?>
<span style="font-family: monospace;"><?php echo $message; ?></span>
<style>img{display:block;margin-bottom:5px}hr{visibility:hidden;margin-bottom:-1px}</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment