Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Basic Arithmetic operation #1279

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

scottdermott
Copy link

@scottdermott scottdermott commented Nov 25, 2021

Various malware samples use obfuscation to avoid detection.
A common technique is to use simple arithmetic within Chr() or [char] to avoid detection

For example :
Chr(104+1-1) & "t" & Chr(120+4-8) & "ps" & "://"

Sum & subtract operations are not a viable solution for this kind of string -> basic calculation -> number that can be converted from a valid Charcode

Using the following recipe this very easy to decode the obfuscated string:

Subsection('chr\\((.*?)\\)',false,true,false)
Basic_Arithmetic()
From_Charcode('CRLF',10) 

Output:
https://

@CLAassistant
Copy link

CLAassistant commented Nov 25, 2021

CLA assistant check
All committers have signed the CLA.

@mt3571
Copy link
Contributor

mt3571 commented Nov 26, 2021

Thanks for you input! There is already an open PR to add arithmetic, but in a different way. You can see it here. Would you be able to achieve what you want using that PR?

@scottdermott
Copy link
Author

Thanks for you input! There is already an open PR to add arithmetic, but in a different way. You can see it here. Would you be able to achieve what you want using that PR?

Hi, I had a look at the PR and I don't think it would be possible using that operation.

The Operation I added evaluates a basic add and/or subtract maths string and returns a numeric value without doing a javascript evil eval() (See screenshot)

Screenshot 2021-11-26 at 17 23 32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants