Skip to content

Instantly share code, notes, and snippets.

@ropnop
Created July 18, 2019 02:16
Show Gist options
  • Save ropnop/c21c35e67a07da2ab50dbb8a085ccd22 to your computer and use it in GitHub Desktop.
Save ropnop/c21c35e67a07da2ab50dbb8a085ccd22 to your computer and use it in GitHub Desktop.
Docker aliases
function dockershell() {
docker run --rm -i -t --entrypoint=/bin/bash "$@"
}
function dockershellsh() {
docker run --rm -i -t --entrypoint=/bin/sh "$@"
}
function dockershellhere() {
dirname=${PWD##*/}
docker run --rm -it --entrypoint=/bin/bash -v `pwd`:/${dirname} -w /${dirname} "$@"
}
function dockershellshhere() {
docker run --rm -it --entrypoint=/bin/sh -v `pwd`:/${dirname} -w /${dirname} "$@"
}
function dockerwindowshellhere() {
dirname=${PWD##*/}
docker -c 2019-box run --rm -it -v "C:${PWD}:C:/source" -w "C:/source" "$@"
}
impacket() {
docker run --rm -it rflathers/impacket "$@"
}
smbservehere() {
local sharename
[[ -z $1 ]] && sharename="SHARE" || sharename=$1
docker run --rm -it -p 445:445 -v "${PWD}:/tmp/serve" rflathers/impacket smbserver.py -smb2support $sharename /tmp/serve
}
nginxhere() {
docker run --rm -it -p 80:80 -p 443:443 -v "${PWD}:/srv/data" rflathers/nginxserve
}
webdavhere() {
docker run --rm -it -p 80:80 -v "${PWD}:/srv/data/share" rflathers/webdav
}
metasploit() {
docker run --rm -it -v "${HOME}/.msf4:/home/msf/.msf4" metasploitframework/metasploit-framework ./msfconsole "$@"
}
metasploitports() {
docker run --rm -it -v "${HOME}/.msf4:/home/msf/.msf4" -p 8443-8500:8443-8500 metasploitframework/metasploit-framework ./msfconsole "$@"
}
msfvenomhere() {
docker run --rm -it -v "${HOME}/.msf4:/home/msf/.msf4" -v "${PWD}:/data" metasploitframework/metasploit-framework ./msfvenom "$@"
}
reqdump() {
docker run --rm -it -p 80:3000 rflathers/reqdump
}
postfiledumphere() {
docker run --rm -it -p80:3000 -v "${PWD}:/data" rflathers/postfiledump
}
@ropnop
Copy link
Author

ropnop commented Jul 20, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment