express_waf_mid
v1.0.1
Published
waf防护
Downloads
2
Maintainers
Readme
express_waf_mid
a waf for the express
##Installation
$ npm install express_waf_mid
##usage
app.use(waf({
url : 1,
cookies: 1,
userAgent : 1,
body : 1,
log : 0
}))
example
import express from 'express'
import waf from './index.js'
const app = express()
waf.get_all_rule()
app.use(waf.waf_middle({
url : 1,
cookies: 1,
userAgent : 1,
body : 1,
log : 0
}))
app.get('/' , (req ,res) => {
res.send("<h1>Hello World</h1>");
});
app.listen(8000);
console.log('Test server at port:8000');
console.log('You can use url for testing');
console.log('http://127.0.0.1:8000/');
console.log('http://127.0.0.1:8000/add.asp?id=1\' or select * from admin');
console.log('http://127.0.0.1:8000/<script>alert(process.platform)</script>')