Following this Bash tutorial, I have succeded in obtaining the code of a web page issuing simple commands by using this method:
$ exec 3<>/dev/tcp/www.google.com/80
$ echo -e "GET / HTTP/1.1\n\n" >&3
$ cat <&3
Indeed, I get the basic Google html site code:
HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Location: http://www.google.es/?gfe_rd=cr&ei=HsiuVafkLpGt8weX7o-YAg
Content-Length: 258
Date: Tue, 21 Jul 2015 22:30:54 GMT
Server: GFE/2.0
Alternate-Protocol: 80:quic,p=0
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.es/?gfe_rd=cr&ei=HsiuVafkLpGt8weX7o-YAg">here</A>.
</BODY></HTML>
This trick is very useful for me. For example, I have succeeded in using it to send Magic Packets (Wake on LAN) ( a similar example ) .
What shells do allow this way of sending data directly to the network by using simple commands and redirectors?
Apart from Bash, of course.
This info be used for knowing if these systems would have this capability:
- routers with embedded Linux
- common Android shells.
- iOS (iPhone/iPad) shells.
- other embedded devices running some kind of Linux (NAS, Compulab's Utilite, Odroid... etc).