Raised This Month: $51 Target: $400
 12% 

[ANY] PayPal Donations (Advanced)


Post New Thread Reply   
 
Thread Tools Display Modes
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 11-03-2017 , 08:49   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #41

I already told you that there is at least on way to exploit this.

Never trust a user input. Use AJAX.
__________________
Want to check my plugins ?
Arkarr is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 11-03-2017 , 13:21   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #42

Quote:
Originally Posted by Arkarr View Post
I already told you that there is at least on way to exploit this.

Never trust a user input. Use AJAX.
And ... since AJAX ("JavaScript") is handled client side, in each client's browser, how come you would trust AJAX?

You're sending data to the server for verification, and the server would for example return true/false depending on the data, ... but how you use the data, that part is still up to the "JavaScript" code to do, which is client side, and can easily be manipulated.

So well, suggesting to trust "AJAX" over "user input", ... really makes no difference in the end.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 11-03-2017 , 16:52   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #43

Quote:
Originally Posted by arne1288 View Post
And ... since AJAX ("JavaScript") is handled client side, in each client's browser, how come you would trust AJAX?

You're sending data to the server for verification, and the server would for example return true/false depending on the data, ... but how you use the data, that part is still up to the "JavaScript" code to do, which is client side, and can easily be manipulated.

So well, suggesting to trust "AJAX" over "user input", ... really makes no difference in the end.
Call PHP page through AJAX. This way, use can't edit forms.

EDIT:
[PUBLIC PHP] ---> user select item --> call another PHP page (ex, makepayements.php?object=tierv) with AJAX to make it looks like it's not another page (so it's just design) --> php is being executed on server side, client can't edit --> return value is value from paypal (sucess / fail)

Not sure if I make sense.
__________________
Want to check my plugins ?

Last edited by Arkarr; 11-03-2017 at 16:55.
Arkarr is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 11-03-2017 , 22:52   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #44

Quote:
Originally Posted by Arkarr View Post
Call PHP page through AJAX. This way, use can't edit forms.

EDIT:
[PUBLIC PHP] ---> user select item --> call another PHP page (ex, makepayements.php?object=tierv) with AJAX to make it looks like it's not another page (so it's just design) --> php is being executed on server side, client can't edit --> return value is value from paypal (sucess / fail)

Not sure if I make sense.
Security through obscurity is not going to help you.

It's about fixing the flaws, not simply attempting to hide or obfuscate them.

If all you do is adding AJAX stuff you say on top of the current code, then what you are doing is not going to help you at all.

If you're really working with AJAX, you should actually know that it is JavaScript, and that the J in "AJAX" actually stands for JavaScript:

JavaScript is handled purely client side, not server side AT ALL, a simple Google search can let you confirm that.

No matter what you send using JavaScript (or AJAX) to the server, is still being returned to the JavaScript part to be processed later on, and here you can still manipulate it, if you want to.

Feel free to try to make an example demonstrating your way, but if you aren't changing your communication with PayPal, please trust me when I tell you - you're not going to fix the issue 100% and only ending up on doing "security through obscurity", which is literally the same as doing nothing: the flaws would still remain.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
lay295
Senior Member
Join Date: Sep 2013
Old 11-04-2017 , 01:04   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #45

Quote:
Originally Posted by arne1288 View Post
Security through obscurity is not going to help you.

It's about fixing the flaws, not simply attempting to hide or obfuscate them.

If all you do is adding AJAX stuff you say on top of the current code, then what you are doing is not going to help you at all.

If you're really working with AJAX, you should actually know that it is JavaScript, and that the J in "AJAX" actually stands for JavaScript:

JavaScript is handled purely client side, not server side AT ALL, a simple Google search can let you confirm that.

No matter what you send using JavaScript (or AJAX) to the server, is still being returned to the JavaScript part to be processed later on, and here you can still manipulate it, if you want to.

Feel free to try to make an example demonstrating your way, but if you aren't changing your communication with PayPal, please trust me when I tell you - you're not going to fix the issue 100% and only ending up on doing "security through obscurity", which is literally the same as doing nothing: the flaws would still remain.
He means taking the POST request out of the client sided HTML, and just make a POST request to something like this. I've made it a GET request instead though so you can just paste it in if you want to see. It seems like a fine approach, I haven't really been following this plugin but just wanted to say what I think @Arkarr was trying to. I think he just brought up AJAX as a way to call the PHP script, not to use it to send the data with to Paypal.

http://mrderp.xyz/makepayments.php?tier=1 (If the page loads slow it's just my shitty box it's on)
https://pastebin.com/wtayNh9C
__________________


Last edited by lay295; 11-04-2017 at 01:06.
lay295 is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 11-04-2017 , 09:13   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #46

Quote:
Originally Posted by lay295 View Post
He means taking the POST request out of the client sided HTML, and just make a POST request to something like this. I've made it a GET request instead though so you can just paste it in if you want to see. It seems like a fine approach, I haven't really been following this plugin but just wanted to say what I think @Arkarr was trying to. I think he just brought up AJAX as a way to call the PHP script, not to use it to send the data with to Paypal.

http://mrderp.xyz/makepayments.php?tier=1 (If the page loads slow it's just my shitty box it's on)
https://pastebin.com/wtayNh9C
^ this

I'm not good at explaining stuff.
__________________
Want to check my plugins ?

Last edited by Arkarr; 11-04-2017 at 09:15.
Arkarr is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 11-04-2017 , 12:05   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #47

Quote:
Originally Posted by lay295 View Post
He means taking the POST request out of the client sided HTML, and just make a POST request to something like this. I've made it a GET request instead though so you can just paste it in if you want to see. It seems like a fine approach, I haven't really been following this plugin but just wanted to say what I think @Arkarr was trying to. I think he just brought up AJAX as a way to call the PHP script, not to use it to send the data with to Paypal.

http://mrderp.xyz/makepayments.php?tier=1 (If the page loads slow it's just my shitty box it's on)
https://pastebin.com/wtayNh9C
That example is, as I said above, changing the communication with PayPal.

Personally, I have been using PayPal's "Hosted Button", which gives you a code like:

Code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  <input type="hidden" name="cmd" value="_s-xclick">
  <input type="hidden" name="hosted_button_id" value="INVALID_BUTTON_ID">
  [...]
</form>
Here you can simply change the "hosted_button_id", and everything (price, options, return URL, etc) for that button id is configured on PayPal's site and all you have to adjust on your site is the button ID, and can't be manipulated with.

However, only verified PayPal Premium and Business accounts can use PayPal's "Hosted Button", unless something changed recently.

A quick look on your demonstrated way seems however to do something similar; on your server-side things, they are taking the information, and sending it to PayPal to create a "token" (seems quite similar to the "Hosted Button") for the payment information your sever puts through, and then redirecting your "customer" to that PayPal URL with the token that your server receives from PayPal.

If you can use this option with a PayPal account you haven't verified in any way (passport, bank statement, etc), I'm probably starting to lean more like using this way, than the "Hosted Buttons" I've been using for stuff myself. Things would get less complicated this way, as you don't have to log in to PayPal every time you need to adjust a button or add new levels.

Again, your demonstrated way is much more different than just "adding AJAX on top of current code", it is changing the communication too.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 11-04-2017 , 12:31   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #48

Look, what I was trying to say is that you need to call a PHP page wich would do the paypal communication (so, it's server-sided only), not a HTML form. AJAX was a suggestion to just make things nice, as it's the only purpose of javascript that I can think of.

Again, I probably wasn't clear enough. If you really need to, I can write a small exemple demonstrating what I'm trying to explain. Basically, it would be exactly the same as @lay295 made.

And really, it is "adding AJAX on top of current code". Nothing else then moving the form into another page PHP page and call it through AJAX. Or whatever you want to is able to call that PHP page and get the result of it.
__________________
Want to check my plugins ?
Arkarr is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 11-05-2017 , 01:04   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #49

Quote:
Originally Posted by Arkarr View Post
Look, what I was trying to say is [...]
I already understand 100% what it is you mean!

And if you're doing exactly as the example from @lay295, it seems perfectly fine!


Quote:
Originally Posted by Arkarr View Post
And really, it is "adding AJAX on top of current code". Nothing else then moving the form into another page PHP page and call it through AJAX. Or whatever you want to is able to call that PHP page and get the result of it.
Really, it isn't "current code" any more, when you are changing so much code, as you are doing:

Line 63 towards line 148, you're removing all that "current code" and replacing it with / using the example from @lay295, so almost nothing of this highlighted code are visible to the end user any more, that is way more than just "adding AJAX on top of current code".

"Adding on top of current code" means all that highlighted code would have to stay in the HTML, otherwise it isn't "current code" anymore, that's what I meant from the beginning!

There are no reasons to discuss it any further, I completely understand what you mean, and have done so since @lay295's example.


BTW, with @lay295's example, you don't even need AJAX/JavaScript in the way you explain:

Code:
<form action="makepayments.php" method="get">
  <input type="hidden" name="tier" value="1" />
  <button name="submit" type="submit" class="btn btn-primary">Tier I - <?=$amount_tier1?> <?=$paypal_currency?></button>
</form>
<form action="makepayments.php" method="get">
  <input type="hidden" name="tier" value="2" />
  <button name="submit" type="submit" class="btn btn-primary">Tier 2 - <?=$amount_tier2?> <?=$paypal_currency?></button>
</form>
[...]
and it would work, even for those kind of people who might be blocking JavaScript on "unknown websites", etc. ;-)

Obviously, "tier" could be manipulated, but "makepayments.php" would take care of that. ;)


With the post above, I was simply sharing the way I have been doing things, not frowning up on your way ( ... any more ) .

Thank you for sharing your way(s) of doing it, and for the nice example!
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
Triniayo
Senior Member
Join Date: Apr 2011
Location: #include <germany>
Old 11-06-2017 , 08:34   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #50

Btw guys, the PHP Script has been made with the intention to use it through the ingame MOTD Panel. And there's not really a way to edit there.
__________________
If you need any help, feel free to add me on Steam.


Triniayo is offline
Send a message via Skype™ to Triniayo
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode