mirror of
				https://github.com/sqlmapproject/sqlmap.git
				synced 2025-10-26 05:31:04 +03:00 
			
		
		
		
	Implementation for an Issue #128
This commit is contained in:
		
							parent
							
								
									098e446ca4
								
							
						
					
					
						commit
						ebc7088f94
					
				|  | @ -218,3 +218,8 @@ class PAYLOAD: | ||||||
|         ORIGINAL = 1 |         ORIGINAL = 1 | ||||||
|         NEGATIVE = 2 |         NEGATIVE = 2 | ||||||
|         REPLACE = 3 |         REPLACE = 3 | ||||||
|  | 
 | ||||||
|  | class WIZARD: | ||||||
|  |     BASIC = ("getBanner", "getCurrentUser", "getCurrentDb", "isDba") | ||||||
|  |     SMART = ("getBanner", "getCurrentUser", "getCurrentDb", "isDba", "getUsers", "getDbs", "getTables", "getSchema", "excludeSysDbs") | ||||||
|  |     ALL = ("getBanner", "getCurrentUser", "getCurrentDb", "isDba", "getHostname", "getUsers", "getPasswordHashes", "getPrivileges", "getRoles", "dumpAll") | ||||||
|  |  | ||||||
|  | @ -67,6 +67,7 @@ from lib.core.enums import PAYLOAD | ||||||
| from lib.core.enums import PRIORITY | from lib.core.enums import PRIORITY | ||||||
| from lib.core.enums import PROXYTYPE | from lib.core.enums import PROXYTYPE | ||||||
| from lib.core.enums import REFLECTIVE_COUNTER | from lib.core.enums import REFLECTIVE_COUNTER | ||||||
|  | from lib.core.enums import WIZARD | ||||||
| from lib.core.exception import sqlmapConnectionException | from lib.core.exception import sqlmapConnectionException | ||||||
| from lib.core.exception import sqlmapFilePathException | from lib.core.exception import sqlmapFilePathException | ||||||
| from lib.core.exception import sqlmapGenericException | from lib.core.exception import sqlmapGenericException | ||||||
|  | @ -1382,6 +1383,9 @@ def __cleanupOptions(): | ||||||
|     if conf.string: |     if conf.string: | ||||||
|         conf.string = conf.string.decode("unicode_escape") |         conf.string = conf.string.decode("unicode_escape") | ||||||
| 
 | 
 | ||||||
|  |     if conf.getAll: | ||||||
|  |         map(lambda x: conf.__setitem__(x, True), WIZARD.ALL) | ||||||
|  | 
 | ||||||
|     threadData = getCurrentThreadData() |     threadData = getCurrentThreadData() | ||||||
|     threadData.reset() |     threadData.reset() | ||||||
| 
 | 
 | ||||||
|  | @ -1613,19 +1617,20 @@ def __useWizardInterface(): | ||||||
|             conf.risk = 1 |             conf.risk = 1 | ||||||
|             conf.level = 1 |             conf.level = 1 | ||||||
| 
 | 
 | ||||||
|     choice = None |     if not conf.getAll: | ||||||
|  |         choice = None | ||||||
| 
 | 
 | ||||||
|     while choice is None or choice not in ("", "1", "2", "3"): |         while choice is None or choice not in ("", "1", "2", "3"): | ||||||
|         message = "Enumeration (--banner/--current-user/etc). Please choose:\n" |             message = "Enumeration (--banner/--current-user/etc). Please choose:\n" | ||||||
|         message += "[1] Basic (default)\n[2] Smart\n[3] All" |             message += "[1] Basic (default)\n[2] Smart\n[3] All" | ||||||
|         choice = readInput(message, default='1') |             choice = readInput(message, default='1') | ||||||
| 
 | 
 | ||||||
