利用SSH Tunnel穿越Firewall

Posted by : hugo5688 at 23:30 in Windows | Total 962 Views

其實穿越firewall有蠻多種方法的

VPN也是可以做到這一點,不過今天要說的是利用SSH Service來穿越

現在有蠻多公司都會用些gateway端的產品來阻擋瀏灠的網站或MSN等

透過SSH就可以避開這些東西了

當然,上班還是要專心

在這邊只是提供一些小技巧,讓午休的時候可以輕鬆一下 xD

首先,要在外部有一台Linux或Windows的主機

有Linux主機的話,只要啟動SSHD就可以了,當然要有acc & pw

如果是Windows的話,可以安裝OpenSSH或是WinSSHD
(都是freeware)

在這邊,我要介紹比較複雜的方式,也就是用OpenSSH安裝

為什麼呢,因為之前有寫給朋友SOP所以再貼上來就好了 xD

Download & Install OpenSSH:Here

接著在本機加入一個使用者,group用user就可以了

然後開啟command mode切換到”c:\program files\OpenSSH\bin\”
(如果你是選擇預設安裝)

在cmd下打入

“mkgroup -l >> ..\etc\group”
“mkpasswd -l -u [username] >> ../etc/passwd “

預設SSHD的port是22,如果想修改的話

可修改 “c:\program files\OpenSSH\bin\sshd_config”

一般的公司來說,都會開放port 80 & 443,所以可以把port指到443

都設定完後,可在cmd下打入”net start opensshd”來啟動sshd service

這樣sshd server就完成了

再接下來就是怎麼連到server並做一些所謂的「娛樂」xD

在client端我是使用Tunnelier

安裝完後呢,開啟程式會如下圖所示

p1

在Host的地方打入你Server的IP,Port的話看你設多少

Username打入你剛才設定的名稱,Initial Method選到Password

Password就填入剛設的,接著按Login

如果成功的話,會有一顯示”Authentication completed.”

到這邊就算成功了80%了

再設定Services頁面,把SOCKS/HTTP Proxy Forwarding的選項Enable

剩下的選項都不用動

最重要的事來了

接著打開你萬惡的聊天工具「MSN」

MSN可設定經由SOCKS連上

在SOCKS的地方填上127.0.0.1:1080 然後按下test

成功的話,它會顯示可連上網路,你的tunnelier也會顯示

Accepted SOCKS4 connection from 127.0.0.1:2787 to 65.54.239.80:1863.
Closing SOCKS4 connection from 127.0.0.1:2787, sent: 26, received: 26.

設定IE的話把Proxy伺服器打勾

並在進階的Sock(s)部份填上127.0.0.1:1080
(所有通訊協定都使用相同的Proxy伺服器不用勾)

這樣就可以無所顧忌的暢遊網路的,不過班還是要認真上 xD

Share this post :

Upgrade SER SIP Server

Posted by : hugo5688 at 16:05 in Linux | Total 1,345 Views

upgrade 0.8.12 to 0.9.6

Download:Here

OS:Linux RedHat 9

如有安裝舊版rpm檔,請先移除

needs to install

  1. gcc
  2. bison
  3. flex
  4. libxml2

$cd ser-0.9.6
$make && make modules
$make prefix=/usr/local install

安裝完成後,要刪除舊資料庫

否則啟動Service時會有問題

ser.cfg照原本的就可以了

$drop database ser;
$/usr/local/sbin/ser_mysql.sh create
$./ser

沒仔細去找升成新版後啟動時會出現SQL的錯誤

不過大概猜是table有變動,直接砍掉重建比較快 :P

NEWS:http://ftp.iptel.org/pub/ser/0.9.6/doc/NEWS

Apache防止DDoS攻擊模組 - mod_evasive

Posted by : hugo5688 at 12:28 in Linux | Total 1,463 Views

WHAT IS MOD_EVASIVE ?

mod_evasive is an evasive maneuvers module for Apache to provide evasive
action in the event of an HTTP DoS or DDoS attack or brute force attack. It
is also designed to be a detection tool, and can be easily configured to talk
to ipchains, firewalls, routers, and etcetera.

Download:http://www.zdziarski.com/projects/mod_evasive/

OS:RedHat 9

$tar zxvf mod_evasive_1.10.1.tar.gz
$cd mod_evasive
$/usr/sbin/apxs -i -a -c mod_evasive20.c

if can’t find apxs pls install httpd-devel-2.0.40-21.i386.rpm

$vi /etc/httpd/conf/httpd.conf

#add to the httpd.conf file

LoadModule evasive20_module /usr/lib/httpd/modules/mod_evasive20.so

<IfModule evasive20_module>
DOSHashTableSize 3097
DOSPageCount 3
DOSSiteCount 40
DOSPageInterval 2
DOSSiteInterval 2
DOSBlockingPeriod 10
</IfModule>

$service httpd restart

how 2 test? Run test.pl, and view the response codes.

架設STUN Server

Posted by : hugo5688 at 12:05 in Linux | Total 1,409 Views

Download:http://sourceforge.net/project/showfiles.php?group_id=47735

$tar -xvf stund_0.96_Aug13
$cd stund
$make

bind another IP in ur eth0:0 or u have 2 eth card

start STUN service

$./server -v -h <IP_1> -a <IP_2>

“If the IP addresses of your NIC are 10.0.1.150 and 10.0.1.151, run this program with”
“./server -v -h 10.0.1.150 -a 10.0.1.151″
“STUN servers need two IP addresses and two ports, these can be specified with”
“-h sets the primary IP”
“-a sets the secondary IP”
“-p sets the primary port and defaults to 3478″
“-o sets the secondary port and defaults to 3479″
“-b makes the program run in the backgroud”
“-m sets up a STERN server starting at port m”
“-v runs in verbose mode”

add to ur bootload

$vi /etc/rc3.d/S99local

/<your patch>/server -b -h <IP_1> -a <IP_2>

———————————————————————————

目前STUN在穿越Symmetric NAT還是會有問題

在較新的技術ICE應該是可以做到

另外RTPProxy也行 ,不過聽說在語音的傳輸上並不是那麼的好

Page 2 of 2«12