'프록시서버'에 해당되는 글 2건

  1. 2010.07.07 HTTP-Tunnel Client 를 사용한 메신져 접속
  2. 2009.10.13 Restriction of the access with the help of Nginx
2010.07.07 23:20

HTTP-Tunnel Client 를 사용한 메신져 접속

HTTP-Tunnel 홈페이지 : http://www.http-tunnel.com/html/



1. HTTP-Tunnel Client 프로그램 다운받아 설치

2. HTTP-Tunnel Client 프로그램 실행



3. 메신저 연결 옵션 설정



ex) 네이트온 : 네트워크 연결설정 - 프록시 서버 사용 - 종류 : SOCKS 버전 4 , 서버 : localhost , 포트 1080

4. 설정 저장 후 메신저 로그인 확인


Trackback 0 Comment 0
2009.10.13 09:53

Restriction of the access with the help of Nginx

In this short post the point is how to protect your files and some part of your web site with a user password. With Nginx, a lot of options exist to protect your site with usernames and passwords. In Nginx the solution is not less attractive than in apache.

In the configuration file, set folder to close, it is only necessary to load the file with passwords.
There are two examples for closing of the folder with files:
        location ^~ /files/ {
            root   /path/to/server;
            autoindex    on;
            autoindex_exact_size  off;
            auth_basic "Hello, please login";
            auth_basic_user_file /usr/nginx/passwords;
            access_log   /usr/nginx/logs/files.log   download;
        }
and for closing of the admin-folder with the additional restriction on IP:
        location ^~ /admin/ {
            fastcgi_pass unix:/home/project/server.sock;
            include  conf/fastcgi.conf;
            allow 11.11.0.0/16;
            allow 22.22.22.22;
            deny all;
            auth_basic "Hello, Admin, please login";
            auth_basic_user_file /usr/nginx/adminpassword;
            access_log   /usr/nginx/logs/admin.log  main;
        }
The passwd program utility of Apache can be used to create and update usernames and passwords of new users:
htpasswd -b passwords NewUser NewPassword
In the file the writing with the encoded password looks like:
NewUser:P47ghZ4kloG78: Your Can Comment Here
The protection from cracking the password can be organized at the same time with two methods based on the use iptables:
  • Blocking IP temporarily if the amount of the requests per second exceeds any reasonable amount.
  • Write failed attempts in the log, check it with the script every minute, than pumps the IP addresses in iptables
For the first variant it is enough to create rules:
iptables -A INPUT -p tcp --syn --dport 80 -i eth0 -m state --state NEW
            -m recent --name bhttp --set
iptables -A INPUT -p tcp --syn --dport 80 -i eth0 -m state --state NEW
            -m recent --name bhttp --update --seconds 120 
            --hitcount 360 -j DROP
iptables -A INPUT -p tcp --syn --dport 80 -i eth0 -j ACCEPT
It is possible to use TARPIT instead of DROP to complicate the life of the crackers.

For the second variant it is necessary to add in config:
        location /401.html {
            root   /usr/nginx;
            access_log   /usr/nginx/logs/denied.log  error401;
        }
For example the format error 401 looks at me:
log_format error401  '$remote_addr - $remote_user [$time_local] '
                     '$status "$request"';
Now all wrong logins are saved in a separate log file, which is checked per cron job:
*/1 * * * * root /usr/nginx/parser401.pl >/dev/null 2>&1
For example this script: parser401.pl Скрипт проверяет лог, и если обнаруживает больше 4-х попыток неправильного набора пароля, блокирует этот IP. Script checks the log file and if it finds more than 4 attempts of the wrong password, it blocks this IP address.


NginxModules : http://wiki.nginx.org/NginxModules

Trackback 0 Comment 0