连接到自己的网络守护进程是什么意思?

What does connecting to own network daemon mean?

我目前正在做来自 overthewire.org 的强盗兵棋(对于那些不知道的人来说,这是一个具有不同任务的网站,您可以通过这些任务来提高您的黑客技能)。 我以前做过,但我很早就被卡住了,我用剧透炸开了它们。这样做的好处是它为 'replayability' 留下了很大的空间,我们称之为 'replayability'。 xD 现在我在 bandit20,我需要使用一个可执行文件:

/home/bandit20/suconnect
usage: ./suconnect <port number>

那个"will connect to the given port on localhost using TCP. If it receives the correct password from the other side, the next password is transmitted back."

我最初的反应是拉出 nmap 并寻找开放端口。我确实找到了一些打开的,其中一些是 运行ning echo 和一些 openssl。无论服务 运行ning,总共有 5 个端口是打开的,我还发现使用 ps -alx netcat 运行ning 在后台监听另一个第 6 个端口。

现在,任务描述说:

[the file] makes a connection to localhost on the port you specify as a commandline argument. It then reads a line of text from the connection and compares it to the password in the previous level (bandit20). If the password is correct, it will transmit the password for the next level (bandit21). NOTE: Try connecting to your own network daemon to see if it works as you think

我使用预期的语法尝试了我找到的所有 6 个端口,但其中 none 返回了任何内容。我确实在一个带有剧透的博客上找到了网站上的旧描述:

To beat this level, you need to login twice: once to run the setuid command, and once to start a network daemon to which the setuid will connect

我尝试了两次 sshing 并监听了所有这些端口,在第二次 window 中使用了二进制文件,但它什么也没做。问题是,在我 运行 二进制文件之后,它给了我一个空白的命令行,但无论我输入什么,它都没有给出任何输出。 我在文件上使用了字符串,我看到它确实有无法连接、密码不正确、密码正确等失败消息,但我什么都没有。

在这种情况下,我更希望了解基本概念,而不是被交给解决方案。我不确定连接到您自己的网络守护进程意味着什么(我尝试使用谷歌搜索并在 youtube 上查找,但我真的不明白什么是网络守护进程或连接到它意味着什么)。 还必须 运行 2 个终端似乎很重要,因为他们把它拿出来了,但我似乎无法弄清楚你应该怎么做,或者在这种情况下你应该用它做什么。 另外,为了监听本地主机上的端口,我使用了 netcat,不确定是否还有其他更好的方法,或者您是否应该使用其他方法。

非常感谢任何反馈, 谢谢:)

只是想说我设法找到了答案。事实证明,localhost 是本地守护进程,连接到它意味着执行 2 个 netcats:一个侦听端口,一个连接到它。