Newbie question about JavaScript
i started learning JS on Codecademy.com and i had an idea ! not sure if it works that’s why i’m asking :
there’s a game , let’s say i wanna buy an item from it’s site , let’s say this item cost 100G(G is a currency)
the idea is to find the if/else statement using “inspect element” : ( of course the code wont look like this , but hey ! this is the idea in my head )
if (G_supply >== 100 )
{
// let’s say i bought that item !
}
{ else {
// i cant buy it , i need more G’s ! <== i'mma change this so i’m able to buy in both cases
}
am i totally wrong ? and this wont work at all ? or theres another way to do it ?
It would work if the server-sided code did not validate your data again.
Example:
[list]
[] You have 980G, not enough to buy the 1000G item.
[] You change JavaScript code to bypass the validation, click Submit to send the data to server.
[] Your submitted data is validated by server-sided code again. It turns out that you didn’t have enough money to buy that item.
[] Server returns “Not enough money” error.
[/list]
If there was a common method to bypass server-sided validation, well, every single website would be hacked. How to bypass/disable/exploit something? A hacker would have to answer that question.
[quote=freewind1012]If there was a common method to bypass server-sided validation, well, every single website in the world would be ruined. How to bypass/disable/exploit something? A hacker would have to answer that question.[/quote]
that’s definitely not an answer to my question dude … or maybe there are other ways to do this ? any Hints ! i’m lost ! :(
Also , i tried this with Basic level 3 and couldnt even find it’s JavaScript hehes …
11 years ago
0
[spoiler]JS are all moved to a centralised location
@Kunai: LOL, you posted in Web Hacking & War Games thread and asked about JavaScript. How the hell could I know that you need a clue to solve Basic+ Level 3?
what i meant is :“ the clue for Basic+ Level 3 and and this little exploit story are same ? Nope , JS are all moved to a centralised location ! and ty for the hint tlotr ”
now let’s find that centralised location ! :)
@Kunai: Well, I should warn you about something: Basic+ Level 3 does not relate to JavaScript. It relates to HTTP methods.