British Expats

British Expats (https://britishexpats.com/forum/)
-   The Barbie (https://britishexpats.com/forum/barbie-92/)
-   -   Very Very experienced PHP programmer , HELP needed (https://britishexpats.com/forum/barbie-92/very-very-experienced-php-programmer-help-needed-511819/)

Timber Floor Au Feb 4th 2008 6:05 pm

Re: Very Very experienced PHP programmer , HELP needed
 

Originally Posted by Wendy (Post 5886370)
Secure File Transfer Protocol http://en.wikipedia.org/wiki/SSH_fil...ol#SFTP_client

I had to convert as mine was hacked too :mad:

Infuriating isnt it !!! Okies, with ya now, SSH. I think he uses Putty to do it, I never get that invloved.. but will be learning fast !!!


Originally Posted by themerlin (Post 5886383)
You on a linux box, what permissions are the file.

If done correctly apache runs as web or nobody and this user should not be able to edit your files.

changing to https probably won't make a difference.

You can PM me if you like, worked on apache support a while ago, if it's a windows box then you deserve to get hacked lol

Yer its Linux. Running Apache.
I cant see how this person has access, its baffling us. Unless theres a backdoor route in.

Son is the coding whizzkid.. so will ask him when he gets in, and see what the go is. Im pretty sure, somehow and somewhere there is some security compromise, within our own code... its like finding a needle in a haystack.

Will report back, cheers mate

themerlin Feb 4th 2008 6:09 pm

Re: Very Very experienced PHP programmer , HELP needed
 
If you make sure only root can write to the files it should be sorted.




Originally Posted by Timber Floor Au (Post 5886414)

Yer its Linux. Running Apache.
I cant see how this person has access, its baffling us. Unless theres a backdoor route in.

Son is the coding whizzkid.. so will ask him when he gets in, and see what the go is. Im pretty sure, somehow and somewhere there is some security compromise, within our own code... its like finding a needle in a haystack.

Will report back, cheers mate


snowbunny Feb 4th 2008 6:10 pm

Re: Very Very experienced PHP programmer , HELP needed
 
Putty *is* an ssh implementation. IIRC sftp is a separate application from Putty or Unix-based ssh applications.

You might get better answers if you post this in The Lab, where all the geeks hang out. Including me. :o

Timber Floor Au Feb 4th 2008 6:12 pm

Re: Very Very experienced PHP programmer , HELP needed
 

Putty *is* an ssh implementation.

You might get better answers if you post this in The Lab, where all the geeks hang out. Including me.
Will do !!! Just prefer familiarity :)


Originally Posted by themerlin (Post 5886430)
If you make sure only root can write to the files it should be sorted.

Do ya mean file permissions , as in 644 777 etc?

themerlin Feb 4th 2008 6:22 pm

Re: Very Very experienced PHP programmer , HELP needed
 
Yep but not 777!
public should only have read access to the files.


Originally Posted by Timber Floor Au (Post 5886439)
Will do !!! Just prefer familiarity :)
Do ya mean file permissions , as in 644 777 etc?


Timber Floor Au Feb 4th 2008 6:24 pm

Re: Very Very experienced PHP programmer , HELP needed
 

Originally Posted by snowbunny (Post 5886435)
Putty *is* an ssh implementation. IIRC sftp is a separate application from Putty or Unix-based ssh applications.

You might get better answers if you post this in The Lab, where all the geeks hang out. Including me. :o


Originally Posted by themerlin (Post 5886478)
Yep but not 777!
public should only have read access to the files.

Yer we have all files and permissions set appropriately.

The header.php file is actually set to 644 !

Then each day, its back to 777 ! ( yet after doing initial permission changes, we check and 644 it is )

Go figure...someones being very very norty !

themerlin Feb 4th 2008 6:28 pm

Re: Very Very experienced PHP programmer , HELP needed
 
who owns the file? And who does apache run as ?

Originally Posted by Timber Floor Au (Post 5886488)
Yer we have all files and permissions set appropriately.

The header.php file is actually set to 644 !

Then each day, its back to 777 ! ( yet after doing initial permission changes, we check and 644 it is )

Go figure...someones being very very norty !


Timber Floor Au Feb 4th 2008 6:29 pm

Re: Very Very experienced PHP programmer , HELP needed
 

Originally Posted by themerlin (Post 5886499)
who owns the file?

we do

themerlin Feb 4th 2008 6:31 pm

Re: Very Very experienced PHP programmer , HELP needed
 
What user? The user that apache runs as shouldn't be able to change the file.

Originally Posted by Timber Floor Au (Post 5886502)
we do


Timber Floor Au Feb 4th 2008 6:33 pm

Re: Very Very experienced PHP programmer , HELP needed
 

Originally Posted by themerlin (Post 5886515)
What user? The user that apache runs as shouldn't be able to change the file.

Now im somehwat lost. lol

If we go in via ftp, using root user and root pass, we can modify any file.

Have we got access permissions wrong? :confused:

themerlin Feb 4th 2008 6:38 pm

Re: Very Very experienced PHP programmer , HELP needed
 
not sure :)

Basically when you start apache it forks child process that actually process the requests from the outside world. There is a setting in your httpd.conf file that sets the user to fork the processes as, it's normally nobody.
Nobody should not be able to do anything other then read files. That way if there is a hole in apache the hacker could only be in as nobody and not be able to do much damage.

I don't think they have your root password or they would do more then change the header :)


Originally Posted by Timber Floor Au (Post 5886520)
Now im somehwat lost. lol
If we go in via ftp, using root user and root pass, we can modify any file.
Have we got access permissions wrong? :confused:


Timber Floor Au Feb 4th 2008 6:41 pm

Re: Very Very experienced PHP programmer , HELP needed
 

Originally Posted by themerlin (Post 5886544)
not sure :)

Basically when you start apache it forks child process that actually process the requests from the outside world. There is a setting in your httpd.conf file that sets the user to fork the processes as, it's normally nobody.
Nobody should not be able to do anything other then read files. That way if there is a hole in apache the hacker could only be in as nobody and not be able to do much damage.

I don't think they have your root password or they would do more then change the header :)

Okies... starting to make sense..

Will check httpd files !!

datamile Feb 4th 2008 7:00 pm

Re: Very Very experienced PHP programmer , HELP needed
 
Restart apache, and make sure that all httpd process have the new/later start time and that they are running as nobody.

do netstat -a and see what comms is there incase there is a perm comms backdoor into the box

Timber Floor Au Feb 4th 2008 7:37 pm

Re: Very Very experienced PHP programmer , HELP needed
 

Originally Posted by datamile (Post 5886628)
Restart apache, and make sure that all httpd process have the new/later start time and that they are running as nobody.

do netstat -a and see what comms is there incase there is a perm comms backdoor into the box

Gonna do just that, speaking with Tech at Host Co. at mo.. gonna tell them what you and Merlin have suggested.

Respect ! ^5 to both of yas ( well everyone ;) thanks )

ridds Feb 5th 2008 10:11 am

Re: Very Very experienced PHP programmer , HELP needed
 
Any joy with your problem? Had some advice from a mate which is below...

DO you have root access to the server? If so you could install
mod_security for apache, as that should be able detect any intrusions
and block/alert you about them.

If you keep changing the password then it is unlikely he is getting in
that way, he's probably exploiting some weakness in a script to do a
code or sql injection.

- Check that all your sql queries that use user data are being escaped
with mysql_escape_string().

- Check if you are using any exec() functions in the PHP code, and if so
that there is no possibility for a user to insert a string into these
functions.

You could pay someone like security metrics
https://www.securitymetrics.com/ about $100 to do a regular automated
security sweep of your server. They will look for vulnerabilities and
alert you of them.


HTH


All times are GMT -12. The time now is 10:56 pm.

Powered by vBulletin: ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 2026 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.