Skip to content

Latest commit

 

History

History
38 lines (19 loc) · 2.37 KB

lmxcms.md

File metadata and controls

38 lines (19 loc) · 2.37 KB

First find the route according to the URL path ?m=Book&a=index. Enter c/index/BookAction.class.php in the root directory and view the index method:

image.png

Enter the add function directly:

img

Follow up the addModel function:

img

Follow up with addDB

img

The problem comes here. The foreach loop is used to traverse the $data array. In each iteration, assign the key of the current element to $key and the value of the current element to $v. Although it attempts to surround the value with single quotes, this approach is not safe enough

img

Capture the data packet and add it to the value of mail)

image.png

Successful error reporting. By viewing the database information, we construct the following database statement

image.png

Poc is as follows:

name=x&mail=x&tel=x&content=x&setbook=%E6%8F%90%E4%BA%A4&time&ischeck)values(user(),1,1,1,1,1,1)#=1

image.png

Analyze why time&ischeck is used), because when writing the sql statement at the end, the data array is traversed. We write time into the data array when passing parameters in post, and the code itself adds time to the data array after post. Therefore, the time we pass in is earlier than the code itself. You can ignore the time of the code itself and implement our SQL injection. Here is a demonstration of revealing the user name.

image.png