banner
44maker

Blog

Kali

Kali#

系統配置#

換源#

sudo vim /etc/apt/sources.list

中科大源

deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib

清華源

deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free

阿里源

deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib

官方源

deb http://http.kali.org/kali kali-rolling main no-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib

完成之後按 esc 再輸入 即保存退出

再進行更新

sudo apt update
sudo apt upgrade -y
sudo apt dist-upgrade -y
sudo reboot now

Root 登錄#

  1. 先修改默認 root 密碼
sudo passwd root
  1. apt-get install kali-root-login命令安裝軟件包。

安裝完成後,輸入命令passwd修改 root 密碼。

init 6重啟後使用 root 登錄。

裝網卡驅動#

sudo apt install realtek-rtl88xxau-dkms -y
sudo apt install dkms -y
git clone https://github.com/aircrack-ng/rtl8812au
cd rtl8812au/
make
sudo make install

檢查一下

lsusb
iwconfig

完成之後測試一下

sudo wifite

顯卡驅動#

部分使用 nvidia 顯卡的計算機在安裝 kali 後會產生缺少驅動不兼容的情況。解決這一問題可參考如下步驟:

apt-cache search linux-image

apt-get install linux-image-xxx linux-header-xxx

init 6

echo -e "blacklist nouveau\noptions nouveau modeset=0\nalias nouveau off" > /etc/modprobe.d/blacklist-nouveau.conf

update-initramfs -u && reboot

apt-get install dkms

下載 nvidia 相應的驅動程序後,用以下命令執行安裝。

./NVIDIA-Linux-x86_64-470.74.run #全部選是即可

安裝驅動後需要編輯一些配置文件

vi /etc/X11/xorg.conf

Section "ServerLayout"
 Identifier "layout"
 Screen 0 "nvidia"
 Inactive "intel"
EndSection

Section "Device"
 Identifier "nvidia"
 Driver "nvidia"
 BusID "PCI:1:0:0"
EndSection

Section "Screen"
 Identifier "nvidia"
 Device "nvidia"
 Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
 Identifier "intel"
 Driver "modesetting"
EndSection

Section "Screen"
 Identifier "intel"
 Device "intel"
EndSection

vi /usr/share/gdm/greeter/autostart/optimus.desktop

[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer

vi /etc/xdg/autostart/optimus.desktop

[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer

init 6

以上命令中,執行apt-cache search linux-image命令可檢索 kali 系統最新版本內核。系統內核是操作系統最基本的部分。在 linux 環境中,某些軟件和驅動在安裝過程中需要調用最新的內核版本。因此我們需要找到最新版本系統內核並安裝升級。

執行apt-get install linux-image-xxx linux-header-xxx命令以安裝 kali 最新版本內核,其中 xxx 代表內核版本。如下圖:

image-20211117210607325

安裝新的內核之後需要重啟電腦,其餘命令按上文順次執行即可。

ssh#

可使用systemctl命令查看和設置 openssh 服務的狀態。

systemctl status sshd.service    #查看ssh狀態
systemctl enable sshd.service    #開啟ssh自啟動
systemctl start sshd.service     #啟動ssh服務
systemctl stop sshd.service      #停止ssh服務

配置免密碼(公私鑰認證)登錄

ssh-keygen命令生成公鑰 / 私鑰對

進入根目錄文件夾內可以看到如下密鑰文件

  id_rsa        #私鑰
  id_rsa.pub    #公鑰

vi /etc/ssh/sshd_config,將文本中有關PubkeyAuthenticationAuthorizedKeysFile的條目修改為如下內容:

PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys

重啟服務

A 機器(客戶機)使用ssh-copy-id [user]@[host]命令拷貝密鑰文件到 B 機器(服務器)。

隨後客戶機訪問服務器,我們會發現直接無密碼登錄。

Tmux#

nano ~/.tmux.conf
#tmux attach 如果無分離終端則新建
new-session
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind ' " '
unbind %
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf; display-message "Config reloaded.."
set -g mouse on
bind V source-file ~/.tmux/layout1         #ctrl b + shift v => change
mkdir ~/.tmux
nano ~/.tmux/layout1
selectp -t 0 # select the first (0) pane
splitw -v -p 50 # split it into two halves


selectp -t 1 # select the new, second (1) pane
splitw -h -p 50 # split it into two halves
selectp -t 0 # go back to the first pane

常用軟件#

sublime-text#

通過 apt 工具在線下載安裝 Sublime Text,包括 x86_64 版本和 ARM 64 版本。

安裝 GPG 密鑰:

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -

確定 apt 可用 https:

sudo apt-get install apt-transport-https

選擇一個可用版本:

穩定版本

echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list

開發版本:

echo "deb https://download.sublimetext.com/ apt/dev/" | sudo tee /etc/apt/sources.list.d/sublime-text.list

更新 apt 軟件列表並安裝 sublime-text:

sudo apt-get update
sudo apt-get install sublime-text

中文輸入法#

sudo apt install fcitx
sudo apt-get install fcitx-googlepinyin
reboot

點擊桌面右上角輸入法圖標,點擊 Configure

去掉 Only Show Current Language, 選中 Google Pinyin,OK

ctrl+空格切換

Firefox 瀏覽器調優#

MozillaFirefox,中文俗稱 “火狐”,是一個由 Mozilla 開發的自由及開放源代碼的網頁瀏覽器。它自帶於 kali 系統中,在使用之前我們需要對部分功能進行調整。

image
image
image
image
image

firefox 關閉 success.txt 及開啟插件安裝#

打開瀏覽器,在地址欄輸入about:config
在 search 那一行輸入 network.security.ports.banned.override,新建一個,選擇字符串,值填寫0-65535
在 search 那一行輸入 xpinstall.signatures,將 xpinstall.signatures.required 那一行雙擊改為 false

image

更新 Firefox 瀏覽器#

在命令終端執行apt-get install firefox-esr命令可將 Firefox 瀏覽器升級到最新版本。

安裝 Chrome 瀏覽器#

雙瀏覽器更符合信息安全工作的需要,因此我們再加裝一款谷歌瀏覽器。

apt-get install chromium
vim /usr/share/applications/chromium.desktop
Exec=/usr/bin/chromium --no-sandbox %U

執行vi /usr/share/applications/chromium.desktop命令後,將文本中Exec一行改為如下內容:

image

typora 需要執行如下命令:

wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -
add-apt-repository 'deb https://typora.io/linux ./'
apt-get update
apt-get install typora
vim /usr/share/applications/typora.desktop
修改exec為:/usr/bin/typora --no-sandbox

flameshot 截圖工具安裝#

截圖功能是編寫學習筆記和滲透測試報告時所必須的,在 kali 中我們可以安裝一款名為 flameshot 的截圖工具。

安裝:

sudo apt-get install flameshot

設置快捷鍵:

image
image
image

設置完成後,按Ctrl+Alt+A即可截圖。

常用工具#

信息收集工具#

Rustscan#

Rustscan 是一個快速的端口掃描工具

去下載 deb 包 👉 https://github.com/RustScan/RustScan/releases

wget https://github.com/RustScan/RustScan/releases/download/2.0.1/rustscan_2.0.1_amd64.deb

在下載文件夾中打開終端輸入dpkg -i

wget https://github.com/RustScan/RustScan/releases/download/2.0.1/rustscan_2.0.1_amd64.deb
chmod +x rustscan_2.0.1_amd64.deb
sudo dpkg -i rustscan_2.0.1_amd64.deb

安裝完成

使用方式

rustscan -b 30 -a 目標  -q

feroxbuster#

sudo apt install feroxbuster -y

gobuster#

sudo apt install gobuster -y

steghide#

sudo apt install steghide -y

xray#

提權工具#

pspy#

在目標主機下載

  • 32 bit big, static version: pspy32 download
  • 64 bit big, static version: pspy64 download
  • 32 bit small version: pspy32s download
  • 64 bit small version: pspy64s download
chmod 777 pspy64
./pspy64

linpeas#

https://github.com/carlospolop/PEASS-ng/releases/latest

fscan#

載入中......
此文章數據所有權由區塊鏈加密技術和智能合約保障僅歸創作者所有。