XORsearch: Searching With Regexes, (Mon, Apr 7th)
文章介绍了如何利用XORsearch工具结合正则表达式进行文件分析。通过提取所有可能的字符串并使用grep的正则表达式过滤结果,可以找到特定模式(如IPv4地址)。示例展示了如何逐步获取更多信息,并提到未来将发布Python版本的XORsearch以支持YARA规则分析。 2025-4-7 12:34:56 Author: isc.sans.edu(查看原文) 阅读量:9 收藏

Xavier asked me a question from one of his FOR610 students: "how can you perform a regex search with XORsearch"?

XORsearch is a tool like grep but it performs a brute-force attack on the input file, trying out different encodings like XOR.

You can give it a string to search for, but not a regular expression.

There is a work around however: let XORsearch extract all possible strings, and then use a regular expression to grep through the results.

Here is an example with a Cobalt Strike beacon:

Option -S instructs XORsearch to extract all ASCII strings, and re-search.py is used with its built-in regular expression for IPv4 address.

We obtain one address, that we then use directly with XORsearch:

This gives us more information: we see a URL path, and we know the encoding is XOR, and the key is 0x0D.

With option -n, we can look for even more info surrounding that IPv4 address:

There also a method using YARA rules, but for that I need to publish a Python version of xorsearch first. More details in an upcoming diary entry.

Didier Stevens
Senior handler
blog.DidierStevens.com


文章来源: https://isc.sans.edu/diary/rss/31834
如有侵权请联系:admin#unsafe.sh