|
Joined: Jan 2013
Posts: 1
stranger
|
stranger
Joined: Jan 2013
Posts: 1 |
|
Like
Reply
Quote
|
|
|
|
Joined: Jan 2004
Posts: 2,474 Likes: 3
Pooh-Bah
|
Pooh-Bah
Joined: Jan 2004
Posts: 2,474 Likes: 3 |
<threadHijackForaGoodReasonAlert>Unfortunately, down to some greedy and malicious individuals, I've had to avail myself of Sucuri's CloudProxy Firewall services. As a result, StopForumSpam is seeing all my registration IP's as the same (bunch of IPs). Their FAQ says... Same IP for All Users
If your system is showing the same IP address for all clients connected to your site that's because CloudProxy is a passthrough WAF. It will be in the middle of the communication between the clients and the hosting server to be able to filter the malicious requests. Because of that, the headers are modified and the source IP will be shown as the CloudProxy IP. and... PHP
Add the following code to your application (the config.php or configuration.php is usually a good location):
if(isset($_SERVER['HTTP_X_SUCURI_CLIENTIP']))
{
$_SERVER["REMOTE_ADDR"] = $_SERVER['HTTP_X_SUCURI_CLIENTIP'];
}
What's the best way to implement this? d. </threadHijackForaGoodReasonAlert>
|
Like
Reply
Quote
|
|
|
|
Joined: Apr 2004
Posts: 1,934 Likes: 142
|
Joined: Apr 2004
Posts: 1,934 Likes: 142 |
|
Like
Reply
Quote
|
|
|
|
Joined: Jun 2006
Posts: 16,207 Likes: 106
|
Joined: Jun 2006
Posts: 16,207 Likes: 106 |
Driv, I appended that to the IP listing code, try to see if it gives you any sort of bad user message, if so i'll tweak its placement.
|
Like
Reply
Quote
|
|
|
|
Joined: Feb 2007
Posts: 1,292 Likes: 2
Veteran
|
Veteran
Joined: Feb 2007
Posts: 1,292 Likes: 2 |
My IP Address on my board shows up as 192.168.3.1 as I'm running on the same IP as my server.
|
Like
Reply
Quote
|
|
|
|
Joined: Jan 2004
Posts: 2,474 Likes: 3
Pooh-Bah
|
Pooh-Bah
Joined: Jan 2004
Posts: 2,474 Likes: 3 |
You're welcome. I think. 
|
Like
Reply
Quote
|
|
|
|
Joined: Jan 2004
Posts: 2,474 Likes: 3
Pooh-Bah
|
Pooh-Bah
Joined: Jan 2004
Posts: 2,474 Likes: 3 |
Driv, I appended that to the IP listing code, try to see if it gives you any sort of bad user message, if so i'll tweak its placement. Sorry mate, you've lost me there. IP listing code?
|
Like
Reply
Quote
|
|
|
|
Joined: Jun 2006
Posts: 16,207 Likes: 106
|
Joined: Jun 2006
Posts: 16,207 Likes: 106 |
v7.6.0 has support for CDN's and Proxy Servers that display a common variable, which are: if(isset($_SERVER["HTTP_FORWARDED_FOR"])) {
$user_ip = $_SERVER["HTTP_FORWARDED_FOR"];
} elseif(isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
$user_ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
} elseif(isset($_SERVER["HTTP_X_CLUSTER_CLIENT_IP"])) {
$user_ip = $_SERVER["HTTP_X_CLUSTER_CLIENT_IP"];
} elseif(isset($_SERVER["HTTP_X_SUCURI_CLIENTIP"])) {
$user_ip = $_SERVER["HTTP_X_SUCURI_CLIENTIP"];
} elseif(isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
$user_ip = $_SERVER["HTTP_CF_CONNECTING_IP"];
} else {
$user_ip = $_SERVER["REMOTE_ADDR"];
}
Your "HTTP_X_SUCURI_CLIENTIP" has been added after the forwarded for and above the CloudFlare identification..
|
Like
Reply
Quote
|
|
|
|
Joined: Jan 2004
Posts: 2,474 Likes: 3
Pooh-Bah
|
Pooh-Bah
Joined: Jan 2004
Posts: 2,474 Likes: 3 |
Ah ok thanks. In the meantime, is there anything I can do for v7.5.8?
|
Like
Reply
Quote
|
|
|
|
Joined: Jun 2006
Posts: 16,207 Likes: 106
|
Joined: Jun 2006
Posts: 16,207 Likes: 106 |
The UBB.threads7 series, up until 7.6.0 just reads the REMOTE_ADDR server variable; you would have to use grep to return every instance of that variable and adjust it (such as say, adding the above php bit to the ubbthreads.php file and replacing the calls for remote addr to use $user_ip). If you where behind CloudFlare I'd suggest installing their apache module to change the addresses accordingly, but I'm not sure if "CloudProxy" has one available. You could try using that bit (though generally I'm against changing server variables, and I'm not sure how well smarty will play with it): if(isset($_SERVER['HTTP_X_SUCURI_CLIENTIP']))
{
$_SERVER["REMOTE_ADDR"] = $_SERVER['HTTP_X_SUCURI_CLIENTIP'];
}
In the ubbthreads.php file; before: // include all of the required libraries
|
Like
Reply
Quote
|
|
|
|
|
PHP v8.0
by moebacom - 03/06/2023 4:08 PM
|
|
|
|
1 members (Ruben),
58
guests, and
149
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|