mirror of
https://github.com/sunknudsen/privacy-guides.git
synced 2025-02-23 09:13:56 +00:00
Refactored code block formatting
This commit is contained in:
parent
542d57a094
commit
5af5380907
@ -34,7 +34,7 @@ brew install gnupg
|
|||||||
|
|
||||||
#### Step 4: generate PGP key pair
|
#### Step 4: generate PGP key pair
|
||||||
|
|
||||||
```shell
|
```console
|
||||||
$ gpg --full-generate-key
|
$ gpg --full-generate-key
|
||||||
gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc.
|
gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc.
|
||||||
This is free software: you are free to change and redistribute it.
|
This is free software: you are free to change and redistribute it.
|
||||||
@ -121,7 +121,7 @@ curl https://sunknudsen.com/sunknudsen.asc | gpg --import
|
|||||||
|
|
||||||
#### Confirm Sun’s PGP public key is legit using its fingerprint
|
#### Confirm Sun’s PGP public key is legit using its fingerprint
|
||||||
|
|
||||||
```shell
|
```console
|
||||||
$ gpg --fingerprint hello@sunknudsen.com
|
$ gpg --fingerprint hello@sunknudsen.com
|
||||||
gpg: checking the trustdb
|
gpg: checking the trustdb
|
||||||
gpg: marginals needed: 3 completes needed: 1 trust model: pgp
|
gpg: marginals needed: 3 completes needed: 1 trust model: pgp
|
||||||
@ -140,7 +140,7 @@ See https://sunknudsen.com/, https://github.com/sunknudsen/pgp-public-key and ht
|
|||||||
|
|
||||||
#### Paste, encrypt and sign message (enter line break and use command `ctrl+d` to quit edit mode)
|
#### Paste, encrypt and sign message (enter line break and use command `ctrl+d` to quit edit mode)
|
||||||
|
|
||||||
```shell
|
```console
|
||||||
$ gpg --encrypt --sign --armor --output ~/Desktop/encrypted.asc -r john@example.net -r hello@sunknudsen.com
|
$ gpg --encrypt --sign --armor --output ~/Desktop/encrypted.asc -r john@example.net -r hello@sunknudsen.com
|
||||||
gpg: 5574F4B0B0F67D7F: There is no assurance this key belongs to the named user
|
gpg: 5574F4B0B0F67D7F: There is no assurance this key belongs to the named user
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ This is a test!
|
|||||||
|
|
||||||
#### Decrypt message to stdout and decode quoted-printable characters
|
#### Decrypt message to stdout and decode quoted-printable characters
|
||||||
|
|
||||||
```shell
|
```console
|
||||||
$ gpg --decrypt /Users/johndoe/Desktop/encrypted.asc | perl -MMIME::QuotedPrint -0777 -nle 'print decode_qp($_)'
|
$ gpg --decrypt /Users/johndoe/Desktop/encrypted.asc | perl -MMIME::QuotedPrint -0777 -nle 'print decode_qp($_)'
|
||||||
gpg: encrypted with 4096-bit RSA key, ID 5574F4B0B0F67D7F, created 2019-10-17
|
gpg: encrypted with 4096-bit RSA key, ID 5574F4B0B0F67D7F, created 2019-10-17
|
||||||
"Sun Knudsen <hello@sunknudsen.com>"
|
"Sun Knudsen <hello@sunknudsen.com>"
|
||||||
|
@ -21,7 +21,7 @@ sudo chown $(whoami):admin /usr/local/sbin/
|
|||||||
|
|
||||||
#### Step 2: create `spoof.sh` script
|
#### Step 2: create `spoof.sh` script
|
||||||
|
|
||||||
**Pro tip 1: when copy/pasting commands that start with `cat << "EOF"`, select all lines (from `cat << "EOF"` to `EOF`) at once as they are part of the same (single) command**
|
> When copy/pasting commands that start with `cat << "EOF"`, select all lines (from `cat << "EOF"` to `EOF`) at once as they are part of the same (single) command
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
cat << "EOF" > /usr/local/sbin/spoof.sh
|
cat << "EOF" > /usr/local/sbin/spoof.sh
|
||||||
@ -64,7 +64,7 @@ Exit on error
|
|||||||
export LC_CTYPE=C
|
export LC_CTYPE=C
|
||||||
```
|
```
|
||||||
|
|
||||||
Fix `sed: RE error: illegal byte sequence` [sed](https://en.wikipedia.org/wiki/Sed) error
|
Fix `sed: RE error: illegal byte sequence` error
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dirname=`dirname "${BASH_SOURCE}"`
|
dirname=`dirname "${BASH_SOURCE}"`
|
||||||
@ -98,7 +98,7 @@ sudo scutil --set HostName "$host_name"
|
|||||||
echo "Spoofed hostname to $host_name"
|
echo "Spoofed hostname to $host_name"
|
||||||
```
|
```
|
||||||
|
|
||||||
Set `ComputerName`, `LocalHostName` and `HostName` using [scutil](https://ss64.com/osx/scutil.html) and echo spoofed computer name
|
Set `ComputerName`, `LocalHostName` and `HostName` using `scutil` and echo spoofed computer name
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
mac_address_prefix=`sed "$(jot -r 1 1 768)q;d" $dirname/mac_address_prefixes.txt | sed -e 's/[^A-F0-9:]//g'`
|
mac_address_prefix=`sed "$(jot -r 1 1 768)q;d" $dirname/mac_address_prefixes.txt | sed -e 's/[^A-F0-9:]//g'`
|
||||||
@ -110,7 +110,7 @@ Set variable `mac_address_prefix` to random Apple MAC address prefix found in `m
|
|||||||
mac_address_suffix=`openssl rand -hex 3 | sed 's/\(..\)/\1:/g; s/.$//'`
|
mac_address_suffix=`openssl rand -hex 3 | sed 's/\(..\)/\1:/g; s/.$//'`
|
||||||
```
|
```
|
||||||
|
|
||||||
Set variable `mac_address_suffix` to random value genereated by [OpenSSL](https://en.wikipedia.org/wiki/OpenSSL)
|
Set variable `mac_address_suffix` to random value genereated by OpenSSL
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
mac_address=`echo "$mac_address_prefix:$mac_address_suffix" | awk '{print toupper($0)}'`
|
mac_address=`echo "$mac_address_prefix:$mac_address_suffix" | awk '{print toupper($0)}'`
|
||||||
@ -123,7 +123,7 @@ sudo ifconfig en0 ether "$mac_address"
|
|||||||
echo "Spoofed MAC address of en0 interface to $mac_address"
|
echo "Spoofed MAC address of en0 interface to $mac_address"
|
||||||
```
|
```
|
||||||
|
|
||||||
Set spoofed MAC address using [ifconfig](https://en.wikipedia.org/wiki/Ifconfig) and echo spoofed MAC address
|
Set spoofed MAC address using `ifconfig` and echo spoofed MAC address
|
||||||
|
|
||||||
#### Step 3: make `spoof.sh` executable
|
#### Step 3: make `spoof.sh` executable
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user