search
HomeBackend DevelopmentPHP Tutorial注册接口被攻击,求解决方案

注册接口,通过手机验证,发验证码到手机

被人恶意攻击,随意提交手机号,消耗短信费用,

提交的表单,ip,手机号都随机,

验证码已经失效(验证码信息服务器存session),

cookie限制不行,ip又是随机,怎么办

就算升级验证码,被破解是迟早的事

还有什么方案?

回复内容:

注册接口,通过手机验证,发验证码到手机

被人恶意攻击,随意提交手机号,消耗短信费用,

提交的表单,ip,手机号都随机,

验证码已经失效(验证码信息服务器存session),

cookie限制不行,ip又是随机,怎么办

就算升级验证码,被破解是迟早的事

还有什么方案?

简单有效的方案就是发送前再加一个图片验证码,防止机器提交。

可以考虑这种极验验证码 http://www.geetest.com/

采用图片验证码的方式是否是一个好的方案,从用户体验的角度来说是值得商榷的

那么,我的建议会是:隐藏文本框

1.在注册表单里添加一个文本框,利用css将其隐藏

<code><input name="antispam" style="display:none" value=""></code>

2.你可以通过javascript来间歇更新这里的值,然后根据你的具体更新规则,在后台进行验证即可,如果不符合规则,即可判断是bot

接口走HTTPS + token + 参数加密传送

js获取光标坐标并传进后端,后端处理这些坐标是否在注册按钮的坐标区中,不知道这样可不可以

限制同一个手机号码,就是发送后保存发送时间,后期这个号码过来,检测是否超过有效时间
无效号码,就是对号码进行效验是否合法
对于合法,随机号码攻击,那就是通过ip限制了,一个ip一段时间内最多几个号码!
暂时想到就这么多了
http://segmentfault.com/q/10100000007530... 这个是和你一样的问题

以下帮你转载的

  1. 【绑定图型校验码】——将图形校验码和手机验证码进行绑定,当用户输入手机号码以后,需要输入图形校验码才可以触发短信,这样能比较有效的防止软件恶意点击。现在大型网站都采用此方式。
    2.【流程限定】——将手机短信验证和用户名注册分成两个步骤,用户在注册成功用户名密码后,下一步才进行手机短信验证。

3.【触发条件】——用户必须填写好所有注册信息才可进行触发,注册资料不完整无法发送验证码。
附加对接设置:

  1. 【短信发送间隔设置】——设置同一号码重复发送的时间间隔,一般设置为60-120秒;

  2. 【IP限定】——设置每个IP每天的最大发送量;

  3. 【发送量限定】——设置每个手机号码每天的最大发送量;
    目前我们推荐的是第1、2、3结合456的方法进行对接接口。以免短信造成不必要的浪费!

除了验证码和签名,其他都没卵用

接口用服务器curl或者flie_get_content请求,接口还要写一个签名验证`

数据使用ajax post提交,同时禁止跨域提交上来的数据,同域提交的数据也做签名验证

建议使用手机号码归属方法,先查是否存在,如果存在时在发送信息,没办法了还可以做地区限制

可以尝试下同盾科技的接口保护解决方案

记录一下每次获取验证码的请求ip,电话号码以及请求时间
下次再请求的时候判断一下两次请求的时间间隔 你可以自己把控这个度
譬如30分钟之内只能发送一次验证码
这样的话如果想消耗你们的短信费用就得有多台机器并且有多个手机号码

这也只是我的猜想,不知道可不可行

可以从HTTP头还有访问记录来判断是否正常用户的,一般脚本的话,只会抓取HTML,不会请求图片,CSS,JS等内容;
还有一些HTTP头,脚本的一般都不完整。
不过真要搞你,我觉得基本拦不住,随机IP,随机电话,这个无法简单的判断出来是正常用户还是攻击。

用12306的验证码。

多准备几套验证码方案,随机更换,他破解的速度能有换验证码的速度快吗?

验证码发送到手机是这么被获取。 一般逻辑过程用户调研注册接口,你调用短信接口,短信平台调用你的回掉接口。或者你们提供验证码给短信接口,短信给用户。 用户没有手机是不知道的。我看有必要花钱找人做渗透测试。如果短信平台是安全可信性的话,你们问题更加严重。

用私钥生成签名,公钥传输,服务验证签名

难道没有对接口请求加token过滤?还是token很容易被破解

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
The Continued Use of PHP: Reasons for Its EnduranceThe Continued Use of PHP: Reasons for Its EnduranceApr 19, 2025 am 12:23 AM

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python: Exploring Their Similarities and DifferencesPHP and Python: Exploring Their Similarities and DifferencesApr 19, 2025 am 12:21 AM

PHP and Python are both high-level programming languages ​​that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

PHP and Python: Different Paradigms ExplainedPHP and Python: Different Paradigms ExplainedApr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP and Python: A Deep Dive into Their HistoryPHP and Python: A Deep Dive into Their HistoryApr 18, 2025 am 12:25 AM

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

Choosing Between PHP and Python: A GuideChoosing Between PHP and Python: A GuideApr 18, 2025 am 12:24 AM

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP and Frameworks: Modernizing the LanguagePHP and Frameworks: Modernizing the LanguageApr 18, 2025 am 12:14 AM

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHP's Impact: Web Development and BeyondPHP's Impact: Web Development and BeyondApr 18, 2025 am 12:10 AM

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

How does PHP type hinting work, including scalar types, return types, union types, and nullable types?How does PHP type hinting work, including scalar types, return types, union types, and nullable types?Apr 17, 2025 am 12:25 AM

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values ​​and handle functions that may return null values.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software