Python
00. Common
mkdir -p ~/.config/pip && printf "[global]\nbreak-system-packages = true\n" > ~/.config/pip/pip.confsudo pip install virtualenv
virtualenv -p python2 venv
virtualenv -p python venv
source venv/bin/activate
deactivate
python -m venv env
source env/bin/activate## ------------------| input function
__import__('os').system('ping -c 2 <IP>')## ------------------| Basic serach
>>> import re
>>> s = 'Part 1. Part 2. Part 3 then more text'
>>> re.search(r'Part 1\.(.*?)Part 3', s).group(1)
' Part 2. '
>>> re.search(r'Part 1(.*?)Part 3', s).group(1)
'. Part 2. '
## ------------------| Search word in respond
respond = (requests.get('http://IP/index.php').text).strip()
fetch = re.search("\[(.*?)\]",respond).group(1)
^ <-> ^ ^
## fetch string start with '[' and end with ']' and show first block only
## ------------------| Search multiple lines in respond
regex = re.compile(r"<h3>(.*)</h3>", re.DOTALL)
respond = requests.get('http://IP/index.php')
match = re.search(regex, respond.text)
print (match.group(1))syntax
sample
01. Flask
02. Blind SQL injection
03. LFI with python
04. XXE with python
05. SSL/HTTPS Server
06. Package Manager RCE
Last updated
