歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> linux backtrack常用命令小結

linux backtrack常用命令小結

日期:2017/3/1 18:03:14   编辑:Linux技術
基本
passwd 修改密碼。

掛載本地分區:
mount /dev/hda1 /mnt/hda1 掛載。
ls -l /mnt/hda1 顯示分區的目錄和文件。

掛載windows網絡共享:
share <user> <targetIP> <remote share>--輸入密碼 掛載share文件。
ls -l /mnt/share/ 顯示內容。
umount /mnt/share 卸載共享

編輯文件:
nano file.sh 創建文件。
ctrl+x 退出。
y 保存。
enter 寫入改變。
chmod 755 file 改變文件權限。
./file.sh 運行腳本

編寫c程序:
gcc -o filename file.c 編譯c代碼。
./filename 運行c程序。

源碼安裝軟件:
tar zxvf program.tar.gz 解壓(bz文件是jxvf參數)
cd program 進入解壓後的目錄。
./configure 配置makefile。
make 編譯。
make install 安裝。

顯卡不支持(vmware)
fix-vesa使用默認顯卡配置。
dpkg-reconfigure xserver-xorg重新配置x服務器。
fix-vesa-vmware使用vmware的顯卡驅動。

切換圖形界面:
dragon 圖形界面選擇工具。
desktop fiuxbox使用fiuxbox桌面。
quit退出。

網絡
動態ip:
ifconfig eth0 up 打開網卡。
dhclient [eth0] dhcp給一個新的ip。
靜態ip:
ifconfig eth0 192.168.0.100/24 設置靜態ip。
route add default gw 192.168.0.1 設置網關。
echo nameserver 192.168.0.1 > /etc/resolv.conf 設置dns。
/etc/network/interfaces靜態ip配置。
auto eth0
iface eth0 inet static
address 192.168.1.112
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
開機自動啟動網絡:
update-rc.d networking defaults
/etc/init.d/networking restart

無線
/etc/init.d/wicd start啟動無線GUI工具
界面啟動:KDE > Internet > Wicd Network Manager
update-rc.d wicd defaults設置開機啟動

服務
apache服務:
apachectl start 打開服務(80端口)
apachectl stop 關閉服務。

ssh服務:
sshd-generate 創建公鑰私鑰(第一次需要)
/etc/init.d/ssh start打開服務(22端口)
/etc/init.d/ssh stop 關閉服務。
ssh user@targetIP 連接ssh服務器。
update-rc.d -f ssh defaults設置開機啟動。

tftp服務:
atftpd --daemon --port 69 /tmp/ 打開tftp(端口69)
pkill tftpd 關閉服務。

vnc服務:
vncserver 打開服務(5901)
pkill Xvnc 關閉服務。

檢查端口監聽:
netstat -ant 顯示tcp監聽端口。
netstat -anu 顯示udp監聽端口。
netstat -ant | grep 22 顯示ssh的狀態。
netstat -anu | grep 69 顯示tftp的狀態。

幫助
man 命令
info 命令
命令--help
命令---h

軟件安裝:
apt命令
apt-get install 軟件名 下載全部依賴關系並安裝。
apt-get remove [--purge] 軟件名 移除軟件包。--purge 指定清除包.
apt-get update 更新安裝源的軟件包目錄。
apt-get upgrade 升級安裝過的所有軟件包。
apt-get dist-upgrade [-u] 和上面個想象要解決依賴關系。
apt-cache search 軟件 搜索軟件包的摘要信息。
apt-cache show 軟件 顯示安裝過的軟件包的完整說明。
apt-cache showpkg 軟件 顯示軟件包的詳細信息和依賴關系。
man apt 查詢apt命令更多的使用。
dpkg命令
dpkg -i 軟件.deb 安裝一個已下載的軟件包。
dpkg -c 軟件.deb 列出deb文件的信息。
dpkg -I 軟件.deb 提取的deb文件包信息。
dpkg -r 軟件.deb 移除一個已安裝的軟件包。
dpkg -P 軟件.deb 完全清除一個已安裝的軟件包(包括配置)
dpkg -L 軟件.deb 流出已經安裝的軟件包。
dpkg -s 軟件.deb 資料顯示已安裝的軟件包。
dpkg-reconfigure 軟件.deb 重新配置已安裝的軟件包。
man dpkg 查詢dpkg命令更多的使用。

內核升級到bt4r2:
apt-get install linux-source
cd /usr/src/
tar jxpf linux-source-2.6.35.8.tar.bz2
rm linux
ln -s linux-source-2.6.35.8 linux
cd linux
cp /boot/config-2.6.35.8 .config
make scripts && make prepare
ln -s /usr/src/linux /lib/modules/2.6.35.8/build
apt-get clean
cd /root/

摘自 acmfly的博客
Copyright © Linux教程網 All Rights Reserved