SOCKS and FTP,WGET, etc….

Overview

SOCKS is one of the proxy implementation connection, that allow us to get connected from system that behind firewall. SOCKS also allow us to do internet activities in a place that unsecure (danger from eavesdropping, hijack connection, or the other security problem)

Problem example

Suppose that we are in a network behind a firewall (picture below) and firewall blocking ftp port. So when the outside network (in this example ftp server) try to send some packet trough port ftp, that packet will never reach our computer.

System Behind Firewall

another example, when use public internet connection (cafe, internet center, etc). That mean we use unsecure internet connection. We don’t know if our connection has been eavesdropping by someone else or not.

Solution

So, how ftp server can connect to our computer that firewalled. And how we can access internet with secure in insecure place..? the answer is SOCKS :)

OK. what we need to make an instant SOCKS server..? here they are

  • a remote server (outside from our firewall), that can connect to our computer through ssh ( use OpenSSH )
  • tsocks (http://tsocks.sourceforge.net), this package has included in my debian-lenny package.
  • now.. what we do then..?

    1. Connect to our remote server using ssh with bind option to make port forwarding to some port. Let we assume port that we use is 8990
    2. ssh -D 8990 remote.proxy.com
      now we already has SOCKS server using port 8990, All trafic from internet will pass firewall through port 8990. Since we use ssh as tool to connect to remote computer, we have a secure connection (secure from eavesdropping, sniffing, hijacking, etc).

    3. tsocks, if don’t have this application in your computer, then you must install it first. Edit tsock configuration, you’ll find it in /etc/tsocks.conf. The most important thing is this 3 line :

      server =
      server_type =
      server_port =

      server indicate server SOCKS, when we use local connection as our server SOCKS, add 127.0.0.1 in server option, server_type indicate we use SOCKS4 or SOCKS5, and server_port indicate number of port we use as server SOCKS. base on our sample, then this line will become like this :


      server = 127.0.0.1
      server_type = 5
      server_port = 8990

    ok.. that’s it.. now we can use ftp, freely.. if we draw connection diagram we will find the connection point will become like blue arrow in picture below

    Connection With SOCKS

    with tsocks we not just can use ftp, but allmost every network application can use under tsock just type like this :
    tsock

    When you only use server socks for browsing, you don’t have tsocks to do that. you can use firefox, this browser has facilities to use SOCKS server. You can find tutorial using SOCKS with firefox in this :

  • http://embraceubuntu.com/2006/12/08/ssh-tunnel-socks-proxy-forwarding-secure-browsing
  • source :

  • http://www.openssh.com
  • http://tsocks.sourceforge.net/index.php
  • http://www.dslreports.com/forum/remark,13563828
  • 10 Responses to “SOCKS and FTP,WGET, etc….”

    1. deptz says:

      aduh.. apa pula ini?hehehehe ga mudeng saya..;))

    2. admin says:

      hehehe…. hasil ujicoba sama linx tuh.. semacam bikin jalan rahasia lewat jaringan :)

    3. Chipz says:

      hoo..sip…
      blm mudeng kalo blm dicoba mas dept..hehe

    4. admin says:

      bener sekali mas chipz :) . Padahal ya mung ssh sama tsock. Tapi penjelasannya aja yang serasa horor :p

    5. topx says:

      wah2,ternyata mas suhu punya blog juga. bahasa inggris pula. ternyata tunneling tu kyk gini to? tapi jg bisa dilakuin tanpa kita pake ssh to? maksudnya langsung dilakuin di kompie buat ngakses ke suatu server yg diblokir gt.

    6. admin says:

      iya pik. ya sambil belajar aja. hehehehe.. Bisa aja pik.. asalkan kompi yang diakses bisa berlaku sebagai sever SOCKS.. :D

    7. topx says:

      nah,itu syaratnya apa? kalo pake kompie biasa gpp to mas? apa kudu pake server

    8. admin says:

      syaratnya diinstal socks server, semacam dante server atau socks4-server. Syarat lainnya kalo mau bisa diakses dari mana aja, dia harus punya ip public. Aku sendiri belum nyoba pik.. Dicoba dulu aja.. nanti kabari aku ;) )

    9. deptz says:

      ah.. IP public… SIC punya IP Public yang bisa dishare kah? hahahaha

    10. admin says:

      who… SIC tidak sesadis itu.. yang sadis telkom tuh. Setiap punya satu akun unlimited dapet satu ip public :D

    Leave a Reply