Follow us on Twitter!
I'd prefer to die standing, than to live on my knees - Che Guevara
Wednesday, April 23, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 26
Guests Online: 25
Members Online: 1

Registered Members: 82885
Newest Member: ConiBE
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Author

php / htaccess problem.

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 29-01-07 22:19
This is the weirdest problem i've encountered and not sure on how to fix it.

spent hours today trying to fix this dam problem will still no success. i reakon i've got about 2 hours tommorow in which it HAS to be sorted.

so please help me out!

Specs:
OS: Windows XP Pro
Program: EasyPHP (latest version)
Server: Apache, running PHP 5
Database: MySQL and PEAR.
CMS: OS-Commerce (open source)

Background:
Heavily tweaked version of OS-Commerce, running MySQL and added PEAR database configuration too. Has custom htaccess throughout the site, to parse html urls into php scripts for processing and output, using Apache ReWrite function. SSL isnt installed and all SSL connections reverted to HTTP instead.

Problem:
the /admin/ panel is htprotceted (obvioulsy). I've configured the htaccess and htpasswd file to how it should be.

When accessing the admin folder im prompted with a login box, as i should be. i enter the correct details and it wont accept anything as a correct answer. i've changed passes, changed htpassed etc and still wont accept correct answers.

So i decided to ditch htaccess and make directory openly accessable, seeing as im only developing on a localhost.

now here is the weird bit. once i've removed the htaccess so theres no prompt or need to login, it acts weird.

i get the whole configuration.php dumped in plaintext in the web pages source, and then after than im left with a big paragraph of chinese charachters.

wtf?

1. Why is this happening? I've never seen this before.
2. How can i fix it?

Tried and Tested solutions:
debugging php scripts. (all seems fine, no errors)
editing config details.
changing htpasswd paths.
FTPing files over to localhost from live site again (incase its happening due to corrupt files)

- considering all the other htaccess files work fine, i cant seem to work out why its happening with just this folder. could it possibly be due to compatibility issues with php4 scripts on php5 server? possibly a server httpd.conf setting i need to chance? php.ini setting i need to change?

im completely lost. google hasnt been any help at all, and even some top coders that i work with dont know why its happening.

any help appreciated.




http://www.hellboundhackers.org/
Author

RE: php / htaccess problem.

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 29-01-07 23:02
ok, now im thinking its possibly the 'Content-Type' has been for some reason been changed to something else.

and the chinese characters are actually the script doing what it should.(minus plaintext php). so maybe if i set the 'Content-Type' so a version of ascii then it will display as html?

i dont have access to the files at the moment so im thinking off the top of my head.

Would this be the answer? setting the 'Content-Type'?


http://www.hellboundhackers.org/
Author

RE: php / htaccess problem.


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-01-07 23:46
I really have no clue, I know you asked me via MSN Messenger but I thought I would post up in here.

If it is a charecter encoding that is causing it to display chinese charecters then I belive you can simply change this to going to View -> Charecter Encoding.

If you cannot figure anything out this way, and if possible...

Can you give me the .htaccess file and if possible the source of the file that is displaying plaintext and chinese charecters?

Just one of them things that I have no clue about just sitting here, but if I see the problem I am sure I could probally fix it.

* I just woke up so im sure my spelling / grammer is extra fucked Smile *


Author

RE: php / htaccess problem.


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-01-07 23:47
well im not sure about the 'Content Type'

but if you still want that htaccess to work heres wats wrong..

if the prompt is showing, but not accepting passwords, you're not pointing to the htpasswd file correctly. this took me forever to figure out as well.

Edited by on 29-01-07 23:55
Author

RE: php / htaccess problem.


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-01-07 23:50
Not necesarily the wrong htpasswd file but really just the wrong path to the file. From my experience that I remember I had always had problems with my .htaccess file with auth... Are you setting the full path to the .htpasswd?


Author

RE: php / htaccess problem.


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 30-01-07 01:00
It's not Content-Type, that's just how your browser interprets what Apache sends it, not how the PHP gets parsed.

If you have Zend studio it's possible to step through the script one line at a time, that would help see where the bug comes from.

Can't suggest anything else really.


Author

RE: php / htaccess problem.

SySTeM
Member

Your avatar

Posts: 1524
Location: England, UK
Joined: 27.07.05
Rank:
HBH Guru
Posted on 30-01-07 08:01
htaccessing with a htpasswd file has never worked with me, I can get htaccess to work, e.g turning dir listing off with it and crap like that, but if I try and use htpasswd, it just breaks...think it's just a Windows problem, because mastergamer also gets this problem.


img138.imageshack.us/img138/6527/sig2ak1.jpg
www.hellboundhackers.org/sig/r/2783.png

http://www.elites0ft.com/
Author

RE: php / htaccess problem.

AldarHawk
Member



Posts: 1690
Location: Canada
Joined: 26.01.06
Rank:
Hacker Level 1
Posted on 30-01-07 12:31
Sounds to me like what SkareCrow suggested. Make sure the relative path to the htaccess file is in your ht directory file.

you can have multiple HTACCESS files but you have to point to EACH one in the base directory.


Just ask Yahoo!Taboo! http://www.erikwestlake.com
Author

RE: php / htaccess problem.

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 30-01-07 18:32
fixed the problem.

it was a bad FTP transfer that made a few files corrupt, and having to manually edit the meta 'content-type' to the correct ASCII value.

so there we have it.

anyone else with a similar problem. thats how to solve it.


http://www.hellboundhackers.org/