sh socat提示

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh socat提示相关的知识,希望对你有一定的参考价值。

# To create a classic TCP listening daemon, similar to netcat -l, use a variation of the following command.
socat TCP-LISTEN:8080 stdout
 
# use remotly a command shell
socat TCP4-LISTEN:1234,reuseaddr,fork 'SYSTEM:/bin/cat /home/infos.txt'
 
# SSLfy a server
socat OPENSSL-LISTEN:443,reuse‐addr,pf=ip4,fork,cert=server.pem,cafile=client.crt TCP4-CONNECT:localhost:80
 
# remote logger on server
socat TCP-LISTEN:5555,reuseaddr,fork SYSTEM:"tail -f /var/log/cassandra/system.log",pty
# client
socat -u TCP:88.190.48.140:5555 STDIO
 
# make a tunnel
socat TCP4-LISTEN:1022,reuseaddr,fork TCP4:host.foo.com:22
 
# make a tunnel via with a proxy
socat TCP4-LISTEN:2022,reuseaddr,fork PROXY:proxy:machine.toto.fr:22,proxyport=3128,proxyauth=user:pass
 
# Installs a simple TCP port forwarder. With TCP4-LISTEN it listens on local port "www" until a connection comes in, accepts it,
# The service running on 172.16.245.11:5432 is forward to 172.16.251.139:5666
socat -d -d -lmlocal2 TCP4-LISTEN:5666,bind=172.16.251.139,su=nobody,fork,reuseaddr TCP4:172.16.245.11:5432

# using socat as an VPN with TUN address
LOCAL_TUN_ADDRESS=10.0.0.0/24
REMOTE_TUN_ADDRESS=10.0.1.0/24
REMOTE_HOSTNAME=server-name.intranet
sudo socat -d TUN:"$LOCAL_TUN_ADDRESS",up  'EXEC:ssh -i '"$HOME/.ssh/id_rsa"' '"$USER"'@'"$REMOTE_HOSTNAME"' "sudo socat - TUN:'"$REMOTE_TUN_ADDRESS"',up"'

以上是关于sh socat提示的主要内容,如果未能解决你的问题,请参考以下文章

sh 在没有wget,curl,socat,nc的情况下执行http请求...

sh 使用bash和[nc | socat]的http请求示例(在unix域套接字中)

CentOS 6.4 安装 rabbitmq(3.6.15)

socat的下载和基础使用

socat 端口转发工具,脚本一键安装配置

如何使用 netcat/socat/telnet 手动连接到 websocket?