humitos / pyfispot

Hotspot running with Python 2.7 + Flask + nginx + uWSGI + dnsmasq + hostapd
GNU General Public License v2.0
60 stars 23 forks source link

Block incomming HTTP request to our Nginx + uWSGI #20

Open humitos opened 8 years ago

humitos commented 8 years ago

I'm getting a lot of this kind of requests:

Oct 26 17:34:23 raspberrypi uwsgi[412]: [pid: 412|app: 0|req: 2695/2695] 192.168.10.57 () {52 vars in 1077 bytes} [Mon Oct 26 17:34:23 2015] POST /p/s?lang=es&country=PE&pkname=mobi.wifi.toolbox&version=115&channel=gp&os=android&apiver=0.3 => generated 233 bytes in 112 msecs (HTTP/1.1 404) 2 headers in 72 bytes (1 switches on core 0)
Oct 26 17:34:23 raspberrypi uwsgi[412]: [pid: 412|app: 0|req: 2696/2696] 192.168.10.57 () {52 vars in 1071 bytes} [Mon Oct 26 17:34:23 2015] POST /i/g?lang=es&country=PE&pkname=mobi.wifi.toolbox&version=115&channel=gp&os=android&apiver=0.3 => generated 233 bytes in 87 msecs (HTTP/1.1 404) 2 headers in 72 bytes (1 switches on core 0)

It seems to be a Smartphone trying something. We need to block all of these because they are generated in bulk. Be careful to not block "portal.redlibre" or "/generate_204" requests.