-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Add FastAdmin Path Traversal Module (CVE-2024-7928) #20045
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Kazgangap, thanks for your contribution! I have left some comments for you about the code. Also, while the getting sensitive information from one file looks like good start, it seems like this vulnerability can be exploited to read arbitrary file if I'm not mistaken. Therefore, I think it makes more sense to modify this into arbitrary file read module. Let me know if you would need any help or if you would have any comments/notes.
'ssl' => datastore['SSL'] | ||
}) | ||
|
||
unless res && res.code == 200 && res.body.include?('jsonpReturn(') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless res && res.code == 200 && res.body.include?('jsonpReturn(') | |
unless res&.code == 200 && res.body.include?('jsonpReturn(') |
return | ||
end | ||
|
||
unless data['username'] && data['password'] && data['database'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless data['username'] && data['password'] && data['database'] | |
unless data.dig('username') && data.dig('password') && data.dig('database') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind adding some steps to set up the target?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please rubocop
this file?
res = send_request_cgi({ | ||
'uri' => url, | ||
'method' => 'GET', | ||
'ssl' => datastore['SSL'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is necessary
)) | ||
|
||
register_options([ | ||
Opt::RPORT(80), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably don't have to register port 80, as it should be default.
Hi @msutovsky-r7 thanks for the review and feedback! This is indeed a path traversal vulnerability, but from my testing it seems to be somewhat limited — I wasn't able to read files like /etc/passwd, for example. It looks like access might be restricted to certain application directories. The original PoCs and the Python script I found also focused on reading the application/database file, which is what I based the module on. That file contains sensitive database credentials, so I thought it was still a useful target. I’ve also included setup instructions in the module description to help with reproduction. For testing, I found targets using Fofa and confirmed the exploit works in real scenarios. |
```bash | ||
git clone https://github.com/fastadminnet/fastadmin.git | ||
cd fastadmin | ||
git checkout 1.3.3.20220121 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git checkout 1.3.3.20220121 | |
git checkout v1.3.3.20220121 |
|
||
7. **Import the Database Schema** | ||
```bash | ||
mysql -u root -p fastadmin < fastadmin.sql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mysql -u root -p fastadmin < fastadmin.sql | |
mysql -u <username> -p fastadmin < ./application/admin/command/Install/fastadmin.sql |
```bash | ||
mysql -u root -p fastadmin < fastadmin.sql | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am having some issues finalizing the setup, looks like after following all the steps, i get blank. I saw there is a composer.json
file, shouldn't I do something like composer install
to get the package dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am having some issues finalizing the setup, looks like after following all the steps, i get blank. I saw there is a
composer.json
file, shouldn't I do something likecomposer install
to get the package dependencies?
Hi @dledda-r7 Sorry for the late response to your message. Honestly, I was referring to the standard setup of the application—I haven't installed it myself. I tested it on assets found among approximately 300,000 results in FOFA. It wouldn't be ethical to directly share vulnerable assets, but you can find assets to test by searching for keywords like fastadmin or using queries such as icon_hash="-1036943727" on FOFA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @Kazgangap, in order to land the module, we need to have valid setup documented with clear steps to install the application in a vulnerable state. Moreover, launching exploits and/or metasploit modules on 3rd-part vulnerable systems is not something we can do to verify the functionality of a pull request. Please take your time on documeting the application setup to be vulnerable and update the docs accordingly.
Thanks for your understanding.
Thanks for your pull request! Before this can be merged, we need the following documentation for your module: |
Hey @Kazgangap I was able to install the application successfully with a few extra steps.
Can you see if these work for you as well, and if so, add them to the documentation? Thank you! |
📌 Add FastAdmin Path Traversal Auxiliary Module (CVE-2024-7928)
Description
This PR adds an auxiliary scanner module for a path traversal vulnerability in FastAdmin (versions ≤
1.3.3.20220121
).The issue exists in the
/index/ajax/lang
endpoint, where thelang
parameter can be manipulated to access arbitrary files on the server. This allows unauthenticated attackers to retrieve sensitive configuration files, including database credentials.Vulnerability Details
Verification Steps
msfconsole
.RHOSTS
andRPORT
options:Output Example
Notes
report_note
for later usage.Let me know if you'd like me to squash commits or reformat anything.
Thanks for reviewing my first contribution to the Metasploit Framework 🙌