博客
关于我
网络安全实验室----脚本关-----第二关
阅读量:140 次
发布时间:2019-02-27

本文共 590 字,大约阅读时间需要 1 分钟。

由于需要在2秒内提交,所以只能使用脚本获取flag。以下是实现的技术解决方案:

我们需要通过脚本获取页面中的动态内容。以下是具体实现步骤:

import requestsurl = "http://lab1.xseclab.com/xss2_0d557e6d2a4ac08b749b61473a075be1/index.php"session = requests.Session()response = session.get(url)content = response.content# 提取特定div中的内容div_content = content.find(b'
')# 查找div中的等于号equal_sign = content.find(div_content + b'=')# 提取数值部分number = content[equal_sign+9 : equal_sign+equal_sign+9]# 发送POST请求获取flagdata = {'v': eval(number)}post_response = session.post(url, data=data)print(post_response.content)

这种方法能够有效地提取页面中的动态内容,并通过脚本自动获取所需的flag。这种解决方案简单且高效,能够在短时间内完成任务。

转载地址:http://rvrf.baihongyu.com/

你可能感兴趣的文章
npm ERR! Unexpected end of JSON input while parsing near '...on":"0.10.3","direc to'
查看>>
npm ERR! Unexpected end of JSON input while parsing near ‘...“:“^1.2.0“,“vue-html-‘ npm ERR! A comp
查看>>
npm error Missing script: “server“npm errornpm error Did you mean this?npm error npm run serve
查看>>
npm error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装
查看>>
npm install CERT_HAS_EXPIRED解决方法
查看>>
npm install digital envelope routines::unsupported解决方法
查看>>
npm install 卡着不动的解决方法
查看>>
npm install 报错 EEXIST File exists 的解决方法
查看>>
npm install 报错 ERR_SOCKET_TIMEOUT 的解决方法
查看>>
npm install 报错 Failed to connect to github.com port 443 的解决方法
查看>>
npm install 报错 fatal: unable to connect to github.com 的解决方法
查看>>
npm install 报错 no such file or directory 的解决方法
查看>>
npm install 权限问题
查看>>
npm install报错,证书验证失败unable to get local issuer certificate
查看>>
npm install无法生成node_modules的解决方法
查看>>
npm install的--save和--save-dev使用说明
查看>>
npm node pm2相关问题
查看>>
npm run build 失败Compiler server unexpectedly exited with code: null and signal: SIGBUS
查看>>
npm run build报Cannot find module错误的解决方法
查看>>
npm run build部署到云服务器中的Nginx(图文配置)
查看>>