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

Randomize the homedir of the user to evade sandbox detection. #262

Open
calebbrown opened this issue Apr 5, 2022 · 2 comments
Open

Randomize the homedir of the user to evade sandbox detection. #262

calebbrown opened this issue Apr 5, 2022 · 2 comments
Labels
dynamic analysis Issues specific to the implementation of Dynamic Analysis enhancement New feature or request needs discussion

Comments

@calebbrown
Copy link
Contributor

Some samples of malware check for a $HOME of /root and skip running if true.

Running at root has its advantages, so perhaps changing the home from /root to /home/${name}, where ${name} is replaced by a name drawn at random from a set of predefined common usernames (e.g. popular first names, admin, deploy, worker, etc)

@maxfisher-g
Copy link
Contributor

Could this be done dynamically in the sandbox by doing an adduser/useradd and then su or sudo -l to that user before installing and running the package?

@maxfisher-g maxfisher-g self-assigned this Oct 18, 2022
@maxfisher-g
Copy link
Contributor

Issues to consider (from discussion with @calebbrown):

  • If the username is randomised, then the home directory will be randomised, and we want to be able to replace the randomised home directory with a generic token (e.g $USER or %USER%)
  • Names should be hard to guess (i.e. not constant or drawn from a small set) but also not too obviously random
  • podman has a way to supply the user to run as
  • Potentially could run as both unprivileged user as well as root, but this doubles the amount of data collected
  • We should probably do some experiments to determine how many packages actually do check whether they're running as root

Current conclusion is that this issue is not super high priority

@maxfisher-g maxfisher-g removed their assignment Nov 28, 2022
@calebbrown calebbrown added enhancement New feature or request dynamic analysis Issues specific to the implementation of Dynamic Analysis needs discussion labels Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dynamic analysis Issues specific to the implementation of Dynamic Analysis enhancement New feature or request needs discussion
Projects
None yet
Development

No branches or pull requests

2 participants