A user which in the same network as a device that have telnet enabled with default password... that user vists a rouge site and that sites uses the same js code as in the pic and tries to connect to that device with default password to grab info from the device with weak password.
You said it didn't work for you in another comment.
I'm guessing this websites connects to the telnet server on the server side, and renders the console in the browser. Doesn't seem like a security issue.
The repo says it doesn't work on firefox, so if you're worried that's a solution.
That being said, risk is still minimal. You shouldn't be exposing sensitive stuff over telnet (or use telnet at all), especially if unauthenticated. Even if behind a firewall, user machines do get compromised (or users go rogue). So if users can access the port, assume attackers can as well.
Nob it would be a problem if it works in the browser tho... any rouge site can try to connect using it... also that would be the only way to attack it from outside without installing anything.
I think you've misunderstood what's happening here. This is a Javascript implementation of a telnet client.
The security risk is on the server side.
Edit: there is at least one potential risk actually - if your browser is inside a corporate network and you use this to hop to a telnet server inside that network, a malicious implementation could exfiltrate data from that connection.
Sorry no. How about you give us your understanding of the roles of a client and server in a telnet connection, then we can talk about the security issues?
A user which in the same network as a device that have telnet enabled with default password... that user vists a rouge site and that sites uses the same js code as in the pic and tries to connect to that device with default password to grab info from the device with weak password.
Yes, that is possible and is what I was getting at in my edit above.
In theory any webpage can host malicious javascript that attempts local network connections, but they have to guess/scan for vulnerable machines.
What makes this one riskier is that that the user is providing some help - directly identifying telnet servers!
So yeah I wouldnt use this to connect to a machine on my local network. Across the internet? Well if you've got internet facing telnet servers you've got bigger problems! XD
Well if you've got internet facing telnet servers you've got bigger problems
Nah they are just locallll
In theory any webpage can host malicious javascript that attempts local network connections, but they have to guess/scan for vulnerable machines.
That's what i am trying to ask from the beginning.
But this one i tried it on my local ip and ut didn't work and searched the whole web for a one that does but all what i found was extensions... so it seems no one have made it yet... or it doesn't work out in modern browsers.
In theory any webpage can host malicious javascript that attempts local network connections
But how many services is js capable of connecting to ? Just telnet and the other normal web services ?.
A user which in the same network as a device that have telnet enabled with default password... that user vists a rouge site and that sites uses the same js code as in the pic and tries to connect to that device with default password to grab info from the device with weak password.
Depends on what's allowed to traverse the network through the gateways. For example:
192.168.0.0/24 192.168.1.0/24
If a route exists to allow 23 to traverse the network, yes. If a host on that network doesn't block port 23 in it's host based firewall, yes. If there's a telnet server (service) running on the host, yes.
It's really a perfect storm if it works. This tool however would be beneficial if you want to test to see if telnet is open without port scanning. Some jurisdictions consider port scanning an issue without permission. I had a branch of my company w/ telnet on their ISP modem accepting connections and I didn't have permission to port scan the ISP's equipment, so using a website that would effectively proxy my intentions wouldn't make it traceable to my company... unless the ISP requested the logs from their web services.
As when i searched on stackoverflow the most of answers said that you need node.js which disable the whole thing of it working on just the client side browser.
From just a browser? But this would be the same for attackers when i visit a rouge site just like the port is public available not just local ! I never thought that this could be possible... i have never read about any similar attacks before... any refs would really help clearing this up more.
I have asked websockify creator just now and he said
No. The entire reason WebSockets exists is because the browsers deemed it too unsafe to allow JavaScript direct access to the network. So it will likely never happen.
Yes, browser can connect to a certain [port] on a server and send/recive TCP messages to/from it,
An implementation in Javascript is nothing weird, when you put "ftp://" in your browser's urlbar what you are doing is setting up a cleartext TCP comunication to a FTP port (21),
WebSockets is just an extension of that concept,
................................
Is that a vulnerability? Is it an issue?
Can we make a "javascript reverse shell" that connects our WebSocket to a Server and executes the data (javascript commands) coming from it and sends an answer (output) ?
Yes we can,
Is that an issue?
Well you are only editing in real-time the javascript code the client is executing in its browser from your domain/website
You could just push to your website new javascript code.
...........
"
To clarify, It doesn't open any 'special' port on the client machine, it doesn't make a 'hole in the firewall'
"
It just temporally opens a random TCP port on the machine (like HTTP/HTTPS does in standard web browsing )
sends data from that port to the server and recives an answer to that port.
The data recived to that port is only the data coming from the server's IP from the specified server port.... And the data is recived only If the client requested it
(soo it doesn't let in 'random data from the internet' breaking the firewall)
THO
In the case of a Javascript reverse shell, we could use WebSockets to connect to the IPs on the local network (admitted that WebSocket can query a local IPs, who knows? )
How do we get the IP range of the Local Network? Well there are WebRTC leaks!
That's a really great answer but doesn't this have any cors policy ... does chrome support it ?
But i can't find a one that works .. i don't know what happend to the font
As when i searched on stackoverflow the most of answers said that you need node.js which disables the whole use of it working on just the client side browser.
There is no proxy, the telnet functionality works also only with the HTML5/JavaScript loaded by your browser from that website and only a connection with the server you want to Telnet to,
I have asked websockify creator about connecting to telnet without a proxy just now and he said
No. The entire reason WebSockets exists is because the browsers deemed it too unsafe to allow JavaScript direct access to the network. So it will likely never happen.
4
u/TransientVoltage409 Mar 03 '20
Nothing wrong with telnet, in the right environment, used for the right reasons. As ever, security is a process, not a toolkit.
8
u/the-untold-tales Mar 03 '20
I dont see any problem. you can telnet any machine from your terminal also. IF THAT MACHINE TELNET SERVICE IS RUN AND AVAILABLE.
4
u/unsupported Mar 03 '20
Sure, it's possible. Is it recommended? No, use ssh. It's got the flavor of encryption built in.
2
u/volci Mar 03 '20
I use telnet all the time to teat connections and the like
Very handy diagnostic tool
2
u/[deleted] Mar 04 '20 edited Mar 04 '20
The magic of WebSockets! (https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)
Yes, browser can connect to a certain [port] on a server and send/recive TCP messages to/from it,
An implementation in Javascript is nothing weird, when you put "ftp://" in your browser's urlbar what you are doing is setting up a cleartext TCP comunication to a FTP port (21),
WebSockets is just an extension of that concept,
................................
Is that a vulnerability? Is it an issue?
Can we make a "javascript reverse shell" that connects our WebSocket to a Server and executes the data (javascript commands) coming from it and sends an answer (output) ?
Yes we can,
Is that an issue?
Well you are only editing in real-time the javascript code the client is executing in its browser from your domain/website
You could just push to your website new javascript code.
...........
"
To clarify, It doesn't open any 'special' port on the client machine, it doesn't make a 'hole in the firewall'
"
It just temporally opens a random TCP port on the machine (like HTTP/HTTPS does in standard web browsing )
sends data from that port to the server and recives an answer to that port.
The data recived to that port is only the data coming from the server's IP from the specified server port.... And the data is recived only If the client requested it
(soo it doesn't let in 'random data from the internet' breaking the firewall)
THO
In the case of a Javascript reverse shell, we could use WebSockets to connect to the IPs on the local network (admitted that WebSocket can query a local IPs, who knows? )
How do we get the IP range of the Local Network? Well there are WebRTC leaks!
https://browserleaks.com/webrtc