password
icon
URL
type
date
summary
status
slug
tags
category
很久前,我出了一期termux安装kali linux视频,有很多问题,这次加以记录和整理,总体来说,大多是国际网络问题和linux命令错误,就算实现了国际网络,但你的安装程序不一定通过国际网络进行!如果出现安装错误,多考虑这两个问题。
Video preview
💡
其实网上的教程有很多,方式也各不相同,但综合起来说,可行方案中,其实就三部分。本文章希望用国内网络实现安装,方便实现,全文 已亲自部署!已亲自实验!
1、termux提供基础环境
2、各种不同的脚本方式安装kali
3、vnc可视化连接(可选)
💡
注意!部分命令添加了 “#” 为解释命令所用,请不要复制并粘贴井号及其后面的内容到termux中运行!会造成命令错误!
 
一、Termux环境 1、F-Droid方案 1️⃣ 下载F-Droid
notion image
2️⃣在F-Droid内查询Termux并安装
F-Droid有时可访问,如果遇到网路慢可考虑国际网络,F-Droid更新完数据进行下面Termux安装
 
如网络实在不便,可直接安装termux链接https://pan.baidu.com/s/1tUwn2XeaTE66_nfjBsqMzA 提取码:6666 (termux github版本)
3️⃣开启Termux的后台运行
 
2、配置存储和换源 1️⃣ 开启Termux的系统存储权限
notion image
2️⃣Termux换源
notion image
3、基本工具安装 资料:PRoot 是chroot、 mount --bind 和 binfmt_misc的用户空间实现。这意味着用户不需要任何权限或设置来执行诸如使用任意目录作为新的根文件系统、使文件可在文件系统层次结构中的其他位置访问或通过 QEMU 用户模式透明地执行为另一个 CPU 架构构建的程序等操作。
 
proot是通过使用Linux内核提供的chroot系统调用来创建虚拟环境的。chroot系统调用可以将当前进程的根目录设置为指定的目录,使得该目录成为进程所能访问到的最高级目录。proot利用这一特性,在指定目录下创建一个与主系统隔离的虚拟环境。在该环境中,用户可以执行各种操作,包括安装软件、运行程序等,而不会对主系统造成影响。 在使用proot创建虚拟环境时,需要指定一个根目录。这个根目录可以是一个已存在的目录,也可以是一个新创建的目录。
notion image
notion image
 
notion image
notion image
 
二、Kali Linux第三方脚本方式安装 1、下载安装脚本 为脚本执行进行Python准备,尽可能的减少错误,需要安装Python2、Python3两个版本,以后运行脚本之类的也有用。
notion image
notion image
notion image
 
2、更换apt源
notion image
notion image
 
notion image
3、图形化
 
4、启动VNC客户端连接即可~!
理论上任何VNC客户端都可以,连接时注意地址和端口号。
Nethunter app :https://pan.baidu.com/s/1MbFMtO5UM2PYXvBeipcztA  提取码:6666 复制这段内容打开「百度网盘APP 即可获取」
notion image
notion image
 
5.通过电脑端连接
考虑手机操作不便,尤其是打字的时候很费劲,考虑直接用win或mac连接KaliLinux,但实现起来有难度,据说需要端口转发,不能直接访问,我才用隔山打牛的方法,通过在网络互通的情况下,先访问termux,然后通过termux去操作KaliLinux。
(0)tmux源
(1)安装tigervnc和xfce4
(2)配置参数
 
(3)启动termux VNC,记得记住密码
(4)通过电脑访问。
以上模式和实现kalilinux中的图形化很类似,但是设计兼容性问题很多WM有错误,不好配置,其实还有很多WM可以选择,有想法的朋友都可以试试。
notion image
 
三、报错汇总
💡
为提升安装成功效率,特集合常见安装错误,有错误的朋友请参考解决,如果没有罗列到的,请留言,我会添加进去。
1、Kali Linux的VNC连接失败或灰屏
notion image
notion image
💡
如果上面还是没成功连接图形桌面,还可参考如下几个解决方案: https://blog.csdn.net/xiaokai1999/article/details/129143605 https://blog.csdn.net/kong1287988804/article/details/78614154
 
2、Kali Nethunter未配置DNS报错 报错信息: Failed to fetch http://mirrors.aliyun.com/kali/dists/kali-rolling/InRelease Temporary failure resolving ‘mirrors.aliyun.com’ W: Some index files failed to download. They have been ignored, or old ones used instead. H: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease Temporary failure resolving ‘http.kali.org’ W: Some index files failed to download. They have been ignored, or old ones used instead.
解决命令如下:
vim /etc/resolv.conf #root模式下,所有命令都是 #替换下面图片内容,建议原有的三行注释掉,添加下面三行命令 search localdomain nameserver 223.5.5.5 nameserver 8.8.8.8
3、Kali Nethunter的VNC连接失败 报错信息: failed to execute child process “dbus-launch” (no such file or directory)
解决命令 :apt install dbus-x11
 
