Purpose
Application was tested
Planned
- capture, broadcast, watch a desktop (RTSP, RTMP-protocol);
- sending, emulating mouse and keyboard signals;
- use command line on the controlled device. Use Command line;
- ability to run an ssh-client with a reverse tunnel and access the device using the ssh-protocol.
Reverse SSH Tunneling;
- file copying. Files are saved in Download folder. File sharing;
- exchange of clipboards;
- console version for use in your applications or as an additional support service for your device.
- install git and Qt (v.6.7.3 or v.5.15.2, Qt Creator v.14.0.1);
- clone the BypassNAT repository and go to the ‘src’ folder;
- select ‘main’ or ‘console-lite’ branch;
- open file *.pro in the Qt Creator;
- run the project;
Full version.
*installation of additional software required
#sudo apt-get update && upgrade
#sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev -y
#sudo apt-get install gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad gstreamer1.0-rtsp -y
#sudo apt-get update && upgrade
#sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev -y
#sudo apt-get install qtdeclarative5-* qml-module-qtquick* qtquickcontrols5-* qml-module-qtquick2 -y
#sudo apt-get install libqt5multimedia5 libqt5multimedia5-plugins qml-module-qtmultimedia -y
#sudo nano /etc/xdg/qt5ct/qt5ct.conf
#change style=gtk2 to style=gtk3
#sudo apt-get install gstreamer1.0-plugins-ugly gstreamer1.0-rtsp -y
With user interface.
*reduced functionality
*lite installation of additional software required
*under testing - some devices (PC) do not show the video stream
#sudo apt-get update && upgrade
#sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libxkbcommon-x11-dev -y
#sudo apt-get install gstreamer1.0-libav gstreamer1.0-plugins-bad -y
#sudo apt-get update && upgrade
#sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libxkbcommon-x11-dev -y
#sudo apt-get install qtdeclarative5-* qml-module-qtquick* qtquickcontrols5-* qml-module-qtquick2 -y
#sudo apt-get install libqt5multimedia5 libqt5multimedia5-plugins qml-module-qtmultimedia -y
#sudo nano /etc/xdg/qt5ct/qt5ct.conf
#change style=gtk2 to style=gtk3
#sudo apt-get install gstreamer1.0-plugins-ugly gstreamer1.0-rtsp -y
Console application.
Use in your applications or as an additional support service for your device.
*installation of additional software required
#sudo apt-get update && upgrade
#sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev -y
#sudo apt-get install gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad gstreamer1.0-rtsp -y
#sudo apt-get update && upgrade
#sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev -y
#sudo apt-get install qtdeclarative5-* qml-module-qtquick* qtquickcontrols5-* qml-module-qtquick2 -y
#sudo nano /etc/xdg/qt5ct/qt5ct.conf
#change style=gtk2 to style=gtk3
#sudo apt-get install gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad gstreamer1.0-rtsp -y
-spas - set server password (default 1111); ./BypassNatClient.sh -spas 2227
-sip - set IP for connect to server; ./BypassNatClient.sh -sip 137.34.15.27
-ptcp - set port for connect to server; ./BypassNatClient.sh -ptcp 1135
-prtsp - set port for broadcast video-stream; ./BypassNatClient.sh -prtsp 8554
-prtmp - set port for broadcast video-stream; ./BypassNatClient.sh -prtmp 1927
-log - set your login; ./BypassNatClient.sh -log user1
-pas - set your password; ./BypassNatClient.sh -pas user1111
-ds - use another available server; ./BypassNatClient.sh -ds 1 Use another available server
-kds - use another available server with an access key; ./BypassNatClient.sh -ds 1 -kds ExxxRt17j Use another available server
Console application.
Use in your applications or as an additional support service for your device.
*reduced functionality
*no additional software installation required
#sudo apt-get update && upgrade
#sudo apt-get install qtdeclarative5-* qml-module-qtquick* qtquickcontrols5-* qml-module-qtquick2 -y
#sudo nano /etc/xdg/qt5ct/qt5ct.conf
#change style=gtk2 to style=gtk3
-spas - set server password (default 1111); ./BypassNatClient.sh -spas 2227
-sip - set IP for connect to server; ./BypassNatClient.sh -sip 137.34.15.27
-ptcp - set port for connect to server; ./BypassNatClient.sh -ptcp 1135
-log - set your login; ./BypassNatClient.sh -log user1
-pas - set your password; ./BypassNatClient.sh -pas user1111
-ds - use another available server; ./BypassNatClient.sh -ds 1 Use another available server
-kds - use another available server with an access key; ./BypassNatClient.sh -ds 1 -kds ExxxRt17j Use another available server
Allows you to run an ssh-client with a reverse tunnel and access the device (dev_target).
Use BypassNatClient - Menu - Comand line - send a command to the controlled device dev_target
# sshpass -p password_user_server ssh -o StrictHostKeyChecking=accept-new user_server@0.0.0.0 -R 6744:localhost:22
*password_user_server - it’s password of user_server
… or send a command with a key
# ssh -i /home/dev_target/folderKey/ssh-key-2020-11-09.key user_server@0.0.0.0 -R 6744:localhost:22
Use server user_server@0.0.0.0 and connect to the device dev_target
# ssh dev_target@localhost -p 6744
- enter password of dev_target.
Allows you to TEMPORARILY use an already configured server 158.101.219.244
The time of using a third-party server (without an access key) 10 min. Next, the server is unavailable 30 min. Next, again, you can use the server 10 min. And so on…
The access key allows you to use a third-party server longer (until a specific date. Date is discussed additionally).
- console version of the application:
# ./BypassNatClient.sh -sip 158.101.219.244 -log user1 -pas user1111 -ds 1 -kds ExxxRt37j2
- versions of the application with user interface: select Menu -> Server -> use the developer server -> enter 158.101.219.244 -> ( optional: enter key ) -> New connect;
-pas - set server password (default 1111); ./BypassNatServer.sh -pas 2227
-p - set listen port; ./BypassNatServer.sh -p 1675
-la - time to disconnect clients with low activity; ./BypassNatServer.sh -la 60
After 30sec the client will reconnect to the server to identification on the network.
#!/bin/bash
sleep 10
a_pFNS_tcp=1137 #for BypassNatServer
a_pRTSP=8554 #for RTSP
a_pRTMP=1927 #for RTMP
a_pSSH=6744 #for SSH
# opening of ports
sudo systemctl start firewalld
sudo firewall-cmd --zone=public --add-port=${a_pSSH}/tcp --permanent #for SSH
sudo firewall-cmd --zone=public --add-port=${a_pRTSP}/tcp --permanent #for RTSP
sudo firewall-cmd --zone=public --add-port=${a_pRTMP}/tcp --permanent #for RTMP
sudo firewall-cmd --zone=public --add-port=${a_pFNS_tcp}/tcp --permanent #for BypassNatServer
sudo firewall-cmd --reload
while true
do
# BypassNatServer check
if pgrep "BypassNatServer" > /dev/null; then
echo "BypassNatServer STARTED!"
else
echo "BypassNatServer NOT STARTED"
cd /home/user/BypassNatServer
./BypassNatServer.sh -p ${a_pFNS_tcp} &
fi
# Mediamtx check
if pgrep "mediamtx" > /dev/null; then
echo "RTSP-server STARTED!"
else
echo "RTSP-server NOT STARTED"
cd /home/user/Mediamtx
MTX_RTSPADDRESS=":${a_pRTSP}" MTX_RTMPADDRESS=":${a_pRTMP}" MTX_PROTOCOLS="tcp,udp" ./mediamtx &
fi
sleep 2
done
*used third-party software
Publishing and broadcasting a video stream of a desktop.
All code in this repository is released under the MIT license.
Application archives and compiled binaries make use of some third-party dependencies: