云桌面文件上传限制绕过方法与实例

前言:

在进行内网渗透时,我们有时会发现云桌面存在文件上传限制,阻止我们直接上传可执行文件(如exe)。但是,仍然可以上传其他类型的文件,例如txt文本文件。在这种情况下,我们可以利用Windows系统自带的一些工具来绕过文件上传限制,以便进行更进一步的渗透测试。

具体实现方法:

CertUtil:

Windows 7及以上版本的系统自带了CertUtil命令,它支持MD5、SHA1等算法的加密和解密操作。我们可以使用CertUtil对想要上传的exe文件进行base64加密,然后在目标主机上使用CertUtil将其解码还原,从而绕过文件上传限制。以下是具体步骤:

Step 1:使用fscan64.exe执行正常的扫描。

图片[1]-云桌面文件上传限制绕过方法与实例-山海云端论坛

Step 2:使用CertUtil对fscan64.exe进行编码,生成base64文本文件fscan_base64.txt。

<code>CertUtil -encode fscan64.exe fscan_base64.txt</code>
图片[2]-云桌面文件上传限制绕过方法与实例-山海云端论坛

Step 3:使用CertUtil对fscan_base64.txt进行解码,还原为fscan64.exe可执行文件。

<code>CertUtil -decode fscan_base64.txt fscan_base64.exe</code>

Step 4:执行解密后的fscan64.exe,确认可以正常使用。

图片[3]-云桌面文件上传限制绕过方法与实例-山海云端论坛

Powershell:

Powershell也可用于加密解密操作,与CertUtil类似。我们可以使用Powershell对想要上传到目标云桌面的exe程序进行base64加密,并转为txt格式。然后上传txt到云桌面,在云桌面上调用系统自带的Powershell进行解密还原exe程序。以下是具体实现:

Step 1:使用fscan64.exe执行正常的扫描。

图片[4]-云桌面文件上传限制绕过方法与实例-山海云端论坛

Step 2:使用Powershell对fscan64.exe进行base64编码,生成fscan_base64.txt。

<code>$PEBytes = [System.IO.File]::ReadAllBytes("fscan64.exe") $Base64Payload = [System.Convert]::ToBase64String($PEBytes) Set-Content fscan_base64.txt -Value $Base64Payload</code>
图片[5]-云桌面文件上传限制绕过方法与实例-山海云端论坛

Step 3:使用Powershell对fscan_base64.txt进行解码,还原为fscan64.exe可执行文件。

<code>$Base64Bytes = Get-Content ("fscan_base64.txt") $PEBytes= [System.Convert]::FromBase64String($Base64Bytes) [System.IO.File]::WriteAllBytes("fscan_base64.exe",$PEBytes)</code>
图片[6]-云桌面文件上传限制绕过方法与实例-山海云端论坛

Step 4:执行还原后的程序,确保可以正常使用。

图片[7]-云桌面文件上传限制绕过方法与实例-山海云端论坛
© 版权声明
THE END
喜欢就支持一下吧
点赞8 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容