Setup Socks Server

Install dante in server (centos):

  • cd /tmp
    wget http://www.inet.no/dante/files/dante-1.3.2.tar.gz
    tar xvfz dante-*.tar.gz
    cd dante-*
    ./configure
    make
    make install

  • Config dante in server:
    cat /etc/sockd.conf
    #logoutput: syslog stdout /var/log/sockd.log
    #logoutput: stderr
    #logoutput: syslog
    logoutput: /var/log/sockd.log

    internal: 127.0.0.1 port = 1080
    external: venet0

    method: none
    clientmethod: none

    user.privileged: sockd
    user.unprivileged: nobody
    #user.libwrap: nobody

    #compatibility: sameport
    #compatibility: reuseaddr

    extension: bind
    timeout.negotiate: 30
    timeout.io: 86400

    #srchost: nounknown nomismatch
    #client pass {
    # from: 10.0.0.0/8 port 1-65535 to: 0.0.0.0/0
    # method: rfc931 # match all idented users that also are in passwordfile
    #}

    client pass {
    from: 127.0.0.1/8 to: 127.0.0.1/0
    log: connect error
    method: none
    }

    client block {
    from: 0.0.0.0/0 to: 0.0.0.0/0
    method: none
    }

    pass {
    from: 127.0.0.1/8 to: 0.0.0.0/0
    command: bind connect udpassociate
    log: connect error
    method: none
    }

    pass {
    from: 0.0.0.0/0 to: 127.0.0.1/8
    command: bindreply udpreply
    log: connect error
    method: none
    }

    block {
    from: 0.0.0.0/0 to: 0.0.0.0/0
    log: connect error
    }

  • Add init script:
    cat /etc/init.d/sockd
    #!/bin/sh
    #
    # chkconfig: – 91 35
    # description: Starts and stops the sockd(dante) daemon \
    # used to provide socks services.
    #

    PID=”/var/run/sockd/sockd.pid”
    CONFIG=”/etc/sockd.conf”

    # Source function library.
    if [ -f /etc/init.d/functions ] ; then
    . /etc/init.d/functions
    elif [ -f /etc/rc.d/init.d/functions ] ; then
    . /etc/rc.d/init.d/functions
    else
    exit 1
    fi

    # Avoid using root’s TMPDIR
    unset TMPDIR

    # Source networking configuration.
    . /etc/sysconfig/network

    # Check that networking is up.
    [ ${NETWORKING} = “no” ] && exit 1

    # Check that sockd.conf exists.
    [ -f ${CONFIG} ] || exit 6

    RETVAL=0
    OPTIONS=”-D -p ${PID} -f ${CONFIG}”

    start() {
    KIND=”SOCKD”
    echo -n $”Starting $KIND services: ”
    /usr/local/sbin/sockd ${OPTIONS}
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sockd || \
    RETVAL=1
    return $RETVAL
    }

    stop() {
    KIND=”SOCKD”
    echo -n $”Shutting down $KIND services: ”
    killproc sockd
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sockd
    return $RETVAL
    }

    restart() {
    stop
    start
    }

    rhstatus() {
    status -l sockd sockd
    return $?
    }

    # Allow status as non-root.
    if [ “$1” = status ]; then
    rhstatus
    exit $?
    fi

    case “$1″ in
    start)
    start
    ;;
    stop)
    stop
    ;;
    restart)
    restart
    ;;
    status)
    rhstatus
    ;;
    condrestart)
    [ -f /var/lock/subsys/sockd ] && restart || :
    ;;
    *)
    echo $”Usage: $0 {start|stop|restart|status|condrestart}”
    exit 2
    esac

    exit $?

  • enable auto launch during boot

    chkconfig –add sockd

  • dante
    http://www.inet.no/dante/

    SS5
    http://ss5.sourceforge.net/

    DeleGate
    http://www.delegate.org/delegate/

    Srelay
    http://socks-relay.sourceforge.net/