4、Kali Linux更新upgrade时postgresql报错 报错信息: mainError: Data directory /var/lib/postgresql/15/main must not be owned by root … failed! E: Sub-process /usr/bin/dpkg returned an error code (1)
#主要是删除postgresql*和重新配置configure sudo apt update && sudo apt full-upgrade -y
sudo rm -rf /var/lib/dpkg/info/postgresql*
sudo dpkg --configure -a
sudo apt update && sudo apt full-upgrade -y 5、Kali未正确关闭VNC session报错 报错信息: vncserver: No matching VNC server running for this user! Linking lock file (/tmp/.X1-lock) in place failed: No such file or directory
#避免经常出现此问题,每次图形化之后logout或vncserver -kill rm -rf /root/.vnc #删除 .vnc下所有文件 rm -rf /tmp #删除tmp下所有文件,包括隐藏文件 .X1-lock .X11-unix 这两个必须删除,然后执行下面命令或vncserver vncserver -depth 24 -geometry 1920x1080 #删tmp下面文件后显示Linking lock file (/tmp/.X1-lock) in place failed: No such file or directory,采取将tmp备份,然后删除tmp创建个空的tmp目录 如果还未解决,可参考其他方案,如下: https://blog.csdn.net/Qwertyuiop2016/article/details/118105155
 
6、Kali的自带Firefox报错 报错信息: Gah Your tab just crashed
解决方案如下: 打开火狐配置 about:config 搜索sandbox 更改如下配置后重启
其他方案如下:
#检测火狐是否开启了系统代理,然后完成上面图片配置更改,如果还不能上网,启动下面命令 vim /etc/NetworkManager/NetworkManager.conf managed=false改成true service networking restart systemctl enable --now NetworkManager #没有NetworkManager 换 network-manager 还没有安装下面的nmcli #上面错误执行下面 apt install nmcli
NetworkManager start #此时 systemctl 将失效 7、Termux的Kali默认没有Systemctl 报错信息: System has not been booted with systemd as init system(PID 1)
apt-get install systemd apt-get install systemctl 后期安装其他工具导致systemctl失效的解决方案如下:
sudo apt-get install aptitude
sudo aptitude install systemctl 8、Kali自带的apache2报错 报错信息: Starting Apache httpd web server: apache2/usr/sbin/apache2ctl: 102: ulimit: error setting limit (Operation not permitted) Setting ulimit failed. See README.Debian for more information. AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using ::1. Set the ‘ServerName’ directive globally to suppress this message (13)Permission denied: AH00072: make_sock: could not bind to address [::]:80 (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down AH00015: Unable to open logs
1️⃣AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using ::1. Set the ‘ServerName’ directive globally to suppress this message
sudo vim /etc/apache2/apache2.conf ServerName localhost:8080 #文件尾添加 2️⃣apache2ctl: 102: ulimit: error setting limit (Operation not permitted)
sudo vim /usr/sbin/apache2ctl ULIMIT_MAX_FILES="${APACHE_ULIMIT_MAX_FILES:-ulimit -n 8192}" #此部分改为ULIMIT_MAX_FILES="" if [ "x$ULIMIT_MAX_FILES" != "x" ] ; then $ULIMIT_MAX_FILES 3️⃣(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down
sudo vim /etc/apache2/ports.conf #改监听端口 #改为 Listen 8080 四、其他参考资料
notion image
1、终端间的VNC连接软件 https://github.com/rustdesk/rustdesk
 
2、Termux后台进程被杀死优化 提示信息: Process completed (signal 9) - press Enter
Android12带GMS的ADB命令如下:
adb shell "/system/bin/device_config set_sync_disabled_for_tests persistent; /system/bin/device_config put activity_manager max_phantom_processes 2147483647" 其他具体操作,参考如下教程: https://www.bilibili.com/read/cv20060713/https://huaweicloud.csdn.net/64e5d7dba3cccc782cc565ca.htmlhttps://blog.csdn.net/m0_72123696/article/details/125349732
 
3、Termux开启Apache2
 
4、Termux开启SSH 不建议在Termux安装的Linux中使用SSH服务,下面教程在termux中操作
 
 

欢迎访问我们的网站和关注我们的公众号,获取最新的技术共享内容、创新想法和安全知识。
微信公众号:黑客驰
notion image

💡
免责声明
本文为技术共享文章,仅有教育交流目的,不构成任何法律或专业建议。读者应自行承担使用该文章所产生的风险和责任。作者和组织不对使用该文章所引起的任何损失或损害负责。
本文严禁提供、讨论或鼓励任何网络安全违法行为。请遵守法律法规,进行合法的技术共享活动。
 
 
WLAN与WiFi 6巧妙解决黑苹果与Windows系统时间不同步
Loading...
黑客驰
黑客驰
对黑客着迷的人💻
公告
公众号
公众号
 
“黑客”一词是由英语Hacker英译出来的,是指专门研究、发现计算机和网络漏洞的计算机爱好者。某些情况下,黑客也可泛指各领域专家。如,游戏黑客,销售黑客等。
 
我们遵守法律,进行教育目的的研究。违法行为请自负后果
 
专门利用计算机进行破坏或入侵他人的人是cracker,翻译成“骇客”,他们不是黑客。
2023-2024 黑客驰.

黑客驰 | 对黑客着迷的人💻

Powered by HyphenTech