From b0d8e93e7976023486fd9722a65de0d1069395ca Mon Sep 17 00:00:00 2001 From: actuated Date: Tue, 29 May 2018 10:12:43 -0500 Subject: [PATCH 1/7] Added Teradata ODBC Login and SQL modules and documentation --- .../admin/teradata/teradata_odbc_sql.md | 101 ++++++++++++++++++ .../scanner/teradata/teradata_odbc_login.md | 70 ++++++++++++ .../admin/teradata/teradata_odbc_sql.py | 87 +++++++++++++++ .../scanner/teradata/teradata_odbc_login.py | 72 +++++++++++++ 4 files changed, 330 insertions(+) create mode 100644 documentation/modules/auxiliary/admin/teradata/teradata_odbc_sql.md create mode 100644 documentation/modules/auxiliary/scanner/teradata/teradata_odbc_login.md create mode 100755 modules/auxiliary/admin/teradata/teradata_odbc_sql.py create mode 100644 modules/auxiliary/scanner/teradata/teradata_odbc_login.py diff --git a/documentation/modules/auxiliary/admin/teradata/teradata_odbc_sql.md b/documentation/modules/auxiliary/admin/teradata/teradata_odbc_sql.md new file mode 100644 index 0000000000..4fdae5d47d --- /dev/null +++ b/documentation/modules/auxiliary/admin/teradata/teradata_odbc_sql.md @@ -0,0 +1,101 @@ +The teradata_odbc_sql module is used to run SQL queries for Teradata databases. + +## Vulnerable Application + +* Teradata Database +* Teradata Express + +Teradata databases can be identified by scanning for TCP port 1025. An Nmap version scan can confirm if the service is recognized as Teradata. + +The teradata_odbc_login module can be used to brute-force credentials. + +## Extra Requirements + +This module requires the Teradata ODBC driver and the Teradata python library. + +### ODBC Driver for Kali Linux 2017.3 +1. Download the Teradata ODBC driver for Ubuntu from [downloads.teradata.com](https://downloads.teradata.com/download/connectivity/odbc-driver/linux). +2. Refer to the Ubuntu package README for up-to-date instructions. + 1. Install **lib32stdc++6** if necessary. + 2. Install the ODBC drivers: `dpkg -i [package].deb` + 3. Copy **/opt/teradata/client/ODBC_64/odbc.ini** to **/root/.odbc.ini** . + * Or your home directory if not root. + * Make sure **odbc.ini** has been renamed to **.obdc.ini** . + +### Python Package +``` +pip install teradata +``` +## Verification Steps +1. Deploy a [Teradata Express](https://www.teradata.com/products-and-services/teradata-express) test environment. +2. Install the OBCD driver and python package. +3. Start msfconsole. +4. Do: `use auxiliary/admin/teradata/teradata_odbc_sql` +5. Do: `set RHOSTS [IPs]` +6. Do: `set USERNAME [username to try]` +7. Do: `set PASSWORD [password to try]` + * The default Teradata credentials are the matching username and password 'DBC'. +8. Set a SQL query for the 'SQL' option. + * The default is `SELECT DATABASENAME FROM DBC.DATABASES` +9. Do: `run` + +``` +msf > use auxiliary/admin/teradata/teradata_odbc_sql +msf auxiliary(admin/teradata/teradata_odbc_sql) > show options + +Module options (auxiliary/admin/teradata/teradata_odbc_sql): + + Name Current Setting Required Description + ---- --------------- -------- ----------- + PASSWORD dbc yes Password + RHOSTS yes The target address range or CIDR identifier + SQL SELECT DATABASENAME FROM DBC.DATABASES yes SQL query to perform + THREADS 1 yes The number of concurrent threads + USERNAME dbc yes Username + +msf auxiliary(admin/teradata/teradata_odbc_sql) > set RHOSTS 192.168.0.2 +RHOSTS => 192.168.0.2 +msf auxiliary(admin/teradata/teradata_odbc_sql) > run + +[*] Running for 192.168.0.2... +[*] 192.168.0.2 - dbc:dbc - Starting +[*] 192.168.0.2 - Creating connection: %s +[*] 192.168.0.2 - Loading ODBC Library: %s +[*] 192.168.0.2 - Available drivers: Teradata Database ODBC Driver 16.20, +[*] 192.168.0.2 - Connection successful. Duration: %.3f seconds. Details: %s +[+] 192.168.0.2 - dbc:dbc - Login Successful +[*] 192.168.0.2 - Starting - SELECT DATABASENAME FROM DBC.DATABASES +[*] 192.168.0.2 - Query Successful. Duration: %.3f seconds,%sQuery: %s%s +[+] 192.168.0.2 - Row 1: [DatabaseUser ] +[+] 192.168.0.2 - Row 2: [All ] +[+] 192.168.0.2 - Row 3: [SYSJDBC ] +[+] 192.168.0.2 - Row 4: [TDStats ] +[+] 192.168.0.2 - Row 5: [TD_SYSXML ] +[+] 192.168.0.2 - Row 6: [PUBLIC ] +[+] 192.168.0.2 - Row 7: [DBC ] +[+] 192.168.0.2 - Row 8: [SYSBAR ] +[+] 192.168.0.2 - Row 9: [TD_SYSGPL ] +[+] 192.168.0.2 - Row 10: [SYSLIB ] +[+] 192.168.0.2 - Row 11: [SQLJ ] +[+] 192.168.0.2 - Row 12: [LockLogShredder ] +[+] 192.168.0.2 - Row 13: [Default ] +[+] 192.168.0.2 - Row 14: [TDPUSER ] +[+] 192.168.0.2 - Row 15: [TD_SYSFNLIB ] +[+] 192.168.0.2 - Row 16: [EXTUSER ] +[+] 192.168.0.2 - Row 17: [tdwm ] +[+] 192.168.0.2 - Row 18: [SystemFe ] +[+] 192.168.0.2 - Row 19: [External_AP ] +[+] 192.168.0.2 - Row 20: [TDQCD ] +[+] 192.168.0.2 - Row 21: [dbcmngr ] +[+] 192.168.0.2 - Row 22: [Sys_Calendar ] +[+] 192.168.0.2 - Row 23: [SysAdmin ] +[+] 192.168.0.2 - Row 24: [TD_SERVER_DB ] +[+] 192.168.0.2 - Row 25: [TDMaps ] +[+] 192.168.0.2 - Row 26: [SYSUDTLIB ] +[+] 192.168.0.2 - Row 27: [Crashdumps ] +[+] 192.168.0.2 - Row 28: [SYSSPATIAL ] +[+] 192.168.0.2 - Row 29: [MyUser ] +[+] 192.168.0.2 - Row 30: [SYSUIF ] +[*] Scanned 1 of 1 hosts (100% complete) +[*] Auxiliary module execution completed +``` diff --git a/documentation/modules/auxiliary/scanner/teradata/teradata_odbc_login.md b/documentation/modules/auxiliary/scanner/teradata/teradata_odbc_login.md new file mode 100644 index 0000000000..52850082c9 --- /dev/null +++ b/documentation/modules/auxiliary/scanner/teradata/teradata_odbc_login.md @@ -0,0 +1,70 @@ +The teradata_odbc_login module is used to brute-force credentials for Teradata databases. + +## Vulnerable Application + +* Teradata Database +* Teradata Express + +Teradata databases can be identified by scanning for TCP port 1025. An Nmap version scan can confirm if the service is recognized as Teradata. + +## Extra Requirements + +This module requires the Teradata ODBC driver and the Teradata python library. + +### ODBC Driver for Kali Linux 2017.3 +1. Download the Teradata ODBC driver for Ubuntu from [downloads.teradata.com](https://downloads.teradata.com/download/connectivity/odbc-driver/linux). +2. Refer to the Ubuntu package README for up-to-date instructions. + 1. Install **lib32stdc++6** if necessary. + 2. Install the ODBC drivers: `dpkg -i [package].deb` + 3. Copy **/opt/teradata/client/ODBC_64/odbc.ini** to **/root/.odbc.ini** . + * Or your home directory if not root. + * Make sure **odbc.ini** has been renamed to **.obdc.ini** . + +### Python Package +``` +pip install teradata +``` +## Verification Steps +1. Deploy a [Teradata Express](https://www.teradata.com/products-and-services/teradata-express) test environment. +2. Install the OBCD driver and python package. +3. Start msfconsole. +4. Do: `use auxiliary/scanner/teradata/teradata_odbc_login` +5. Do: `set RHOSTS [IPs]` +6. Do: `set USERNAME [username to try]` +7. Do: `set PASSWORD [password to try]` + * The default Teradata credentials are the matching username and password 'dbc'. +8. Do: `run` + +``` +msf > use auxiliary/scanner/teradata/teradata_odbc_login +msf auxiliary(scanner/teradata/teradata_odbc_login) > set RHOSTS 192.168.0.2 +RHOSTS => 192.168.0.2 +msf auxiliary(scanner/teradata/teradata_odbc_login) > set USERNAME dbc +USERNAME => dbc +msf auxiliary(scanner/teradata/teradata_odbc_login) > set PASSWORD dbc +PASSWORD => dbc +msf auxiliary(scanner/teradata/teradata_odbc_login) > run + +[*] Running for 192.168.0.2... +[*] 192.168.0.2:1025 - Creating connection: %s +[*] 192.168.0.2:1025 - Loading ODBC Library: %s +[*] 192.168.0.2:1025 - Method succeeded with info: [26] 523 24 +[*] 192.168.0.2:1025 - Method succeeded with info: [26] 523 24 +[*] 192.168.0.2:1025 - Available drivers: Teradata Database ODBC Driver 16.20, +[*] 192.168.0.2:1025 - Creating connection using ODBC ConnectString: %s +[*] 192.168.0.2:1025 - Setting AUTOCOMMIT to %s +[*] 192.168.0.2:1025 - FETCH_SIZE: 1 +[*] 192.168.0.2:1025 - Buffer size for column %s: %s +[*] 192.168.0.2:1025 - SELECT SESSION returned %s +[*] 192.168.0.2:1025 - Executing query on session %s using SQLExecDirectW: %s +[*] 192.168.0.2:1025 - Committing transaction... +[*] 192.168.0.2:1025 - Created session %s. +[*] 192.168.0.2:1025 - Creating cursor %s for session %s. +[*] 192.168.0.2:1025 - Connection successful. Duration: %.3f seconds. Details: %s +[*] 192.168.0.2:1025 - Closing cursor %s for session %s. +[*] 192.168.0.2:1025 - Closing session %s... +[*] 192.168.0.2:1025 - Session %s closed. +[+] 192.168.0.2:1025 - [1/1] - dbc:dbc - Success +[*] Scanned 1 of 1 hosts (100% complete) +[*] Auxiliary module execution completed +``` diff --git a/modules/auxiliary/admin/teradata/teradata_odbc_sql.py b/modules/auxiliary/admin/teradata/teradata_odbc_sql.py new file mode 100755 index 0000000000..7b088f19c5 --- /dev/null +++ b/modules/auxiliary/admin/teradata/teradata_odbc_sql.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python2.7 +# -*- coding: utf-8 -*- +#2018-05-09 14-15 + +# Standard Modules +import logging + +# Extra Modules +dependencies_missing = False +try: + import teradata +except ImportError: + dependencies_missing = True + +from metasploit import module + + +# Metasploit Metadata +metadata = { + 'name': 'Teradata ODBC SQL Query Module', + 'description': ''' + SQL query module for ODBC connections to local Teradata databases. + + Port specification (TCP 1025 by default) is not necessary for ODBC connections. + + Requires ODBC driver and Python Teradata module. + ''', + 'authors': [ + 'Ted Raffle (actuated)' + ], + 'date': '2018-03-29', + 'license': 'MSF_LICENSE', + 'references': [ + {'type': 'url', 'ref': 'https://developer.teradata.com/tools/reference/teradata-python-module'}, + {'type': 'url', 'ref': 'https://downloads.teradata.com/download/connectivity/odbc-driver/linux'}, + {'type': 'aka', 'ref': 'Teradata ODBC Authentication Scanner'} + ], + 'type': 'single_scanner', + 'options': { + 'USERNAME': {'type': 'string', 'description': 'Username', 'required': True, 'default': 'dbc'}, + 'PASSWORD': {'type': 'string', 'description': 'Password', 'required': True, 'default': 'dbc'}, + 'SQL': {'type': 'string', 'description': 'SQL query to perform', 'required': True, 'default': 'SELECT DATABASENAME FROM DBC.DATABASES'}, + } +} + + +# Run function +def run(args): + + # Define UdaExec ODBC connection "application", must be before LogHandler + udaExec = teradata.UdaExec(appName="Auth", version="1.0", logConsole=False, configureLogging=False) + + # Metasploit LogHandler + module.LogHandler.setup(msg_prefix='{} - '.format(args['rhost'])) + + # Return error for missing dependency + if dependencies_missing: + logging.error('Python Teradata module missing, cannot continue') + return + + # Set variables to current RHOST, and USERNAME and PASSWORD options + host = args['rhost'] + user = args['USERNAME'] + password = args['PASSWORD'] + + # Perform login attempt + module.log(host + ' - ' + user + ':' + password + ' - Starting') + try: + session = udaExec.connect(method="odbc", system=host, username=user, password=password); + except teradata.api.Error as e: + logging.error(user + ':' + password + ' - ' + format(e)) + return + else: + module.log(host + ' - ' + user + ':' + password + ' - Login Successful', level='good') + try: + query = args['SQL'] + module.log(host + ' - Starting - ' + query) + for row in session.execute(query): + outputRow=str(row) + module.log(host + ' - ' + outputRow, level='good') + except teradata.api.Error as e: + logging.error(format(e)) + return + + +if __name__ == '__main__': + module.run(metadata, run) diff --git a/modules/auxiliary/scanner/teradata/teradata_odbc_login.py b/modules/auxiliary/scanner/teradata/teradata_odbc_login.py new file mode 100644 index 0000000000..e74cca1c96 --- /dev/null +++ b/modules/auxiliary/scanner/teradata/teradata_odbc_login.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python2.7 +# -*- coding: utf-8 -*- +#2018-05-29 08-49 + +# Standard Modules +import logging + +# Extra Modules +dependencies_missing = False +try: + import teradata +except ImportError: + dependencies_missing = True + +from metasploit import module, login_scanner + + +# Metasploit Metadata +metadata = { + 'name': 'Teradata ODBC Login Scanner Module', + 'description': ''' + Login scanner module for ODBC connections to Teradata databases. + + Port specification (TCP 1025 by default) is not necessary for ODBC connections. + + Blank passwords are not supported by ODBC connections. + + Requires ODBC driver and Python Teradata module. + ''', + 'authors': [ + 'Ted Raffle (actuated)' + ], + 'date': '2018-03-30', + 'license': 'MSF_LICENSE', + 'references': [ + {'type': 'url', 'ref': 'https://developer.teradata.com/tools/reference/teradata-python-module'}, + {'type': 'url', 'ref': 'https://downloads.teradata.com/download/connectivity/odbc-driver/linux'}, + {'type': 'aka', 'ref': 'Teradata ODBC Login Scanner'} + ], + 'type': 'single_host_login_scanner', + 'options': { + 'rhost': {'type': 'address', 'description': 'Host to target', 'required': True}, + 'rport': {'type': 'port', 'description': 'Port to target, ignored by the ODBC driver', 'required': True, 'default': 1025}, + 'sleep_interval': {'type': 'float', 'description': 'Time in seconds to wait between login attempts', 'required': False} + }, + 'service_name': 'teradata' +} + + +def valid_login(udaExec, host, user, password): + try: + udaExec.connect(method="odbc", system=host, username=user, password=password) + except teradata.api.Error as e: + return False + else: + return True + + +def run(args): + if dependencies_missing: + module.log('Python Teradata module missing, cannot continue', level=error) + return + + # Define UdaExec ODBC connection "application" globally, must be before LogHandler + udaExec = teradata.UdaExec(appName="Auth", version="1.0", logConsole=False, configureLogging=False) + module.LogHandler.setup(msg_prefix='{}:{} - '.format(args['rhost'], 1025)) + scanner = login_scanner.make_scanner(lambda host, port, username, password: valid_login(udaExec, host, username, password)) + scanner(args) + + +if __name__ == '__main__': + module.run(metadata, run) From ef309e0d5f44cda368c140d02a332ae6cc005fcd Mon Sep 17 00:00:00 2001 From: Adam Cammack Date: Wed, 27 Jun 2018 15:09:23 -0500 Subject: [PATCH 2/7] Fixup metadata whitespace --- .../scanner/teradata/teradata_odbc_login.py | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/modules/auxiliary/scanner/teradata/teradata_odbc_login.py b/modules/auxiliary/scanner/teradata/teradata_odbc_login.py index e74cca1c96..aad8b3a270 100644 --- a/modules/auxiliary/scanner/teradata/teradata_odbc_login.py +++ b/modules/auxiliary/scanner/teradata/teradata_odbc_login.py @@ -17,33 +17,33 @@ from metasploit import module, login_scanner # Metasploit Metadata metadata = { - 'name': 'Teradata ODBC Login Scanner Module', - 'description': ''' - Login scanner module for ODBC connections to Teradata databases. + 'name': 'Teradata ODBC Login Scanner Module', + 'description': ''' + Login scanner module for ODBC connections to Teradata databases. - Port specification (TCP 1025 by default) is not necessary for ODBC connections. + Port specification (TCP 1025 by default) is not necessary for ODBC connections. - Blank passwords are not supported by ODBC connections. + Blank passwords are not supported by ODBC connections. - Requires ODBC driver and Python Teradata module. - ''', - 'authors': [ - 'Ted Raffle (actuated)' - ], - 'date': '2018-03-30', - 'license': 'MSF_LICENSE', - 'references': [ - {'type': 'url', 'ref': 'https://developer.teradata.com/tools/reference/teradata-python-module'}, - {'type': 'url', 'ref': 'https://downloads.teradata.com/download/connectivity/odbc-driver/linux'}, - {'type': 'aka', 'ref': 'Teradata ODBC Login Scanner'} - ], - 'type': 'single_host_login_scanner', - 'options': { - 'rhost': {'type': 'address', 'description': 'Host to target', 'required': True}, - 'rport': {'type': 'port', 'description': 'Port to target, ignored by the ODBC driver', 'required': True, 'default': 1025}, - 'sleep_interval': {'type': 'float', 'description': 'Time in seconds to wait between login attempts', 'required': False} - }, - 'service_name': 'teradata' + Requires ODBC driver and Python Teradata module. + ''', + 'authors': [ + 'Ted Raffle (actuated)' + ], + 'date': '2018-03-30', + 'license': 'MSF_LICENSE', + 'references': [ + {'type': 'url', 'ref': 'https://developer.teradata.com/tools/reference/teradata-python-module'}, + {'type': 'url', 'ref': 'https://downloads.teradata.com/download/connectivity/odbc-driver/linux'}, + {'type': 'aka', 'ref': 'Teradata ODBC Login Scanner'} + ], + 'type': 'single_host_login_scanner', + 'options': { + 'rhost': {'type': 'address', 'description': 'Host to target', 'required': True}, + 'rport': {'type': 'port', 'description': 'Port to target, ignored by the ODBC driver', 'required': True, 'default': 1025}, + 'sleep_interval': {'type': 'float', 'description': 'Time in seconds to wait between login attempts', 'required': False} + }, + 'service_name': 'teradata' } From 3985191e0f6b0148a366b1caf0260762fc91f556 Mon Sep 17 00:00:00 2001 From: Adam Cammack Date: Wed, 27 Jun 2018 15:10:02 -0500 Subject: [PATCH 3/7] Add `userpass` option to Teradata login scanner --- modules/auxiliary/scanner/teradata/teradata_odbc_login.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/auxiliary/scanner/teradata/teradata_odbc_login.py b/modules/auxiliary/scanner/teradata/teradata_odbc_login.py index aad8b3a270..0cfac85b8d 100644 --- a/modules/auxiliary/scanner/teradata/teradata_odbc_login.py +++ b/modules/auxiliary/scanner/teradata/teradata_odbc_login.py @@ -41,6 +41,7 @@ metadata = { 'options': { 'rhost': {'type': 'address', 'description': 'Host to target', 'required': True}, 'rport': {'type': 'port', 'description': 'Port to target, ignored by the ODBC driver', 'required': True, 'default': 1025}, + 'userpass': {'type': 'string', 'description': 'A list of username/password combinations to try', 'required': False}, 'sleep_interval': {'type': 'float', 'description': 'Time in seconds to wait between login attempts', 'required': False} }, 'service_name': 'teradata' From 1dbcf0fd09c4436e1efea1c9aaa2c022b4f07751 Mon Sep 17 00:00:00 2001 From: Adam Cammack Date: Wed, 27 Jun 2018 15:12:21 -0500 Subject: [PATCH 4/7] Cleanup Teradata SQL options --- modules/auxiliary/admin/teradata/teradata_odbc_sql.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/auxiliary/admin/teradata/teradata_odbc_sql.py b/modules/auxiliary/admin/teradata/teradata_odbc_sql.py index 7b088f19c5..ffb7181a42 100755 --- a/modules/auxiliary/admin/teradata/teradata_odbc_sql.py +++ b/modules/auxiliary/admin/teradata/teradata_odbc_sql.py @@ -37,9 +37,11 @@ metadata = { ], 'type': 'single_scanner', 'options': { - 'USERNAME': {'type': 'string', 'description': 'Username', 'required': True, 'default': 'dbc'}, - 'PASSWORD': {'type': 'string', 'description': 'Password', 'required': True, 'default': 'dbc'}, - 'SQL': {'type': 'string', 'description': 'SQL query to perform', 'required': True, 'default': 'SELECT DATABASENAME FROM DBC.DATABASES'}, + 'rhost': {'type': 'address', 'description': 'Host to target', 'required': True}, + 'rport': {'type': 'port', 'description': 'Port to target, ignored by the ODBC driver', 'required': True, 'default': 1025}, + 'username': {'type': 'string', 'description': 'Username', 'required': True, 'default': 'dbc'}, + 'password': {'type': 'string', 'description': 'Password', 'required': True, 'default': 'dbc'}, + 'sql': {'type': 'string', 'description': 'SQL query to perform', 'required': True, 'default': 'SELECT DATABASENAME FROM DBC.DATABASES'}, } } @@ -65,7 +67,7 @@ def run(args): # Perform login attempt module.log(host + ' - ' + user + ':' + password + ' - Starting') - try: + try: session = udaExec.connect(method="odbc", system=host, username=user, password=password); except teradata.api.Error as e: logging.error(user + ':' + password + ' - ' + format(e)) From fe8538a4a7b384a4cb5deab352e2778eb38be4eb Mon Sep 17 00:00:00 2001 From: Adam Cammack Date: Wed, 27 Jun 2018 15:33:50 -0500 Subject: [PATCH 5/7] Add note about Teradata configuration for OS X --- .../auxiliary/admin/teradata/teradata_odbc_sql.md | 9 +++++++++ .../auxiliary/scanner/teradata/teradata_odbc_login.md | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/documentation/modules/auxiliary/admin/teradata/teradata_odbc_sql.md b/documentation/modules/auxiliary/admin/teradata/teradata_odbc_sql.md index 4fdae5d47d..a8fb7ec911 100644 --- a/documentation/modules/auxiliary/admin/teradata/teradata_odbc_sql.md +++ b/documentation/modules/auxiliary/admin/teradata/teradata_odbc_sql.md @@ -22,6 +22,15 @@ This module requires the Teradata ODBC driver and the Teradata python library. * Or your home directory if not root. * Make sure **odbc.ini** has been renamed to **.obdc.ini** . +### Configuration for OS X + +On OS X the Python client needs to be pointed to the ODBC driver manually. Create `~/udaexec.ini` with the following contents: +```ini +[CONFIG] + +odbcLibPath=/usr/lib/libiodbc.dylib +``` + ### Python Package ``` pip install teradata diff --git a/documentation/modules/auxiliary/scanner/teradata/teradata_odbc_login.md b/documentation/modules/auxiliary/scanner/teradata/teradata_odbc_login.md index 52850082c9..92d1d0e989 100644 --- a/documentation/modules/auxiliary/scanner/teradata/teradata_odbc_login.md +++ b/documentation/modules/auxiliary/scanner/teradata/teradata_odbc_login.md @@ -20,6 +20,15 @@ This module requires the Teradata ODBC driver and the Teradata python library. * Or your home directory if not root. * Make sure **odbc.ini** has been renamed to **.obdc.ini** . +### Configuration for OS X + +On OS X the Python client needs to be pointed to the ODBC driver manually. Create `~/udaexec.ini` with the following contents: +```ini +[CONFIG] + +odbcLibPath=/usr/lib/libiodbc.dylib +``` + ### Python Package ``` pip install teradata From 8b2bd3565991835e78326c73f2f5e6ca52159652 Mon Sep 17 00:00:00 2001 From: Adam Cammack Date: Wed, 27 Jun 2018 15:34:29 -0500 Subject: [PATCH 6/7] Fixup option references in Teradata SQL --- modules/auxiliary/admin/teradata/teradata_odbc_sql.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/auxiliary/admin/teradata/teradata_odbc_sql.py b/modules/auxiliary/admin/teradata/teradata_odbc_sql.py index ffb7181a42..82643711cd 100755 --- a/modules/auxiliary/admin/teradata/teradata_odbc_sql.py +++ b/modules/auxiliary/admin/teradata/teradata_odbc_sql.py @@ -62,8 +62,8 @@ def run(args): # Set variables to current RHOST, and USERNAME and PASSWORD options host = args['rhost'] - user = args['USERNAME'] - password = args['PASSWORD'] + user = args['username'] + password = args['password'] # Perform login attempt module.log(host + ' - ' + user + ':' + password + ' - Starting') @@ -75,7 +75,7 @@ def run(args): else: module.log(host + ' - ' + user + ':' + password + ' - Login Successful', level='good') try: - query = args['SQL'] + query = args['sql'] module.log(host + ' - Starting - ' + query) for row in session.execute(query): outputRow=str(row) From 9d8294fcc9a7b46216cfc769f6667046418acb95 Mon Sep 17 00:00:00 2001 From: Adam Cammack Date: Wed, 27 Jun 2018 15:35:13 -0500 Subject: [PATCH 7/7] Mark Teradata login scanner executable --- modules/auxiliary/scanner/teradata/teradata_odbc_login.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 modules/auxiliary/scanner/teradata/teradata_odbc_login.py diff --git a/modules/auxiliary/scanner/teradata/teradata_odbc_login.py b/modules/auxiliary/scanner/teradata/teradata_odbc_login.py old mode 100644 new mode 100755