Stylish webchallenge
by cavour13 - Tuesday April 9, 2024 at 09:40 PM
#1
i can't approve by admin .. got an idea by xss with css code but nothing work!

Anybody got make it work! i think it's the only way .. bot it's looking only in there..

router.post('/api/submission/submit', async (req, res) => {
    const { customCSS } = req.body;

    if(customCSS) {
        return db.insertSubmission(customCSS)
            .then(submissionID => {
                fs.writeFile(`card_styles/${submissionID}.css`, customCSS, function (err) {
                    if (err) return console.log(err);
                });
                bot.visitURL(`http://127.0.0.1:1337/view/${submissionID}`);
               
                return res.send(response(
                    `Your submission (Number ${submissionID}) successfully sent!<br>When approved it will become available <a href="/view/${submissionID}">here</a>`
                ));
            });
    }
    return res.status(403).send(response('CSS code field cannot be empty!'));
});
Reply
#2
Nothing to do with XSS...
Just go through the code and you will get it...
Reply
#3
we need submit approval with token, but get token and approve may a only from local 127.0.0.1 (isAdmin in code); and how can we do this, where to look ssrf or csrf
UPD: after approve easy sqli with sqlmap
Reply
#4
ZombieBear i was able to bypass csp! so xss is util to exfil approvalToken how you got flag without this part of path Big Grin
Reply
#5
(Apr 11, 2024, 12:12 PM)cavour13 Wrote: ZombieBear i was able to bypass csp! so xss is util to exfil approvalToken how you got flag without this part of path Big Grin

I haven't solved it yet, but I assumed it was CSS injection to exfil the approvalToken value
Reply
#6
it is, but we need a solution, hints of what to cling to
Reply
#7
pwned ! try in local and figure out how token is generated ! then exfil and sql as any other says.. anyway ZombieBear why you don't share with us your incredible skills?
Reply
#8
(Apr 11, 2024, 02:41 PM)herpyderp Wrote:
(Apr 11, 2024, 12:12 PM)cavour13 Wrote: ZombieBear i was able to bypass csp! so xss is util to exfil approvalToken how you got flag without this part of path Big Grin

I haven't solved it yet, but I assumed it was CSS injection to exfil the approvalToken value

Yes, That is CSS Injection. You just need to reconstruct Token via CSSi...
Reply
#9
Any tips for this CSS injection ? I tried every payload that i was able to find... nothing works.

do we need to re-write this from our custom css with js payload to exfil token ?
<div class="card-body">
      <p class="card-text">...</p>
</div>

i'm also trying with just copied html + css templates, which is visible only to admin/bot with python http.server.
not able to trigger xss from css.
Reply
#10
(Apr 20, 2024, 06:01 PM)mazafaka555 Wrote: Any tips for this CSS injection ? I tried every payload that i was able to find... nothing works.

do we need to re-write this from our custom css with js payload to exfil token ?
<div class="card-body">
      <p class="card-text">...</p>
</div>

i'm also trying with just copied html + css templates, which is visible only to admin/bot with python http.server.
not able to trigger xss from css.

Look at this technique [https://github.com/HackTricks-wiki/hackt...ode-range-]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Hack the box Pro Labs, VIP, VIP+ 1 month free Method RedBlock 23 2,160 22 minutes ago
Last Post: kkkato
  [FREE] HackTheBox Academy - CBBH CDSA CPTS All Modules Flags Techtom 20 2,489 Yesterday, 11:06 PM
Last Post: op334
Heart [FREE] HackTheBox All Cheatsheets Tamarisk 3 394 Yesterday, 10:36 PM
Last Post: op334
  [FREE] 300+ Writeups PDF HackTheBox/HTB premium retired Tamarisk 369 91,993 Yesterday, 04:10 PM
Last Post: sabbyahmed
  CBBH Write Ups hiddenhacker 22 6,226 Yesterday, 06:39 AM
Last Post: Usercomplex

Forum Jump:


 Users browsing this forum: 1 Guest(s)