Học an toàn thông tin miễn phí từ WebGoat WebWolf

Con dê liếm vào đá để ăn muối, bổ sung chất dinh dưỡng cần thiết cho cơ thể của chúng.

Sườn núi có độ dốc rất cao nhìn như thẳng đứng nhưng dê vẫn bám vào được sườn núi vì miếng ăn :d


Lớp lập trình thực chiến cho Dev, DevOps, DevSecOps khóa 01 02 đã tới bài an toàn thông tin trên Linux.

Chúng tôi cố gắng cung cấp cho người học những thứ về công nghệ lõi Linux trong đó có đề cao tính thực chiến nên có nội dung trên.

Khi bạn hiểu sâu, hiểu rõ hệ điều hành Linux, Linux kernel tự nhiên bạn biết khá nhiều thứ về an toàn thông tin và làm được 1 đống thứ về an toàn thông tin.

Chúng tôi không ngại ngùng gì khi giới thiệu với người học các tài liệu học an toàn thông tin miễn phí trên mạng vì chúng tôi cũng đã coi và làm chán chê rồi.

Học an toàn thông tin từ WebGoat WebWolf là không đủ. Bạn muốn học an toàn thông tin chuyên sâu, thực chiến, chú ý là chuyên sâu nhưng thực chiến nha thì xin mời bạn đến với các khóa học trên website của chúng tôi.


WebGoat WebWolf là ứng dụng web để học an toàn thông tin giờ đã được đóng gói thành Container nên chỉ cần bung ra là chạy mà không cần cài cắm, cấu hình khổ sở, vất vả như xưa.

Lab chạy WebGoat WebWolf bằng Docker trên Ubuntu Server 24.04 rất đơn giản chỉ với 5 bước sau:

Bước 1: Cập nhật metadata của các repository trên Ubuntu Server 24.04.

apt update
Warning: The unit file, source configuration file or drop-ins of apt-news.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Warning: The unit file, source configuration file or drop-ins of esm-cache.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Get:1 http://security.ubuntu.com/ubuntu noble-security InRelease [89.7 kB] 
Get:2 http://archive.ubuntu.com/ubuntu noble InRelease [256 kB]            
Get:3 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages [21.5 kB]
Get:4 http://security.ubuntu.com/ubuntu noble-security/main Translation-en [6,544 B]
Get:5 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages [8,248 B]
Get:6 http://security.ubuntu.com/ubuntu noble-security/universe Translation-en [3,672 B]         
Get:7 http://archive.ubuntu.com/ubuntu noble-updates InRelease [89.7 kB]
Hit:8 http://archive.ubuntu.com/ubuntu noble-backports InRelease                                                                       
Get:9 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages [1,401 kB]                                                            
Get:10 http://archive.ubuntu.com/ubuntu noble/main Translation-en [513 kB]                                                             
Get:11 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages [15.0 MB]                                                        
Get:12 http://archive.ubuntu.com/ubuntu noble/universe Translation-en [5,982 kB]                                                       
Get:13 http://archive.ubuntu.com/ubuntu noble/restricted amd64 Packages [93.9 kB]                                                      
Get:14 http://archive.ubuntu.com/ubuntu noble/restricted Translation-en [18.7 kB]                                                      
Get:15 http://archive.ubuntu.com/ubuntu noble/multiverse amd64 Packages [269 kB]                                                       
Get:16 http://archive.ubuntu.com/ubuntu noble/multiverse Translation-en [118 kB]                                                       
Get:17 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [21.8 kB]                                                    
Get:18 http://archive.ubuntu.com/ubuntu noble-updates/main Translation-en [6,704 B]                                                    
Get:19 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [12.8 kB]                                                
Get:20 http://archive.ubuntu.com/ubuntu noble-updates/universe Translation-en [4,524 B]                                                
Fetched 24.0 MB in 53s (452 kB/s)                                                                                                      
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
1328 packages can be upgraded. Run 'apt list --upgradable' to see them.

Bước 2: Cài Docker container bằng lệnh apt install docker.io -y

