python flask内存马学习
概念内存马,也被称为无文件马,是无文件攻击的一种常用手段。 常用的python框架有Django、flask,而这两种框架都可能存在SSTI漏洞。python 内存马就是利用flask框架中SSTI或者pickle反序列化来实现的,通过添加新的路由访问该路由实现命令执行。 请求上下文管理机制当网页请求进入flask时,会实例化一个requset context.在python中分出了两种上下文:请求上下文(request context)、应用上下文(session context).一个请求上下文中封装了请求的信息,而上下文的结构是运用了一个stack的栈结构,也就是说它拥有一个栈所拥有的全部特性。request context实例化后会被push到栈_request_ctx_stack中,基于此特性便可以通过获取栈顶元素的方法来获取当前的请求. 原理利用flask编写一个SSTI例子: 12345678910111213141516from flask import Flask, request, render_template_stringapp =...
CTF中的IP伪造
在一些CTF比赛常常会考到通过伪造IP获得flag,下面是一些常见的IP伪造的请求头: X-Forwarded-For:127.0.0.1 Client-ip:127.0.0.1 X-Client-IP:127.0.0.1 X-Remote-IP:127.0.0.1 X-Rriginating-IP:127.0.0.1 X-Remote-addr:127.0.0.1 HTTP_CLIENT_IP:127.0.0.1 X-Real-IP:127.0.0.1 X-Originating-IP:127.0.0.1 via:127.0.0.1 X-Forwarded:127.0.0.1 X-Forwarded-Host:127.0.0.1 True-Client-IP:127.0.0.1 Ali-CDN-Real-IP:127.0.0.1 Cdn-Real-IP:127.0.0.1 Cdn-Src-IP:127.0.0.1 CF-Connecting-IP:127.0.0.1 Proxy-Client-IP:127.0.0.1
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1$ hexo new "My New Post" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment







