Skip to content

Instantly share code, notes, and snippets.

p3t3r67x0 /
Last active Feb 29, 2016
Hosteurope virtual server hostname setting script


# Provides:
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 6



A remote code execution exploit for Fortigate firewalls that exploits a HTTP cookie overflow vulnerability. It affects models 60, 60M, 80C, 200A, 300A, 400A, 500A, 620B, 800, 5000, 1000A, 3600, and 3600A. The model of the firewall is detected by examining the ETag in the HTTP headers of the firewall. This is not CVE-2006-6493 as detected by Avast.




Test the nginx config

$ sudo nginx -t
$ sudo nginx -t -c /etc/nginx/nginx.conf
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Beautifiul git log

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
git lg
p3t3r67x0 / zip_codes.csv
Last active Dec 28, 2016
A sorted list of german zip codes
View zip_codes.csv
We can't make this file beautiful and searchable because it's too large.
p3t3r67x0 /
Last active Jan 9, 2017
Simple script to extract the server cert of a given domain
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ssl
import OpenSSL
cert = ssl.get_server_certificate(('', 443))
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, cert)
print 'Expired: {}'.format(x509.has_expired())
p3t3r67x0 /
Last active Jan 29, 2017
Retrieves domains from the database and tries to get records for each entry and updates the database when neccessary
#!/usr/bin/env python
from dns import resolver
from import EmptyLabel
from dns.resolver import NoAnswer
from dns.resolver import NXDOMAIN
from pymongo import MongoClient
from pymongo.errors import DuplicateKeyError
p3t3r67x0 /
Last active Sep 3, 2017
Iptables for Ubuntu Desktop 16.04 with default DROP policy

Iptables for Ubuntu Desktop 16.04

With these rules you are able to protect yourself a tiny bit

  • You are able to do open website in your browser or terminal
  • You are able to reviece and send mails with e. g. Thunderbird
  • You are able to ping any device you want from you machine
  • You are able to connect yourself to a remote secure shell
  • You are able to retrieve a dhcp lease from your router
p3t3r67x0 /
Last active Oct 29, 2017
Extract mp4 url from and a proper title
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import json
import requests
from lxml import html
from urlparse import urlparse
from fake_useragent import UserAgent

You need to add the following entry in /etc/apt/sources.list or a new file in /etc/apt/sources.list.d/:

deb xenial main
deb-src xenial main

Then add the gpg key used to sign the packages by running the following commands at your command prompt: