php - 网站短信接口被爬, 影响到网站性能
给我你的怀抱
给我你的怀抱 2017-05-16 13:09:25
0
5
886

网站短信发送接口一直在被人循环调用, 严重影响到 app 端的运行性能, 我是先把网站关掉了, 但是接口一直还在调用, 性能问题还是没解决, 求问解决思路
环境: windows server 2008 + apache + php + mysql

给我你的怀抱
给我你的怀抱

reply all (5)
洪涛

There are several solution ideas, I will briefly introduce them respectively.
The first method is to check the access.log log and take a look at the interface access status. If an IP is used dozens of times within a minute, it must be brushed. You can do some rate limiting or blocking on this IP, such as this IP When accessing again, you can allow him to access within a certain period of time according to custom rules, or simply blacklist directly, and the network layer directly denies all access.
The second idea is to record the access IP, the maximum number of visits per minute and the access time. When the user accesses the interface and submits it successfully, the relevant information is placed in Memcache or Redis, and a comparison is made. If it expires, submit it again and it has not expired. Don't submit it.
The third idea is to use a reverse proxy to call the interface internally, and then restrict access at the proxy layer. In fact, it is not much different from the first idea.

The above is my personal thinking and may not be the best solution. Everyone is welcome to criticize and correct me.

    曾经蜡笔没有小新

    You need to verify the graphic verification code before sending a text message, and the graphic verification code must also be verified on the backend

      洪涛

      The SMS interface must be restricted. Verification code restrictions, IP restrictions, and mobile phone number restrictions. Otherwise, tens of thousands of dollars can be spent every day

        Ty80

        1. The server controls the number of times each mobile phone number is sent per day, for example, it can only send 3 times per day

        2. Every time the server sends a text message, you must fill in the verification code

          滿天的星座

          The website SMS interface under mark was crawled, which affected the website performance

            Latest Downloads
            More>
            Web Effects
            Website Source Code
            Website Materials
            Front End Template
            About us Disclaimer Sitemap
            php.cn:Public welfare online PHP training,Help PHP learners grow quickly!