REMOTE ADDR and SQL injections
Author | Message |
---|---|
Kalvin | # Posted two weeks ago |
![]() |
Could one make a SQL injection via a |
Ads | |
DDSR | # Posted one week ago |
![]() |
It seems to me that PHP checks that the entry has the form of an IP (it's still a global). But you can have fun checking this by changing your user agent (with a firefox plugin for example) and seeing if the global variables retranscribe the info as is, or if there are a minimum of tests behind. |
Kalvin | # Posted yesterday |
![]() |
Exactly, but I'm not talking about the user agent, nor the |
DDSR | # Posted yesterday |
![]() |
Yeah I assumed that all variables had the same level of control. Since the IP is also changeable anyway (forged queries). |
Kalvin | # Posted yesterday |
![]() |
So I tried some basic forging with scapy, but this bitch tries to resolve a domain name :p. |
Celeri | # Posted two hours ago |
![]() |
I think PHP gets the remote IP address provided by apache, itself grabbed from the source IP of the TCP connection. |
Kegon | # Posted two hours ago |
![]() |
Spoofing will allow you to change the value of |
H2Fr Master | # Posted one hour ago |
![]() |
$_SERVER = array([...], 'REMOTE_ADDR' => '127.0.0.1', [...]);Or a progressive filling. $_SERVER = array();I don't remember the function that extracts the IP from the network layer, so I put it in hardcoded, but let's postulate that it works pretty much like that And so, we access it using $ _SERVER['REMOTE_ADDR'] as you know it.All that to say three things. 1) Since it's up to the server to grab the IP directly, replacing it with something else on the network layer could lead to routing problems. 2) The problem is that it is the server that will look for this IP from the network layer, and whatever happens it will always have the form that we know (bits, points... in other words an IP). I am virtually certain that there is an IP check with a regular expression or something similar. The best you could do is "spoofing" (and even that would be hard since HTTP requests occur after the TCP handshake). 3) Since $ _SERVER is an associate array, its values can be overwritten manually within the PHP script. |
Valter | # Posted one hour ago |
![]() |
The idea is interesting since many webmasters store IP addresses as binaries or other numerical datatypes, and many probably do get it through |
Kalvin | # Posted 7 minutes ago |
![]() |
That's what I thought. |
Post a reply
Please be kind and courteous in your replies. Don't roast others for no reason.