淘宝建站程序,宁波网络营销策划哪家公司好,东莞订制网站建设,苏州网站建设软件浏览器解析机制和XSS向量编码
!-- javascript伪协议不能被urlcode编码#xff0c;但可以被html实体编码:也是js协议的一部分#xff0c;不能被编码js协议被解码后#xff0c;URL解析器继续解析链接剩下的部分unicode编码可识别实现解码但符号不能被编码#xff0c;编码…浏览器解析机制和XSS向量编码
!-- javascript伪协议不能被urlcode编码但可以被html实体编码:也是js协议的一部分不能被编码js协议被解码后URL解析器继续解析链接剩下的部分unicode编码可识别实现解码但符号不能被编码编码后无法识别符号可放在location右边实现解码
--
a hrefjavascript:\u0061\u006c\u0065\u0072\u0074(10);sss/aa href%6a%61%76%61%73%63%72%69%70%74:%61%6c%65%72%74%28%31%29aaa/a
!-- js协议被编码 alert()被编码。无法被识别 --a hrefjavascript%3aalert(2)bbb/a
!-- :被编码不能被识别 --a href%6a%61%76%61%73%63%72%69%70%74:alert(1)ccc/a
!-- js协议被urlcode编码不能被识别 --a href#x6a;#x61;#x76;#x61;#x73;#x63;#x72;#x69;#x70;#x74;:%61%6c%65%72%74%28%31%29ddd/a
!-- 协议被html实体编码alert(1)被urlcode编码 --a hrefjavascript:alert(5)eee/a
!-- 编码顺序html实体编码urlcode编码 --!-- unicode可被js识别 --
script\u0061\u006c\u0065\u0072\u0074(10);/script!-- script\u0061\u006c\u0065\u0072\u0074\u0028\u0031\u0031\u0029;/script --
!-- unicode不能编码符号 --/form
/body
/html
form表单实现交互
!DOCTYPE html
html langen
headmeta charsetUTF-8meta nameviewport contentwidthdevice-width, initial-scale1.0title123/title
/head
bodyform action./login.php methodpostlabel forusername:/labelinput typetext nameuser idlabel forpassword:/labelinput typepassword namepassword idinput typesubmit name id/form!-- 提交form表单php后面这三种得用web框架接受nodejsexpress框架pythonflask框架此模块环境本机不匹配无法展示----javaservlet模块--/body
/html 1php
用php文件接收
?
$username $_POST[user];
$password $_POST[password];
echo $username . . $password;
?
运行结果
2nodejs
我们使用linux虚拟机实现交互创建新目录使用npm init创建package.json包
下载express库
修改package.json包
web-express目录下创建web-express.js文件
const express require(express);
const bodyParse require(body-parser);
const app express();
const port 3000;app.use(bodyParse.urlencoded({extended:true}));// 处理post数据
app.post(/login,(req ,res) {const {username,password} req.body;console.log(username,username);console.log(password,password);res.send(login success!!!!!!!!!);
});app.listen(port,() console.log(server is running on http://localhost:${port}))
直接运行web-express.js文件
web界面运行form表单与nodejs交互
3python
下载Flask模块
创建123.py文件
from flask import Flask, requestapp Flask(__name__)
# 装饰器
app.route(/login,methods [GET,POST])
def login(): # put applications code hereusername request.form.get(username)password request.form.get(password)print(username:,username)print(password:,password)return login successful!if __name__ __main__:app.run(debugTrue)
直接运行123.py文件
web界面运行index.html文件