Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

apache deny access to a folder failed

my site just got hacked.
I have a site where user can upload photo.
in my httpd.conf file.
I use
Quote:<Directory /var/www/html/photo>
Order Deny,Allow
Deny from All
</Directory>
to block access to photo folder directly.
It works fine for most users.
But for for some reason, some hacker still be able to access this folder.

He uploaded a gif file which contains php codes and execute it
http://mysite/photo/123.gif
and my site get hacked.

I guess he use some software to bypass apache.

Also weird thing is : I can not find the log from the apache access log.
But I can see it in the error log, because there are some php warning error .
Quote:[error] [client 113.1.1.1] PHP Warning: Unexpected character in input: '\x01' (ASCII=1) state=0 in /var/www/html/photo/123.gif : eval()'d code on line 1, referer: site.com

So 2 things:
1) how to block the photo folder completely. it looks like if user use browser, he got blocked. but if he use some software, he can access. any software can do this?
2)how come there is not server log in access_log? any software can do this?
He shelled your site sir, if you need help pm me.
I remember someone posting somewhere that changing your HTTP method from GET/POST to something like KJAFD (Using Tamperdata) could bypass either the .htpasswd or .htaccess. Dont quote me on it as I can't remember 100% and I can't seem to find the thread
Hiring PHP developers does not contribute to the quota of employees with disabilities.
[Image: lPQX27G.png]
(May 17, 2015 08:27 PM)♕ Pimp ♕ Wrote:  you're a waste of my time and giving me cancer.
(Oct 29, 2013 11:41 PM)Sʜᴀᴅᴏᴡ Rᴇᴀʟᴍ Wrote:  I remember someone posting somewhere that changing your HTTP method from GET/POST to something like KJAFD (Using Tamperdata) could bypass either the .htpasswd or .htaccess. Dont quote me on it as I can't remember 100% and I can't seem to find the thread

i don't think Tamperdata can bypass htpasswd or htaccess
(Oct 29, 2013 11:41 PM)Sʜᴀᴅᴏᴡ Rᴇᴀʟᴍ Wrote:  I remember someone posting somewhere that changing your HTTP method from GET/POST to something like KJAFD (Using Tamperdata) could bypass either the .htpasswd or .htaccess. Dont quote me on it as I can't remember 100% and I can't seem to find the thread
changing it to anything can possibly bypass it
https://hackforums.net/showthread.php?tid=3392310
(Oct 30, 2013 11:39 AM)phlower Wrote:  changing it to anything can possibly bypass it
https://hackforums.net/showthread.php?tid=3392310

That's what I was thinking of and by the looks of that thread it seems your vuln. Test it just to see if you are though
Hiring PHP developers does not contribute to the quota of employees with disabilities.
[Image: lPQX27G.png]
(May 17, 2015 08:27 PM)♕ Pimp ♕ Wrote:  you're a waste of my time and giving me cancer.
(Oct 30, 2013 10:45 PM)Sʜᴀᴅᴏᴡ Rᴇᴀʟᴍ Wrote:  That's what I was thinking of and by the looks of that thread it seems your vuln. Test it just to see if you are though

live http header can only bypass .htaccess which use
Quote:<LimitExcept GET POST>
Order Allow,Deny
Deny from all
</LimitExcept>

it doesn't work if .htaccess use something like
Quote:AuthName Login
AuthType Basic
require valid-user
What if you create a .htaccess file in the /var/www/html/photo/ directory which contains "deny from all"?

Also PM me your upload script, I can patch the vulnerability.
Check your site for local file inclusion vulns mate! https://hackforums.net/showthread.php?tid=3837733
(Oct 31, 2013 11:58 AM)cheatson Wrote:  Check your site for local file inclusion vulns mate! https://hackforums.net/showthread.php?tid=3837733

i think it's a good direction!
my site is a clipshare video site.
it has inclusion vulns.
But BTW, I inject a php into a jpg file, and it looks like it doesn't run the php codes.
I have tried edjpgcom and Exif editor.
I also tried this
Quote:copy google.gif /b + phpinfo.php /a phpinfo.gif
the image still not running php codes.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by rchowavijitJan 12, 2024 01:15 AM 0 171 Jan 12, 2024 01:15 AM
Last Post: rchowavijit
by MinaiseSep 29, 2019 10:36 PM 1 128 Sep 29, 2019 10:36 PM
Last Post: ~[DogiD]~
by WOLGANov 27, 2015 03:15 AM 7 144 Nov 27, 2015 03:15 AM
Last Post: Gee4rce