AI 智能体正在注册账号

已有蜜罐字段存在。

你觉得还需要补充什么?

2 个赞

这听起来合情合理,但我们已经会将用户个人资料标记为 noindex,并将链接标记为 nofollow,因此即使被抓取/索引,个人资料中的垃圾链接也无法提升 PageRank。此外,作为额外的预防措施,我们也不会为 TL0 用户的 website 个人资料字段生成链接。

对于低信任等级用户,帖子中的链接同样会被标记为 nofollow。

不幸的是,对于许多作为支持论坛运行的站点(包括 Meta)来说,这几乎是不可能的……有时人们只是希望直接发帖陈述他们的问题,而不必先建立信任度。

我知道这因站点而异,但新账户的链接垃圾邮件并不是我们在此处看到的主要问题……而是发布含糊相关的内容以试图建立信任度,然后随后发布垃圾信息。因此,他们在创建垃圾信息之前,已经足够精明以建立声誉。

不过,对于面临新用户链接垃圾邮件问题的站点,Newuser max links(新用户最大链接数)设置已经可以实现这一功能,今天就可以将其设置为 0。

是的,这是事实,而且许多机器人仍然能绕过它……也许它能拦截一些。我们有时会在注册的“代词”(pronouns)自定义字段中看到不良输入,这表明存在低投入的机器人,但仍有很多机器人能顺利通过。

Discourse Captcha 可用於此功能

4 个赞

这很好 :+1:

我认为我们现在需要转向更强(更明显)的威慑措施。我希望在证明他们是真正的成员之前,个人资料中不允许添加任何链接。

……正是如此——大量论坛完全能够接受这种做法,而不需要此功能的论坛只需将其关闭即可。

我认为也许一个全局设置(例如 Newuser max links——但扩展到超越新用户的信任级别)加上按类别的选项可能会最有效。例如,我们可以在某些版块将其关闭,或者允许 TL1 用户在某些版块发布链接,而在其他地方则要求 TL2。

如果这对任何人有用,我将分享这个工作流:
add-revoke-monitor-group-membership.json (17.6 KB)
上面的 JSON 文件可以导入到新的 Discourse Workflow 中。请参阅工作流中的注释以获取配置说明。

这是一个截图:

一些配套的工作流:

lock-monitor-group-posts.json (7.2 KB)

tidy-monitor-group.json (3.8 KB)

这是用于对具有潜在可疑特征账户的帖子发出标记的工作流:

flag-posts-from-reviewable-users.json (47.0 KB)

1 个赞

你如何定义这些特征?它与现有的AI垃圾内容检测有何区别?

它是在工作流中名为“Reviewable user classifier”的代码节点里定义的:

// SPDX-License-Identifier: CC0-1.0

// 各种账户特征阈值加权分数。
const characteristicScores = {
  // 其他账户使用相同的 IP 地址。
  associatedAccounts: 4,
  // 账户有个人简介。
  bio: 1,
  /*
    自注册以来 IP 地址已更改。这可能表明该账户正被注册人以外的实体使用,
    或者使用了 VPN/代理来绕过 IP/位置限制。
  */
  ipChanged: 1,
  // 位置已更改国家(可能表明使用 VPN/代理来规避 IP/位置限制)。
  migrated: 10,
  // 个人资料中指定的位置与 IP 地址地理位置不匹配。
  profileLocationMismatch: 10,
  // IP 地址被其他已被暂停的账户使用过。
  suspendedAssociation: 15,
  // 个人简介中包含可疑内容。
  suspiciousBio: 5,
  // 电子邮件中包含可疑内容。
  suspiciousEmail: 4,
  // 帖子中包含可疑内容。
  suspiciousPost: 3,
  // 个人网站链接中包含可疑内容。
  suspiciousWebsite: 6,
  // 个人资料中有网站链接。
  website: 2,
};

const thresholdData = {
  /*
    如果账户统计数据未超过以下至少一个阈值,用户将被分类为“需要审查”。
    阈值定义为范围。有效阈值根据上述定义的账户评分进行加权计算。
  */

  /*
    垃圾账户通常在创建几天后才会被使用。不过,它们很可能在不会太久的时间后被使用。
    单位:秒。
  */
  accountAge: {
    description: "account age",
    range: {
      low: 8 * 24 * 60 * 60,
      high: 40 * 24 * 60 * 60,
    },
  },
  daysVisited: {
    description: "days visited",
    range: {
      low: 2,
      high: 6,
    },
  },
  // 包括话题首帖和回复。
  postCount: {
    description: "post count",
    range: {
      low: 1,
      high: 5,
    },
  },
  postsRead: {
    description: "posts read",
    range: {
      low: 4,
      high: 60,
    },
  },
  // 单位:秒。
  timeReading: {
    description: "time spent reading",
    range: {
      low: 3 * 60,
      high: 15 * 60,
    },
  },
  topicsEntered: {
    description: "topics entered",
    range: {
      low: 2,
      high: 10,
    },
  },
  /*
    注意:常规工作流运行的最大信任级别在“Post edited”触发器的配置中
    以及“Low trust level?”过滤节点中设置。
  */
  trustLevel: {
    description: "trust level",
    range: {
      low: 0,
      high: 1,
    },
  },
};

