I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.
if ufw is not installed by default be sure to install it first.
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" | |
#!/bin/bash | |
# Define physical ethernet interface to be bridged | |
# with TAP interface(s) above. | |
eth="eth0" | |
eth_ip="192.168.42.2" | |
eth_netmask="255.255.255.0" | |
eth_broadcast="192.168.42.255" | |
eth_gateway="192.168.42.1" | |
eth_mac="XX:XX:XX:XX:XX:XX" |
# adapated from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# generate seperate key+crt files, make sure common name (CN) == ip or hostname | |
# openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout newkey.key -out newkey.crt | |
# run as follows: | |
# python simple-https-server.py | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl | |
# 0.0.0.0 allows connections from anywhere |
# UPDATED 17 February 2019 | |
# Redirect all HTTP traffic to HTTPS | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name www.domain.com domain.com; | |
return 301 https://$host$request_uri; | |
} | |
# SSL configuration |
Abstract
This is a document explaining how to locate WaitForSingleObject(..., INFINITE)
within msfvenom's (4.12.23-dev) generated payload and how to fix the payload's glitches. It goes through the analysis of a windows/shell_reverse_tcp payload, touching issues like stack alignment, WaitForSingleObject locating & patching. It has been written when I realised there are many topics on the Offensive-Security OSCE/CTP forums touching problem of finding this particular Windows API. Since RE is one of my stronger FU's I decided to write down my explanation of the subject.
Contents:
Sometimes you may want to use a DNS server for specific domain requests and another DNS server for all other requests. This is helpful, for instance, when connected to a VPN. For hosts behind that VPN you want to use the VPN's DNS server but all other hosts you want to use Google's public DNS. This is called "DNS splitting."
Here, we run dnsmasq as a background service on macOS. The dnsmasq configuration described below implements DNS splitting.
brew install dnsmasq
*update: TBC, but this new might affect how easy it is to use this technique past August 2024: Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August
This gist, based in part on a gist by Brian Hartvigsen, allows you to export from Authy your TOTP tokens you have stored there.
Those can be "standard" 6-digits / 30 secs tokens, or Authy's own version, the 7-digits / 10 secs tokens.
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#ifdef _MSC_VER | |
#include <intrin.h> /* for rdtscp and clflush */ | |
#pragma optimize("gt",on) | |
#else | |
#include <x86intrin.h> /* for rdtscp and clflush */ | |
#endif |
#!/usr/bin/python3 | |
dir='/sys/class/power_supply/max170xx_battery/' | |
with open(dir + 'current_avg', 'r') as f: | |
current = int(f.read()) / 1000000.0 | |
with open(dir + 'voltage_avg', 'r') as f: | |
voltage = int(f.read()) / 1000000.0 | |
wattage = voltage * current | |
# print('{0:.2f}V {1:.2f}A {2:.2f}W'.format(voltage, current, wattage)) |