thantzinz

docker

Apr 30th, 2018 (edited)
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.86 KB | None | 0 0
  1.  
  2. # additional packages
  3. sudo apt install ca-certificates apt-transport-https ca-certificates curl gnupg-agent software-properties-common
  4.  
  5. # add docker gpg key
  6. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  7.  
  8. # add to repository list
  9. sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  10.  
  11. # update apt and install
  12. sudo apt-get update
  13. sudo apt-get install docker-ce docker-ce-cli containerd.io
  14.  
  15. # enable docker debug
  16. echo '{"debug": true}' | sudo tee -a /etc/docker/daemon.json
  17. ####Reload Nginx################
  18.  
  19. docker kill -s HUP n1
  20.  
  21. ####Restart Nginx###############
  22.  
  23. docker restart n1
  24.  
  25. ####How to login using root user into docker container#######
  26.  
  27. docker exec -it --workdir /root --user root f296ce6cf879 bash
  28.  
  29. ###Downloading an image
  30. docker search mariadb
  31. docker pull mariadb:latest
  32. docker images
  33.  
  34. ###List all exited containers
  35. docker ps -aq -f status=exited
  36.  
  37. ###Remove stopped containers
  38. docker ps -aq --no-trunc -f status=exited | xargs docker rm
  39.  
  40. ###
  41.  
  42. ###Creating a container
  43. docker run --name mariadbtest -e MYSQL_ROOT_PASSWORD=mypass -d mariadb
  44. docker ps
  45.  
  46. ###Running and stopping the container
  47. docker restart mariadbtest
  48. docker stop mariadbtest
  49. docker start mariadbtest
  50. docker stop --time=30 mariadbtest
  51. docker kill mariadbtest
  52. docker rm -v mariadbtest
  53.  
  54. ###Removing All Unused Objects
  55. docker system prune
  56.  
  57. ###Removing containers
  58. docker container rm cc3f2ff51cab cd20b396a061
  59.  
  60. docker update --restart=no $(docker ps -a -q)
  61.  
  62. ###Pausing containers
  63. docker pause node1 node2 node3
  64. docker unpause node1 node2 node3
  65.  
  66. ###Troubleshooting a container
  67. docker logs mariadbtest
  68. docker inspect mariadbtest
  69.  
  70. ###Accessing the container
  71. docker exec -it mariadbtest bash
  72.  
  73. ###Deleting the images
  74. docker rmi mariadb
  75.  
  76. #########################
  77. docker run --name n1 -p 192.168.241.17:8080:80 -d nginx
  78. docker run --name n2 -p 192.168.241.27:8888:80 -d nginx
  79. docker run -p 8080:80 -p 8443:443 bitnami/apache:latest
  80.  
  81.  
  82.  
  83. #########################
  84. docker run --rm -it -p 80:80 vulnerables/web-dvwa
  85. docker pull feltsecure/owasp-bwapp
  86. docker run -d -p 80:80 feltsecure/owasp-bwapp [http://localhost/install.php]
  87. docker pull bkimminich/juice-shop
  88. docker run --rm -p 3000:3000 bkimminich/juice-shop
  89. docker run -p 8080:80 -it -d f5devcentral/f5-demo-app:latest
  90.  
  91. #!/bin/bash
  92. yum update -y
  93. yum install -y docker
  94. service docker start
  95. docker pull bkimminich/juice-shop
  96. docker run -d -p 80:3000 bkimminich/juice-shop
  97.  
  98. https://github.com/bsqrl/juice-shop-walkthrough
  99. https://incognitjoe.github.io/hacking-the-juice-shop.html
  100.  
  101. https://www.fireeye.com/blog/threat-research/2018/04/establishing-a-baseline-for-remote-desktop-protocol.html
  102. http://www.hackingarticles.in/2-ways-use-msfvenom-payload-netcat/
  103. http://www.hackingarticles.in/network-packet-forensic-using-wireshark/
Add Comment
Please, Sign In to add comment