> For the complete documentation index, see [llms.txt](https://wiki.zacheller.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.zacheller.dev/pentest/courses/beginner-network-pentesting/week-3-python-102.md).

# Week 3: Python 102

**Introductory Python** - Similar to Linux, we will spend some time learning basic Python scripting, which will be essential to our future endeavors as penetration testers.

## Notes

Python scripting in python102.py, a simple portscanner in scanner.py.

installed text size plugin for gedit

```
apt-get install -y gedit-plugin-text-size
```

HOST FILES\
python -m SimpleHTTPServer 80\
\---OR---\
python3 -m http.server 80\
\
HOST AN FTP SERVER\
\#pip3 install pyftpdlib\
python3 -m pyftpdlib -p 21 -w #-w allows anonymous users\
\
Navigate to <ftp://10.0.2.15> or wherever your ipconfig says

print router's IP address:

```
ip route show | grep -i 'default via'| awk '{print $3 }'
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://wiki.zacheller.dev/pentest/courses/beginner-network-pentesting/week-3-python-102.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.
