Pages:
Author

Topic: [Hack-A-Thon: Round 2 ended] Hack my site - page 2. (Read 24353 times)

legendary
Activity: 980
Merit: 1003
I'm not just any shaman, I'm a Sha256man
August 18, 2011, 11:55:13 AM
#51
Hack-a-thon: round 1 will close at the end of 18th 11:59 pm
Payments will be provided at that time i will be pm soon for bitcoin addresses.
full member
Activity: 140
Merit: 100
August 18, 2011, 01:55:46 AM
#50
Here is some code I used to use whenever I have a page that connects to the DB....I put this code in my PHP include that is at the top of the page before any other code is run.

Maybe someone else can verify it will help....

Code:

if(!get_magic_quotes_gpc())
{
  $_GET = array_map('mysql_real_escape_string', $_GET);
  $_POST = array_map('mysql_real_escape_string', $_POST);
  $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}
else
{  
 
   $_GET = array_map('stripslashes', $_GET);
   $_POST = array_map('stripslashes', $_POST);
   $_COOKIE = array_map('stripslashes', $_COOKIE);
   $_GET = array_map('mysql_real_escape_string', $_GET);
   $_POST = array_map('mysql_real_escape_string', $_POST);
   $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}

It's just a quick and dirty way to escape everything as it comes in...but you should still escape stuff just before it hits the DB too.. or use prepared statements helps a lot.

 
Edit: Also note that this function won't escape HTML entities '<>'...  you should escape those just prior to being displayed on screen.

legendary
Activity: 980
Merit: 1003
I'm not just any shaman, I'm a Sha256man
August 18, 2011, 01:52:21 AM
#49


 Grin

Oh...  I also put some strange inputs in account details for some test accounts I made.  Take a look in your back end pages that list your user accounts.  Look through your users' account details for any HTML or javascript that hasn't been escaped properly.



I was attempting to check but I can't seem to gain access to my database at all at this point.
full member
Activity: 140
Merit: 100
August 18, 2011, 01:38:57 AM
#48


 Grin

Oh...  I also put some strange inputs in account details for some test accounts I made.  Take a look in your back end pages that list your user accounts.  Look through your users' account details for any HTML or javascript that hasn't been escaped properly.

sr. member
Activity: 275
Merit: 250
August 18, 2011, 01:32:46 AM
#47
SQL injection in cateId parameter - showcategory.php

Add ' to the end of the cateId,

Code:
GET /showcategory.php?cateId=25' HTTP/1.1

and you get another (very helpful and informative) mysql database error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\\\' ORDER BY `id` DESC LIMIT 0,10' at line 1

Now if you just change the way the app handles that error and simply don't send the details back to the user, WE STILL KNOW THE VULN IS THERE, so that won't work, you need to really fix it.

I've gotta go, but maybe tomorrow I'll post some more if everyone else didn't already get to everything.



sr. member
Activity: 275
Merit: 250
August 18, 2011, 01:18:12 AM
#46
SQL injection in qty parameter of cart.php?

If you send a single quote (') for the qty parameter,

Code:
POST /cart.php?act=add&productId= HTTP/1.1
***SNIP HEADERS ***

qty=1%00'

you get a mysql database error message:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1' at line 4

If you use two single quotes instead:

Code:
POST /cart.php?act=add&productId= HTTP/1.1
***SNIP HEADERS ***

qty=1%00''

you don't get the error:

Code:
HTTP/1.1 302 Found
Date: Thu, 18 Aug 2011 04:21:44 GMT
Server: Apache/2.2.14 (Ubuntu)
X-Powered-By: PHP/5.3.2-1ubuntu4.9
Location: /login.php?
Vary: Accept-Encoding
Content-Length: 13
Connection: close
Content-Type: text/html


So it looks like the site tries to block SQL injection, but you just URL-encode a NULL (%00) before the quote or whatever's getting blocked, and you've gotten around the filter.

So is this some kind of php extension that's checking for sql injection characters like the single quote?

Did you develop the shopping cart in-house, or is it "third-party" software?

Can you show us the code?

While it doesn't fix or prevent the underlying sql injection issue in the php code, I would have your developer add some more "friendly" and generic error handling so these mysql errors don't get sent back to the user.

I'm sure by the time I finish typing this someone will show you how to actually exploit the sql injection vulnerability.
full member
Activity: 140
Merit: 100
August 18, 2011, 12:57:34 AM
#45
Tongue  I can run my own javascript on your site!

Put this in the search...  Hello

Then after it searches, put your mouse over the word Hello... the numbers 666 will pop up in a javascript alert box.





legendary
Activity: 980
Merit: 1003
I'm not just any shaman, I'm a Sha256man
August 18, 2011, 12:52:34 AM
#44
I tried to check out.. and I got this error:

"Fatal error: Uncaught BitcoinClientException:
  • : Connect error: Connection refused (111) thrown in on line 0"

Probably just means your bitcoind is down...


oh..BTW...what is your validation rules for zip Code?  I'm in Canada, and our postal codes have letters in them....if you're going to ship international, allow letters in zip code plz.

perhaps just a slight oversite: Your link on the top menu to register is broken.
"The requested URL /register.php was not found on this server."


I have started the bitcoin daemon so there should be no more bitcoin client exceptions errors.

I'll count the /register.php error.

About your zip code question, I will in the future be able to ship internationally but at the moment I'm starting small and only shipping in the USA once I start to get the hang of things I'll look into a shipping internationally. Thanks!

Use zip code 96001 if you need a usa zip code

valid formats should be 00000-0000
legendary
Activity: 980
Merit: 1003
I'm not just any shaman, I'm a Sha256man
August 18, 2011, 12:49:44 AM
#43
While in any category, such as "http://www.cheaperinbitcoins.com/showcategory.php?cateId=25", the "Grid" and "List" icon links are broken.

Grid:
Code:
Not Found

The requested URL /listing_4.html was not found on this server.

Apache/2.2.14 (Ubuntu) Server at www.cheaperinbitcoins.com Port 80

List:
Code:
Not Found

The requested URL /listing_3.html was not found on this server.

Apache/2.2.14 (Ubuntu) Server at www.cheaperinbitcoins.com Port 80

Sitemap link is 404 also.

 yeah that will count since those were supposed to be finished in the final product.
Payments will be awarded at the end of the week (end of round 1)
legendary
Activity: 980
Merit: 1003
I'm not just any shaman, I'm a Sha256man
August 18, 2011, 12:48:09 AM
#42
Chrome 14.0.835.35.  Item title goes behind BTC price.  I believe the offending div is "s_item_clearfix".  Repeats on many other items.




Are you looking for layout quirks like that also, or only security holes?

Looking for security holes.

 Just as a note some products have only been imported from XML files there is still work to be done on the titles as well as the descriptions;
hero member
Activity: 630
Merit: 500
August 18, 2011, 12:28:39 AM
#41
While in any category, such as "http://www.cheaperinbitcoins.com/showcategory.php?cateId=25", the "Grid" and "List" icon links are broken.

Grid:
Code:
Not Found

The requested URL /listing_4.html was not found on this server.

Apache/2.2.14 (Ubuntu) Server at www.cheaperinbitcoins.com Port 80

List:
Code:
Not Found

The requested URL /listing_3.html was not found on this server.

Apache/2.2.14 (Ubuntu) Server at www.cheaperinbitcoins.com Port 80

Sitemap link is 404 also.
hero member
Activity: 630
Merit: 500
August 18, 2011, 12:22:56 AM
#40
Chrome 14.0.835.35.  Item title goes behind BTC price.  I believe the offending div is "s_item_clearfix".  Repeats on many other items.




Are you looking for layout quirks like that also, or only security holes?
full member
Activity: 140
Merit: 100
August 17, 2011, 11:25:59 PM
#39
I tried to check out.. and I got this error:

"Fatal error: Uncaught BitcoinClientException:
  • : Connect error: Connection refused (111) thrown in on line 0"

Probably just means your bitcoind is down...


oh..BTW...what is your validation rules for zip Code?  I'm in Canada, and our postal codes have letters in them....if you're going to ship international, allow letters in zip code plz.

perhaps just a slight oversite: Your link on the top menu to register is broken.
"The requested URL /register.php was not found on this server."

legendary
Activity: 980
Merit: 1003
I'm not just any shaman, I'm a Sha256man
August 17, 2011, 10:48:21 PM
#38
Servers back up Cheesy Okay apperently i was on a bad node. So lets see how this good node works. Continue the testing!!! FULL STEAM AHEAD!!!
legendary
Activity: 1358
Merit: 1002
August 17, 2011, 09:57:43 PM
#37
Any hosting suggestions?

I have several dedicated servers on Worldstream with 1 year+ uptime. Can't really say how fast their technical support is because luckily i never needed to use it. But their sales support is allright, at least during the week and on dutch work hours

Your mileage may vary, ofcourse Smiley
full member
Activity: 140
Merit: 100
August 17, 2011, 09:51:05 PM
#36
yea... just tried.. it's down... no joy.

If you want to try something where you have full control of your server, try linode.

I used them before and really like the platform.

They have a bunch of different linux distros you can install and have full root access.

http://www.linode.com/

Their basic plan is $19.95 per month and gives you 20 GB of disk space....not sure if thats enough...how many GB is the blockchain these days?  The basic plan should be good enough for most start-up websites, but I'm not sure how much resources bitcoind would use on it.

I heard someone else say they were running bitcoind on there...but not sure what plan he is under.
legendary
Activity: 980
Merit: 1003
I'm not just any shaman, I'm a Sha256man
August 17, 2011, 09:28:05 PM
#35
Server back up, It will be a moment before bitcoin daemon is back up Thanks for your patience.

EDit: apache2 wont boot, it has come to my attention i need a new host this is just rediculas. Any hosting suggestions?

Yeah Having too many problems with this host Hack-A-thon held off until tomorrow I'm getting a different host.
legendary
Activity: 980
Merit: 1003
I'm not just any shaman, I'm a Sha256man
August 17, 2011, 08:50:26 PM
#34
Its stuck in restart, I just submitted a ticket Tongue
full member
Activity: 140
Merit: 100
August 17, 2011, 08:48:56 PM
#33
Yea... both http and https sites are down for me too.   Cry
member
Activity: 145
Merit: 10
August 17, 2011, 08:15:20 PM
#32
Ill PM you my findings in the morning, lol if im able to connect to the server.
Pages:
Jump to: