> For the complete documentation index, see [llms.txt](https://oklencodes.gitbook.io/untitled/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://oklencodes.gitbook.io/untitled/ctfs/devoops-ctf/creating-python-exploit.md).

# Creating Python exploit

In the home page there was mention to feeed.py –

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FNOxdZnzwzy7yUmKm7ipx%2Fimage.png?alt=media&amp;token=ccafb05d-7a12-462c-a15b-15d5ebf8c562" alt=""><figcaption></figcaption></figure>

I did not see this in the results of filepath I got back from the respose I got back from Burpsuite but I can still call on the file to see what I get

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FCZefUyAXO8FXUwVaioOM%2Fimage.png?alt=media&amp;token=ad4dfb3a-6731-44b6-8201-39ab1badd4d4" alt=""><figcaption><p>results of feed.py</p></figcaption></figure>

In the subject I still cannot get the full path to the file maybe because of XML bad characters.

Python web applications usually create routes, then give the routes a page that then define the code as per lines 15, 19 and 23

\
Now, i need to create a script to exploit pickle.

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FzDNVHE4BO8AQvrlNN7fs%2Fimage.png?alt=media&amp;token=380beca8-3306-4550-8437-566007d436ce" alt=""><figcaption><p>Can see here they use urlsafe b64decode, so in the script I will include b64encode</p></figcaption></figure>

The script -&#x20;

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FDUwvwvoQDIGVpSck4XdF%2Fimage.png?alt=media&amp;token=67f51aec-4738-485d-93a2-4d31062ad0a6" alt=""><figcaption></figcaption></figure>

Imported base64 as necessary

Line 4 is from pentest monkey\_chichi - <https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet> -NC

"pickkle.dumps" is in regards to pickleloads from the original feed.py file.

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2F93OlcWlvaxOlBsFEYkNg%2Fimage.png?alt=media&amp;token=d2279f83-1f32-4dd7-81ac-f99933fb3497" alt=""><figcaption></figcaption></figure>

First attempt error.syntax. I will change it so that I need to write the whole b64encode

(To be continued)
