Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Banlist ip check #215

Closed
cataalin opened this issue Dec 9, 2022 · 27 comments
Closed

Banlist ip check #215

cataalin opened this issue Dec 9, 2022 · 27 comments

Comments

@cataalin
Copy link

cataalin commented Dec 9, 2022

I have seen that the $ipbanned option was deactivated, I activated it to see how it is but it seems that it does not work well, how can I fix it? He shows me this even though I ban myself. @Wruczek

fdsfdsfd

@Wruczek
Copy link
Owner

Wruczek commented Dec 10, 2022

If you banned yourself then it's correct that you see the ban information. I do not understand, can you try explaining what is wrong?

@cataalin
Copy link
Author

cataalin commented Dec 10, 2022

If you banned yourself then it's correct that you see the ban information. I do not understand, can you try explaining what is wrong?

Shouldn't it come out that you are not banned by not being? because the same thing always comes out, banned or not.

gfdgdgfd

Wouldn't it work just like in a post of yours from 2018?

image 👀 no, it's not dead ;)

image I guess the bans page is complete. Finishing the viewer now!

You don't need to enable this feature - it is on by default. In fact, there is no config for this function. Everyone banned will see this message. I was referring to the fact that you should not edit any files as all the config options are in DB.

I was saying it because I tried an autoban and nothing comes out, but what about this image? when does it appear?

image 👀 no, it's not dead ;)

image I guess the bans page is complete. Finishing the viewer now!

@Wruczek
Copy link
Owner

Wruczek commented Dec 12, 2022

Yes, it should only show the alert if your IP is banned.
So it shows it every time, even if you are not banned?
Can you check what IP your website detects? Click on login and hover over the 𝝅 icon:
image
Now compare it to the IP banned by your TS3 server. Is it the same?

@cataalin
Copy link
Author

cataalin commented Dec 12, 2022

Yes, it shows it the same all the time even if you are not prohibited, the ip is the same as the ts in the debugging, maybe I activate it wrong or something or through the https protocol could it be? I activate it by changing line 12 of bans.php, false to true.

image
image

@Wruczek
Copy link
Owner

Wruczek commented Dec 12, 2022

Line 12 does not activate anything, you have made the site think that everyone is IP banned. The configuration is in database, you don't need to change anything else.

@cataalin
Copy link
Author

oh, but in the database I don't see anything related to this, not even in the translations, could you tell me where?

@Wruczek
Copy link
Owner

Wruczek commented Dec 12, 2022

You don't need to enable this feature - it is on by default. In fact, there is no config for this function. Everyone banned will see this message.
I was referring to the fact that you should not edit any files as all the config options are in DB.

@cataalin
Copy link
Author

cataalin commented Dec 12, 2022

I was saying it because I tried an autoban and nothing comes out, but what about this image? when does it appear? "Your IP is not banned"

image I guess the bans page is complete. Finishing the viewer now!

@Wruczek
Copy link
Owner

Wruczek commented Dec 12, 2022

It seems that it was removed, only the "You are banned" alert exists.

@cataalin
Copy link
Author

ah I understand, that's why there is no div in body.latte, okay thanks I'll close the topic.

@cataalin cataalin reopened this Dec 13, 2022
@cataalin
Copy link
Author

It seems that it was removed, only the "You are banned" alert exists.

I have tried to self-ban, and the alert does not appear, should it appear?

fdffffffffffff

@Wruczek
Copy link
Owner

Wruczek commented Dec 13, 2022

It should - check if the banned IP is the same as shown in the login modal screen when hovering over the 𝝅 icon.

@cataalin
Copy link
Author

cataalin commented Dec 13, 2022

It should - check if the banned IP is the same as shown in the login modal screen when hovering over the 𝝅 icon.

I have checked and it is the same.

@Wruczek
Copy link
Owner

Wruczek commented Dec 13, 2022

Can you attach a screenshot both from the 𝝅 icon and banlist? You can censor half of the IP.
Also, are any other files modified? Please make sure you are using TS-website with no file modifications.

@cataalin
Copy link
Author

¿Puedes adjuntar una captura de pantalla tanto del ícono 𝝅 como de la lista de prohibición? Puedes censurar la mitad de la IP. Además, ¿se modifican otros archivos? Asegúrese de estar utilizando el sitio web de TS sin modificaciones de archivos.

original website without any editing, it shows the same ip check, I have php 7.4 and use https protocol

fffffffffddddddddddddddd

@Wruczek
Copy link
Owner

Wruczek commented Dec 14, 2022

Edit bans.php and add the following line on line 63

if ($ip === Utils::getClientIp()) {
    $ipbanned = [
        "invoker" => (string) $ban["invokername"],
        "reason" => (string) $ban["reason"]
    ];

+   var_dump($ipbanned);
}

Refresh the website, you should see additional text show up - please screenshot or copy/paste it here.

@cataalin
Copy link
Author

cataalin commented Dec 14, 2022

Edit bans.php and add the following line on line 63

if ($ip === Utils::getClientIp()) {
    $ipbanned = [
        "invoker" => (string) $ban["invokername"],
        "reason" => (string) $ban["reason"]
    ];

+   var_dump($ipbanned);
}

Refresh the website, you should see additional text show up - please screenshot or copy/paste it here.

It matches me on line 53 and nothing appears, it does not show the var_dump

@Wruczek
Copy link
Owner

Wruczek commented Dec 14, 2022

Move it after the if statement + add an echo with more info:

  if ($ip === Utils::getClientIp()) {
      $ipbanned = [
          "invoker" => (string) $ban["invokername"],
          "reason" => (string) $ban["reason"]
      ];
  }

+ var_dump($ipbanned);
+ echo "IP: $ip, Client: " . Utils::getClientIp() . "<br>\n";

@cataalin
Copy link
Author

cataalin commented Dec 14, 2022

Move it after the if statement + add an echo with more info:

  if ($ip === Utils::getClientIp()) {
      $ipbanned = [
          "invoker" => (string) $ban["invokername"],
          "reason" => (string) $ban["reason"]
      ];
  }

+ var_dump($ipbanned);
+ echo "IP: $ip, Client: " . Utils::getClientIp() . "<br>\n";

now show me

bool(false) IP: 47.63.***.***, Client: 47.63.***.***

@Wruczek
Copy link
Owner

Wruczek commented Dec 14, 2022

Those two strings must somehow be different, can you send the uncensored version via email to image?

@cataalin
Copy link
Author

Those two strings must somehow be different, can you send the uncensored version via email to image?

sure, tell me what you need me to send you exactly

@Wruczek
Copy link
Owner

Wruczek commented Dec 14, 2022

Send the same output but not censored.

@cataalin
Copy link
Author

Send the same output but not censored.

sent, you can check.

@Wruczek
Copy link
Owner

Wruczek commented Dec 14, 2022

I see, it compares against the censored IP....

Try changing these lines to:

    try {
        $ipCensored = Utils::censorIpAddress($ip);
    } catch (\Exception $e) {}

    if ($lastNickname !== null) {
        $abbreviation = [$ipCensored, "IP"];
    } else {
        $target = $ipCensored;
    }

@cataalin
Copy link
Author

I see, it compares against the censored IP....

Try changing these lines to:

    try {
        $ipCensored = Utils::censorIpAddress($ip);
    } catch (\Exception $e) {}

    if ($lastNickname !== null) {
        $abbreviation = [$ipCensored, "IP"];
    } else {
        $target = $ipCensored;
    }

It seems to work, thank you very much for the help, there are a couple of other similar things that I'm trying to solve but I don't know if I should open a topic for each one, what do you think, would you have time?

fdsfdshhgf

@Wruczek
Copy link
Owner

Wruczek commented Dec 14, 2022

Yes, each problem should have its own issue.

@cataalin
Copy link
Author

Yes, each problem should have its own issue.

Ok, I was saying it so as not to make you too dizzy, I have been able to solve some things but there are some that I can't find with it, when I have time I'll tell you, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants