Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create exploit for CVE-2015-2996/8 (sysaid SQL database cred disclosure) #5474

Merged
merged 5 commits into from Jul 17, 2015
Merged

Create exploit for CVE-2015-2996/8 (sysaid SQL database cred disclosure) #5474

merged 5 commits into from Jul 17, 2015

Conversation

pedrib
Copy link
Contributor

@pedrib pedrib commented Jun 3, 2015

This module exploits two vulnerabilities in SysAid Help Desk 14.4 to obtain the SQL database credentials. This module has been tested on Windows and Linux.

@wchen-r7 wchen-r7 added the module label Jun 4, 2015
@void-in
Copy link
Contributor

void-in commented Jun 4, 2015

@pedrib You can omit the OSVDB and reference URL entries that is currently having TODO entries. These are causing the travis to fail. Once the OSVDB entries are allocated, another commit can be pushed then.

}
create_credential_login(database_login_data)
# Skip creating the Login, but tell the user about it if we cannot resolve the DB Server Hostname
rescue SocketError
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this rescue statement should be right after the line:

db_address = Rex::Socket.getaddress(db_address, true)

and all other statements should be outside the begin rescue block. This way it is easy to determine what it is rescue-ing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment - what should be the db_address set to then? 127.0.0.1?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I was suggesting like:

if database_url['localhost'] == 'localhost'
  db_address = rhost
else
  begin
    db_address = matches.captures[2]
    db_address = (db_address.index(':') ? db_address[0, db_address.index(':')] : db_address)
    db_address = Rex::Socket.getaddress(db_address, true)
  rescue
    print_error "Could not resolve database server hostname."
  end
end

This way the rescue is more easy to follow with the begin.

@wchen-r7
Copy link
Contributor

Delayed label applied. Author pinged.

@pedrib
Copy link
Contributor Author

pedrib commented Jun 20, 2015

Addressed two of your comments, please see my comment above for the other one.

@wchen-r7 wchen-r7 removed the blocked Blocked by one or more additional tasks label Jun 22, 2015
@jvazquez-r7 jvazquez-r7 self-assigned this Jun 26, 2015
@jvazquez-r7
Copy link
Contributor

I'm downloading the beta from the home page. If the beta isn't vulnerable anymore would be nice if you could provide us with installer URL if available or just a PCAP for verification (without SSL pls, otherwise a ssl capable proxy would be good enough :))

'fileName' => '../conf/serverConf.xml'
},
})
rescue Rex::ConnectionRefused
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prolly has more sense to rescue Rex::ConnectionError which will also take care of Rex::ConnectionRefused

@jvazquez-r7 jvazquez-r7 removed their assignment Jun 26, 2015
@pedrib
Copy link
Contributor Author

pedrib commented Jun 30, 2015

@jvazquez-r7 I've uploaded the vulnerable version to dropbox:
https://www.dropbox.com/s/fbkydxrcbfl9j0y/SysAidServer64.exe?dl=0 (Windows)
https://www.dropbox.com/s/k0zr201ef1kfts3/sysaid-server-linux.tar.gz?dl=0 (Linux)

These are the vulnerable 14.2 version. Let me know if you need anything else!

@jvazquez-r7 jvazquez-r7 self-assigned this Jul 17, 2015
@jvazquez-r7 jvazquez-r7 merged commit 50a3a32 into rapid7:master Jul 17, 2015
jvazquez-r7 added a commit that referenced this pull request Jul 17, 2015
@jvazquez-r7
Copy link
Contributor

Thanks @pedrib, landed after some cleanup, see final result here: 29718ce

Test:

cremsf auxiliary(sysaid_sql_creds) > run

[*] 172.16.158.131:8080 - Stored SQL credentials sa:Password1 for localhost:1450
[*] Auxiliary module execution completed
msf auxiliary(sysaid_sql_creds) > creds
Credentials
===========

host            service           public  private    realm  private_type
----            -------           ------  -------    -----  ------------
172.16.158.131  1450/tcp (mssql)  sa      Password1         Password

msf auxiliary(sysaid_sql_creds) > exit

@pedrib
Copy link
Contributor Author

pedrib commented Jul 18, 2015

@jvazquez-r7 I'm getting this on mine with your version:

msf auxiliary(sysaid_db) > run

[-] Auxiliary failed: NoMethodError undefined method +' for nil:NilClass [-] Call stack: [-] /usr/share/metasploit-framework/modules/auxiliary/admin/http/sysaid_db.rb:95:inrun'
[*] Auxiliary module execution completed

???

@pedrib pedrib deleted the sysaid_sql_cred branch February 1, 2017 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants