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

sql inject 3 #24

Open
novysodope opened this issue Jan 16, 2023 · 0 comments
Open

sql inject 3 #24

novysodope opened this issue Jan 16, 2023 · 0 comments

Comments

@novysodope
Copy link

src/main/resources/mybatis/system/UserMapper.xml

There is a ${} in this mapper
image
Search selectUserList to see where the this select id is used:
image
UserController.java

Query user information:
image
Follow up the selectUserList method to see the specific implementation:

UserServiceImpl.java
image
The parameters in the User are passed into the mapper for SQL operation. Because the datascope is controllable, the vulnerability is generated

Verification:

Splice URL and parameters according to code:

params[dataScope]=

Use error injection to query the database version:

params[dataScope]=and+extractvalue(1,concat(0x7e,substring((select+version()),1,32),0x7e))

image

Select database name:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant