| 2 | from shutil import which |
| 3 | |
| 4 | class RedisCli(ServiceScan): |
| 5 | |
| 6 | def __init__(self): |
| 7 | super().__init__() |
| 8 | self.name = 'Redis Cli' |
| 9 | self.tags = ['default', 'safe', 'redis'] |
| 10 | |
| 11 | def configure(self): |
| 12 | self.match_service_name('^redis$') |
| 13 | |
| 14 | def check(self): |
| 15 | if which('redis-cli') is None: |
| 16 | self.error('The redis-cli program could not be found. Make sure it is installed. (On Kali, run: sudo apt install redis-tools)') |
| 17 | return False |
| 18 | |
| 19 | async def run(self, service): |
| 20 | if which('redis-cli') is not None: |
| 21 | _, stdout, _ = await service.execute('redis-cli -p {port} -h {address} INFO', outfile='{protocol}_{port}_redis_info.txt') |
| 22 | if not (await stdout.readline()).startswith('NOAUTH Authentication required'): |
| 23 | await service.execute('redis-cli -p {port} -h {address} CONFIG GET \'*\'', outfile='{protocol}_{port}_redis_config.txt') |
| 24 | await service.execute('redis-cli -p {port} -h {address} CLIENT LIST', outfile='{protocol}_{port}_redis_client-list.txt') |
nothing calls this directly
no outgoing calls
no test coverage detected