Skip to content

Commit 4c9db0a

Browse files
committed
fix ruff
1 parent 277a78c commit 4c9db0a

6 files changed

Lines changed: 30 additions & 26 deletions

File tree

nxc/modules/enum_impersonate.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#Author:
2-
# deathflamingo
31
class NXCModule:
4-
"""Enumerate SQL Server users with impersonation rights"""
2+
"""
3+
Enumerate SQL Server users with impersonation rights
4+
Module by deathflamingo
5+
"""
56

67
name = "enum_impersonate"
78
description = "Enumerate users with impersonation privileges"
@@ -28,7 +29,7 @@ def get_impersonate_users(self) -> list:
2829
"""
2930
Fetches a list of users with impersonation rights.
3031
31-
Returns:
32+
Returns
3233
-------
3334
list: List of user names.
3435
"""

nxc/modules/enum_links.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#Author:
2-
# deathflamingo
31
class NXCModule:
4-
"""Enumerate SQL Server linked servers"""
2+
"""
3+
Enumerate SQL Server linked servers
4+
Module by deathflamingo
5+
"""
56

67
name = "enum_links"
78
description = "Enumerate linked SQL Servers"
@@ -28,7 +29,7 @@ def get_linked_servers(self) -> list:
2829
"""
2930
Fetches a list of linked servers.
3031
31-
Returns:
32+
Returns
3233
-------
3334
list: List of linked server names.
3435
"""

nxc/modules/enum_logins.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#Author:
2-
# deathflamingo
31
class NXCModule:
4-
"""Enumerate SQL Server logins"""
2+
"""
3+
Enumerate SQL Server logins
4+
Module by deathflamingo
5+
"""
56

67
name = "enum_logins"
78
description = "Enumerate SQL Server logins"
@@ -28,7 +29,7 @@ def get_logins(self) -> list:
2829
"""
2930
Fetches a list of SQL Server logins.
3031
31-
Returns:
32+
Returns
3233
-------
3334
list: List of login names.
3435
"""

nxc/modules/exec_on_link.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#Author:
2-
# deathflamingo
31
class NXCModule:
4-
"""Execute commands on linked servers"""
2+
"""
3+
Execute commands on linked servers
4+
Module by deathflamingo
5+
"""
56

67
name = "exec_on_link"
78
description = "Execute commands on a SQL Server linked server"
@@ -35,9 +36,7 @@ def on_login(self, context, connection):
3536
self.execute_on_link()
3637

3738
def execute_on_link(self):
38-
"""
39-
Executes the specified command on the linked server.
40-
"""
39+
"""Executes the specified command on the linked server."""
4140
query = f"EXEC ('{self.command}') AT [{self.linked_server}];"
4241
result = self.mssql_conn.sql_query(query)
4342
self.context.log.display(f"Command output: {result}")

nxc/modules/link_enable_xp.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#Author:
2-
# deathflamingo
31
class NXCModule:
4-
"""Enable or disable xp_cmdshell on a linked SQL server"""
2+
"""
3+
Enable or disable xp_cmdshell on a linked SQL server
4+
Module by deathflamingo
5+
"""
56

67
name = "link_enable_xp"
78
description = "Enable or disable xp_cmdshell on a linked SQL server"
@@ -43,10 +44,10 @@ def enable_xp_cmdshell(self):
4344
"""Enable xp_cmdshell on the linked server."""
4445
query = f"EXEC ('sp_configure ''show advanced options'', 1; RECONFIGURE;') AT [{self.linked_server}]"
4546
self.context.log.display(f"Enabling advanced options on {self.linked_server}...")
46-
out=self.query_and_get_output(query)
47+
out = self.query_and_get_output(query)
4748
query = f"EXEC ('sp_configure ''xp_cmdshell'', 1; RECONFIGURE;') AT [{self.linked_server}]"
4849
self.context.log.display(f"Enabling xp_cmdshell on {self.linked_server}...")
49-
out=self.query_and_get_output(query)
50+
out = self.query_and_get_output(query)
5051
self.context.log.display(out)
5152
self.context.log.success(f"xp_cmdshell enabled on {self.linked_server}")
5253

nxc/modules/link_xpcmd.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#Author:
2-
# deathflamingo
31
class NXCModule:
4-
"""Run xp_cmdshell commands on a linked SQL server"""
2+
"""
3+
Run xp_cmdshell commands on a linked SQL server
4+
Module by deathflamingo
5+
"""
56

67
name = "link_xpcmd"
78
description = "Run xp_cmdshell commands on a linked SQL server"

0 commit comments

Comments
 (0)