apt install docker.io -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  bridge-utils containerd curl git git-man libcurl3t64-gnutls libcurl4t64 liberror-perl libgnutls30t64 libhogweed6t64 libnettle8t64
  libpsl5t64 libssl3t64 openssl pigz runc ubuntu-fan
Suggested packages:
  ifupdown aufs-tools btrfs-progs cgroupfs-mount | cgroup-lite debootstrap docker-buildx docker-compose-v2 docker-doc rinse zfs-fuse
  | zfsutils git-daemon-run | git-daemon-sysvinit git-doc git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn gnutls-bin
The following packages will be REMOVED:
  libcurl3-gnutls libcurl4 libgnutls30 libhogweed6 libnettle8 libpsl5 libssl3
The following NEW packages will be installed:
  bridge-utils containerd docker.io git git-man libcurl3t64-gnutls libcurl4t64 liberror-perl libgnutls30t64 libhogweed6t64
  libnettle8t64 libpsl5t64 libssl3t64 pigz runc ubuntu-fan
The following packages will be upgraded:
  curl openssl
2 upgraded, 16 newly installed, 7 to remove and 1326 not upgraded.
Need to get 86.5 MB of archives.
After this operation, 313 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble/main amd64 libnettle8t64 amd64 3.9.1-2.2build1 [182 kB]
Get:2 http://archive.ubuntu.com/ubuntu noble/main amd64 libhogweed6t64 amd64 3.9.1-2.2build1 [199 kB]
Get:3 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libgnutls30t64 amd64 3.8.3-1.1ubuntu3.1 [998 kB]
Get:4 http://archive.ubuntu.com/ubuntu noble/main amd64 openssl amd64 3.0.13-0ubuntu3 [1,002 kB]                                       
Get:5 http://archive.ubuntu.com/ubuntu noble/main amd64 libssl3t64 amd64 3.0.13-0ubuntu3 [1,936 kB]                                    
Get:6 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libcurl4t64 amd64 8.5.0-2ubuntu10.1 [341 kB]                           
Get:7 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 curl amd64 8.5.0-2ubuntu10.1 [227 kB]                                  
Get:8 http://archive.ubuntu.com/ubuntu noble/main amd64 libpsl5t64 amd64 0.21.2-1.1build1 [57.1 kB]                                    
Get:9 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libcurl3t64-gnutls amd64 8.5.0-2ubuntu10.1 [333 kB]                    
Get:10 http://archive.ubuntu.com/ubuntu noble/universe amd64 pigz amd64 2.8-1 [65.6 kB]                                                
Get:11 http://archive.ubuntu.com/ubuntu noble/main amd64 bridge-utils amd64 1.7.1-1ubuntu2 [33.9 kB]                                   
Get:12 http://archive.ubuntu.com/ubuntu noble/main amd64 runc amd64 1.1.12-0ubuntu3 [8,599 kB]                                         
Get:13 http://archive.ubuntu.com/ubuntu noble/main amd64 containerd amd64 1.7.12-0ubuntu4 [38.6 MB]                                    
Get:14 http://archive.ubuntu.com/ubuntu noble/universe amd64 docker.io amd64 24.0.7-0ubuntu4 [29.1 MB]                                 
Get:15 http://archive.ubuntu.com/ubuntu noble/main amd64 liberror-perl all 0.17029-2 [25.6 kB]                                         
Get:16 http://archive.ubuntu.com/ubuntu noble/main amd64 git-man all 1:2.43.0-1ubuntu7 [1,098 kB]                                      
Get:17 http://archive.ubuntu.com/ubuntu noble/main amd64 git amd64 1:2.43.0-1ubuntu7 [3,674 kB]                                        
Get:18 http://archive.ubuntu.com/ubuntu noble/universe amd64 ubuntu-fan all 0.12.16 [35.2 kB]                                          
Fetched 86.5 MB in 2min 12s (653 kB/s)                                                                                                 
Preconfiguring packages ...
dpkg: libhogweed6:amd64: dependency problems, but removing anyway as you requested:
 librtmp1:amd64 depends on libhogweed6.
 libjcat1:amd64 depends on libhogweed6.
 libgnutls30:amd64 depends on libhogweed6 (>= 3.6).
 dnsmasq-base depends on libhogweed6 (>= 2.4-3).

(Reading database ... 162874 files and directories currently installed.)
Removing libhogweed6:amd64 (3.9.1-2) ...
dpkg: libnettle8:amd64: dependency problems, but removing anyway as you requested:
 librtmp1:amd64 depends on libnettle8.
 libgnutls30:amd64 depends on libnettle8 (>= 3.9~).
 libcurl3-gnutls:amd64 depends on libnettle8.
 libarchive13:amd64 depends on libnettle8.
 dnsmasq-base depends on libnettle8 (>= 2.4-3).

Removing libnettle8:amd64 (3.9.1-2) ...
Selecting previously unselected package libnettle8t64:amd64.
(Reading database ... 162862 files and directories currently installed.)
Preparing to unpack .../libnettle8t64_3.9.1-2.2build1_amd64.deb ...
Unpacking libnettle8t64:amd64 (3.9.1-2.2build1) ...
Selecting previously unselected package libhogweed6t64:amd64.
Preparing to unpack .../libhogweed6t64_3.9.1-2.2build1_amd64.deb ...
Unpacking libhogweed6t64:amd64 (3.9.1-2.2build1) ...
dpkg: libgnutls30:amd64: dependency problems, but removing anyway as you requested:
 sane-airscan depends on libgnutls30 (>= 3.7.0).
 samba-libs:amd64 depends on libgnutls30 (>= 3.8.2).
 ntfs-3g depends on libgnutls30 (>= 3.7.2).
 network-manager depends on libgnutls30 (>= 3.7.2).
 libvte-2.91-0:amd64 depends on libgnutls30 (>= 3.7.2).
 librtmp1:amd64 depends on libgnutls30 (>= 3.7.2).
 libqpdf29:amd64 depends on libgnutls30 (>= 3.8.2).
 libnm0:amd64 depends on libgnutls30 (>= 3.7.2).
 libldap2:amd64 depends on libgnutls30 (>= 3.8.2).
 libjcat1:amd64 depends on libgnutls30 (>= 3.7.3).
 libcurl3-gnutls:amd64 depends on libgnutls30 (>= 3.8.2).
 libcups2:amd64 depends on libgnutls30 (>= 3.8.1).
 gnome-control-center depends on libgnutls30 (>= 3.7.0).
 glib-networking:amd64 depends on libgnutls30 (>= 3.8.1).
 fwupd depends on libgnutls30 (>= 3.7.3).
 dirmngr depends on libgnutls30 (>= 3.8.1).
 apt depends on libgnutls30 (>= 3.8.1).

