First, you need to enable the vhost config in lighttpd:
sudo sed -i '/^#.*vhosts\.d\/\*\.conf/ s/^#//' /etc/lighttpd/lighttpd.conf
Finally create the lighttpd docket vhost log dir
sudo mkdir -p /var/log/lighttpd/docket
| #!/usr/bin/env python3 | |
| import argparse | |
| from pathlib import Path | |
| import csv | |
| from elasticsearch import Elasticsearch | |
| from elasticsearch.exceptions import TransportError | |
| from elasticsearch.helpers import bulk, streaming_bulk | |
| parser = argparse.ArgumentParser(description='Simple upload of a CSV to Elasticsearch for analysis') | |
| #group = parser.add_mutually_exclusive_group() |
| ip route get $(ip route get 1.1.1.1 | awk '{ print $3 }') | awk 'NR == 1 {print $5}' |
| # /etc/systemd/system/certbot.service | |
| [Unit] | |
| Description=Certbot Renewal | |
| [Service] | |
| ExecStart=/usr/bin/certbot renew --post-hook "systemctl restart httpd" |
First, you need to enable the vhost config in lighttpd:
sudo sed -i '/^#.*vhosts\.d\/\*\.conf/ s/^#//' /etc/lighttpd/lighttpd.conf
Finally create the lighttpd docket vhost log dir
sudo mkdir -p /var/log/lighttpd/docket
| # Dockerfile for lighttpd | |
| FROM centos/systemd | |
| RUN yum install -y epel-release; \ | |
| yum update -y; \ | |
| yum install -y lighttpd; \ | |
| yum clean all; \ | |
| rm -rf /var/cache/yum/*; \ | |
| systemctl enable lighttpd; |
| --- | |
| # This playbook uses docker to deploy dnsmasq for each DNS zone required for the | |
| - hosts: core-dns | |
| become: yes | |
| vars: | |
| ansible_user: fedora | |
| tasks: | |
| - name: Download DNS image | |
| docker_image: | |
| name: andyshinn/dnsmasq |
| # Enable deletion of topics | |
| echo -n "delete.topic.enable=true" | sudo tee -a /opt/kafka/config/server.properties | |
| # Generate list of topics | |
| ./bin/kafka-topics.sh --list --zookeeper 127.0.0.1:2181 | grep -v consumer | tee /tmp/topics | |
| # Delete all topics | |
| for topic in $(cat /tmp/topics); do ./bin/kafka-topics.sh --zookeeper 127.0.0.1:2181 --delete --topic=${topic}; done | |
| # Disable topic deletion |
I'm going through Offensive Security's "Pentesting With Kali" (PWK) course, and I added this hook to my Kali VM so that Bro would record everything going over the wire. I wanted to do this so I could analyze what my traffic would show up like using various tools.
Of course, you could use this on other systems using NetworkManager. And if you're pentesting, but not going over a VPN, just change the interface name in the script and the instructions. To add this to Kali for the OpenVPN connection, you need to do the following:
apt-get install bro broctl
sed -i 's/eth0/tap0/' /etc/bro/node.cfg
curl 'https://gist.githubusercontent.com/dcode/214fe616b1c98cd5665c99ad34a78893/raw/8d116140bb567c5990e378ab01973399719bb62a/nm-broctl.sh' | tee /etc/NetworkManager/dispatcher.d/broctl.sh
chmod +x /etc/NetworkManager/dispatcher.d/broctl.sh
| #!/usr/bin/env python | |
| IPV4_MIN = 0 | |
| IPV4_MAX = 0xFFFFFFFF | |
| def not_network(ipv4_address, ipv4_netmask): | |
| assert IPV4_MIN <= ipv4_address <= IPV4_MAX | |
| assert IPV4_MIN <= ipv4_netmask <= IPV4_MAX | |
| def hostmask_netmask(m): |
| ciphertext = 'V3Vqirostg6qW26sle5mnyrwEYSrteN6oHkilO50e9dFkN+0JhC3yu0LcQNw/hXU' | |
| key = 'r7y1dhmTvjQrcra7A1UQFw==' | |
| from Crypto.Cipher import AES | |
| from base64 import b64decode | |
| ct = b64decode(ciphertext) | |
| k = b64decode(key) | |
| d_suite = AES.new(k, AES.MODE_ECB) |