Continuing with the bugs in other universities ... Now we'll see a couple of errors in the website ... Well, I'm not saying that college xD
The first error is a typical SQL Injection. The vulnerable URL is:
http://palestra.??????.edu.pe/index.php?id =
Where is
vulnerable variable "id" . First I tried putting a single quote to see if error occurred. The result was this:
Figure 1 - The web filters quotes.
As noted, the application has been charged with escape quote a prepending "\\"
therefore does not change the SQL command and no error occurs. But not always necessary to alter a quotation mark syntax. The numerical values \u200b\u200bneed not be in quotes in an SQL statement and we are dealing with this case;)
Using a test by contradiction we can see that yes we interfere in the query.
Fig. 2 - When an error is false.
Fig. 3 - When true shows the item.
When injected
"and 1 = 0" the condition will always be false and did not select any items so the application displays an error message. But when injected "and 1 = 1" condition
does not change and shows us the article with id 423. Well, I discovered the vulnerability ... Now let's play a little.
After some time flirting with ORDER BY
already knowing the number of columns in the next step is to see which fields are displayed on the website. We will do a UNION SELECT well: |
| / index.php? Id = null + union + select +1,2,3,4,5,6,7,8,9,10,11,12 , 13,14,15,16,17% 23 |
Fig. 4 - Distribution of the fields shown.
A test mode will we get the name of the databases that exist in the server. To do this we query the table "schemata" of |
|
and display many of the names in a single query;)
Lo LIMIT
we have already explained before so it will be an excuse to learn something new. Serialized SQL Injection is a technique that allows us to show many results of a query in one field visible. This is done using different methods according to the manager database (Oracle, SQL Server, MySQL, etc.) In the case of MySQL you use the "GROUP_CONCAT" that concatenates the results to the same group belong to one string .
The consultation would be serialized like this: / index.php? Id = null + union + select +1,2,3,4, GROUP_CONCAT (schema_name + +0 x20 separator), 6,7,8,9, 10,11,12,13,14,15,16,17 + from + information_schema.schemata% 23
Fig. 6 - Consultation serialized. |
| "0x20" | that is just a blank encoded in hexadecimal, not to use the quotes;)
"FILE"
that is what allows use "INTO OUTFILE" to inject the code. I leave
an image showing the
file "/ etc / passwd" proof of concept :
|
Greetings.
Subscribe to:
Post Comments (Atom)
|
A test mode will we get the name of the databases that exist in the server. To do this we query the table
0 comments:
Post a Comment