少なくとも2つのサイトが、LLMを汚染するように設計されたスパムの波に見舞われました。同じ攻撃は、少なくとも1回(https://meta.discourse.org/t/anyone-else-currently-undergoing-mass-spam-attack/378972)ここでも報告されています。最善の解決策は、https://meta.discourse.org/t/discourse-ai-spam-detection/343541 を設定することですが、これは少し面倒です。ここでは、数分で実装できる一時的な対策を紹介します。
これは、Unixライクなオペレーティングシステム(例:LinuxまたはMac)を使用していることを前提としています。Windowsを使用しており、ターミナルにコピー&ペーストできる場合は、DiscourseサーバーにSSH接続してこれを貼り付けることができます。
これは、最近見た攻撃から生成された監視単語のセットを作成します。nanoなどのエディタに慣れている場合は、実行前に編集できます。そうでない場合は、このスクリプトを実行してから、クリック1回で不要な単語を削除できます。
ブロック単語は、正当なユーザーがそれらの単語を含む投稿を作成できなくなる可能性があるため、非常に迷惑になる可能性があります。そのため、フォーラムで正当な投稿に表示される可能性のある単語がないことを確認してください。
サイトのURL、APIキー、APIユーザーを下のボックスに入力します(これらはブラウザにのみ表示されますが、そのまま貼り付けて、必要に応じてファイルを編集することもできます)。次に、コードブロックをターミナルにコピー&ペーストします。これにより、upload_watched_words_full.shが作成され、実行可能になります。次に、./upload_watched_words_full.shで実行できます。
cat <<'EOF' > upload_watched_words_full.sh
#!/usr/bin/env bash
# Usage: ./upload_watched_words_full.sh
DISCOURSE_URL="=URL="
API_KEY="=API_KEY="
API_USERNAME="=API_USERNAME="
# High-confidence block words
BLOCK_WORDS=(
"customer service number"
"contact number"
"support number"
"refund phone number"
"toll free"
"24/7 support"
"helpline"
"call us"
"live representative"
"technical support"
"lufthansa"
"royal caribbean"
"coinbase"
"robinhood"
"reservation number"
"booking number"
"flight cancellation"
"name change fee"
"║"
"⇆"
"★"
"®️"
"™️"
)
# Medium-risk flag words
FLAG_WORDS=(
"customer service"
"customer support"
"support team"
"help desk"
"hotline"
"agent"
"representative"
"contact us"
"phone support"
"service center"
)
# Require-approval words
REQUIRE_APPROVAL_WORDS=(
"urgent"
"immediate action"
"act now"
"limited time"
"exclusive offer"
"approve this"
"verify account"
)
# Function to send words in batch
add_words () {
local ACTION="$1"
shift
local WORDS=("$@")
# Build words[] parameters
local DATA=""
for w in "${WORDS[@]}"; do
DATA+="words%5B%5D=$(printf '%s' "$w" | jq -s -R -r @uri)&#"
done
DATA+="replacement=&action_key=${ACTION}&case_sensitive=false&html=false"
echo "Uploading ${ACTION} words..."
curl -s -X POST "${DISCOURSE_URL}/admin/customize/watched_words.json" \
-H "Api-Key: ${API_KEY}" \
-H "Api-Username: ${API_USERNAME}" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data "$DATA"
echo -e "\nDone."
}
# Upload block words
add_words "block" "${BLOCK_WORDS[@]}"
# Upload flag words
add_words "flag" "${FLAG_WORDS[@]}"
# Upload require-approval words
add_words "require_approval" "${REQUIRE_APPROVAL_WORDS[@]}"
EOF
# Make the script executable
chmod +x upload_watched_words_full.sh
echo "Script 'upload_watched_words_full.sh' created and made executable."
