0

Is it possible to see all columns of all tables of a database without the data using sqlmap

I don't want to use -D database -T table manually for all the tables

1

The following queries can be used to retrieve (MySQL):

the list of all tables: SELECT table_name FROM information_schema.tables
the list of all columns: SELECT column_name FROM information_schema.columns

  • Is there any other method to get them organised ? I mean like a table containing the columns names under their table – crismatiq Nov 24 '16 at 15:02
  • SELECT 1,concat(table_name,':', column_name),3,4 FROM information_schema.columns – Michal Koczwara Nov 24 '16 at 15:15
-1

If the database MySQL, you can see the all tables in database:

SELECT table_name FROM information_schema.tables WHERE table_schema=database()

You can find more important columns with this command. After that find the columns:

SELECT column_name FROM information.schema_columns WHERE table_name='tablename'

  • The OP asked for a sqlmap-specific answer; furthermore you should denote this is MySQL-specific. – Jens Erat Feb 22 '17 at 21:27
-1

[Edit]

Please see the SQLmap --schema option.

Enumerate database management system schema

Switches: --schema and --exclude-sysdbs

User can retrieve a DBMS schema by using this switch. Schema listing will contain all databases, tables and columns, together with their respective types. In combination with --exclude-sysdbs only part of the schema containing non-system databases will be retrieved and shown.

SQLmap usage

  • you need to specify what table to get the columns from, which is what the OP wants to avoid – schroeder Mar 25 '17 at 15:47
  • Alright. Then --schema sounds like what the OP is after. – Anonymous Mar 25 '17 at 15:55
  • Can you confirm this and edit your answer with the correction and evidence? – schroeder Mar 25 '17 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.