diff --git a/app.js b/app.js index 10ee213..df592ba 100644 --- a/app.js +++ b/app.js @@ -26,6 +26,9 @@ const oneDay = 86400000; app.use(compress()); app.use(express.static(__dirname + '/build')); +// Lets try and slow down some of those exploit crawlers +app.use("/", require('./filterRoutes')) + var md = markdown({html: true}); md.parser.use(emoji); diff --git a/filterRoutes.js b/filterRoutes.js new file mode 100644 index 0000000..8895cc1 --- /dev/null +++ b/filterRoutes.js @@ -0,0 +1,10 @@ +const express = require('express'); + +const router = express.Router(); +router.all('(/*)?/wp-admin/', function (req, res) {}); +router.all('*?/xmlrpc.php', function (req, res) {}); +router.all('(/*)?/wp-includes/(*)?', function (req, res) {}); +router.all('/.git/*?', function (req, res) {}); +router.all('/wp-login.php', function (req, res) {}); + +module.exports = router