黑客防线,在攻与防的对立统一中寻求突破!2001年创刊的黑客技术专业刊物!

设为首页
收藏本站
联系我们
网站导航


黑客文章 - 脚本漏洞 - 浏览 - 扫权限.aspx文件
扫权限.aspx文件
http://www.hacker.com.cn/ 2008-10-11 0:03:46 黑客防线
扫权限.aspx
<%@ Page Language="C#" ValidateRequest="false" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Text" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>ScanWrtieable</title>
</head>
<body>

<script runat="server">

protected void Page_Load(object sender, EventArgs e)
{
}
int cresults;
protected void ScanRights(DirectoryInfo cdir)
{
try
{
if (Int32.Parse(TextBox_stopat.Text) > 0)
{
if (cresults > Int32.Parse(TextBox_stopat.Text))
return;
}
DirectoryInfo[] subdirs = cdir.GetDirectories();
foreach (DirectoryInfo item in subdirs)
{
ScanRights(item);
}

if (File.Create(cdir.FullName + "\\test").CanWrite)
{
this.Lb_msg.Text += cdir.FullName+"<br/>";
cresults++;
}
}

catch { }
}
System.DateTime start = DateTime.Now;
protected void ClearAllThread_Click(object sender, EventArgs e)
{
this.Lb_msg .Text= "";
cresults = 0;
ScanRights(new DirectoryInfo(Fport_TextBox.Text));
TimeSpan usetime = System.DateTime.Now - start;
this.Lb_msg.Text +="usetime: "+ usetime.TotalSeconds.ToString();
}

</script>

<form id="form1" runat="server">

<div>
start<asp:TextBox ID="Fport_TextBox" runat="server" Text="c:\" Width="60px"></asp:TextBox>  
Stopat <asp:TextBox ID="TextBox_stopat" runat="server" Text="5" Width="60px"></asp:TextBox>files
<asp:Button ID="Button" runat="server" OnClick="ClearAllThread_Click" Text="ScanWriterable" /><br />
<asp:Label ID="Lb_msg" runat="server" Text=""></asp:Label>
<br />
 </div>
<div>code by <a href ="http://www.cncert.net">www.cncert.net</a></div>
</form>
</body>
</html>

保存为.aspx
所属分类: 脚本漏洞   所属专题:
共有 258 人次浏览 收藏本页 返回上一页
评论作者:
电子邮件:
评论内容:
投票评价:
验 证 码:
图片包含4个随机字符,点击刷新
请输入上面图片中的随机字符