스팸 계정 등록 방지


10

이미 시도한 양식에서 CAPTCHA를 활성화하지 않고 스팸 계정 등록을 방지하는 방법은 무엇입니까? 우리는 꾸준히 홍수를 겪고 있습니다.

이름 필드는 항상 러시아어 문자이므로 더 쉬운 경로를 찾지 못하면 특정 문자를 감지하고 등록을 차단하는 방법 일 수 있습니까?


또는 비슷한 문제가 있지만 모듈 등으로 운이 좋았다면 알려주십시오.
brackfost

답변:


15

우리는 같은 문제를 겪었습니다. 전면 최대 길이 제한은 쉽게 무시 되었습니다 (html에서 최대 길이 25 클래스를 제거하여 직접 시도하십시오 ).

그래서 여기 내가 찾은 것이 있습니다 :

  • 해결 방법 1 : IP를 통한 차단 : 각 계정 구독은 콜롬비아에서 베트남까지 다른 IP를 사용합니다 ...

  • 해결 방법 2 : 사용자 에이전트를 통한 차단 : 가짜 일 수 있습니다 ... 크롤러 오점을 제한하려는 경우 작동합니다.

  • 솔루션 3 : HoneyPot 사용 : 작동 할 수 있지만 봇이 이미 초점을 맞춘 경우 게시 할 필드를 반드시 알고 있다고 생각합니다 ( https://magento.stackexchange.com/a/104261/50635 참조 )

  • 해결책 4 : 보안 문자 (Magento 또는 Google) : 작동 할 수 있지만 일부 사람들은이를 초과했다고 말했습니다

  • 해결책 5 : 편집 이메일 템플릿확인 이메일을 추가 :

    • /app/locale/[locale]/template/email/account_new.html 템플릿에서 {{var customer.name}}, {{var customer.firstname}}과 같은 입력 데이터를 제거하면 비트가 스팸으로 표시되지 않을 수 있습니다.
    • 이메일 확인 추가 : 시스템> 구성> 고객 구성> 이메일 확인 필요> 예
  • 해결 방법 6 : customer_eav_attribute 테이블 에서 직접 데이터베이스의 필드 제한 규칙을 업데이트하고 attribute_id = 5 [firstname] 및 attribute_id = 7 [lastname]로 행을 업데이트 하고 25525로 바꿉니다 .

    • a:2:{s:15:"max_text_length";i:255;s:15:"min_text_length";i:1;}
    • 으로 : a:2:{s:15:"max_text_length";i:25;s:15:"min_text_length";i:1;}

솔루션 6 은 25 개 이상의 문자를 사용하므로 스팸봇을 방지하는 가장 빠르고 효과적인 방법으로 보입니다.

그 이후로, 더 이상 가짜 계정이 만들어지지 않았습니다! 문제 해결됨.


그들이 더 적게 시도한다면, 적어도 피싱 시도에서 그들을 제한 할 것입니다.

이미 25 자 이상의 이름이나 성을 가진 사용자 수를 확인할 수 있습니다.

SELECT ce.entity_id, ce.email, cev2.value AS firstname, cev3.value AS lastname
FROM customer_entity ce
-- first name
INNER JOIN customer_entity_varchar cev2 ON (ce.entity_id = cev2.entity_id AND cev2.attribute_id = 5)
-- last name
INNER JOIN customer_entity_varchar cev3 ON (ce.entity_id = cev3.entity_id AND cev3.attribute_id = 7)
WHERE CHAR_LENGTH(cev2.value)>25 or CHAR_LENGTH(cev3.value)>25

이러한 가짜 계정이 등록 된 이유에 대한 자세한 내용은 여기 ( https://magento.stackexchange.com/a/240710/50635)를 참조 하십시오.


1
안녕하세요, 위에서 언급 한 솔루션 6에 대해. Magento 2.2.6에 대해 어떻게해야합니까? validate_rules에 "{"max_text_length ": 225,"min_text_length ": 1}"이 표시되고 input_filter : "trim"도 있습니다. 그것을 제거하고 225에서 25를 편집해야합니까? 감사합니다
Kris Wen

225를 25로 바꾸고 작동하는지 테스트하십시오.
DependencyHell

2
225를 25로 바꾸고 어제 "트림"을 제거했지만 여전히 새로운 스팸을 받고 있습니다. 나는 지금 새로운 질문을 열었습니다 : magento.stackexchange.com/questions/266564/…
Kris Wen

1

우리가 계정 등록에 대해 이야기하고 있다는 것을 고려할 때, 당신은 올바른 길을 가고있는 것 같습니다. 이메일 등록 제목을 변경해 보셨습니까?

아마도 app / locale / yourlanguage / template / email / account_new.html에있을 것입니다


1

보충 메모로 다음 코드를 사용하여 스팸 계정을 삭제했습니다.

$customers = $this->getCustomerCollection();

$this->registry->register('isSecureArea', true);

function isRussian($text) {
    return preg_match('/[А-Яа-яЁё]/u', $text);
}

foreach($customers as $customer){
  $name = $customer->getName();
  if(isRussian($name)){
    $customer->delete();
  }
}

이 문제는 해결되지 않습니다
Gezzasa

개인적으로 DependencyHell의 솔루션 6을 사용했습니다. 다른 사람이 러시아 스팸을 대량 삭제해야하는 경우에 이것을 포함하고 싶었습니다.
brackfost

안녕하세요, 어떻게이 코드를 실행해야합니까? 나는 magento 2.2.6에 있습니다. 감사합니다
Kris Wen

@KrisWen, 다른 사용자가 눈을 돌리게 될지 확실하지 않지만 사용자 지정 모듈에 템플릿을 넣습니다. 내 경우, 나는 그것을 붙어 App/Code/Ibex/Deleter/view/frontend/templates/customer.phtml만들를 다음과 deleter_index_index.xml에서 파일을 Deleter/view/frontend/layout그렇게 때 거기에 </ "Ibex_Deleter :: character.phtml을"= 이름을 "아이 벡스 \ Deleter가 \ 블록 삭제 \"= 템플릿을 "삭제"= 블록 클래스>와 코드가 실행될 yoursite.com/deleter로 이동하십시오. 나중에 모듈을 비활성화하고 삭제하십시오.
brackfost

하하 고마워! @TryingestFool 원래 선택된 답변에 대해 약간의 혼란이 있습니다. 당신은 알고 있습니까? -> "안녕하세요, 위에서 언급 한 솔루션 6의 경우 Magento 2.2.6에 대해 어떻게해야합니까? validate_rules에"{ "max_text_length": 225, "min_text_length": 1} "이 표시되고 input_filter도 있습니다. "트림". 트림을 제거하고 225에서 25까지 숫자를 편집해야합니까? "
Kris Wen

1

가능한 경우 cloudflare 또는 다른 방화벽을 사용하여 일부 국가를 차단하십시오. 중국, 홍콩, 러시아. 그러나 모든 스팸을 차단하지는 않으며 해당 국가에서 액세스 할 수 있어야하는 경우 작동하지 않습니다. 그러나 서버가 상당히 망치질 때 실제로 관리자 패널을 사용하게하는 것이 도움이되었습니다.

Magento를 2.3.0 이상으로 업데이트하지 않은 경우 Google Recaptcha에서 빌드를 사용하거나 대체 플러그인을 사용하십시오.

Magento 2.3에서 내장 Google reCAPTCHA를 활성화합니다.

1) 상점> 설정> 구성> 보안> Google reCAPTCHA를 방문하십시오. 2) Recaptcha v2 보이지 않는 recaptcha를 생성하거나 봇 키가 아닙니다. 3) 해당 페이지의 관리자 구성에 입력하고 프런트 엔드에서 사용자 생성에 사용하도록 설정하십시오.

그러나 다른 기능을 사용하도록 설정해도 실제로 상처를 줄 수는 없습니다.

기존 계정을 정리하려면 입력에서 패턴을 찾고 일반 사용자가 해당 데이터 세트에 속하지 않도록 패턴을 선택하여 쿼리를 선택하십시오.

customer_entity 테이블에서 삭제할 수 있습니다.

내가 정리 한 사이트의 SQL 예 : 상황을 염두에 두어야 할 데이터를 직접 작성하십시오. 잘못된 사용자를 먼저 지워도 백업을 수행해도 데이터에 대한 책임은지지 않습니다.

DELETE FROM customer_entity
WHERE SUBSTRING_INDEX(email, '\@', -1) IN ('pp.com',
'sf-express.com',
'qqlong.com',
'kinohit.win',
'sohu.com',
'21cn.com',
'yeah.net',
'koreamail.com',
'aliyun.com',
'mail.ru',
'VIP.SINA.COM',
'yahoo.co.in',
'icload.com',
'sogou.com',
'vip.qq.com',
'sina.cn',
'189.cn',
'wo.com.cn',
'qq.cn',
'sina.com.cn',
'126.cn',
'yahoo.com.cn',
'3g.cn',
'163.com',
'167.com',
'139.com',
'126.com',
'130.com',
'144.com',
'123.com',
'ca800.com',
'168.com',
'188.com',
'1974.com',
'qq.co',
'sina.com',
'qq.com',
'qq.con',
'QQ.come',
'yandex.com',
'5ol.com',
'yeat.net',
'yahoo.cn')
OR lastname LIKE '%http://%'
OR lastname LIKE '%https://%'
OR lastname LIKE '%【%】%'
OR lastname LIKE '%tw55.cc%'
OR lastname LIKE '%www.ope2228.com%'

이전 기본 Magento Captcha가 비활성화되어 있는지 확인하십시오. 고객> 고객 구성> 보안 문자

상점 첫 화면에서 보안 문자 사용 : 아니오

Google reCAPTCHA와 충돌하므로 ...

공식 문서 링크 :

https://docs.magento.com/m2/ce/user_guide/configuration/security/google-recaptcha.html

https://docs.magento.com/m2/ce/user_guide/stores/security-google-recaptcha.html

봇은 계정 생성 엔드 포인트에 도달 한 것 같습니다 (예 : 테마에서 계정 생성 버튼 / 링크를 삭제하더라도 예) 나중에 잠들거나 다른 것들을 스팸으로 만들 수 있으므로 계정을 삭제하거나 비활성화하는 것이 좋습니다. 어쨌든 당신의 DB ....

모두 행운을 빌어 요.


0

차단 목록에 도메인을 쉽게 넣고 사용자가 차단 목록에서 전자 메일 도메인에 등록하려고 할 때 표시되는 오류 메시지를 설정할 수 있습니다. 전체 지침은 다음과 같습니다 –

Ecomsolver 폴더에 이름이 EmailCheck 인 새 모듈을 만듭니다.

단계 – 1 관리자 패널에서 다음 코드를 작성하십시오. 파일 경로는 –Ecomsolver >EmailCheck > etc > Adminhtml > System

<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <tab id="ecomsolver" translate="label" sortOrder="999"> <label>Ecomsolver</label> </tab> <section id="emailblock" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1"> <class>separator-top</class> <label>Email Check</label> <tab>ecomsolver</tab> <resource>PixieMedia_General::general_config</resource> <group id="domains" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Domain Names</label> <field id="domains" translate="label" type="textarea" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Domain names to block</label> <comment>Comma separated values eg google.co.uk,mail.ru,some.com</comment> </field> <field id="message" translate="label" type="textarea" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Message to display</label> <comment>The error message to show users who try to register with one of the above domain names</comment> </field> </group> </section> </system> </config>

단계 – 2 파일에 다음 코드를 작성하십시오. 파일 경로는 – Ecomsolver >EmailCheck > etc > Frontend > di

<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Customer\Controller\Account\CreatePost"> <plugin name="restrictCustomerEmail" type="Ecomsolver\Emailcheck\Model\Plugin\Controller\Account\RestrictCustomerEmail"/> </type> </config>

단계 – 3 이름이 Config 인 XML 파일에 다음 코드를 작성하십시오. 파일 경로는 –Ecomsolver >EmailCheck > etc > Config

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <emailblock> <domains> <domains>163.com,mail.ru</domains> </domains> <message> <domains>We do not allow registration from your email domain</domains> </message> </emailblock> </default> </config>

단계 – 4 이름이 Module 인 XML 파일에 다음 코드를 작성하십시오. 파일 경로는 –Ecomsolver >EmailCheck > etc > Module

<config xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> <module name="Ecomsolver_Emailcheck" setup_version="1.0.0"> </module> </config>

단계 – 5 EmailCheck에서 폴더 이름 Model을 만듭니다. 그런 다음 하위 폴더를 만듭니다 Plugin > Controller > Account. 이름이 RestrictCustomerEmail 인 PHP 파일에 다음 코드를 작성하십시오. PHP 파일의 경로는 –Ecomsolver >EmailCheck > Plugin > Controller > Account > RestrictCustomerEmail

/*Ecomsolver @@@@@@ ecomsolver@gmail.com*/ namespace Ecomsolver\Emailcheck\Model\Plugin\Controller\Account; use Magento\Framework\Controller\Result\RedirectFactory; use Magento\Framework\UrlFactory; use Magento\Framework\Message\ManagerInterface; use Magento\Framework\App\Config\ScopeConfigInterface; class RestrictCustomerEmail {

 /**
  * @var \Magento\Framework\UrlInterface
  */

protected $urlModel;

/**
 * @var \Magento\Framework\Controller\Result\RedirectFactory
 */

protected $resultRedirectFactory;

/**
 * @var \Magento\Framework\Message\ManagerInterface
 */
protected $messageManager;
/**
 * RestrictCustomerEmail constructor.
 * @param UrlFactory $urlFactory
 * @param RedirectFactory $redirectFactory
 * @param ManagerInterface $messageManager
 */
public function __construct(
    UrlFactory $urlFactory,
    RedirectFactory $redirectFactory,
    ManagerInterface $messageManager,
    ScopeConfigInterface $scopeConfig
)
{
    $this->urlModel = $urlFactory->create();
    $this->resultRedirectFactory = $redirectFactory;
    $this->messageManager = $messageManager;
    $this->scopeConfig = $scopeConfig;
}
/**
 * @param \Magento\Customer\Controller\Account\CreatePost $subject
 * @param \Closure $proceed
 * @return mixed
 * @throws \Magento\Framework\Exception\LocalizedException
 */
public function aroundExecute(
    \Magento\Customer\Controller\Account\CreatePost $subject,
    \Closure $proceed
)
{
    /** @var \Magento\Framework\App\RequestInterface $request */
    $email = $subject->getRequest()->getParam('email');
    list($nick, $domain) = explode('@', $email, 2); 
    $domains = $this->scopeConfig->getValue('emailblock/domains/domains', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    if(!$domains) { 
        return $proceed; 
    }
    $domainArray = array_map('trim', explode(',', $domains));
    if(count($domainArray) < 1) { 
        return $proceed;
    }       
    if (in_array($domain, $domainArray, true)){
    $message = $this->scopeConfig->getValue('emailblock/domains/message', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
        if(!$message) { $message = __('We do not allow registration from your email domain'); }
        $this->messageManager->addErrorMessage($message);
        $defaultUrl = $this->urlModel->getUrl('*/*/create', ['_secure' => true]);
        /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
        $resultRedirect = $this->resultRedirectFactory->create();
        return $resultRedirect->setUrl($defaultUrl);
    }
    return $proceed();
}
}

-1

디버깅 로트로 .htaccess에 다음 코드를 추가하여 문제를 해결했습니다. 아무 것도 찾지 못했습니다.이를 얻은 후 고객 저장시 하나의 이벤트를 생성 한 다음 지금 resloved했습니다.

<IfModule mod_rewrite.c>
    RewriteCond %{HTTP_USER_AGENT} "rv:40\.0\)\ Gecko/20100101\ Firefox/40\.1$" [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} "Gecko.*Gecko" [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} "Gecko/([a-z]|[A-Z])\." [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} "Gecko/\ " [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} "Gecko/20([2-9])" [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} "Gecko/201([1-9])"
</IfModule>

답변 감사합니다. 위의 내용은 정확히 무엇이며 Gecko 등을 타겟팅하기로 어떻게 결정 했습니까?
brackfost

2
고객 저장 이벤트에서이를 감지했습니다. 이것은 러시아 봇입니다. 따라서 해당 코드로 비활성화 할 수 있습니다. 또한 작동하지 않으면 고객이 $ _Server 및 $ _request에 대한 로그를 저장하고 쓸 때 이벤트를 작성하고 디버그하십시오.
Sukumar Gorai

발견 된 사용자 에이전트 : Mozilla / 5.0 (Windows NT 6.1; Win64; x64) AppleWebKit / 537.36 (Kcko, Gecko) Chrome / 62.0.3202.94 Safari / 537.36 및 Mozilla / 5.0 (Windows NT 10.0; WOW64; rv : 45.0) Gecko / 20100101 Firefox / 45.0
DependencyHell

지금 당신은 당신의 htaccess에 추가하고 문제를 해결할 수 있습니다
Sukumar Gorai

이 사용자를 가진 방문자가 많으므로이 사용자 에이전트를 차단할 수 없습니다. 유명한 봇을 지정하지 않습니다이 하나 있지만, 일반적인 사용자 에이전트 ...
DependencyHell
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.