Javascript

Webpage 'Maze' challenge

  • Inspect Elements

  • Inspecter > Script > View the JavaScript

  • Write an updated Function (similar to the original) that doesnt do a rule-check

function canMoveTo(destX, destY) {
   var imgData = context.getImageData(destX, destY, 15, 15);
   var data = imgData.data;
   var canMove = 1; // 1 means: the rectangle can move
   return canMove;
}
  • Console Tab > Paste your 'function' there, and click 'run'!

  • Now you can move anywhere you want!

XSS

  • Javascript Injections (also: WebInjections)

  • Goal is to pop an alert

  • Tricks to Avoid filters that might:

    • Block 'script' but not 'sCript'

    • Trim <script> but not recursive <sc<script>ript>

    • Blacklisted but can still create an error that Pops

    • Block 'alert' but can concat using 'eval'

    • Block 'alert' but allow String fromCharCode

    • Inject new JavaSript using 'Inspect Elements'

    • Mistake in code allows us to trust index.php

Last updated

Was this helpful?