(Reading database ... 162876 files and directories currently installed.)
Removing libgnutls30:amd64 (3.8.3-1ubuntu1) ...
Selecting previously unselected package libgnutls30t64:amd64.
(Reading database ... 162867 files and directories currently installed.)
Preparing to unpack .../libgnutls30t64_3.8.3-1.1ubuntu3.1_amd64.deb ...
Unpacking libgnutls30t64:amd64 (3.8.3-1.1ubuntu3.1) ...
Preparing to unpack .../openssl_3.0.13-0ubuntu3_amd64.deb ...
Unpacking openssl (3.0.13-0ubuntu3) over (3.0.10-1ubuntu4) ...
dpkg: libssl3:amd64: dependency problems, but removing anyway as you requested:
 wpasupplicant depends on libssl3 (>= 3.0.0).
 wget depends on libssl3 (>= 3.0.0).
 tnftp depends on libssl3 (>= 3.0.0).
 tcpdump depends on libssl3 (>= 3.0.0).
 systemd-resolved depends on libssl3 (>= 3.0.0).
 systemd depends on libssl3 (>= 3.0.0).
 sudo depends on libssl3 (>= 3.0.0).
 sssd-common depends on libssl3 (>= 3.0.0).
 sbsigntool depends on libssl3 (>= 3.0.0).
 rsync depends on libssl3 (>= 3.0.0).
 python3-cryptography depends on libssl3 (>= 3.0.0).
 ppp depends on libssl3 (>= 3.0.0).
 perl-openssl-defaults:amd64 depends on libssl3 (>= 3.0.0~~alpha1).
 openvpn depends on libssl3 (>= 3.0.0).
 openssh-server depends on libssl3 (>= 3.0.10).
 openssh-client depends on libssl3 (>= 3.0.10).
 open-vm-tools depends on libssl3 (>= 3.0.0).
 linux-headers-6.8.0-11-generic depends on libssl3 (>= 3.0.0).
 libxmlsec1-openssl:amd64 depends on libssl3 (>= 3.0.0).
 libwinpr2-2:amd64 depends on libssl3 (>= 3.0.0).
 libtss2-esys-3.0.2-0:amd64 depends on libssl3 (>= 3.0.0).
 libsystemd-shared:amd64 depends on libssl3 (>= 3.0.0).
 libsss-certmap0 depends on libssl3 (>= 3.0.0).
 libssh-4:amd64 depends on libssl3 (>= 3.0.0).
 libsnmp40:amd64 depends on libssl3 (>= 3.0.0).
 libshout3:amd64 depends on libssl3 (>= 3.0.0~~alpha1).
 libsasl2-modules:amd64 depends on libssl3 (>= 3.0.0).
 libsasl2-2:amd64 depends on libssl3 (>= 3.0.0).
 libqt5network5:amd64 depends on libssl3.
 libpython3.12-minimal:amd64 depends on libssl3 (>= 3.0.0).
 libpython3.11-minimal:amd64 depends on libssl3 (>= 3.0.0).
 libpkcs11-helper1:amd64 depends on libssl3 (>= 3.0.0).
 libpipewire-0.3-modules:amd64 depends on libssl3 (>= 3.0.0).
 libnvme1 depends on libssl3 (>= 3.0.0).
 libnet-ssleay-perl:amd64 depends on libssl3 (>= 3.0.0).
 libkrb5-3:amd64 depends on libssl3 (>= 3.0.0).
 libkmod2:amd64 depends on libssl3 (>= 3.0.0).
 libimobiledevice6:amd64 depends on libssl3 (>= 3.0.0).
 libfreerdp2-2:amd64 depends on libssl3 (>= 3.0.0).
 libfido2-1:amd64 depends on libssl3 (>= 3.0.0).
 libcurl4:amd64 depends on libssl3 (>= 3.0.0).
 libcryptsetup12:amd64 depends on libssl3 (>= 3.0.0).
 kmod depends on libssl3 (>= 3.0.0).
 gstreamer1.0-plugins-good:amd64 depends on libssl3 (>= 3.0.0).
 dhcpcd-base depends on libssl3 (>= 3.0.0).
 coreutils depends on libssl3 (>= 3.0.0).
 bind9-libs:amd64 depends on libssl3 (>= 3.0.0).

(Reading database ... 162877 files and directories currently installed.)
Removing libssl3:amd64 (3.0.10-1ubuntu4) ...
Selecting previously unselected package libssl3t64:amd64.
(Reading database ... 162866 files and directories currently installed.)
Preparing to unpack .../libssl3t64_3.0.13-0ubuntu3_amd64.deb ...
Unpacking libssl3t64:amd64 (3.0.13-0ubuntu3) ...
dpkg: libcurl4:amd64: dependency problems, but removing anyway as you requested:
 libgphoto2-6:amd64 depends on libcurl4 (>= 7.16.2).
 curl depends on libcurl4 (= 8.5.0-2ubuntu2).

(Reading database ... 162879 files and directories currently installed.)
Removing libcurl4:amd64 (8.5.0-2ubuntu2) ...
Selecting previously unselected package libcurl4t64:amd64.
(Reading database ... 162874 files and directories currently installed.)
Preparing to unpack .../libcurl4t64_8.5.0-2ubuntu10.1_amd64.deb ...
Unpacking libcurl4t64:amd64 (8.5.0-2ubuntu10.1) ...
Preparing to unpack .../curl_8.5.0-2ubuntu10.1_amd64.deb ...
Unpacking curl (8.5.0-2ubuntu10.1) over (8.5.0-2ubuntu2) ...
dpkg: libpsl5:amd64: dependency problems, but removing anyway as you requested:
 wget depends on libpsl5 (>= 0.16.0).
 network-manager depends on libpsl5 (>= 0.13.0).
 libsoup2.4-1:amd64 depends on libpsl5 (>= 0.16.0).
 libsoup-3.0-0:amd64 depends on libpsl5 (>= 0.16.0).
 libcurl3-gnutls:amd64 depends on libpsl5 (>= 0.16.0).

(Reading database ... 162880 files and directories currently installed.)
Removing libpsl5:amd64 (0.21.2-1build1) ...
Selecting previously unselected package libpsl5t64:amd64.
(Reading database ... 162875 files and directories currently installed.)
Preparing to unpack .../libpsl5t64_0.21.2-1.1build1_amd64.deb ...
Unpacking libpsl5t64:amd64 (0.21.2-1.1build1) ...
dpkg: libcurl3-gnutls:amd64: dependency problems, but removing anyway as you requested:
 whoopsie depends on libcurl3-gnutls (>= 7.16.2).
 network-manager depends on libcurl3-gnutls (>= 7.24.0).
 libsane1:amd64 depends on libcurl3-gnutls (>= 7.16.2).
 libproxy1v5:amd64 depends on libcurl3-gnutls (>= 7.16.2).
 libpoppler134:amd64 depends on libcurl3-gnutls (>= 7.16.2).
 libfwupd2:amd64 depends on libcurl3-gnutls (>= 7.63.0).
 libdebuginfod1:amd64 depends on libcurl3-gnutls (>= 7.28.0).
 libappstream5:amd64 depends on libcurl3-gnutls (>= 7.63.0).
 kerneloops depends on libcurl3-gnutls (>= 7.16.2).
 fwupd depends on libcurl3-gnutls (>= 7.63.0).

(Reading database ... 162881 files and directories currently installed.)
Removing libcurl3-gnutls:amd64 (8.5.0-2ubuntu2) ...
Selecting previously unselected package libcurl3t64-gnutls:amd64.
(Reading database ... 162874 files and directories currently installed.)
Preparing to unpack .../0-libcurl3t64-gnutls_8.5.0-2ubuntu10.1_amd64.deb ...
Unpacking libcurl3t64-gnutls:amd64 (8.5.0-2ubuntu10.1) ...
Selecting previously unselected package pigz.
Preparing to unpack .../1-pigz_2.8-1_amd64.deb ...
Unpacking pigz (2.8-1) ...
Selecting previously unselected package bridge-utils.
Preparing to unpack .../2-bridge-utils_1.7.1-1ubuntu2_amd64.deb ...
Unpacking bridge-utils (1.7.1-1ubuntu2) ...
Selecting previously unselected package runc.
Preparing to unpack .../3-runc_1.1.12-0ubuntu3_amd64.deb ...
Unpacking runc (1.1.12-0ubuntu3) ...
Selecting previously unselected package containerd.
Preparing to unpack .../4-containerd_1.7.12-0ubuntu4_amd64.deb ...
Unpacking containerd (1.7.12-0ubuntu4) ...
Selecting previously unselected package docker.io.
Preparing to unpack .../5-docker.io_24.0.7-0ubuntu4_amd64.deb ...
Unpacking docker.io (24.0.7-0ubuntu4) ...
Selecting previously unselected package liberror-perl.
Preparing to unpack .../6-liberror-perl_0.17029-2_all.deb ...
Unpacking liberror-perl (0.17029-2) ...
Selecting previously unselected package git-man.
Preparing to unpack .../7-git-man_1%3a2.43.0-1ubuntu7_all.deb ...
Unpacking git-man (1:2.43.0-1ubuntu7) ...
Selecting previously unselected package git.
Preparing to unpack .../8-git_1%3a2.43.0-1ubuntu7_amd64.deb ...
Unpacking git (1:2.43.0-1ubuntu7) ...
Selecting previously unselected package ubuntu-fan.
Preparing to unpack .../9-ubuntu-fan_0.12.16_all.deb ...
Unpacking ubuntu-fan (0.12.16) ...
Setting up libssl3t64:amd64 (3.0.13-0ubuntu3) ...
Setting up libpsl5t64:amd64 (0.21.2-1.1build1) ...
Setting up runc (1.1.12-0ubuntu3) ...
Setting up liberror-perl (0.17029-2) ...
Setting up libnettle8t64:amd64 (3.9.1-2.2build1) ...
Setting up bridge-utils (1.7.1-1ubuntu2) ...
Setting up libhogweed6t64:amd64 (3.9.1-2.2build1) ...
Setting up pigz (2.8-1) ...
Setting up git-man (1:2.43.0-1ubuntu7) ...
Setting up containerd (1.7.12-0ubuntu4) ...
Created symlink /etc/systemd/system/multi-user.target.wants/containerd.service → /usr/lib/systemd/system/containerd.service.
Setting up openssl (3.0.13-0ubuntu3) ...
Setting up libgnutls30t64:amd64 (3.8.3-1.1ubuntu3.1) ...
Setting up ubuntu-fan (0.12.16) ...
Created symlink /etc/systemd/system/multi-user.target.wants/ubuntu-fan.service → /usr/lib/systemd/system/ubuntu-fan.service.
Setting up libcurl4t64:amd64 (8.5.0-2ubuntu10.1) ...
Setting up libcurl3t64-gnutls:amd64 (8.5.0-2ubuntu10.1) ...
Setting up docker.io (24.0.7-0ubuntu4) ...
info: Selecting GID from range 100 to 999 ...
info: Adding group `docker' (GID 124) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /usr/lib/systemd/system/docker.socket.
Setting up git (1:2.43.0-1ubuntu7) ...
Setting up curl (8.5.0-2ubuntu10.1) ...
Processing triggers for man-db (2.12.0-3) ...
Processing triggers for libc-bin (2.39-0ubuntu2) ...

Docker daemon đã tự động chạy như là 1 dịch vụ trong systemd.

systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: enabled)
     Active: active (running) since Tue 2024-05-07 15:12:20 +07; 2min 33s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 6558 (dockerd)
      Tasks: 10
     Memory: 25.6M (peak: 26.3M)
        CPU: 261ms
     CGroup: /system.slice/docker.service
             └─6558 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

May 07 15:12:20 DevSecOps-Edu-VN systemd[1]: Starting docker.service - Docker Application Container Engine...
May 07 15:12:20 DevSecOps-Edu-VN dockerd[6558]: time="2024-05-07T15:12:20.143199467+07:00" level=info msg="Starting up"
May 07 15:12:20 DevSecOps-Edu-VN dockerd[6558]: time="2024-05-07T15:12:20.145186198+07:00" level=info msg="detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.conf"
May 07 15:12:20 DevSecOps-Edu-VN dockerd[6558]: time="2024-05-07T15:12:20.212792369+07:00" level=info msg="Loading containers: start."
May 07 15:12:20 DevSecOps-Edu-VN dockerd[6558]: time="2024-05-07T15:12:20.469268446+07:00" level=info msg="Loading containers: done."
May 07 15:12:20 DevSecOps-Edu-VN dockerd[6558]: time="2024-05-07T15:12:20.500318947+07:00" level=info msg="Docker daemon" commit=24.0.7-0ubuntu4 graphdriver=overlay2 version=24.0.7
May 07 15:12:20 DevSecOps-Edu-VN dockerd[6558]: time="2024-05-07T15:12:20.500400012+07:00" level=info msg="Daemon has completed initialization"
May 07 15:12:20 DevSecOps-Edu-VN dockerd[6558]: time="2024-05-07T15:12:20.525688435+07:00" level=info msg="API listen on /run/docker.sock"
May 07 15:12:20 DevSecOps-Edu-VN systemd[1]: Started docker.service - Docker Application Container Engine.

Bước 3: Chạy Webgoat ở dạng container, nếu chưa có Webgoat container image thì Docker sẽ tự động download về từ Docker hub.

docker run -d -p 8080:8080 -p 9090:9090 -e TZ=Asia/Ho_Chi_Minh webgoat/webgoat
Unable to find image 'webgoat/webgoat:latest' locally
latest: Pulling from webgoat/webgoat
cbe3537751ce: Pull complete 
6cd63fc495d1: Pull complete 
f4cbbc7af672: Pull complete 
c0d3f602482e: Pull complete 
77c3cb3bde8d: Pull complete 
428640dd0c77: Pull complete 
27a58071a52d: Pull complete 
4f4fb700ef54: Pull complete 
Digest: sha256:01672eb9aeba60d042ae1131d6de683b98fa64e9da60fa5d3daad2642a6795dd
Status: Downloaded newer image for webgoat/webgoat:latest
7d7bb550a59532be9a809f5f3690f97b5dd18c8b9e56f7bd5159217fb3522044

Webgoat container đang chạy ứng dụng web viết bằng Java và Webgoat container image là template đã có trên máy.

docker images
REPOSITORY        TAG       IMAGE ID       CREATED        SIZE
webgoat/webgoat   latest    bde451613ef3   5 months ago   411MB

docker ps
CONTAINER ID   IMAGE             COMMAND                  CREATED             STATUS             PORTS                                                                                  NAMES
7d7bb550a595   webgoat/webgoat   "java -Duser.home=/h…"   About an hour ago   Up About an hour   0.0.0.0:8080->8080/tcp, :::8080->8080/tcp, 0.0.0.0:9090->9090/tcp, :::9090->9090/tcp   blissful_tesla

Bước 4: Coi địa chỉ IP bằng lệnh ip a để mở web của Webgoat lên chiến.

ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:85:7c:9c brd ff:ff:ff:ff:ff:ff
    altname enp2s0
    inet 192.168.71.154/24 brd 192.168.71.255 scope global dynamic noprefixroute ens32
       valid_lft 1496sec preferred_lft 1496sec
    inet6 fe80::20c:29ff:fe85:7c9c/64 scope link 
       valid_lft forever preferred_lft forever
3: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:d0:c6:95:33 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:d0ff:fec6:9533/64 scope link 
       valid_lft forever preferred_lft forever
5: veth071be4d@if4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default 
    link/ether c2:d0:63:24:86:f0 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::c0d0:63ff:fe24:86f0/64 scope link 
       valid_lft forever preferred_lft forever

Tắt dịch vụ ufw là firewall mặc định của Ubuntu Server 24.04.

systemctl stop ufw

systemctl status ufw
○ ufw.service - Uncomplicated firewall
     Loaded: loaded (/usr/lib/systemd/system/ufw.service; disabled; preset: enabled)
     Active: inactive (dead)
       Docs: man:ufw(8)

May 07 14:31:19 DevSecOps-Edu-VN systemd[1]: Starting ufw.service - Uncomplicated firewall...
May 07 14:31:19 DevSecOps-Edu-VN systemd[1]: Finished ufw.service - Uncomplicated firewall.
May 07 15:21:55 DevSecOps-Edu-VN systemd[1]: Stopping ufw.service - Uncomplicated firewall...
May 07 15:21:55 DevSecOps-Edu-VN ufw-init[7159]: Skip stopping firewall: ufw (not enabled)
May 07 15:21:55 DevSecOps-Edu-VN systemd[1]: ufw.service: Deactivated successfully.
May 07 15:21:55 DevSecOps-Edu-VN systemd[1]: Stopped ufw.service - Uncomplicated firewall.

Bước 5: Đăng nhập WebGoat bằng link: http://192.168.71.154:8080/WebGoat

WebGoat default login username, password là guest guest, admin admin, webgoat webgoat đều không ăn, bạn phải chọn register yourself as a new user

Các bài Lab về an toàn thông tin đang có của WebGoat.

WebWolf default login username, password là của WebGoat đã setup trước đó.