News for hackers. Stuff that matters.
Re:Man who thought opening a TXT file is fine thought wrong by tetha on Saturday April 03, 2021 @05:01AM (#26679411)
> Linux somewhat supports /dev/tcp/HOSTNAME/PORT (technically that's application level in bash so not everywhere), and im sure there's daemons you could run to automount things on the fly.

Do note that this has been disabled in the major distributions at compile time for pretty much ever. The debian bug to build bash with that feature by default is ~20 years old (and was closed as wontdo).

Re:Man who thought opening a TXT file is fine thought wrong by kevinoid on Saturday April 03, 2021 @08:30AM (#26680523)
Although it was disabled in Debian bash 2.04-5 on 2000-06-05, it was re-enabled in bash 4.0-5 on 2009-09-13 and is currently enabled. See https://metadata.ftp-master.debian.org/changelogs/main/b/bas...
Re:Man who thought opening a TXT file is fine thought wrong by exikyut on Saturday April 03, 2021 @07:18AM (#26680068)
On two different Debian 10 boxes bash seems to have it enabled:

  Terminal 1
  $ echo hi > /dev/tcp/127.0.0.1/9999

  Terminal 2
  $ nc -vvvlp 9999
  Listening on [0.0.0.0] (family 2, port 9999)
  Connection from 127.0.0.1 57540 received!
  hi
  $
Re:Man who thought opening a TXT file is fine thought wrong by amenod on Saturday April 03, 2021 @09:28AM (#26680867)
For anyone wondering, it is enabled by default on Ubuntu too. I wonder what made someone think that this was a good idea?
Re:Man who thought opening a TXT file is fine thought wrong by rijoja on Saturday April 03, 2021 @11:05AM (#26681603)
If you follow the everything is a file philosophy it seems quite natural does it not?
Re:Man who thought opening a TXT file is fine thought wrong by soulofmischief on Saturday April 03, 2021 @12:24PM (#26682279)
Except permissions aren't granular enough / are too confusing, it's a giant footgun with the current Linux architecture, which doesn't have all the nice things Plan9 does
Re:Man who thought opening a TXT file is fine thought wrong by rijoja on Wednesday April 07, 2021 @01:39PM (#26728148)
I didn't say that the everything is a file philosophy is necessarily correct and well implemented on Linux. Merely that if you where to continue along this direction it would seem like a logical next step. I don't think I would use this for anything but for shell scripts at best. However especially if you are a plan 9 fanatic then it would seem like quite a good idea which is what the original question was.
Re:Man who thought opening a TXT file is fine thought wrong by bawolff on Saturday April 03, 2021 @05:06PM (#26684736)
I mean, unless you're host is extremely locked down you'll probably also have telnet,netcat, etc installed, so no great difference.
Re:Man who thought opening a TXT file is fine thought wrong by nolok on Saturday April 03, 2021 @05:46PM (#26685023)
I'm no specialist but I'm inclined to disagree, for me it's the difference between the ability to run an arbitrary binary and the ability to read/write an arbitrary filepath
Re:Man who thought opening a TXT file is fine thought wrong by capitainenemo on Monday April 05, 2021 @07:53AM (#26697842)
They are imaginary paths in the bash executable. They aren't usable outside it. Thus the netcat analogy.
Re:Man who thought opening a TXT file is fine thought wrong by LinuxBender on Monday April 05, 2021 @10:09AM (#26699150)
Anything you can do in telnet or netcat can also be done in python, perl, ruby. One of those is likely installed, most probably python.
Re:Man who thought opening a TXT file is fine thought wrong by rijoja on Sunday April 11, 2021 @06:22AM (#26769184)
And if you think about if all applications where using files for communication blocking one program from the internet would be as simple as a chmod.