Can't open include file when compiling multiple rules
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Reproduce the failure with yara.compile('./malware_index.yar') from the Yara-Rules rules directory, then compare it with yarac malware_index.yar malware_index. Trace how the Python compile entry point handles included files such as malware/MALW_AZORULT.yar and TOOLKIT_exe2hex_payload.yar. Done means Python compilation succeeds for the demonstrated rulesets without the erroneous include-file failure.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- Checkout https://github.com/Yara-Rules/rules (this also happens with other rulesets, but this is convenient to demonstrate the issue)
- from the rules directory, run 'rules = yara.compile('./malware_index.yar')
Yara raises a syntax
File "yara-python-test.py", line 3, in <module>
rules = yara.compile('./malware_index.yar')
yara.SyntaxError: ././malware/MALW_AZORULT.yar(377): can't open include file: ./malware/TOOLKIT_exe2hex_payload.yar
The rule MALW_AZORULT.yar doesn't refer to the exe2hex payload rule:
/*
This Yara ruleset is under the GNU-GPLv2 license (http://www.gnu.org/licenses/gpl-2.0.html) and open to any user or organization, as long as you use it under this license.
*/
import "cuckoo"
rule Windows_Malware : Azorult_V2
{
meta:
author = "Xylitol xylitol@temari.fr"
date = "2017-09-30"
description = "Match first two bytes, strings, and parts of routines present in Azorult"
reference = "http://www.kernelmode.info/forum/viewtopic.php?f=16&t=4819&p=30867"
// May only the challenge guide you
strings:
$mz = {4D 5A}
$string1 = "ST234LMUV56CklAopq78Brstuvwxyz01NOPQRmGHIJKWXYZabcdefgDEFhijn9+/" wide ascii // Azorult custom base64-like alphabet
$string2 = "SYSInfo.txt"
$string3 = "CookieList.txt"
$string4 = "Passwords.txt"
$constant1 = {85 C0 74 40 85 D2 74 31 53 56 57 89 C6 89 D7 8B 4F FC 57} // Azorult grabs .txt and .dat files from Desktop
$constant2 = {68 ?? ?? ?? ?? FF 75 FC 68 ?? ?? ?? ?? 8D 45 F8 BA 03 00} // Portion of code from Azorult self-delete function
condition:
($mz at 0 and all of ($string*) and ($constant1 or $constant2) or cuckoo.sync.mutex(/Ad48qw4d6wq84d56as|Adkhvhhydhasdasashbc/))
}
running the same command with yara itself works fine (albeit with warnings):
yarac malware_index.yar malware_index
./malware/APT_DPRK_ROKRAT.yar(43): warning: $b2 in rule ROKRAT_loader is slowing down scanning
./malware/MALW_IcedID.yar(18): warning: $magic1 in rule IceID_Bank_trojan is slowing down scanning
./malware/Operation_Blockbuster/sharedcode.yara(155): warning: $a in rule DynamicAPILoading is slowing down scanning
./malware/Operation_Blockbuster/sharedcode.yara(181): warning: $a in rule DNSCalcStyleEncodeAndDecode is slowing down scanning
./malware/RAT_DarkComet.yar(123): warning: $data contains .* or .+, consider using .{,N} or .{1,N} with a reasonable value for N
On a different machine, I get the same error but with different files. If I remove the MALW_AZORULT.yar file I get the same error with a different rule each time. This error also happens with https://github.com/Neo23x0/signature-base
- Ngôn ngữ chính
- C
- Star
- 754
- Fork
- 190
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của VirusTotal/yara-python
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
VirusTotal/yara-python#263 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 28/100
VirusTotal/yara-python#234 · 2 bình luận ·
-
Missing python interface file Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
VirusTotal/yara-python#218 · 3 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
VirusTotal/yara-python#216 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
VirusTotal/yara-python#212 · 11 bình luận ·
Tất cả issue của VirusTotal/yara-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NVIDIA/k8s-device-plugin#2061 · 1 bình luận ·
-
task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
vsanthanam/JBird#429 ·