Post

IML - Python Coding Network Challenge Ep. 2&3

Python Coding Network Challenge Ep. 2&3 - A walkthrough of the challenge with enumeration, exploitation and privilege escalation steps.



IML - Python Coding Network Challenge Ep. 2&3

Can get to it from here: https://endeavour.immersivelabs.online/objectives/objective/354d11850f9748feaf33a5e3a2f9b3a1/labs

As you don’t seem to be able to search for this challenge

Note - It says:

image1

But you can get this token from either Ep.2 or Ep.3

Ep.1

  • Ep.1 - Source code:

image2

  • Ep.1 Token:

image3

Ep.2

  • Ep.2 Source code:

image4

  • Ep.2 Token:

image5

Ep.3

  • Source code:

image6

  • This one is a bit more advance - we need to look at this line:
1
2
dk = hashlib.pbkdf2_hmac('sha256', bytes(os.environ.get('level_2_secret_token'),'utf-8'), b'12345', randint(100,199))

  • If we look at the python hashlib docs - we can see what each part does:

image7

We are particularly interested in the last part - the random number of iterations

  • So all we need to do is create a for loop and hash every number between 100 and 199 (inclusive):

image8

  • Token:

image9

This post is licensed under CC BY 4.0 by the author.