简体   繁体   English

通过HTTP的SSH隧道

[英]SSH tunnel through HTTP

I got a question: How can I encapsulate a SSH server's output into a HTTP request, only using scripting ? 我有一个问题:如何仅使用脚本将SSH服务器的输出封装到HTTP请求中?

I want the HTTP request to be valid, with headers and all those things. 我希望HTTP请求有效,包括标头和所有其他内容。

Further details: I want to establish a ssh connection between 2 hosts, but i need this connection to be encapsuled into HTTP packets along the way. 更多详细信息:我想在2台主机之间建立ssh连接,但是我需要将此连接封装到HTTP数据包中。

Thanks 谢谢

PS: I do not want to install anything, I want to do this only with scripts. PS:我不想安装任何东西,我只想使用脚本来安装。

Edit: As it does not seem clear, I'm not asking for all done scripts by one of you guys. 编辑:由于似乎不清楚,我不是要你们中的任何一个完成脚本。

What I want to know is, what can be done to redirect the output of a SSH server to a text file or anything. 我想知道的是,可以采取什么措施将SSH服务器的输出重定向到文本文件或其他任何文件。 I want to take this output and put it into a HTTP request, but I don't know how to "redirect" the output of the SSH server. 我想将此输出放入HTTP请求中,但是我不知道如何“重定向” SSH服务器的输出。

This is, amongst other things, what I want to do. 除其他外,这就是我想要做的。

I'm not exactly sure on the specifics of what you want, but it sounds like it could be accomplished through a CGI script that would start an ssh session, read the data from said session(Which I believe is possible through a child of /dev/, experimentation needed), then sending the data back. 我不确定您要的具体细节,但听起来可以通过CGI脚本来完成,该脚本将启动ssh会话,从该会话中读取数据(我相信可以通过/的子代来实现dev /,需要进行实验),然后将数据发送回去。 Beyond that it's really up to specific implementation. 除此之外,还取决于具体的实现。

Edit:
Actually a better method might be something like this with a reverse shell.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM