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

[FEATURE] Analyzing string values looking for credentials #1866

Closed
SynacktivCerv opened this issue Dec 10, 2021 · 3 comments
Closed

[FEATURE] Analyzing string values looking for credentials #1866

SynacktivCerv opened this issue Dec 10, 2021 · 3 comments
Assignees
Labels
enhancement MobSF enhancements and feature requests

Comments

@SynacktivCerv
Copy link

SynacktivCerv commented Dec 10, 2021

After analyzing some APKs, I was thinking that having regex run on the strings values (and not on the strings name) may be interesting. For example, looking for patterns that look likes credentials such as: Basic BASE64STRING.

Is your feature request related to a problem? Please describe.
MobSF check for string names in order to find potential secrets. However, secrets may be stored into variables with unpredictable name.

Describe the solution you'd like
is_secret method in mobsf/StaticAnalyzer/views/shared_func.py is looking for variable names. Something may be added there, looking for string or regex:

  • Basic BASE64STRING -> Basic [^-A-Za-z0-9+/=]|=[^=]|={3,}
  • {"alg":"
  • eyJhbGciOi (encoded string for {"alg":)

I'll add more patterns.

@SynacktivCerv SynacktivCerv added the enhancement MobSF enhancements and feature requests label Dec 10, 2021
@github-actions
Copy link

👋 @SynacktivCerv
Issues is only for reporting a bug/feature request. For limited support, questions, and discussions, please join MobSF Slack channel
Please include all the requested and relevant information when opening a bug report. Improper reports will be closed without any response.

@SynacktivCerv
Copy link
Author

SynacktivCerv commented Jan 12, 2022

This regex can trigger authentication URL using SSH/FTP/SFTP/HTTP

- :\/\/[-\w:%.\+~#=]+@[-\w@:%.\+~#=]{1,256}\.[-\w@:%.\+~#=]{1,256}

@ajinabraham
Copy link
Member

Tracked separately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement MobSF enhancements and feature requests
Projects
None yet
Development

No branches or pull requests

2 participants