So I am facing a situation which is as follows :
I have this field,
metadata.description"new user: name=swiagent, UID=995, GID=749, home=/opt/SolarWinds/Agent, shell=/sbin/nologin"
I want to extract this name swiagent and strore it in a variable say $user.
Can I do something to store the part after "=" and before ","
How am I supposed to do that in yara L ?
I need this to make a usecase user account created and deleted in a short interval.
Similarly,
I want to extract the 2 strings after the usermod -aG command i.e. testgroup and testuser_hehe1 in 2 different varaibles.
metadata.description"root : TTY=pts/0 ; PWD=/home ; USER=root ; COMMAND=/usr/sbin/usermod -aG testgroup testuser_hehe1"
Can someone tell me how to code for the same?
Extract a substring from a string | Yara L
Login to the community
Login with SSO
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.


