본문 바로가기
카테고리 없음

[TIL] - Day 1

by secnabi 2022. 8. 2.

XSS [ Failed ]

  • Application allowed uploading files via drag/drop and file explorer. While appending filename in dom it wasn't santizing filename which allowed xss using filename ie <svg onload=alert(xss)>.html
  • Since type of xss is self here. It means user had to upload such files with malicious name to trigger the xss which is no fun . So I tried exploring other ways to make user upload filename with a xss payload to cause client side dos. Since it was listening for drag/drop events, I decided to go with drag/drop abuse.
from flask import Flask, send_file
import urllib.parse

app = Flask(__name__)

@app.route("/payload")
def hello_world():
    return send_file(
    "file.png",
    attachment_filename=urllib.parse.quote_plus("<h1>hello</h1>.png"), as_attachment=True)

@app.route("/")
def index():
    return '<img src="/payload" >'

app.run()
  • Above attempt fail as browser was converting special chars before saving filename or on drag. < to _

Also Drag/drop wasn't working when I was draging element from parent to target iframe ummmm SOP? . This seems to work fine if its been dragged across the tabs.

CORS Bypass

scroll-to-text-fragment