Applications Connecting to Services

ELF Executable Examination

Sample Scenario

  1. Running the file shows this.

    $ ./octopus_checker 
    
    Program had started..
    Attempting Connection 
    Connecting ... 
    
    The driver reported the following diagnostics whilst running SQLDriverConnect
    
    01000:1:0:[unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found
    connected

  2. The binary probably connects using a SQL connection string that contains credentials. Using tools like PEDAarrow-up-right (Python Exploit Development Assistance for GDB) we can further examine the file. This is an extension of the standard GNU Debugger (GDB), which is used for debugging C and C++ programs.

  3. Run gdb

$ gdb ./octopus_checker
  1. Set flavor and disas main

  1. We can also see this portion

  1. Add a breakpoint at 0x5555555551b0 or at SQLDriverConnect

DLL File Examination

Sample Scenario

  1. Use Get-FileMetaData in powershell and we will see that this is a .net assembly

  2. Using the debugger and .NET assembly editor dnSpyarrow-up-right, we can view the source code directly. This tool allows reading, editing, and debugging the source code of a .NET assembly (C# and Visual Basic).

  3. Inspection of MultimasterAPI.Controllers -> ColleagueController reveals a database connection string containing the password.

dnspy_hidden

Last updated