-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22db36d
commit fa3e675
Showing
10 changed files
with
26 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
openssl genrsa -out cert.key 2048 | ||
|
||
# (Specify the mitm domain as Common Name, e.g. \*.google.com) | ||
# openssl req -new -x509 -key cert.key -out cert.crt | ||
# cat cert.key cert.crt > cert.pem | ||
|
||
openssl req -new -x509 -key cert.key -out mitmproxy-ca-cert.pem | ||
cat cert.key mitmproxy-ca-cert.pem > mitmproxy-ca.pem | ||
|
||
cat cert.key mitmproxy-ca-cert.pem > mitmproxy-ca.pem | ||
|
||
openssl pkcs12 -export -inkey cert.key -in mitmproxy-ca-cert.pem -out mitmproxy-ca-cert.p12 | ||
|
||
|
||
cat mitmproxy-ca-cert.pem | base64 -w0 | ||
cat mitmproxy-ca-cert.pem | base64 -w0 | ||
# sample output | ||
# LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURnekNDQW11Z0F3SUJBZ0lVUzJTOHNMblQ1bi8vNkM3QTErMG01WXJUejhRd0RRWUpLb1pJaHZjTkFRRUwKQlFBd1VURUxNQWtHQTFVRUJoTUNSbEl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FRQkswdFdybDZ3b1dDUCs1bS81VWx4SWl3MnE2d1QvdVQwVgpCR2J5QllYTGZKcms5L1lXQVBZR05yaFdmekhVQU8vaEIrbVY5TDU2UlU3NHAvYk51MXdqdGZuT0phRjl5YmUwCmhyMFNsaDlkdFdvRnBHeFVzMGlFVVFHNmhEVzM5bDg2TTlweVJ6NFYrWjVGVHMvMEkya2NTUk1ySk9PZk5JZm4KMkJiVSs4Z1FUV0U5L3gvcThOcWJocUZxSUQybkZXWjl4aUlvWG1GSmt5T3hNeU1ZS2RyTERERUlHa2ZEWHhqNQphUHp1Y3l4S0ZBVzNtbWEwd1Y3WEZFdE8yYjVDMkh1YjdEN2RlbDBkSzFmZUsveWR6Z2szaTdIREFvaFZKSFlLCmZxVzVZWlpNMjkyLzY1VThPaWJmNmtjYTNZOGRFTFRPYzkxRUdPdkt2SVBJQVQvdTFFTmgKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,24 @@ | ||
#!/bin/bash | ||
|
||
sudo apt update -y | ||
# 1. install MITM proxy from official package | ||
|
||
# wget https://downloads.mitmproxy.org/10.2.2/mitmproxy-10.2.2-linux-x86_64.tar.gz | ||
wget https://downloads.mitmproxy.org/10.2.4/mitmproxy-10.2.4-linux-x86_64.tar.gz | ||
|
||
# tar -xvf mitmproxy-10.2.2-linux-x86_64.tar.gz | ||
tar -xvf mitmproxy-10.2.4-linux-x86_64.tar.gz | ||
|
||
# # start the proxy | ||
|
||
# ./mitmproxy | ||
|
||
# sudo apt update -y | ||
# [Other option] install MITM proxy using Python pip | ||
|
||
# sudo apt install python3-pip -y | ||
|
||
# pip3 install mitmproxy | ||
# sudo apt install wget -y # install if not installed | ||
|
||
# mitmproxy --listen-port 8080 --web-host 0.0.0.0 --web-port 8081 --set block_global=false | ||
|
||
# sudo apt install wget -y | ||
# MITM proxy can create a certificate for us on starting, but we will use our own certificate | ||
# 2. download the certificate files | ||
|
||
wget 'https://raw.githubusercontent.com/HoussemDellai/docker-kubernetes-course/main/_egress_proxy/certificate/mitmproxy-ca-cert.pem' | ||
wget 'https://raw.githubusercontent.com/HoussemDellai/docker-kubernetes-course/main/_egress_proxy/certificate/mitmproxy-ca.pem' | ||
wget 'https://raw.githubusercontent.com/HoussemDellai/docker-kubernetes-course/main/_egress_proxy/certificate/mitmproxy-ca-cert.p12' | ||
|
||
./mitmweb --listen-port 8080 --web-host 0.0.0.0 --web-port 8081 --set block_global=false --certs *=./mitmproxy-ca.pem --set confdir=./ | ||
|
||
# mitmweb --listen-port 8080 --web-host 0.0.0.0 --web-port 8081 --certs *=cert.pem --set block_global=false | ||
|
||
# screen -d -m mitmweb --listen-port 8080 --web-host 0.0.0.0 --web-port 8081 --set block_global=false | ||
|
||
# install the cert in: mitm.it | ||
|
||
# 3. start MITM proxy with the certificate and expose the web interface | ||
|
||
cat mitmproxy-ca-cert.pem | base64 -w0 | ||
# cat ~/.mitmproxy/mitmproxy-ca-cert.pem | base64 -w0 | ||
./mitmweb --listen-port 8080 --web-host 0.0.0.0 --web-port 8081 --set block_global=false --certs *=./mitmproxy-ca.pem --set confdir=./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
variable "prefix" { | ||
description = "Prefix for resources" | ||
type = string | ||
default = "66" | ||
default = "68" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters