zoukankan      html  css  js  c++  java
  • socat-简易使用

    socat -- 被称为nc++,简单理解就是增强版的nc,双向数据流通道工具
    连接端口:socat - tcp:10.0.1.85:80 或者 socat - tcp4:10.0.1.85:80
    
    侦听端口:socat - tcp4-listen:2222  /  socat -tcp -l :8833
    
    接收文件:socat tcp4-listen:8833 open:3.txt,creat,append
    
    发送文件:cat 3.txt | socat - tcp4:127.0.0.1:8833
    
    远程shell
    服务端
    socat tcp-l:23 exec:sh,pty,stderr   (简写的tcp侦听)
    
    客户端
    socat - tcp:10.0.1.92:23
    
    端口转发
    socat tcp4-listen:8080,fork tcp4:10.0.1.85:80
    表示本地监听一个8080端口,然后将访问8080端口的数据流量转发到10.0.1.85上的80端口
    
    远程执行命令
    服务端:socat - udp-l:2020  (本机IP就是10.0.1.92)
    客户端:echo "`id`" | socat - udp4-datagram:10.0.1.92:2020
    
    udp全端口任意内容发包
    for PORT in {1..65535}; do echo "cntfcntfcntf" | socat - udp4-datagram:10.0.1.87:$PORT; sleep .5; done
    
    二进制编辑器
    echo -e "12d" | socat -u - file:/usr/bin/ps,seek,seek=0x00074420

    传文件作用,下面是服务端侦听

    客户端传送

    连接侦听端口

    远程shell

    迷茫的人生,需要不断努力,才能看清远方模糊的志向!
  • 相关阅读:
    C++11 学习总结
    平衡二叉树 (AVL) 笔记
    拼图模板
    2013.9.12
    2013.9.11
    2013.9.10
    2013.9.9
    下载网站
    ubuntu 安装codeblocks
    12个球称3次找坏球的完美解答
  • 原文地址:https://www.cnblogs.com/autopwn/p/14642482.html
Copyright © 2011-2022 走看看