# Python script and Bash script

Now that I have the username "jason\_test\_account". Now I need the password. Looking back on the clues I got from the function.phps, the password needs to have a md5 has ending in "001"

Going to need a python script for it.

```python
#!/usr/bin/env python3

from hashlib import md5
from string import ascii lowercase
import itertools

counter = 1
while True:
	combinations = intertools.combinations_with_replacement(ascii_lowercase)

	for combo in combinations:
		string = "".join(combo)

		m = md5(string.encode("utf-8"))
		the_hash = m.hexidigest()
		if the_hash.endswith("001"):
			print(string, the_hash)
			exit()
	counter +=1
```

### Explainer:

Imports are the neccesary libaries needed md5 is for the hashes, ascii lowercase is for the strings I am looking for and intertools allows iterators for efficient looping.

```python
m = md5(string.encode("utf-8")
the_hash = m.hexidigest()
```

Allows me to see the hash that comes out of each object.

```python
if the_hash.endswith("001"):
    print(string, the_hash)
    exit()
```

If the hash ends with the string "001" print it. I can then see it in the terminal. Exit is to close the loop, without it, even if I found the hash, the search could keep going infinitely.

![](https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FZWesI9UgWqAM7r8Hi2iw%2FPython%20code.PNG?alt=media\&token=46ee6f2e-f136-40b0-bdf8-523b5a2c065a)

Yeah I failed the code a few times before finally succeeding, I can now use the information Jason\_test\_account and akbr as well as completing the captcha to move forward.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://oklencodes.gitbook.io/untitled/ctfs/biteme-ctf/python-script-and-bash-script.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