const associatedAccountData = $("Associated accounts").first().json;
const emailAddress = $("User email address").first().json.normalized_email;
const postData = $("Get post data").first().json;
const profileLocation = $("Profile location").item.json.profile_location;
const userData = $("User data").first().json;

const userLocations = {};
if ($("Profile location").item.json.profile_location != null) {
  userLocations.profile = $("Profile location").item.json.profile_location;
}

const userCharacteristics = {
  associatedAccounts: associatedAccountData.matching_account_count > 0,
  bio: userData.user.bio_raw !== null && userData.user.bio_raw !== "",
  ipChanged: userData.user.ip_address !== userData.user.registration_ip_address,
  migrated:
    userData.user.last_location !== null &&
    userData.user.registration_location !== null &&
    userData.user.last_location.country !==
      userData.user.registration_location.country,
  profileLocationMismatch: !evaluateProfileLocationMatch(
    $("Compare last location").first().json,
    $("Compare registration location").first().json,
  ),
  suspendedAssociation:
    associatedAccountData.matching_suspended_account_count > 0,
  suspiciousBio:
    userData.user.bio_raw !== null && suspiciousContent(userData.user.bio_raw),
  suspiciousEmail: spamKeywords(emailAddress),
  suspiciousPost: suspiciousContent(postData.post.raw),
  suspiciousWebsite:
    userData.user.website !== null && spamKeywords(userData.user.website),
  website: userData.user.website !== null && userData.user.website !== "",
};

const thresholdStats = {
  accountAge: (Date.now() - Date.parse(userData.user.created_at)) / 1000, // Seconds.
  daysVisited: userData.user.stats.days_visited,
  // `user.post_count` 实际上仅指回复数,因此必须加上 `user.topic_count` 才能得到总帖子数。
  postCount: userData.user.stats.topic_count + userData.user.stats.post_count,
  postsRead: userData.user.stats.posts_read_count,
  timeReading: userData.user.stats.time_read, // Seconds.
  topicsEntered: userData.user.stats.topics_entered,
  trustLevel: userData.user.trust_level,
};

const userStats = {
  associatedAccountCount: associatedAccountData.matching_account_count,
  locations: userLocations,
  monitorGroup: monitorGroup(userData),
  staff: userData.user.staff,
};

if (reviewable()) {
  return [
    {
      flag: true,
      reason: reason(),
    },
  ];
}

console.log(reason());

// Do not flag.
return [
  {
    flag: false,
    reason: "",
  },
];

// evaluateProfileLocationMatch 评估个人资料位置与 IP 地理位置比较数据。
function evaluateProfileLocationMatch(
  lastLocationComparison,
  registrationLocationComparison,
) {
  const confidenceThreshold = 0.7;

  if (Object.keys(lastLocationComparison).includes("classification")) {
    if (
      lastLocationComparison.classification.match.choice === "false" &&
      lastLocationComparison.classification.match.confidence >=
        confidenceThreshold
    ) {
      return false;
    }
  }

  if (Object.keys(registrationLocationComparison).includes("classification")) {
    if (
      registrationLocationComparison.classification.match.choice === "false" &&
      registrationLocationComparison.classification.match.confidence >=
        confidenceThreshold
    ) {
      return false;
    }
  }

  return true;
}

// formatDuration 将持续时间值格式化为人类友好的格式。
function formatDuration(totalSeconds) {
  const hours = Math.floor(totalSeconds / 3600)
    .toString()
    .padStart(2, "0");
  const minutes = Math.floor((totalSeconds % 3600) / 60)
    .toString()
    .padStart(2, "0");
  const seconds = Math.round(totalSeconds % 60)
    .toString()
    .padStart(2, "0");

  return `${hours}:${minutes}:${seconds} (H:M:S)`;
}

// monitorGroup 返回账户是否位于 `monitor` 用户组中。
function monitorGroup(data) {
  for (group of data.user.groups) {
    // `monitor_group_id` 工作流变量是 `monitor` 用户组的 ID。
    if (group.id == $vars.monitor_group_id) {
      return true;
    }
  }

  return false;
}

// reason 返回将在标记中显示的消息文本。
function reason() {
  let reason = `<br />
**Account Stats**

- **Account age:** ${formatDuration(thresholdStats.accountAge)}
- **Associated account count:** ${userStats.associatedAccountCount}
- **Days visited:** ${thresholdStats.daysVisited}
- **Time spent reading posts:** ${formatDuration(thresholdStats.timeReading)}
- **Post count:** ${thresholdStats.postCount}
- **Posts read:** ${thresholdStats.postsRead}
- **Topics entered:** ${thresholdStats.topicsEntered}
- **Trust level:** ${thresholdStats.trustLevel}
`;

  if (userStats.monitorGroup) {
    reason = reason.concat(
      `

❗ User is a member of the "monitor" user group.
`,
    );
  }

  if (userCharacteristics.migrated) {
    reason = reason.concat(
      `

❗ User's location has changed countries.
This might indicate use of a proxy/VPN to circumvent location-based restrictions.
`,
    );
  } else if (userCharacteristics.ipChanged) {
    reason = reason.concat(
      `

❗ User's IP address has changed.
This might indicate use of a proxy/VPN to circumvent IP-based restrictions.
`,
    );
  }

  if (userCharacteristics.profileLocationMismatch) {
    reason = reason.concat(
      `

❗ User's IP address does not match the location "${userStats.locations.profile}" they specified in their account profile.
`,
    );
  }

  if (userCharacteristics.suspendedAssociation) {
    reason = reason.concat(
      `

❗ User IP address has been used by other suspended accounts.
This might indicate bulk account use for spam deployment.
`,
    );
  }

  if (userCharacteristics.suspiciousEmail) {
    reason = reason.concat(
      `

❗ User email address contains keywords commonly seen in those of spammer accounts.
`,
    );
  }

  return reason;
}

