Skip to content

Issue with older SQL server installations #16

Description

@Invoke-Mimikatz

It seems like older SQL servers do not have the sys.trusted_assemblies table. I get the following error when running PySqlRecon with the clr method against a Server 2016 server:

$ pysqlrecon --target 10.11.1.1 --username user --domain DOMAIN --debug --no-pass clr --dll payload.dll --function Run

        _____     _____ _____ __    _____
       |  _  |_ _|   __|     |  |  | __  |___ ___ ___ ___
       |   __| | |__   |  |  |  |__|    -| -_|  _| . |   |
       |__|  |_  |_____|__  _|_____|__|__|___|___|___|_|_|  v0.3.1
             |___|        |__|

[12:25:52] INFO     Connecting to 10.11.1.1:1433
[12:25:52] DEBUG    ENVCHANGE(DATABASE): Old Value: master, New Value: master
[12:25:52] DEBUG    ENVCHANGE(LANGUAGE): Old Value: , New Value: us_english
[12:25:52] DEBUG    ENVCHANGE(PACKETSIZE): Old Value: 4096, New Value: 16192
[12:25:52] DEBUG    (10.11.1.1): Line 1: Changed database context to 'master'.
[12:25:52] DEBUG    (10.11.1.1): Line 1: Changed language setting to us_english.
[12:25:52] DEBUG    ACK: Result: 1 - Microsoft SQL Server (130 27138)
[12:25:52] DEBUG    Login successful
[12:25:52] INFO     Performing CLR custom assembly attack on 10.11.1.1
[12:25:53] ERROR    (10.11.1.1): Line 1: Invalid object name 'sys.trusted_assemblies'.

The full SQL version:

Microsoft SQL Server 2016 (SP3-CU1-GDR) (KB5046856) - 13.0.7050.2 (X64)
        Oct 14 2024 22:01:52
        Copyright (c) Microsoft Corporation
        Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2019 Standard 10.0 <X64> (Build 17763: ) (Hypervisor)

This error does not happen in other SQL stored procedure loaders, such as Metasploit's mssql_clr_payload

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions