Comments (4)
[deleted comment]
from yara-project.
These rules are an example of the worst case scenario for yara. The [0-255]
jump is simply too wide, they are allowed but they aren't recommended because
they are really slow. If the first part of the strings would be longer,
probably that wouldn't be a problem, but these [0-255] jumps are preceded by
just two or three bytes. Whenever yara finds a match for those 2-3 bytes (and
this should happen a lot), it has to scan the following 255 bytes trying to
match the remaining part of the string, that's what make the scanning so slow.
The problem is even worse with the string containing two of those jumps with
just b801000000 in between, wich his a a very common pattern in executable
files because is the Intel's opcode for mov eax,1. So, the problem here is not
with some particular file in your dataset, the problem is the rule.
My recommendation in this case would be removing the first bytes of the strings
including the jump, for example, the string
5657[0-255]b801000000f7d0ffc081c00100000081e889402626 is better written as
b801000000f7d0ffc081c00100000081e889402626. The first two bytes don't make a
lot of difference in the signature and the remaining string is long enough to
be significant. With shorter strings like 505f[0-255]505e81e800764000 this
approach imposes a lot more risk.
Original comment by [email protected]
on 26 Jan 2012 at 9:11
from yara-project.
After testing the given rule file with some files I've noticed that in fact it
was taking even longer than I would expect because of the reasons discussed
above. Actually the scan was never ending even with small files. So you were
right, YARA was not simply taking long, it was completely hang. The issue has
been fixed in r136.
Original comment by [email protected]
on 31 Jan 2012 at 3:27
from yara-project.
Original comment by [email protected]
on 31 Jan 2012 at 3:27
- Changed state: Fixed
from yara-project.
Related Issues (20)
- variable in range using the offset of another variable as last parameter in range will hit even if the second variable does not exists HOT 1
- malfind and yara (volatility 2.2) HOT 1
- Yara-Python DLL Load Failure HOT 3
- RegEx no longer greedy in v1.7 HOT 1
- /usr/bin/ld: error: cannot find -lyara HOT 4
- Infinite loop on certain samples with one particular rule. Regex related. HOT 1
- Fix abort issue on ARM platforms HOT 1
- [yara python]match() method does not accept variable as parameter HOT 1
- Old issue closed but not fixed HOT 1
- Python - read access during match is not read only HOT 1
- Buffer overflow
- latest svn with gcc 4.7.1 build issue HOT 1
- trying to build python-yara 1.7
- yara 1.7 gets stuck. HOT 2
- YARA 1.7 failing to detect a one-byte string at the end of a two-bytes file
- Failure to build on trunk on ubuntu 12.04 x86_64 HOT 2
- yara-python fails to build on OS X 10.8.5 HOT 1
- Uppercase or Lowercase HOT 2
- Unable to compile Yara on OS X HOT 10
- Yara rule working in 2.0 but not in yara 1.6 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yara-project.