Setting Up Rustdesk - RIT-GCI-CyberRange/Openstack-Guides GitHub Wiki
- Navigate to https://github.com/rustdesk/rustdesk/releases/tag/1.2.3-1
- click on Windows next to x86-64.
- once downloaded, run the executable.
- when the window opens next to ID click the three vertical dots.
- click on network and type in the following, then click apply.
If you are getting invalid key on connection, Add this to the key field on the client you are connecting with
3SLkCQnj7B6A1++0E3fZaN2M7MbusS82huuX+6bQBS8=
Now Rustdesk is ready to be run on windows.
- Ensure that the machine is connected to open internet to download the necessary packages.
- copy the following commands into a bash script.
#!/bin/bash
wget https://github.com/rustdesk/rustdesk/releases/download/1.2.3/rustdesk-1.2.3-x86_64.deb -O /tmp/rustdesk.deb
apt-get update
apt-get install -fy /tmp/rustdesk.deb > null
apt-get install -yq pwgen screen
rustdesk_pw=`pwgen -1 -A -0 -B`
rustdesk_config="9JSP4MlQRJmNrgVd1hmM4M1c1JWT30kMOFmWmNTRwsyKxEkNCdjauF1Qrx0UzIiOikXZrJCLiIiOikGchJCLiUHZl5CdpJnLldmbhJnclJWej5yazVGZ0NXdyJiOikXYsVmciwiI1RWZuQXay5SZn5WYyJXZil3Yus2clRGdzVnciojI0N3boJye"
/bin/bash -l -c "/usr/bin/rustdesk --password $rustdesk_pw"
/bin/bash -l -c "/usr/bin/rustdesk --config \"$rustdesk_config\""
systemctl restart rustdesk
sleep 15
/bin/bash -l -c "/usr/bin/rustdesk --password $rustdesk_pw"
/bin/bash -l -c "/usr/bin/rustdesk --config \"$rustdesk_config\""
/bin/bash -l -c "/usr/bin/rustdesk --password $rustdesk_pw"
rustdesk_id=$(rustdesk --get-id)
systemctl restart rustdesk
echo $rustdesk_id -- $rustdesk_pw
- run chmod +x <new bash script>
- run sudo ./<script>
- you should get the following:
- each time this process is stopped the following part of the script will need to be re-run
rustdesk_pw=`pwgen -1 -A -0 -B`
rustdesk_config="9JSP4MlQRJmNrgVd1hmM4M1c1JWT30kMOFmWmNTRwsyKxEkNCdjauF1Qrx0UzIiOikXZrJCLiIiOikGchJCLiUHZl5CdpJnLldmbhJnclJWej5yazVGZ0NXdyJiOikXYsVmciwiI1RWZuQXay5SZn5WYyJXZil3Yus2clRGdzVnciojI0N3boJye"
/bin/bash -l -c "/usr/bin/rustdesk --password $rustdesk_pw"
/bin/bash -l -c "/usr/bin/rustdesk --config \"$rustdesk_config\""
systemctl restart rustdesk
sleep 15
/bin/bash -l -c "/usr/bin/rustdesk --password $rustdesk_pw"
/bin/bash -l -c "/usr/bin/rustdesk --config \"$rustdesk_config\""
/bin/bash -l -c "/usr/bin/rustdesk --password $rustdesk_pw"
rustdesk_id=$(rustdesk --get-id)
systemctl restart rustdesk
echo $rustdesk_id -- $rustdesk_pw
- the password will be randomly generated each time
During a competition scenario you may be required to disconnect the competition environment from the open internet. This is relatively easy using port security if you have an OpenStack routed network. If however you are using a pfSense routed network with port security disabled this becomes more diffficult. If the router is in scope of the competition, then it is possible that the router may go down. If this occurs we must ensure that Rustdesk can still be used to access the machines by doing the following:
- create a new network on openstack
- Ensure the subnet is available on your environment. Set the gateway to whatever won't interfere with your other network's traffic. In this example the internal network routes through 192.168.x.254 so leaving the gateway as default will set it to 192.168.10.1 which will work automatically.
- we want to automatically add a new static route that will only be utilized for traffic being sent over our rustdesk server so we will add the following:
Make sure to change the ip after the comma to be the subnet of the new network in this case the gateway would be 192.168.10.1 because out network is 192.168.10.0/24. Click create. now every machine added to the network will receive the correct route for Rustdesk only.
- Now we will create a router connected to external 249.
- Now we will add an interface connected to the Rustdesk network. Click on the newly created router and navigate to interfaces. Click add interface and select the Rustdesk network. Unless specified the IP of the interface will be x.x.x.1 so change it if that is not the gateway you are using for the Rustdesk connections.
- Now navigate to your default security group and add the following rule (This allows Rustdesk connections):
- Now you can add machines to the Rustdesk network by clicking on the dropdown for an instance and selecting Attach Interface.
-
source into your .rc file for the current project
-
Create the separate Rustdesk network:
openstack network create -- project <your project name> --enable-port-security Rustdesk
- Now create the subnet for the Rustdesk network
openstack subnet create --subnet-range 192.168.10.0/24 --gateway 192.168.10.1 --ip-version 4 --network Rustdesk --host-route destination=129.21.33.138/32,gateway=192.168.10.1 Rustdesk_subnet
- create the router that will only be used for Rust desk connections
openstack router create --project <your project> --external-gateway external249 Rustdesk
- create a network port that will be used to connect the Rustdesk network and router
openstack port create --network <your Rustdesk network ID> --fixed-ip subnet=<your Rustdesk_subnet network ID>,ip-address=192.168.10.1 --project<your project name> --enable-port-security Rustdesk
- connect the network to the router
openstack router add port <router ID> <port created in step 5 ID>
- no route to 192.168.10.1
most machines will automatically update to have the new route when added to the new network. If a machine does not auto update then you can run
sudo > > dhclient
on Linux andipconfig /release
followed byipconfig /renew
on Windows machines.