Newbie question about JavaScript

Kunai
11 years ago

0

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 ?

8replies
3voices
221views
Cyan Wind [freewind1012]
11 years ago | edited 11 years ago

0

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]

Kunai
11 years ago

0

what to do then ? learn more JavaScript ? :/
how to bypass/disable the server side validation ?

Cyan Wind [freewind1012]
11 years ago | edited 11 years ago

1

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.

Kunai
11 years ago

0

[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 …

[deleted user]
11 years ago

0

[spoiler]JS are all moved to a centralised location

Cyan Wind [freewind1012]
11 years ago | edited 11 years ago

0

@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?

Kunai
11 years ago | edited 11 years ago

0

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 ! :)

Cyan Wind [freewind1012]
11 years ago | edited 11 years ago

0

@Kunai: Well, I should warn you about something: Basic+ Level 3 does not relate to JavaScript. It relates to HTTP methods.

You must be logged in to reply to this discussion. Login
1 of 9

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss