Hackthebox is a website which has bunch of vulnerable machines in its own VPN.
This is a write-up of “Active” on that website.
Solution
1. Initial Enumeration
Port Scanning:
What we have to notice is there is a time difference between our host and Active.
We have to change the current time of our host manually later for Active Directory enumeration.
Gobuster HTTP:
SMB Share listing:
2.Getting User
According to the result above, we have a right to see some of SMB shares.
By enumeration, we can find an interesting file.
We can find a domain user credentail in Groups.xml
By taking advantage of “gpp-decrypt” command, we can achieve a password for user “active.htb\SVC_TGS”
Now we have one credential to get into Active.
We can use the credentail for doing more enumeration of some SMB shares.
In “USERS”, we can find user.txt
We can download the user.txt by get command.
3.Getting root
Then, continue the enumeration.
To identify what service is running on Active, we can use lookupsid.py from impacket.
Then, we can achieve kerberous tickets for each service by GetUserSPNs.py
To deal with hash, we can not use default johnTheRipper on Kali linux.
It does not recognize this hash as “hash” and we have to download the “JTR bleeding” from official github for the decryption.
Now we got a password for user Administrator.
Since C$ is a share which we can see the entire C drive, we can find root.txt by accessing it by smbclient.
We have several malware reversing challenges this page on MalwareTech
This is a write-up of “shellcode1”.
Solution
1. Opening the shellcode1.exe
Let’s open the shellcode1.exe.
As we can see on a following picture, it shows a MD5 encrypted flag.
Just like strings challenges, we have to “decrypt” this MD5 hash and get original text.
2. Analyzing assembly code
Same as last challenge, to encrypt the original text, a function MD5:digestString is used.
It’s argument is in an offset “Str” and it must be a text which we’re looking for.
However, it is already encrypted and sounds like does not mean anything.
In this assembly code, we can find the “offset Str” one more time.
As we can see, it’s getting the length of Str and storing it into [ecx+4].
Then, figure out what it ecx.
Sounds like the value of ecx is return value of HeapAlloc.
And the return value is a pointer to the allocated momory block.
This means, after these instructions below, values of ecx and ecx+4 are
Then we still have 3 functions which we have to analyze.
Sounds like return value of VirtualAlloc is set in [ebp+Dst].
According to the official document, the arguments of VirtualAlloc are
We can find that the unknown function [ebp+Dst] is from offset unk_404068.
Looks like just some encrypted codes. However, we can convert the data to code with C key.
Sounds like this doing followning things.
At this time, the value of esi is [ebp+var_4]. This means it is heap space allocated.
Now, we have offset Str in the heapspace.
In summerize, the value which Str is modified by this function above is the original text.
3. decryption
Now we know what we have to do.
After selecting the data we need, we can export it with “Edit->Export data” (or Shift+E) and choose C hex for python code.
Then, what we have to do is writing a code for decryption.
By executing this code, we can obtain the original text.
We have several malware reversing challenges this page on MalwareTech
This is a write-up of “Strings3”.
Solution
1. Opening with IDA and Resource Hacker
Let’s open the strings3.exe with IDA and search for the flag.
According to the strings windows, it looks like we don’t have any encrypted flag.
Then, what we can guess is that this executable is loading the flag from somewhere else.
We can use “Resource Hacker” to figure out “Hidden” resources on IDA.
As we can see, there are too many “Possible flags” and we still have to figure out which is the correct password.
2. Identify the correct flag
To identify the correct flag, we can take advantage of these functions.
According to the official document of “LoadStringA” function, it takes 4 arguments.
This means, in strings3.exe, LoadStringA is called like this
Sounds like we have to figure out what’s the value of edx.
To figure out this, we have to focus on following instructions.
Let’s see valus of eax and edx.
We can figure out the value of each register by python interpreter.
According to this, after the “or eax, edx” instruction, the value of eax is 272.
This value is stored in [ebp+var_4]. Then it is moved to edx.
So the value of edx which is argument of LoadStringA is “272”.
if we look at num 272 of string table, we can find the correct flag.
We have several malware reversing challenges this page on MalwareTech
This is a write-up of “Strings2”.
Solution
1. Opening with IDA
When we open the strings2.exe with IDA, we can get following lots of variables.
Then, bunch of mov instructions are following.
Because there is “h” trailing, we can figure out these are hex numbers.
2. Translate hex to ascii
We can write a python script which translates there hex codes to ascii characters.
Let’s execute the python script.
We can grab the flag for this challenge.
We have several malware reversing challenges this page on MalwareTech
This is a write-up of “Strings1” on that website.
Solution
1. Opening with IDA
Sounds like we have to find an un-encrypted flag from one windows executable file strings1.exe.
As written on the challenge web page, we don’t need to run the executable.
By opening with IDA, we can see the overal structure.
To find a strings, we can go to Strings window.
(View->Open Subviews->Strings or Shift+F12).
As we can see, we have too many numbers of possible flags.
2. Analysing assembly code
By reading the disassembly code, we can find that after a few lines of standard instructions, we have these instructions below.
looks like it is hashing the characters in off_432294.
By double clicking the operand, we can see the value of the address.
This is the flag which we have to find.