Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wget on https://*IP*:22/connect returns 404 in connect.sh #2

Open
vddev opened this issue Nov 27, 2017 · 9 comments
Open

Wget on https://*IP*:22/connect returns 404 in connect.sh #2

vddev opened this issue Nov 27, 2017 · 9 comments

Comments

@vddev
Copy link

vddev commented Nov 27, 2017

Hey there,

Love the project, it looks great on paper and I could really use something like this for a personal project. I'm experiencing a problem getting the correct connect.sh script. When I wget the url it gives me a 404. Do you have any idea what could be going wrong? I'd love to contribute when needed.

Greetings,

JD

@vddev
Copy link
Author

vddev commented Nov 27, 2017

On the client VM

crssh:~$ wget https://192.168.205.69:8000/connect --no-check-certificate
--2017-11-27 15:49:35--  https://192.168.205.69:8000/connect
Connecting to 192.168.205.69:8000... connected.
WARNING: The certificate of ‘192.168.205.69’ is not trusted.
WARNING: The certificate of ‘192.168.205.69’ hasn't got a known issuer.
The certificate's owner does not match hostname ‘192.168.205.69’
HTTP request sent, awaiting response... 404 Not Found
2017-11-27 15:49:35 ERROR 404: Not Found.

@vddev
Copy link
Author

vddev commented Nov 27, 2017

On the server VM:

rssh:/# wget https://127.0.0.1:8000/connect --no-check-certificate
--2017-11-27 15:52:18--  https://127.0.0.1:8000/connect
Connecting to 127.0.0.1:8000... connected.
WARNING: The certificate of ‘127.0.0.1’ is not trusted.
WARNING: The certificate of ‘127.0.0.1’ hasn't got a known issuer.
The certificate's owner does not match hostname ‘127.0.0.1’
HTTP request sent, awaiting response... 404 Not Found
2017-11-27 15:52:18 ERROR 404: Not Found.


rssh:/# wget https://127.0.0.1:8000/info --no-check-certificate
--2017-11-27 15:53:05--  https://127.0.0.1:8000/info
Connecting to 127.0.0.1:8000... connected.
WARNING: The certificate of ‘127.0.0.1’ is not trusted.
WARNING: The certificate of ‘127.0.0.1’ hasn't got a known issuer.
The certificate's owner does not match hostname ‘127.0.0.1’
HTTP request sent, awaiting response... 404 Not Found
2017-11-27 15:53:05 ERROR 404: Not Found.

rssh:/# wget https://127.0.0.1:8000 --no-check-certificate
--2017-11-27 15:54:17--  https://127.0.0.1:8000/
Connecting to 127.0.0.1:8000... connected.
WARNING: The certificate of ‘127.0.0.1’ is not trusted.
WARNING: The certificate of ‘127.0.0.1’ hasn't got a known issuer.
The certificate's owner does not match hostname ‘127.0.0.1’
HTTP request sent, awaiting response... 302 Found
Location: /auth?next=%2F [following]
--2017-11-27 15:54:17--  https://127.0.0.1:8000/auth?next=%2F
Reusing existing connection to 127.0.0.1:8000.
HTTP request sent, awaiting response... 302 Found
Location: / [following]
--2017-11-27 15:54:17--  https://127.0.0.1:8000/
Reusing existing connection to 127.0.0.1:8000.
HTTP request sent, awaiting response... 200 OK
Length: 1846 (1.8K) [text/html]
Saving to: ‘index.html’

index.html                   100%[=============================================>]   1.80K  --.-KB/s    in 0s

2017-11-27 15:54:17 (67.2 MB/s) - ‘index.html’ saved [1846/1846]


@vddev
Copy link
Author

vddev commented Nov 27, 2017

Docker command:

docker run -d --cap-add=SYS_PTRACE -e "SSHHOST=192.168.205.69" -p 8000:8000 -e "HTTPSPORT=8000" -p 221:22 -e "SSHPORT=221" --cap-add=SYS_PTRACE logicethos/revssh

@vddev
Copy link
Author

vddev commented Nov 27, 2017

Docker SSH interface:

Reverse SSH Terminal
wget https://192.168.205.69:8000/connect --no-check-certificate -O connect.sh; sh connect.sh
curl -k https://192.168.205.69:8000/connect -o connect.sh; sh connect.sh
===============================================================================
 
NO ACTIVE CONNECTIONS
 
 
===============================================================================
-> Please enter SSH port to connect.
-> [ENTER] to refresh status.
-> 'passwd' to change password.
-> 'kill <port>' to drop connection.
-> 'exit' or 'quit'

@logicethos
Copy link
Collaborator

Confirmed. Seems to build OK from source, but I pulled directly from docker hub, and it's broken. Thanks for reporting, will look into it.

@vddev
Copy link
Author

vddev commented Nov 28, 2017

Thank you for your time. Upon building the docker manually it works like you said. Although I walked into some other problems. The connect.sh generates with a static localhost reference, so when executing the connect.sh on the remote client it will try to connect to itself. Upon modifying the reference to the RevSSH server it will work, but only for the first connected client. The following connected clients will not register their username properly:


Reverse SSH Terminal
wget https://192.168.205.69:8000/connect --no-check-certificate -O connect.sh; sh connect.sh
curl -k https://192.168.205.69:8000/connect -o connect.sh; sh connect.sh
===============================================================================

ACTIVE CONNECTIONS

PORT: 10000     user@crssh  (PID:98)        0 days, 00h 17m
PORT: 10001     <??>@<??>       (PID:155)       0 days, 00h 03m
PORT: 10002     <??>@<??>       (PID:765)       0 days, 00h 00m

===============================================================================
-> Please enter SSH port to connect.
-> [ENTER] to refresh status.
-> 'passwd' to change password.
-> 'kill <port>' to drop connection.
-> 'exit' or 'quit'

@logicethos
Copy link
Collaborator

Have you got --cap-add=SYS_PTRACE in the docker run ?

Try docker exec -it revssh /bin/bash
then lsof
see if any error messages

lsof -i tcp:10000-19999 should show you whats connected.

@vddev
Copy link
Author

vddev commented Dec 4, 2017

Hey thanks for coming back to me. I removed the container from my server, pulled the new code and rebuild it. When I wget now, the 404 problem is back, so it's probably something in the new code. I did put --cap-add=SYS_PTRACE in the docker run last time.

@logicethos
Copy link
Collaborator

I don't think docker hub is building the image correctly. I changed the instructions to self build.
docker build https://github.com/logicethos/RevSSH.git -t logicethos/revssh

I wonder if you need to first delete the original image that is maybe cached on your drive (logicethos/revssh)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant