[源码]Python简易http服务器(内网渗透文件传输)

Python简易http服务器源码

import SimpleHTTPServer
import SocketServer
import sys
PORT = 80
if len(sys.argv) != 2:
    print("use: web.exe port")
else:
    PORT = int(sys.argv[1])
    Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
    httpd = SocketServer.TCPServer(("", PORT), Handler)
    print "SimpleHTTPServer is ", PORT
    print "by k8gege"
    httpd.serve_forever()

用法:

python web.py 端口

web.exe 端口

访问: http://IP:端口

内网渗透

机器A:可上网

机器B:不联网

0x001 机器A文件传到机器B
使用方法,自行打包成可执行文件传到机器部署Web

然后在机器B上通过wget、VBS、Powershell等命令下载文件到机器B

0x002 机器B文件传到机器A

当然也可以反过来,将此程序上传到不可上网机器部部署web

再通过机器A下载机器B文件

0x003 速度

WGET内网下载速度高达70M/S

PS: 很简单但很多人不懂,特别是客户,遇到不懂的直接发文章给他(可能工具还得编译好的)

  当然如果内网自带WEB或其它可用文件传输工具,再自已弄个web进行文件传输就是SB了

 下载: https://github.com/k8gege/K8tools/blob/master/web.py

 下载: https://github.com/k8gege/K8tools/blob/master/web.exe 无Python环境可直接下载exe

猜你喜欢

转载自www.cnblogs.com/k8gege/p/10585372.html