Repeater Linux port (version 0.14)

Requirements

This software is intended to run on a Linux or BSD operating system where the distribution is current as of at least May 2006. If you intend to make the repeater available on the internet, you are strongly advised to get a static IP for the computer on which this will run. It is not necessary to register a domain.

Compiling

Just type "make" in the directory where you unpacked the zip file. It should compile and link an executable "repeater".

Install by copying the executable "repeater" to a directory in your path, perhaps /usr/sbin. Copy uvncrepeater.ini to /etc. See Configuration below for more information.

Create a user uvncrep so that repeater can drop root privileges and run as a normal user. For example
groupadd -g uvncrep
useradd -u uvncrep -g uvncrep -d /no/where -s /bin/false uvncrep
See Starting and stopping the server below for a script that runs the server.

If you intend to use the event listener, you're on your own.

Usage / Hints

Starting and stopping the server

Here is a sample script for starting or stopping the server:
#! /bin/sh
# Start/stop/restart the VNC repeater server

vnc_start() {
  if [ ! -f /etc/uvncrepeater.ini ]; then
    echo "uvncrepeater.ini does not exist.  Aborting."
    exit
  fi
  /usr/sbin/repeater 2>>/var/log/vnc.log &
  pgrep repeater >/var/run/vnc.pid
}

vnc_stop() {
  killall repeater
  rm /var/run/vnc.pid
}

vnc_restart() {
  if [ -r /var/run/vnc.pid ]; then
    kill `cat /var/run/vnc.pid`
  else
    echo "Killing repeater in the absence of /var/run/vnc.pid"
    killall repeater
  fi
  sleep 1
  vnc_start
}

case "$1" in
'start')
  vnc_start
  ;;
'stop')
  vnc_stop
  ;;
'restart')
  vnc_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac

Configuration

HINT  Make this work on your LAN. That will ensure that no firewall or other connectivity issue will give you grief. When it works on your LAN, then you can make it work over the internet.

The included configuration only works on a LAN. If you also want to allow connections from the internet, you need to modify /etc/uvncrepeater.ini so that srvListAllow0 = 0.0.0.0 and srvListAllow1 is commented. Also set srvListDeny0 = 255.255.255.255 and comment the srvListDeny1 line. If your repeater server is to be accessible from the internet, you need to understand that anyone can run vncviewer and connect to it. Use iptables to limit connections to viewerport, perhaps like this

# Allow specified IP addresses to connect to VNC repeater
iptables -A INPUT -i eth1 -p tcp -s $ALLOWED_IP --dport 5900 -j ACCEPT
# Drop all IP addresses not specifically allowed above
iptables -A INPUT -i eth1 -p tcp --dport 5900 -j DROP

In order to quiet error messages from the event interface, set useeventinterface = false. Once you have a working setup, you'll probably want to set logginglevel = to 0 or 1. You probbly don't need to change anything else unless you have more than 10 remote machines proxied to this server, in which case you might need to add more lines of the format idlist[n] = 0, which is determined by your requirelistedid = setting.

Set up the Victim (remote computer)

I use the word "victim" because that term is more meaningful to me than "server". I consider the server to be the repeater computer.

Although you will see dialog telling you that the remote computer needs to run vncviewer in listen mode, the only program that needs to run on the victim is winvnc.exe. This should be set up as a Windows service that starts when the computer boots.

You should install the newest version of UltraVNC that works, but be aware that I could not connect when 1.0.8 was installed, so I used 1.0.5. You might want to get things working with 1.0.5. If desired, upgrade your UltraVNC version at a later time. My failure happened on a Windows 2000 Server where 1.0.2 was previously installed.

If the version of UltraVNC installed on the remote computer is 1.0.5 or newer, there will be a file in the UltraVNC directory named ultravnc.ini. Edit it so that the first 3 lines look like

[Permissions]
[admin]
service_commandline=-autoreconnect ID:5555 -connect ns.chsoft.biz::5501
Of course you will want to use the correct ID and either the IP address or the fully qualified domain name of your repeater server, and the port will probably be 5500. The service_commandline causes the equivalent of Add New Client each time the computer boots and the service starts. However, it also causes a reconnection between the victim and the server as often as every 5 seconds. I believe that this reconnection occurs because repeater does not convince winvnc that there is a connection, so winvnc keeps attempting to reestablish the connection. I'm still looking for a solution.

For version 1.0.2, you must right click the VNC icon in the system tray and select Add New Client. Enter either the fully qualified domain name or the IP address of the computer running repeater, a colon, and the port that repeater is listening on (serverport). This must be done each time winvnc is started. For example

66.102.7.105:5500

In the ID Code field, enter the letters ID, a colon, and up to 5 digits. Because VNC expects that the entry to the right of the colon be a port number, you may only enter a unique numeric value here, where the minimum is 1 and the maximum is 65535. outgoing.png
When you click OK, a connection to your repeater server will be established. Note that the port in the image is 5501 because ns.chsoft.biz handles connections to port 5500 specially, so 5500 cannot be used. Its uvncrepeater.ini sets the port with serverport = 5501. When connecting to the repeater running on ns.chsoft.biz from a computer in the LAN at chsoft, the LAN IP is used rather than the fully qualified domain name because machines on the LAN cannot access ns.chsoft.biz using its internet IP.
lan.png

Connecting to the victim from your Windows PC

Run UltraVNC Viewer. Enter the ID of the computer you want to remotely control into the Server field and enter either the IP address or the fully qualified domain name of your repeater server, a colon and the port - as specified in uvncrepeater.ini's viewerport = 5900 line. Note that the viewer uses port 5900 while the victim uses port 5500. connection.png
When you click the Connect button, you should shortly be running the remote machine.

Download

Copyright © 2006 Jari Korhonen
Copyright © 2010 gypsy