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

Feature suggestion: IP check at registration for StopForumSpam #5

Open
frwololo opened this issue Dec 6, 2012 · 0 comments
Open

Feature suggestion: IP check at registration for StopForumSpam #5

frwololo opened this issue Dec 6, 2012 · 0 comments

Comments

@frwololo
Copy link

frwololo commented Dec 6, 2012

Suggestion based on this thread: http://nmguse.webfactional.com/forum/viewtopic.php?f=57&t=3455&p=15115#p15109

EXreaction wrote:IP addresses are not checked against Stop Forum Spam. IP addresses are too dynamic and it's just as likely that legitimate users will be banned from an IP address as a spammer.

I would suggest to reconsider using this, in conjunction with the "lastseen" value sent from stopforumspam.
A spam IP that was last seen less than (for example) 2 weeks ago could be considered as a spammer, and is very unlikely to be used by a legitimate user within 2 weeks.

Blocking usernames and emails does nothing these days, gmail virtually allows anybody to create an infinite amount of emails, by just adding as many "." characters they want in the email address. Usernames, similarly, are generated randomly by spambots.

Akismet integration has been very effective on my forum so far, but the stopforumspam integration does not feel very useful yet, without IP support. But I agree that without some form of Date comparison blocking all IPs is a bad idea.

Here is the change I am suggesting, in asacp.php.

$stop_forum_spam_urls = array(
'api?username=' . urlencode($data['username']),
'api?email=' . urlencode($data['email']),
'api?ip=' . $user->ip,
);

foreach ($stop_forum_spam_urls as $url)
{
$errstr = $errno = '';
$file = get_remote_file('stopforumspam.com', '', $url, $errstr, $errno);

if ($file !== false)
{
$file = str_replace("\r\n", "\n", $file);
$file = explode("\n", $file);

$appears = $frequency = $lastseen = false;
foreach ($file as $line)
{
if (strpos($line, '') !== false && strpos($line, '') !== false)
{
$start = strpos($line, '') + 9;
$end = strpos($line, '') - $start;
$appears = (substr($line, $start, $end) == 'yes') ? true : false;
}
else if (strpos($line, '') !== false && strpos($line, '') !== false)
{
$start = strpos($line, '') + 11;
$end = strpos($line, '') - $start;
$frequency = (int) substr($line, $start, $end);
}
else if (strpos($line, '') !== false && strpos($line, '') !== false)
{
$start = strpos($line, '') + 10;
$end = strpos($line, '') - $start;
$lastseen = strtotime(substr($line, $start, $end));
}
}

if ($appears && $frequency >= $config['asacp_sfs_min_freq'] && ($lastseen > strtotime("now - 1 month")))
{
self::$sfs_spam = true;
}
}

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

1 participant