I have written a lot about thick clients. However, I have not done more than a few practical examples that I can show my co-workers or anyone else asking questions. Recently, I came across the Damn Vulnerable Thick Client Application by SecVulture at https://github.com/secvulture/dvta.
I am not going to use the original version of the application. Someone has created a fork and added more protections. We will use this fork instead:
Neither fork's setup instructions worked for me. As a result, the first part is actually setting up the application and the necessary back-end in only one VM. But don't worry, we will do a bit of reverse engineering with dnSpy to fix an issue.
Thanks to SecVulture for creating the app and maintainers of the second repository for adding protections.
There are no instructions in the original repository at:
But author's has some post on Infosec Institute with setup and solutions at1:
The fork has a Word document file with pictures and setup instructions. I still could not make it work.
I know setup is boring and you want to "hack." But this is necessary to have fun later.
Hint: Everything is free.
Download the whole repository as a zip file (because you don't want to install git on a disposable VM like me) from:
Extract it to a location of your choice. I named mine dvta-master
.
We need management studio to set up our database and tables.
Now we can use the management studio to create the database and populate it.
SQL Server Management Studio
and connect to the SQLExpress
instance.Databases
to the left and select New Database
.DVTA
in the database name and press OK
. Don't change anything else.
Only change the database nameDVTA
under Databases
and select New Query
.users
table, enter this query and select Execute
(note this is different from the original instructions, we are setting the id
column to auto-increment by 1
starting from 0
). Without auto-increment, registration will not work:
|
|
expenses
table (I have set the id
column to auto-increment):
|
|
|
|
dbo.users
and select Select Top 1000 Rows
to see the test data.
Test users in the databaseSQL Server Configuration Manager
and click on SQL Server Network Configuration > Protocols for SQLEXPRESS
There's no need to install XAMPP. Manually install and use FileZilla FTP server.
dvta-ftp
and put in on desktop.Edit (menu) > Users
Now our FTP server is ready and runs as a Windows service.
The binary is configured to look for the SQL and FTP servers at a hardcoded IP address. The SQL Server address is in the .NET config file (which is just an XML file).
dvta-master\DVTA\DVTA\bin\Debug\DVTA.exe.config
(by default extensions are hidden on Windows so the extension might not be visible).appSettings
change value of DBSERVER
to 127.0.0.1\SQLEXPRESS
.
Modified config fileRelease
version in this fork has extra protections (the login button is disabled by default). We will use the Debug
version for testing the connection to our SQL Server. Be sure to do the same for the Release
build later.Fetch Time
button will return an error regardless. I think it is the cert pinning protection that we need to bypass later.Admin can backup server files to an FTP server. But the FTP's address is hardcoded. It's 192.168.56.110
. We can see this in the source code at \dvta-master\DVTA\DVTA\Admin.cs
(search for Upload("ftp://192.168.56.110", "dvta", "p@ssw0rd", @pathtodownload+"admin.csv");
). We want to change it to localhost.
hosts
file. This is a common approach with real world software.Let's assume we do not know the FTP address. That means we need to:
Use whatever method you are comfortable with. I used Procmon.
Process Name is DVTA.exe
.Profit2.
FTP address discoveredNow we can use dnSpy to modify this address in the application.
We setup DVTA in a VM and patched it to connect to our local FTP server. Now things are ready to go and we can start hacking the application. In the next post I will start working on the application.