| 2 | from shutil import which |
| 3 | |
| 4 | class OracleTNScmd(ServiceScan): |
| 5 | |
| 6 | def __init__(self): |
| 7 | super().__init__() |
| 8 | self.name = "Oracle TNScmd" |
| 9 | self.tags = ['default', 'safe', 'databases'] |
| 10 | |
| 11 | def configure(self): |
| 12 | self.match_service_name('^oracle') |
| 13 | |
| 14 | def check(self): |
| 15 | if which('tnscmd10g') is None: |
| 16 | self.error('The tnscmd10g program could not be found. Make sure it is installed. (On Kali, run: sudo apt install tnscmd10g)') |
| 17 | return False |
| 18 | |
| 19 | async def run(self, service): |
| 20 | if service.target.ipversion == 'IPv4': |
| 21 | await service.execute('tnscmd10g ping -h {address} -p {port} 2>&1', outfile='{protocol}_{port}_oracle_tnscmd_ping.txt') |
| 22 | await service.execute('tnscmd10g version -h {address} -p {port} 2>&1', outfile='{protocol}_{port}_oracle_tnscmd_version.txt') |
nothing calls this directly
no outgoing calls
no test coverage detected