// reviewable 返回用户是否被分类为“需要审查”。
function reviewable() {
  if (userStats.staff) {
    /*
      为了管理 `monitor` 用户组,版主必须是该组成员。因此,有必要明确将其
      排除在“需要审查”分类之外。
    */
    console.log("Not reviewable: user is staff.");
    return false;
  }

  if (userStats.monitorGroup) {
    // 用户位于 `monitor` 用户组中,因此无论其他统计数据如何,始终需要审查。
    console.log("Reviewable: user is in monitor group.");
    return true;
  }

  // 检查数据是否表明用户应被分配“需要审查”分类。
  const weight = thresholdWeight();

  for (const [stat, value] of Object.entries(thresholdStats)) {
    const threshold = Math.round(
      (thresholdData[stat].range.high - thresholdData[stat].range.low) *
        weight +
        thresholdData[stat].range.low,
    );

    if (value > threshold) {
      console.log(
        `Not reviewable: ${thresholdData[stat].description} ${value} exceeds threshold ${threshold}.`,
      );
      return false;
    }
  }

  console.log("Reviewable: account does not pass any threshold");
  return true;
}

// spamKeywords 返回给定字符串是否包含与垃圾信息发送者相关的关键词。
function spamKeywords(content) {
  const keywords = [
    "777",
    "agency",
    "apk",
    "app",
    "astrolog",
    "backlink",
    "brand",
    "casino",
    "chems",
    "club",
    "coin",
    "consultan",
    "crm",
    "crypto",
    "design",
    "digital",
    "escort",
    "estate",
    "fashion",
    "fitness",
    "game",
    "gelatin",
    "gift",
    "girls",
    "gluco",
    "gummies",
    "gummy",
    "homes",
    "logistic",
    "manage",
    "manufactur",
    "market",
    "meds",
    "menu",
    "official",
    "pcb",
    "pharma",
    "properties",
    "repair",
    "resort",
    "review",
    "sale",
    "seo",
    "sephora",
    "service",
    "slot",
    "soda",
    "solution",
    "spell",
    "spotif",
    "team",
    "travel",
    "website",
  ];

  for (keyword of keywords) {
    if (content.includes(keyword)) {
      return true;
    }
  }

  return false;
}

// suspiciousContent 返回给定字符串是否包含垃圾信息帖子中常见的内容。
function suspiciousContent(content) {
  const suspiciousTexts = ["pcbcool", "digital market", "online marketing"];
  const suspiciousPatterns = [
    /*
      合法用户有时会将多个破折号用作图形元素。只有作为标点符号使用的单个破折号
      才是 AI 生成内容的指标。
    */
    /.+[^—]—[^—].+/,
    /\bSEO\b/,
  ];

  for (suspiciousText of suspiciousTexts) {
    if (content.includes(suspiciousText) != null) {
      return true;
    }
  }
  for (suspiciousPattern of suspiciousPatterns) {
    if (content.match(suspiciousPattern) != null) {
      return true;
    }
  }

  return false;
}

// thresholdWeight 返回基于给定分数的阈值权重。
function thresholdWeight() {
  let score = 0;

  // 添加基于特征的分数。
  for (const [characteristic, present] of Object.entries(userCharacteristics)) {
    if (present) {
      score += characteristicScores[characteristic];
    }
  }

  // 计算最大分数。
  let maxCharacteristicScore = 0;
  for (characteristicScore of Object.values(characteristicScores)) {
    maxCharacteristicScore += characteristicScore;
  }

  // 计算权重。
  return score / maxCharacteristicScore;
}

如果您对代码有任何具体问题,我很乐意提供说明。

根本区别在于,该系统旨在将具有垃圾信息发送者常见特征的账户活动引起版主注意。它类似于 Discourse 核心内置的“Review TL1 users first post”(或“Review every post”)功能,但更适合热门论坛,因为审查每个帖子对版主团队来说负担过重。

在我看来,垃圾信息检测系统旨在检测客观的垃圾信息,且仅应用于此目的。您不应以导致高误报率的方式配置垃圾信息检测提示词,因为这些误报会导致糟糕的用户体验。这就是我为突出显示潜在可疑活动(本身就容易产生误报)的任务创建一个独立系统的原因。

3 个赞

感谢详细说明 @per1234 :+1: