| Comments | There are no comments in MS Access. So ?/*?, ???, and ?#? can?t be used here. But it?s possible to use the NULL byte (%00) to comment out the end of the query :
|
||||||||||||
| Syntax Error Message | ?[Microsoft][Driver ODBC Microsoft Access] | ||||||||||||
| Stacked Query | Not Allowed. | ||||||||||||
| UNION support | The UNION operator is supported, but it needs a valid table name in the FROM clause. | ||||||||||||
| Subquery | Subqueries are supported (in the example ?TOP 1? is used to make the query returns only one row) :
|
||||||||||||
| LIMIT support | LIMIT isn?t implemented, but it?s possible to use ?TOP N? in SELECT statement, to limit the number of returned rows :
|
||||||||||||
| Make the query returns 0 rows | This could be useful when the script displays only the first result rows in the html response :
|
||||||||||||
| String concatenation | No CONCAT() function exists. It?s possible to use the ?&? or ?+? operator to concat two strings. But you need to URL encode them :
|
||||||||||||
| Substring | MID() function :
|
||||||||||||
| String length | LEN() function :
|
||||||||||||
| Find web root directory | You can find the web root directory trying to select something from an inexistent database. MS Access will response with an error message containing the full path name :
|
||||||||||||
| ASCII value from a character | ASC() function :
|
||||||||||||
| Character from an ASCII value | CHR() function :
|
||||||||||||
| IF Statement | IIF() function can be used. Syntax : IIF(condition, true, false) :
|
||||||||||||
| Time Inference | Not allowed. Function such as BENCHMARK() or SLEEP() doesn?t exist! | ||||||||||||
| Verify File Existence |
By injecting :
|
||||||||||||
| Table Name bruteforcing | You don?t need the columns name number to bruteforce the table names. You have to try the table name wordlist untill you get an error message referred to a wrong number of columns. In that case you guessed the table name :
|
||||||||||||
| Field Name bruteforcing | You need a valid table name and column number :
|
||||||||||||
| Login bypass | User : ? OR 1=1%00 (or ? OR 1=1%00)Password : (blank) | ||||||||||||
| Attributes Enumeration | NOTE : This method was tested with JBoss (using a bugged .jsp script) + MS Access, I don?t know if this works with other configurations.
Usually if a SQL Injection exists, when you type a quote (?) in a URL parameter you obtain an error message such as :
And this tells you that the current table has a parameter called ?Id?. Often programmers use the same names for URL and query attributes. When you know one parameter name you can use the technique used with MS SQL Server to enumerate other table fields name by injecting :
Now you?ll obtain a new error message contains another attribute name. Enumeration follows by injecting :
until you?ll enumerate all the parameters. |
||||||||||||
|
System OS Interaction |
|||||||||||||
|
By default its impossible to access to these functions |
|||||||||||||
| Security Notes | It?s possible to block the use of critical functions (such as SHELL(), etc ?) by setting this register key :
Its default values is 2, so by default it?s impossible to use these functions. What I propose below are some examples tested with that register key setted to 0. |
||||||||||||
| Get Current Directory | Here you need of columns number and a valid table name :
|
||||||||||||
| Execute OS Commands | SHELL() function can be used to run OS command :
|
||||||||||||
|
MS Access System Tables |
|||||||||||||
|
By default it?s impossible to access to these system tables |
|||||||||||||
| MSysAccessXML | Table fields name :
|
||||||||||||
| MSysACEs | Table fields name :
|
||||||||||||
| MSysObjects | Here you can find database table name :
This query can be used to obtain database tables name :
|
||||||||||||
| Step #1 : Bruteforce Table Name | You have to bruteforce the table name. You can use the wordlist listed below. Inject query :
After injection you have to check the html response page. If table exists you should have the same html page layout (because ?AND 1? has no effect on the query). |
||||||||||||
|
Step #2 : Bruteforce Field Name |
You have to find table fields name. Inject query :
As above, you should check the html page layout to inferece the field name existence . |
||||||||||||
| Step #3 : Bruteforce Table rows number | You have to find the number of table rows. This value will be used as ?TAB_LEN? variable in the following queries/descriptions :
Where ?X? is a number between 0 and an arbitrary value. As above you will find the correct number by checking html page layout. |
||||||||||||
| Step #4 : Bruteforce item length |
You can bruteforce the value length of a generic ?ATTRIB? field at row number 1 with this query :
You can bruteforce the value length of a generic ?ATTRIB? field from row 2 to TAB_LEN with this query (here N is a number between 2 and TAB_LEN, the value bruteforced before) :
?KKK? is a value between 0 and an arbitrary value, while ATTRIB<>?valueXXX? is used because we have to select a specific line to bruteforce. The unique way I found to do this is to select the desidered row with ?TOP N?,and then insert in the WHERE clause all the attribute values bruteforced before. I have to say that ?ATTRIB? must be the table key-field. Here is an example :
You can bruteforce fields value length for row 1 in this way :
While you can bruteforce fields length value of second row in this way (assuming A1 as table key-field) :
The same for row number 3 :
Obviusly, before bruteforcing field value length (at row between 2 and TAB_LEN) you have to bruteforce the previous row (key) field value (you have to put it in the WHERE clause). |
||||||||||||
| Step #5 : Bruteforce Table Content | Supposing that the attacker already knows the table and fields name, he will inject this query :
Where ?N? is the row to bruteforce, ?XXX? is the x-th byte of ?ATTRIBxxx? to bruteforce, ?ATT_key? is the table key-field and ?YYY? is a number between 0 and 255 (it represents the ASCII value for a char). Here we have to use the same method mentioned before to correctly bruteforce a specific row attribute content. |
||||||||||||
| Tables/Fields Bruteforcing (Wordlist) | |||||||||||||
| Table/Field Wordlist | Here is a very short table/field names wordlist that can be used during bruteforcing :
|
||||||||||||
Advertise Here
This site is maintained by d3hydr8[at]gmail[dot]com
darkc0de.com ™ © 2006-Now