Skip to content

Instantly share code, notes, and snippets.

SNIFF SSL TRAFFIC

Recently I get confused on how to sniff HTTPS traffic, I think I need a proxy and it turns out correct. I setup a proxy chain by using stunnel.

SETUP

I use two machines (which is not optimal), one is used for executing command and serving stunnel server; then other one is used for stunnel client and sniffing.

STUNNEL SERVER & CLIENT

CONFIGURE FIREWALLS

WINDOWS

On newer windows,

netsh advfirewall set  allprofiles state off/on

:: or equivalently

POWERSHELL CHEATSHEET

ENABLE REMOTE DESKTOP

# https://www.interfacett.com/blogs/methods-to-enable-and-disable-remote-desktop-locally/
Set-ItemProperty -Path hklm:"HKEY_LOCAL_MACHINE\SYSTEM\CurRentControlSet\Control\Terminal Server" -Name fDenyTSConnections -Value 0
# generate ca key & certificate
openssl genrsa -out ca.key 2048
openssl req -x509 -new -nodes -key ca.key -sha256 -days 10000 -out ca.crt

# generate client key & csr
openssl genrsa -out client.key 2048
openssl req -new -key client.key -out client.csr

# sign request and get client certificate

PROXY OPENSTACK REQUEST

I get a job to hide openstack behind a reverse proxy and make default ports completely invisible from users.

MAIN CONFIGURATION

Right now I am afraid openstack has some problem with a unified api gateway, so I have to modify response body if version controller is accessed by the end user. (Sadly version controller should not be used because from my point of view, it conflicts with endpoints returned)

# nginx config

BUNDLE

BUNDLE_EXEC_PATH=
BUNDLE_DIR=

cd $BUNDLE_DIR
${BUNDLE_EXEC_PATH} exec ${EXECUTABLE_FILE}
# ~/.pip/pip.conf
[global]
index-url = https://pypi.douban.com/simple

IPMITOOLS CHEATSHEET

# print info
ipmitool lan print

# restart bmc
ipmitool -I lanplus -U <USERNAME> -P <PASSWORD> -H <HOST_ADDRESS> bmc reset cold

# change boot order

ETHTOOL CHEATSHEET

To get a full list of available options, use man ethtool.

SHOW NIC INFO/DRIVER

ethtool -i ${NIC}
@jshen28
jshen28 / rabbitmq.txt
Created January 7, 2019 05:28 — forked from sdieunidou/rabbitmq.txt
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"