|         if choice == '2': |             if choice == '2': | ||||||
|             map(lambda x: conf.__setitem__(x, True), ['getBanner', 'getCurrentUser', 'getCurrentDb', 'isDba', 'getUsers', 'getDbs', 'getTables', 'getSchema', 'excludeSysDbs']) |                 map(lambda x: conf.__setitem__(x, True), WIZARD.SMART) | ||||||
|         elif choice == '3': |             elif choice == '3': | ||||||
|             map(lambda x: conf.__setitem__(x, True), ['getBanner', 'getCurrentUser', 'getCurrentDb', 'isDba', 'getUsers', 'getPasswordHashes', 'getPrivileges', 'getRoles', 'dumpAll']) |                 map(lambda x: conf.__setitem__(x, True), WIZARD.ALL) | ||||||
|         else: |             else: | ||||||
|             map(lambda x: conf.__setitem__(x, True), ['getBanner', 'getCurrentUser', 'getCurrentDb', 'isDba']) |                 map(lambda x: conf.__setitem__(x, True), WIZARD.BASIC) | ||||||
| 
 | 
 | ||||||
|     logger.debug("muting sqlmap.. it will do the magic for you") |     logger.debug("muting sqlmap.. it will do the magic for you") | ||||||
|     conf.verbose = 0 |     conf.verbose = 0 | ||||||
|  |  | ||||||
|  | @ -96,6 +96,7 @@ optDict = { | ||||||
|                              }, |                              }, | ||||||
| 
 | 
 | ||||||
|             "Enumeration":   { |             "Enumeration":   { | ||||||
|  |                                "getAll":            "boolean", | ||||||
|                                "getBanner":         ("boolean", "Banners"), |                                "getBanner":         ("boolean", "Banners"), | ||||||
|                                "getCurrentUser":    ("boolean", "Users"), |                                "getCurrentUser":    ("boolean", "Users"), | ||||||
|                                "getCurrentDb":      ("boolean", "Databases"), |                                "getCurrentDb":      ("boolean", "Databases"), | ||||||
|  |  | ||||||
|  | @ -183,6 +183,7 @@ BASIC_HELP_ITEMS = ( | ||||||
|                         "level", |                         "level", | ||||||
|                         "risk", |                         "risk", | ||||||
|                         "tech", |                         "tech", | ||||||
|  |                         "getAll", | ||||||
|                         "getBanner", |                         "getBanner", | ||||||
|                         "getCurrentUser", |                         "getCurrentUser", | ||||||
|                         "getCurrentDb", |                         "getCurrentDb", | ||||||
|  |  | ||||||
|  | @ -302,6 +302,9 @@ def cmdLineParser(): | ||||||
|                                   "and data contained in the tables. Moreover " |                                   "and data contained in the tables. Moreover " | ||||||
|                                   "you can run your own SQL statements") |                                   "you can run your own SQL statements") | ||||||
| 
 | 
 | ||||||
|  |         enumeration.add_option("-a", "--all", dest="getAll", | ||||||
|  |                                action="store_true", help="Retrieve everything") | ||||||
|  | 
 | ||||||
|         enumeration.add_option("-b", "--banner", dest="getBanner", |         enumeration.add_option("-b", "--banner", dest="getBanner", | ||||||
|                                action="store_true", help="Retrieve DBMS banner") |                                action="store_true", help="Retrieve DBMS banner") | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -324,6 +324,10 @@ extensiveFp = False | ||||||
| # tables. Moreover you can run your own SQL statements. | # tables. Moreover you can run your own SQL statements. | ||||||
| [Enumeration] | [Enumeration] | ||||||
| 
 | 
 | ||||||
|  | # Retrieve everything | ||||||
|  | # Valid: True or False | ||||||
|  | getAll = False | ||||||
|  | 
 | ||||||
| # Retrieve back-end database management system banner. | # Retrieve back-end database management system banner. | ||||||
| # Valid: True or False | # Valid: True or False | ||||||
| getBanner = False | getBanner = False | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user