Convert BYTE to STRING

Hi All,

IS it possible to convert BYTE to a STRING in Yara L.

Getting error :- Validating intermediate representation: expect type [string], got type bytes for "Factory(e.udm.principal.process.commmand_line) 

Use case convert input hex string to base64 and base64 to readable format

Mufa_shah_0-1727693376121.png

 

 

Solved Solved
0 2 380
1 ACCEPTED SOLUTION

Based on the screenshot and what you are looking to do, I'm not sure if you need to do that.

The process.command_line field is a string so even if there is hex within it, you would need to break it out into a placeholder variable before running an conversions on it. Below is a blog where i use base64 decode with encoded powershell but i also use re.regex in this example to extract the base64 and then decode it.

https://www.googlecloudcommunity.com/gc/Community-Blog/New-to-Google-SecOps-The-Replacements/ba-p/72...

 

View solution in original post

2 REPLIES 2