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
  • 1
    It depends on what DBMS the target is using. Jan 23, 2017 at 18:53

4 Answers 4

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

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

[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

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

Use

-D database --columns

No need to use the -T flag. Sqlmap will automatically get all columns of all tables.

-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'

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .