一些在物理机上使用linux - kali-2022.3-5.18.0的变强(秃头)经历

从脚本小子到脚本老子之路

KALI in Physical machine的安装

物理机硬件:

​ 型号:Dell-G5 5590(笔记本)

​ CPU:i7-9750H (intel UHD Graphics 630) Core:12 Speed:2.60GHz

​ GPU:NVIDIA GeForce GTX 1660 Ti Mobile

​ Memory:16G

​ SATA:512G(SSD)+ 1T(HDD)

系统:

​ Kali GNU/Linux Rolling

​ kernel:5.18.0-kali2-amd64

单独安装

暂 略

win10+linux-kali双系统安装

注意事项:

1、UEFI 启动

2、bios修改硬盘类型 RCHI

3、grub引导文件

kali的一些配置

Kali Linux 中文文档

详情请见本目录下的 Use-KALI.conf.md

遇到的一些错误

错误编码含义:

​ Kr:表示hostname用户(-或在root环境下)

​ K0:表示重要的问题处理

​ KR:表示root用户环境

​ S A B C D :表示影响,严重等级

​ ×a-×f :表示处理(依赖)复杂度

错误编号 K0S-22628-0a00

双屏幕驱动设置问题

问题简介

双屏幕驱动设置问题

本次处理时间为2022-6-(26–28),success at Tue28, 13:29

详:安装nvidia驱动遇到的问题,及安装成功后,主屏幕黑屏处理问题

附:扩展功能的实现

解决方案

Nvidia驱动的安装:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$ sudo apt-get purge nvidia*
$ sudo vim /etc/modprobe.d/blacklist-modem.conf
# .conf
blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off

$ sudo update-initramfs -u
# 检查nouveau,x-server是否在运行
$ lsmod |grep x
$ sudo init 3
# 进入命令行界面,本次安装过程可能要重启数次才会成功
$->#
./nvidia*.run [--kernel-source-path=$(pwd)]
# 报错kernel-source找不到 则运行下面命令(更新内核)
apt-get install linux-headrs-$(uname -r)
apt-get update && apt-get upgrade && apt-get dist-upgrade
# 等待更新结束
# 报错关闭nouveau或者x-server,则上面的服务没有关闭完全,尝试reboot->grub->init 3
#安装结束后,reboot -> nvidia-smi -> xrandr

检查是否安装成功 & 并配置扩展屏幕相关文件-link

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
$ nvidia-smi
$ sudo vim /etc/X11/xorg.conf
# .conf
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BusID "PCI:1:0:0"
Option "AllowEmptyInitialConfiguration"
EndSection

Section "Module"
Load "modesetting"
EndSection
:wq

$ sudo vim /etc/X11/xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 515.48.07

Section "ServerLayout"
Identifier "Layout0"
# Screen 1 "Screen1"
Screen 0 "Screen0" #RightOf "Screen1"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "Module"
Load "modesetting"
EndSection

Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "RTK"
Option "DPMS"
EndSection

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BusID "PCI:1:0:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "nvidia"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection

Section "Monitor"
Identifier "Monitor1"
VendorName "Unknown"
ModelName "laptop"
Option "DPMS"
EndSection

Section "Device"
Identifier "intel"
Driver "modesetting"
BusID "PCI:0:2:0"
Option "AccelMethod" "uxa"
EndSection

Section "Screen"
Identifier "Screen1"
Device "intel"
Monitor "Monitor1"
SubSection "Display"
Depth 24
EndSubSection
EndSection

$ sudo vim /usr/share/X11/xorg.conf.d/10-amdgpu.conf
# .conf
Section "OutputClass"
Identifier "AMDgpu"
MatchDriver "amdgpu"
Driver "modesetting"
EndSection
:wq

$ sudo vim /usr/share/X11/xorg.conf.d/nvidia-drm-outputclass.conf
# This xorg.conf.d configuration snippet configures the X server to
# automatically load the nvidia X driver when it detects a device driven by the
# nvidia-drm.ko kernel module. Please note that this only works on Linux kernels
# version 3.9 or higher with CONFIG_DRM enabled, and only if the nvidia-drm.ko
# kernel module is loaded before the X server is started.

Section "OutputClass"
Identifier "nvidia"
MatchDriver "nvidia-drm"
Driver "nvidia"
Option "PrimaryGPU" "Yes"
EndSection
:wq

$ sudo vim /etc/lightdm/display_setup.sh
#!/bin/sh
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
xrandr --dpi 96
:wq

$ sudo chmod +x *.sh
$ sudo vim /etc/lightdm/lightdm.conf
# [Seat:*] matches all seats and is applied first.
display-setup-script=/etc/lightdm/display_set.sh
:wq

$ vim ~/.xinputrc
# im-config(8) generated on Fri, 26 Nov 2021 11:36:05 +0800
run_im fcitx
# im-config signature: a048be2b3b9913496843703eb79fd0c1 -
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
xrandr --dpi 96
:wq


$->#

-> update-initramfs -u
-> update-grub
-> reboot

扩展屏幕执行-link1-link2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 检测屏幕
$ xrandr
Screen 0: minimum 8 x 8, current 4480 x 1440, maximum 32767 x 32767
HDMI-0 connected 2560x1440+1920+0 (normal left inverted right x axis y axis) 697mm x 392mm
2560x1440 120.00 + 144.00* 120.00 59.95
1920x1200 59.88
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
eDP-1-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
1920x1080 144.00*+ 60.01 59.97 59.96 59.93
1680x1050 84.94 74.89 69.88 59.95 59.88

# HDMI-0 为外接显示器
# eDP-1-1为笔记本内置显示器

# 将外接显示向右扩展
$ xrandr --output HDMI-0 --right-of eDP-1-1 --auto

错误编号 KRA-22624-0d00

Grub与boot引导问题

报错简介

Grub与boot引导问题

问题描述:执行apt-upgrade导致gurb引导项目丢失(win10)

1
2
3
4
5
6
7
8
9
10
mkdir -p /mnt/window
mount /dev/${/efi}
grub-install target=x86_64-efi --efi-directory=/boot --recheck #安装grub引导程序
grub-mkconfig -o /boot/grub/grub.cfg

利用 fdisk -l 获取EFI的分区
blkid /dev/{$/efi}
grub-probe -t fs_uuid -d /dev/{$/efi}

vim /boot/grub/grub.cfg
1
2
3
4
5
6
7
8
9
10
11
### BEGIN /etc/grub.d/30_os-prober ###
menuentry ''{
insmod part_gpt
insmod fat
insmod search_fs_uuid
insmod chain
search --fs-uuid --no-floopy --set=root XXXX
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}

### END /etc/grub.d/30_os-prober ###

Warning: os-prober will not be excuted to detect other bootable partitions.

1
2
3
4
5
6
vim /etc/default/grub  #打开grub配置文件

GRUB_DISABLE_OS_PROBER=false #添加这一行

sudo update-grub
grub-mkconfig -o /boot/grub/grub.cfg #重新生成配置文件,终于检测到windows了

错误编号 KrB-21916-0f00

sqlmap启动文件丢失问题

报错简介

sqlmap启动,出现问题

注释:报错文件丢失

解决方案

1
2
#sqlmap修复
git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-dev

错误编号 KrD-22626-0f01

磁盘挂载访问问题

报错简介

Files、OS磁盘分区挂载错误,导致挂载后文件只有只读权限,不能访问更改。

解决方案

1
2
3
4
5
mount -o rw,remount /dev/nvme0n1p5
mount -o rw,remount /dev/nvme0n1p3


mount -o rw,remount [磁盘分区]

错误编号 KrD-22626-0f02

lvm2固件丢失问题

报错简介

W: Possible missing firmware /lib/firmware/i915/skl_guc_69.0.3.bin for modul i915

进行如下命令时触发:

1
2
3
4
5
6
apt-get install lvm2

update-initramfs: Generating /boot/initrd.img-5.18.0-kali2-amd64
W: Possible missing firmware /lib/firmware/i915/skl_guc_69.0.3.bin for module i915
└─# wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/i915/skl_guc_69.0.3.bin

解决方案

参考来自

1、进入如下这个地址,固件文件非常全面,找到适合自己的版本

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/rtl_nic/

2、切换到刚才报缺少固件的目录,下载缺少的文件内容

1
2
cd /lib/firmware/rtl_nic/
sudo wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/rtl_nic/rtl8125a-3.fw

3、再次查看

1
sudo update-initramfs -u

┌──(root💀hostname)-[/lib/firmware/i915]
└─# update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.18.0-kali2-amd64

错误编号 K0C-22630-0f01

postgresql服务启动问题

报错简介

未登录状态,postgresql@14-main.service启动失败.

hostname systemd[1]: postgresql@14-main.service: Can’t open PID file /run/postgresql/14-main.pid (yet?) after start: Operation not permitted
Jun 30 17:16:28 hostnam systemd[1]: postgresql@14-main.service: Failed with result ‘protocol’.

Failed to start PostgreSQL Cluster 14-main.

解决方案

原因1:多版本启动冲突,redis-server服务未启动,依赖缺失

1
2
3
4
5
6
7
8
# 卸载其他版本,此处以@14版本为主举例
apt-get purge postgresql-13 postgresql-client-13
apt-get install postgresql-client-14 postgresql-client-common postgresql-doc

systemctl start redis-server.service
systemctl enable redis-server.service

systemctl restart postgresql@14.main.service

原因2:出现此问题的原因之一是未正确设置区域设置值,或者如果对docker文件使用了以下命令,则会出现此问题,这是不推荐的

pg_ctl:无法启动服务器 invalid value for parameter “lc_messages”: “en_HK.UTF-8”

命令:apt get升级

1
2
3
4
5
6
7
8
运行
localedef -i en_US-f UTF-8 en_US.UTF-8

dpkg-reconfigure locales
选择错误项语言
reboot

systemctl restart postgresql@14.main.service

原因3:private key file权限不正确,导致不能读取或者其他人可访问

FATAL: private key file “/etc/ssl/private/ssl-cert-snakeoil.key” has group or world access

FATAL: could not load private key file “/etc/ssl/private/ssl-cert-snakeoil.key”: SSL error code 2147483661

1
2
3
sudo chmod 710 /etc/ssl/private/
sudo chmod 640 ssl-cert-snakeoil.key
systemctl restart postgresql@14.main.service

错误编号 K0C-22813-0f02

redis-server服务启动问题

报错简介

Failed to start Advanced key-value store.

WARNING supervised by systemd - you MUST set appropriate values for TimeoutStartSec and TimeoutStopSec in your service unit.
oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=31109, just started
Configuration loaded
Could not create server TCP listening socket #:6379: Name or service not known

解决方案

1
2
3
4
5
6
7
8
9
sudo mkdir /var/log/redis 
sudo chown -R redis:redis /var/log/redis

sudo vim /etc/redis/redis.conf
+
bind 0.0.0.0
:wq

systemctl restart redis-server.service

错误编号K0D-22709-0d00

ping域名解析错误

报错简介

ping [域名] 时,报出Temporary failure in name resolution错误

错误详情:

1
2
3
┌──(root💀hostname)-[/home/hostname]
└─# ping baidu.com
ping: baidu.com: Temporary failure in name resolution

重启了networking服务,也没有效果

解决方案

1
2
3
4
5
6
7
8
vim /etc/resolv.conf

# Generated by NetworkManager
nameserver 114.114.114.114
nameserver 8.8.8.8
nameserver 192.168.1.1
nameserver 172.21.0.1

​ 错误得到解决,正常ping通。

错误编号 KrD-22710-0f00

ssh自动断连问题

报错简介

进行ssh远程连接时,一段时间不进行输入导致连接断开终端死锁现象。

解决方案

  1. 客户端

    编辑本地的SSH 配置文件

    1
    2
    3
    4
    5
    6
    vim ~/.ssh/config

    # 最后一行加入
    ServerAliveInterval 120
    # 这行代码会让你的电脑在使用SSH连接服务器时,每隔120s给服务器发送一个“空包”,保持他们的连接

  2. 服务端

    如果你有服务器的超级管理员权限,可以在服务端进行配置,这样就不需要每个客户端都单独配置。

    1
    2
    3
    4
    5
    6
    7
    8
    9
    vim /etc/ssh/sshd_config

    # 添加如下两行
    ClientAliveInterval 120
    ClientAliveCountMax 720

    # 第一行,表示每隔120秒向客户端发送一个“空包”,以保持于客户端的连接。
    # 第二行,表示总共发送720次“空包”,之后断开它们之间的连接,也就是:120秒 × 720 = 86400 秒 = 24小时 后。

    然后重启ssh服务:

    1
    2
    3
    4
    # 三种重启方式
    /etc/init.d/ssh restart
    systemctl restart sshd
    service sshd restart

​ 错误已解决。

错误编号 K0S-22720-0d01

grub引导界面,引导项错误

报错简介

​ 开机进入grub rescue>界面,出现引导错误。

​ 修复引导,重启之后再次进入grub界面。

解决方案

参考链接

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Welcome to grub
grub rescue> ls
(hd1,gpt3),.....
grub rescue> ls (hd2,gpt7)/boot/grub
gurb.cfg ......
grub rescue> set root=(hd2,gpt7)/boot/grub
grub rescue> set prefix=(hd2,gpt7)/boot/grub
grub rescue> insmod normal
grub rescue> normal
....


进入系统之后:
$
update-initramfs -u
update-grub
grub-install /dev/sda
grub-install /boot/grub/grub.cfg

错误编号 K0A-22811-0d01

磁盘挂载验证问题

问题简介

每次登录后,加载其他磁盘文件时,需要进行身份验证,输入密码。

解决方案-参考1-参考2

1
2
3
4
5
6
7
vim /etc/fstab

# <file system> <mount point> \t <type> \t <options> \t <dump> \t <pass>

#/dev/nvme0n1p6 on /media/username/Files type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
UUID=D0FC4C19FC4BF7EC /media/username/Files ntfs defaults,rw,uid=1000,gid=0 0 1

1
sudo blkid 查看分区uuid

错误编号 K0B-22811-0d02

QQ for Linux闪退问题

我的qq for linux版本是v2.0.0-b2(1082)
我linux qq是刚扫完码闪退,删掉~/.config/tencent-qq那个目录就好了

1
2
rm -rf ~/.config/tencent-qq
1

有的时候执行一次还是闪退,需要再删再进qq

错误编号 K0A-22825-0f01

安装卸载微信报错

从uos商店下载了微信安装包weixin-2.1.1.deb

安装时报错,但是可以正常启动

卸载时报错导致不能卸载(卸载原因:群友给了高版本-2.1.4安装包链接)

报错详细信息

1
2
3
4
5
6
7
8
9
└─# dpkg -P weixin                                                                                                                                                                          100 ⨯
(正在读取数据库 ... 系统当前共安装有 572075 个文件和目录。)
正在卸载 weixin (2.1.1) ...
mv: 无法获取'/etc/lsb-release-test' 的文件状态(stat): 没有那个文件或目录
dpkg: 处理软件包 weixin (--purge)时出错:
已安装 weixin 软件包 post-removal 脚本 子进程返回错误状态 1
在处理时有错误发生:
weixin

解决方案-参考

1
2
3
4
5
6
# 本方法可以应用其他软件包的相同报错
sudo vim /var/lib/dpkg/info/*.postrm

# 注释掉相关内容(以下为本次注释)
# mv /etc/lsb-release-test /etc/lsb-release
## 本机没有/etc/...-test 这个目录所以产生如上报错

错误编号 K0S-22825-0d02

kali启动 msf. 时候报错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
msfconsole

/usr/share/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/hrr_rb_ssh-0.4.2/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb:

11: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::NAME

11: warning: previous definition of NAME was here

12: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::PREFERENCE

12: warning: previous definition of PREFERENCE was here

13: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::IDENTIFIER

13: warning: previous definition of IDENTIFIER was here

11: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::NAME

11: warning: previous definition of NAME was here

12: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::PREFERENCE

12: warning: previous definition of PREFERENCE was here

13: warning: already initialized constant HrrRbSsh::Transport::ServerHostKeyAlgorithm::EcdsaSha2Nistp256::IDENTIFIER

13: warning: previous definition of IDENTIFIER was here

......

解决方案:不明

进行apt-get upgrade 后问题自动解决

错误编号 K0S-22825-0d03

postgresql监听端口混乱

问题产生情况及描述

msf进行数据库初始化时不能正常连接数据库

msfdb init

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
└─# msfdb reinit
[i] Database already started
psql: 错误: 连接到套接字"/var/run/postgresql/.s.PGSQL.5432"上的服务器失败:没有那个文件或目录
服务器是否在本地运行并接受该套接字上的连接?
psql: 错误: 连接到套接字"/var/run/postgresql/.s.PGSQL.5432"上的服务器失败:没有那个文件或目录
服务器是否在本地运行并接受该套接字上的连接?
psql: 错误: 连接到套接字"/var/run/postgresql/.s.PGSQL.5432"上的服务器失败:没有那个文件或目录
服务器是否在本地运行并接受该套接字上的连接?
[+] Deleting configuration file /usr/share/metasploit-framework/config/database.yml
[+] Stopping database
[+] Starting database
psql: 错误: 连接到套接字"/var/run/postgresql/.s.PGSQL.5432"上的服务器失败:没有那个文件或目录
服务器是否在本地运行并接受该套接字上的连接?
[+] Creating database user 'msf'
Error: PostgreSQL version 13 is not installed
psql: 错误: 连接到套接字"/var/run/postgresql/.s.PGSQL.5432"上的服务器失败:没有那个文件或目录
服务器是否在本地运行并接受该套接字上的连接?
[+] Creating databases 'msf'
Error: PostgreSQL version 13 is not installed
psql: 错误: 连接到套接字"/var/run/postgresql/.s.PGSQL.5432"上的服务器失败:没有那个文件或目录
服务器是否在本地运行并接受该套接字上的连接?
[+] Creating databases 'msf_test'
Error: PostgreSQL version 13 is not installed
[+] Creating configuration file '/usr/share/metasploit-framework/config/database.yml'
[+] Creating initial database schema
rake aborted!
ActiveRecord::ConnectionNotEstablished: connection to server at "::1", port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?

重启数据库服务无果

重新配置端口报错

1
2
3
4
└─# psql -p 5432     
psql: 错误: 连接到套接字"/var/run/postgresql/.s.PGSQL.5432"上的服务器失败:没有那个文件或目录
服务器是否在本地运行并接受该套接字上的连接?

解决方案

2022-09-05 11:40:20 解决

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
vim /etc/postgresql/14/main/start.conf

:set nu => 64
port = 5432
:wq

systemctl restart postgresql*
systemctl status postgresql*


└─# msfdb reinit
[i] Database already started
[+] Deleting configuration file /usr/share/metasploit-framework/config/database.yml
[+] Stopping database
[+] Starting database
[+] Creating database user 'msf'
为新角色输入的口令:
再输入一遍:
[+] Creating databases 'msf'
[+] Creating databases 'msf_test'
[+] Creating configuration file '/usr/share/metasploit-framework/config/database.yml'
[+] Creating initial database schema

msf6 > db_status
[*] Connected to msf. Connection type: postgresql.
# 问题至此解决
# psql仍然报错,暂时认为普通用户没有权限

错误编号 K0S-22825-0b05

ClamAv-daemon运行失败×2

1、本地机服务启动无反映

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
└─# systemctl status clamav-daemon.service 
○ clamav-daemon.service - Clam AntiVirus userspace daemon
Loaded: loaded (/lib/systemd/system/clamav-daemon.service; disabled; preset: disabled)
Drop-In: /etc/systemd/system/clamav-daemon.service.d
└─extend.conf
Active: inactive (dead)
Condition: start condition failed at Fri 2022-08-26 22:21:11 HKT; 14min ago
└─ ConditionPathExistsGlob=/var/lib/clamav/main.{c[vl]d,inc} was not met
Docs: man:clamd(8)
man:clamd.conf(5)
https://docs.clamav.net/

8月 26 22:19:12 kaming systemd[1]: /lib/systemd/system/clamav-daemon.service:12: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing>
8月 26 22:19:13 kaming systemd[1]: /lib/systemd/system/clamav-daemon.service:12: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing>
8月 26 22:20:52 kaming systemd[1]: /lib/systemd/system/clamav-daemon.service:12: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing>
8月 26 22:21:11 kaming systemd[1]: Clam AntiVirus userspace daemon was skipped because of a failed condition check (ConditionPathExistsGlob=/var/lib/clamav/main.{c[vl]d,inc}).

原因&解决方案

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#  /var/lib/clamav/main.cvd daily.cvd 文件缺失
scp root@enxm:/var/lib/clamav/*cvd /var/lib/clamav/
systemctl restart clamav-daemon.service
systemctl status clamav-daemon.service
└─# systemctl status clamav-daemon.service
● clamav-daemon.service - Clam AntiVirus userspace daemon
Loaded: loaded (/lib/systemd/system/clamav-daemon.service; disabled; preset: disabled)
Drop-In: /etc/systemd/system/clamav-daemon.service.d
└─extend.conf
Active: active (running) since Fri 2022-08-26 22:49:29 HKT; 1s ago
Docs: man:clamd(8)
man:clamd.conf(5)
https://docs.clamav.net/
Process: 245271 ExecStartPre=/bin/mkdir -p /run/clamav (code=exited, status=0/SUCCESS)
Process: 245272 ExecStartPre=/bin/chown clamav /run/clamav (code=exited, status=0/SUCCESS)
Main PID: 245273 (clamd)
Tasks: 1 (limit: 18739)
Memory: 130.7M
CPU: 1.450s
CGroup: /system.slice/clamav-daemon.service
└─245273 /usr/sbin/clamd --foreground=true

8月 26 22:49:29 kaming systemd[1]: Starting Clam AntiVirus userspace daemon...
8月 26 22:49:29 kaming systemd[1]: Started Clam AntiVirus userspace daemon.

2、在服务器上启动服务失败

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
➜  clamav systemctl status clamav-daemon.service 
● clamav-daemon.service - Clam AntiVirus userspace daemon
Loaded: loaded (/lib/systemd/system/clamav-daemon.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/clamav-daemon.service.d
└─extend.conf
Active: failed (Result: signal) since Fri 2022-08-26 22:33:10 CST; 11min ago
Docs: man:clamd(8)
man:clamd.conf(5)
https://docs.clamav.net/
Process: 23991 ExecStart=/usr/sbin/clamd --foreground=true (code=killed, signal=KILL)
Main PID: 23991 (code=killed, signal=KILL)

Aug 26 22:33:11 VM-4-17-ubuntu clamd[23991]: LibClamAV Error: mpool_malloc(): Can't allocate memory (33558528 bytes).

# 解决方案:
systemctl restart clamav-daemon.service

错误编号 K0S-22910-0b01

Gvm-openvas服务启动报出权限问题*

报错简介

openvas报错

init_openvas: Can not open or create log file or directory. Please check permissions of log files listed in /etc/openvas/openvas_log.conf.

gvm-check-setup

└─# gvm-check-setup
gvm-check-setup 21.4.3
Test completeness and readiness of GVM-21.4.3
Step 1: Checking OpenVAS (Scanner)…
OK: OpenVAS Scanner is present in version 21.4.4.
ERROR: No CA certificate file for Server found.
FIX: Run ‘sudo runuser -u _gvm – gvm-manage-certs -a -f’.

ERROR: Your GVM-21.4.3 installation is not yet complete!

Please follow the instructions marked with FIX above and run this
script again.

解决方案

1
2
# openvas报错:
chmod 666 /var/log/gvm/openvas.log

错误编号 K0S-22X11-0b01

问题简介

Linux上安装vmware

参考方案

解决方案

1
2
3
4
5
6
7
8
9
10
11
12
13
mkdir -p /tmp/patch-vmware
cd /tmp/patch-vmware
git clone https://github.com/mkubecek/vmware-host-modules.git
cd vmware-host-modules
git checkout origin.workstation-16.2.4
git fetch
make
sudo make install

sudo rm /usr/lib/vmware/lib/libz.so.1
sudo ln -s /lib/x86_64-linux-gnu/libz.so.1 /usr/lib/vmware/lib/libz.so.1

sudo /etc/init.d/vmware restart

没有编制的小家伙们

尚未编入的错误

此栏目包括:已经遇到但是尚未解决的错误、可能即将会遇到的错误、其他师傅遇到的错误详解

​ VMware 报错:可能会用到

Ubuntu NVIDIA显卡驱动工作模式切换,无法检测到笔记本自带屏幕,屏幕无法工作/黑屏


移除i386架构

参考

1
2
3
4
5
6
7
8
9
10
└─# dpkg --remove-architecture i386                                                                                                                        2 ⨯
dpkg: 错误: 无法移除体系结构 i386 ,当前它仍被数据库使用
E: 不允许移除系统必需的关键软件包。这么做可能损坏系统。

dpkg --force all -P

dpkg --remove-architecture i386

dpkg --get-selections | awk '/i386/{print $1}'
apt-get remove --purge `dpkg --get-selections | awk '/i386/{print $1}'`

**auth.log大量出现报错 **

auth.log

大量出现pam_unix(cron:session): session opened for user root by (uid=0)解决办法

参考


wine中中文字体方框

解决[参考]

尚未解决的问题

此栏目包括:目前阶段正在解决的问题,遇到但是还未着手解决的问题# – 不包括造成不良影响的错误

双屏幕登录(display-greeter-setting)界面问题 2022-06~至今

物理机硬件:

​ 型号:Dell-G5 5590(笔记本)

​ CPU:i7-9750H (intel UHD Graphics 630) Core:12 Speed:2.60GHz

​ GPU:NVIDIA GeForce GTX 1660 Ti Mobile

系统:

​ Kali GNU/Linux Rolling

​ kernel:5.18.0-kali2-amd64

笔记本屏幕:1920×1080-144hz eDP-1-1

外接屏幕:2560×1440-144hz HDMI-0

问题描述:安装nvidia驱动,使外接屏幕获取信号,当外接屏幕不存在是,内置屏幕不会引导登录界面(greeter),修改配置文件可以使内置屏幕引导登录,但是不能使用双屏幕输出。

问题配置文件:/etc/X11/xorg.conf

ACPI error

ACPI error: No pointer back to namespace node in package (20211217/dsargs-301)

当我们在为有独立显卡gpu的电脑安装Ubuntu系统时,有可能会遇到上述的问题。

解决方法一:先把显示器接到集成显卡上,装完系统后,再接到独立显卡gpu,再为gpu配置驱动;

解决方法二:当电脑没有集成显卡时,选择UEFI General …disk进行安装,当安装过程进入到四个选项(try ubuntu, install ubuntu……),点击”e”进入edit mode,找到”quiet splash —“,把“—”换成“nomodeset”,然后F10继续安装;

当安装完成进入系统后, sudo gedit /etc/default/grub,找到GRUB_CMDLINE_LINUX_DEFAULT=quiet splash,然后改成GRUB_CMDLINE_LINUX_DEFAULT=quiet splash nomodeset, 保存文件,然后 sudo update-grub。

触摸板驱动问题

psmouse serio1:synaptics: Unable to initialed device

卸载微信报错—已解决–详细见错误编号K0A-22825-0f01

1
2
3
4
5
6
7
8
9
└─# dpkg -P weixin                                                                                                                                                                          100 ⨯
(正在读取数据库 ... 系统当前共安装有 572075 个文件和目录。)
正在卸载 weixin (2.1.1) ...
mv: 无法获取'/etc/lsb-release-test' 的文件状态(stat): 没有那个文件或目录
dpkg: 处理软件包 weixin (--purge)时出错:
已安装 weixin 软件包 post-removal 脚本 子进程返回错误状态 1
在处理时有错误发生:
weixin

执行多条命令会报出错误

在执行systemctl enable service时会报错

1
2
3
4
insserv: warning: current start runlevel(s) (empty) of script `php8.1-fpm' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `php8.1-fpm' overrides LSB defaults (0 1 6).

insserv: Script `ssh' has overlapping Default-Start and Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.

执行insserv可以查看报错–参考

临时记录已解决的小问题

通过以下命令

1
sudo dmegs

来获取开机引导后的系统消息

Usage:

1
2
Display or control the kernel ring buffer.
显示或控制内核环形缓冲区。

开机grub引导后,出现

x86/64,,,,SGX disable

解决方案:开机通过特殊键进入bios选项设置,将CPU的SGX选项改为enable(当你的cpu支持SGX时)。

通过命令打开图形化文件夹

1
2
3
4
thunar [文件夹]

sudo apt-get install nautilus
nautilus [文件夹]

修改kali系统的语言

1
2
3
4
dpkg-reconfigure locales
空格选择语言
回车OK,等待安装Done
reboot即可

Enable NTP daemon

1
2
3
4
systemctl start ntpsec-rotate-stats.service
systemctl start ntpsec.service
systemctl start ntp.service
# mkdir /var/log/ntpsec

kali-beef-xss面板404

unable to load ‘……’

1
sudo cp -r /var/lib/beef-xss/extensions /usr/share/beef-xss/

cat查看GBK编码文件乱码

1
cat 文件名 | iconv -f GBK -t UTF-8

想用录屏软件–OBS

1、打开终端添加PPA:

2、软件更新

3、安装OBS-studio

4、打开obs

终端输入:obs再回车,即可打开软件

其他录屏软件参考

1
2
3
sudo add-apt-repository ppa:obsproject/obs-studio
sudo apt-get update
sudo apt-get install obs-studio

vim中处于insert模式ESC无效

终止微信进程

1
ps -ef |grep -i weixin|grep -v grep|cut -c 9-16|xargs kill -9

kali上安装与切换java不同版本

参考 - download_jdk8

1
2
3
4
5
6
7
8
9
10
tar -zxvf jdk-8u341-linux-x64.tar.gz
mv jdk1.8.0_341/ /opt


update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_341/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_341/bin/javac 1
update-alternatives --set java /opt/jdk1.8.0_341/bin/java
update-alternatives --set javac /opt/jdk1.8.0_341/bin/javac
update-alternatives --config java

jdk1.7.0_80 error from centos7

1
2
3
4
5
6
7
8
9
10
  Selection    Command
-----------------------------------------------
1 java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.*el7_8.x86_64/jre/bin/java)
* 2 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.*el7_9.x86_64/jre/bin/java)
+ 3 /usr/java/jdk1.7.0_80/bin/java

Enter to keep the current selection[+], or type selection number: 3
[root@localhost alternatives]# java -version
java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

qqmusic闪退

命令行启动程序,报错:
FATAL:gpu_data_manager_impl_private.cc The display compositor is frequently crashing. Goodbye.

尝试命令行加qqmusix --no-sandbox启动成功!
但是不想每次都走命令行启动。

文本编辑其或vim打开/usr/share/applications中的qqmusic.desktop,在其参数,在Exec后加上 –no-sandbox,如下图:
在这里插入图片描述

linux下打开chm文件的方法

参考于

1
sudo apt-get install xchm

Files 挂在出现ntfs报错

重启windows,在回到kali

vscode终端字体间距过大(全角)

  1. 文件-首选项-设置
  2. terminal.integrated.fontFamily 配置为 Consolas, 'Courier New', monospace 或其他想要的字体,或者点击齿轮按钮重置此设置

msf-postgresql报错版本规则问题

1
2
3
4
5
6
7
8
WARNING:  database "msf" has a collation version mismatch
DETAIL: The database was created using collation version 2.35, but the operating system provides version 2.36.
HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE msf REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.

# 解决:

sudo -u postgres psql
postgres=# ALTER DATABASE postgres REFRESH COLLATION VERSION;

来自centos7 的问题

暂时没有单独整理

1、在搭建dvwa时,文件夹及某些文件无法获得写权限–参考

1
setsebool -P httpd_unified 1

2、在搭建dvwa时,无法连接数据库–参考

报错:

1
Could not connect: Can't connect to MySQL server on '127.0.0.1' (13) 2003

解决:

1
2
3
4
getsebool -a | grep httpd
发现 httpd_can_network_connect --> off

setsebool httpd_can_network_connect 1

问题已解决

难题

风扇问题

jianj

fan i8k*

ipmitool ipmitool2

acpi 文件脚本流

minicom 详细