I'm writing an app using php and have been looking into security issues. I'd like to know how the following code grabs browser information and how it is passed from the browser to the server:
$_SERVER['HTTP_USER_AGENT']
$_SERVER['REMOTE_ADDR']
gethostbyaddr($_SERVER['REMOTE_ADDR'])
Is this information encrypted when it's passed from the client PC to the server? Would it be easy for a hacker to steal this data?
HTTP_USER_AGENTis not something you can trust.REMOTE_ADDRcan also be the IP of the load balancer or proxy server, so you should check for the headerX-Forwarded-Foras well. What security issues are you trying to solve anyway?