-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🧑‍💻 feat: Extend exploit scripts and user simulator to support like s…
…ervice
- Loading branch information
1 parent
dba5dc5
commit 284d5e2
Showing
7 changed files
with
97 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
exploit-toolkit/exploits/sql-injection/SQLI-LIKE-SERVICE-REMOVE-LIKE.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# SQL Injection | ||
|
||
Utilizing [SQL injection](https://owasp.org/www-community/attacks/SQL_Injection) can lead to sensitive data being read | ||
and/or databases to be modified (Insert/Update/Delete). | ||
In addition, administrative operations such as shutting down the DBMS can also be completed. | ||
|
||
Unguard has a PHP microservice for handling likes that uses an unsafe version of Laravel, allowing you to remove another user's like on a post. When liking/unliking, normally, the PHP service would receive a post ID and a user ID, but with the right parameters, you can send two post IDs, leading to the latter one being misinterpreted as the user ID by Laravel ([see more details](https://security.snyk.io/vuln/SNYK-PHP-LARAVELFRAMEWORK-1060045)). | ||
|
||
## Preconditions and Requirements | ||
|
||
For this exploit to work you need: | ||
|
||
* [unguard](../../../docs/DEV-GUIDE.md) deployed and running | ||
* (optional) [unguard-exploit-toolkit](../../INSTALL.md) set up | ||
|
||
## Removing another user's like | ||
You can exploit the vulnerability in the PHP Like Service either with or without the Toolkit CLI. | ||
In any case, you will have to find out the user ID of the user whose like you want to remove. | ||
This ID is exposed indirectly through the Users page. The admanager user always has the ID 1, and you can see that it is listed at the top of the users page. | ||
The user shown below the admanager has the ID 2, the one below that has the ID 3 etc. | ||
|
||
### w/o Toolkit CLI | ||
Once you have the ID of the user whose like on a particular post you want to remove, head over to the frontend page for that post, e.g. http://unguard.kube/ui/post?postId=1. | ||
You can get to that page by liking the post yourself. Then, in the search bar, modify the parameters thusly: | ||
`http://unguard.kube/ui/post?postId=[POST_ID]&postId=[USER_ID]&like_delete`. | ||
The second `postId` parameter is misinterpreted by Laravel as the user ID, and the like for that user will be deleted. After you load the site with these parameters, | ||
you should see a 404 error. | ||
|
||
### With Toolkit CLI | ||
You can use the `ug-exploit` tool for exploiting the vulnerability. Make sure to use `ug-exploit login` first. | ||
|
||
Afterwards, use `ug-exploit sql-inject-unlike-post` and enter the post and user ID. That should delete the specified user's like. The returned status code will always be 404. | ||
|
||
|
||
## Further Details | ||
|
||
* [SQL Injection - OWASP](https://owasp.org/www-community/attacks/SQL_Injection) | ||
* [SQL Injection affecting laravel/framework - Snyk](https://security.snyk.io/vuln/SNYK-PHP-LARAVELFRAMEWORK-1060045) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters