This commit is contained in:
Stefan Friese 2021-12-21 17:36:55 +01:00
parent 615effb8a0
commit 9d78c9be30
5 changed files with 109 additions and 7 deletions

36
crypto/rsa.md Normal file
View File

@ -0,0 +1,36 @@
# RSA
* `p * q = n`
* Coprime Phi is calculated either by [Euler Totient](https://en.wikipedia.org/wiki/Euler's_totient_function) or [greatest common divisor](https://en.wikipedia.org/wiki/Greatest_common_divisor) via [euclidean algorithm](https://crypto.stanford.edu/pbc/notes/numbertheory/euclid.html)
* \\(1 < $\phi$ < n \\)
* There is also $\phi$ = (p-1) * (q-1)
* Encryption, public key `e` is a prime between 2 and phi --> \\( 2 < e < $\phi$ \\)
```python
possible_e = []
for i in range (2, phi):
if gcd(n, i) == 1 and gcd(phi, i) == 1:
possible_e.append()
```
* Decryption, private key `d` --> \\( d * e mod $\phi$ = 1 \\)
```python
possible_d = []
for i in range (phi + 1, phi + foo):
if i * e mod phi == 1 :
possible_d.append()
```
* \\( Cipher = msg ** d mod $\phi$ \\)
* \\( Cleartext = cipher ** e mod $\phi$ )
## Euklid
```python
def gcd(a, b):
if b == 0:
return a
return gcd(b, a % b)
```
## Links
* [Encryption+Decryption](https://www.cs.drexel.edu/~jpopyack/Courses/CSP/Fa17/notes/10.1_Cryptography/RSA_Express_EncryptDecrypt_v2.html)

View File

@ -0,0 +1,21 @@
# Docker Enumeration
## Save Images
* Save image and extract it
```sh
docker save -o image.tar <image-name>
tar -xf image.tar
```
* Run a container from the image and `printenv`
### Manifest
* Read the manifest inside the image extracted
```sh
jq . manifest.json
```
* Read the config JSON file mentioned in the manifest
* Inside this config file there are the shell commands used at building the image
* Snoop around after interesting files, especially inside the root dir in `layer.tar`

View File

@ -0,0 +1,13 @@
# Microk8s
* [microk8s repo](https://github.com/ubuntu/microk8s)
## Enumeration
```sh
microk8s kubectl get nodes
microk8s kubectl get services
microk8s kubectl get pods
microk8s kubectl get deployments -o wide
microk8s kubectl cluster-info
```

View File

@ -1,7 +0,0 @@
# AWS Buckets
# Usage
* Enum to s3 bucket
```sh
aws s3 ls s3://bucketname.region-name.amazonaws.com
```

View File

@ -0,0 +1,39 @@
# MicroK8s
## Usage
* Create `pod.yaml` configuration
```yaml
apiVersion: v1
kind: Pod
metadata:
name: harry-podder
spec:
containers:
- name: shell
image: localhost:47111/alpine
command:
- "/bin/bash"
- "-c"
- "sleep 10000"
volumeMounts:
- name: root
mountPath: /mnt/root
volumes:
- name: root
hostPath:
path: /
type: Directory
```
* Deploy the pod
```sh
microk8s kubectl apply -f pod.yaml
```
* Run the Pod
```sh
microk8s kubectl exec -it harry-podder -- /bin/bash
```