Change a JavaScript variable value used in a web form. | General Hacking | Crax

Welcome To Crax.Pro Forum!

Check our new Marketplace at Crax.Shop

   Login! SignUp Now!
  • We are in solidarity with our brothers and sisters in Palestine. Free Palestine. To learn more visit this Page

  • Crax.Pro domain has been taken down!

    Alternatives: Craxpro.io | Craxpro.com

Change a JavaScript variable value used in a web form.

Change a JavaScript variable value used in a web form.

LV
1
 

ChanChinuio

Member
Joined
Apr 17, 2023
Threads
10
Likes
6
Awards
4
Credits
1,040©
Cash
0$
Hi Bros!

This is very usefull to change the value of a form parameters after sending them. You can always put a proxy like burp or zap in the middle, but understanding how the javascript logic works will let you change prices, exam grades... In most cases the site will made a second check serverside, but there is still chance to do this in some websites.
  1. Open the web page in Google Chrome and launch the developer tools by right-clicking anywhere on the page and selecting "Inspect" or pressing the F12 key.
  2. In the developer tools window, locate the "Sources" tab and select it.
  3. In the left-hand panel, you should see a list of files that make up the website. Look for the JavaScript file that handles the form submission. You can usually find this by expanding the "assets" or "scripts" folders, or by using the search bar at the top of the panel.
  4. Once you have found the JavaScript file, open it and locate the function that is called when the form is submitted. You can usually do this by searching for the form's submit event listener, or by looking for a function that has a name related to the form.
  5. Once you have found the function, you can put a breakpoint in the code by clicking on the line number where you want to stop execution. A blue arrow will appear on the line, indicating that a breakpoint has been set.
  6. Now you can submit the form and the code execution will stop at the breakpoint. You can use the "Scope" panel in the developer tools window to inspect the variables and their values at this point.
  7. If you want to change the value of a variable, you can do so in the console by typing the variable name and assigning it a new value. For example, if you want to change the value of a variable called "myVar" to 10, you can type "myVar = 10" in the console and press Enter.
  8. After you have made changes to the variable, you can resume execution of the code by clicking the "Resume script execution" button in the developer tools window (or by pressing F8).
  9. Finally, you should test the modified code by submitting the form again and checking that the variable has been updated accordingly.
 
  • Like
Reactions: fognayerku

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

Top Bottom