linux backtrack常用命令小結(jié)
發(fā)布日期:2022-03-24 18:32 | 文章來(lái)源:gibhub
基本
passwd 修改密碼。
掛載本地分區(qū):
mount /dev/hda1 /mnt/hda1 掛載。
ls -l /mnt/hda1 顯示分區(qū)的目錄和文件。
掛載windows網(wǎng)絡(luò)共享:
share <user> <targetIP> <remote share>--輸入密碼 掛載share文件。
ls -l /mnt/share/ 顯示內(nèi)容。
umount /mnt/share 卸載共享
編輯文件:
nano file.sh 創(chuàng)建文件。
ctrl+x 退出。
y 保存。
enter 寫入改變。
chmod 755 file 改變文件權(quán)限。
./file.sh 運(yùn)行腳本
編寫c程序:
gcc -o filename file.c 編譯c代碼。
./filename 運(yùn)行c程序。
源碼安裝軟件:
tar zxvf program.tar.gz 解壓(bz文件是jxvf參數(shù))
cd program 進(jìn)入解壓后的目錄。
./configure 配置makefile。
make 編譯。
make install 安裝。
顯卡不支持(vmware)
fix-vesa使用默認(rèn)顯卡配置。
dpkg-reconfigure xserver-xorg重新配置x服務(wù)器。
fix-vesa-vmware使用vmware的顯卡驅(qū)動(dòng)。
切換圖形界面:
dragon 圖形界面選擇工具。
desktop fiuxbox使用fiuxbox桌面。
quit退出。
網(wǎng)絡(luò)
動(dòng)態(tài)ip:
ifconfig eth0 up 打開網(wǎng)卡。
dhclient [eth0] dhcp給一個(gè)新的ip。
靜態(tài)ip:
ifconfig eth0 192.168.0.100/24 設(shè)置靜態(tài)ip。
route add default gw 192.168.0.1 設(shè)置網(wǎng)關(guān)。
echo nameserver 192.168.0.1 > /etc/resolv.conf 設(shè)置dns。
/etc/network/interfaces靜態(tài)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
開機(jī)自動(dòng)啟動(dòng)網(wǎng)絡(luò):
update-rc.d networking defaults
/etc/init.d/networking restart
無(wú)線
/etc/init.d/wicd start啟動(dòng)無(wú)線GUI工具
界面啟動(dòng):KDE > Internet > Wicd Network Manager
update-rc.d wicd defaults設(shè)置開機(jī)啟動(dòng)
服務(wù)
apache服務(wù):
apachectl start 打開服務(wù)(80端口)
apachectl stop 關(guān)閉服務(wù)。
ssh服務(wù):
sshd-generate 創(chuàng)建公鑰私鑰(第一次需要)
/etc/init.d/ssh start打開服務(wù)(22端口)
/etc/init.d/ssh stop 關(guān)閉服務(wù)。
ssh user@targetIP 連接ssh服務(wù)器。
update-rc.d -f ssh defaults設(shè)置開機(jī)啟動(dòng)。
tftp服務(wù):
atftpd --daemon --port 69 /tmp/ 打開tftp(端口69)
pkill tftpd 關(guān)閉服務(wù)。
vnc服務(wù):
vncserver 打開服務(wù)(5901)
pkill Xvnc 關(guān)閉服務(wù)。
檢查端口監(jiān)聽:
netstat -ant 顯示tcp監(jiān)聽端口。
netstat -anu 顯示udp監(jiān)聽端口。
netstat -ant | grep 22 顯示ssh的狀態(tài)。
netstat -anu | grep 69 顯示tftp的狀態(tài)。
幫助
man 命令
info 命令
命令--help
命令---h
軟件安裝:
apt命令
apt-get install 軟件名 下載全部依賴關(guān)系并安裝。
apt-get remove [--purge] 軟件名 移除軟件包。--purge 指定清除包.
apt-get update 更新安裝源的軟件包目錄。
apt-get upgrade 升級(jí)安裝過的所有軟件包。
apt-get dist-upgrade [-u] 和上面?zhèn)€想象要解決依賴關(guān)系。
apt-cache search 軟件 搜索軟件包的摘要信息。
apt-cache show 軟件 顯示安裝過的軟件包的完整說明。
apt-cache showpkg 軟件 顯示軟件包的詳細(xì)信息和依賴關(guān)系。
man apt 查詢apt命令更多的使用。
dpkg命令
dpkg -i 軟件.deb 安裝一個(gè)已下載的軟件包。
dpkg -c 軟件.deb 列出deb文件的信息。
dpkg -I 軟件.deb 提取的deb文件包信息。
dpkg -r 軟件.deb 移除一個(gè)已安裝的軟件包。
dpkg -P 軟件.deb 完全清除一個(gè)已安裝的軟件包(包括配置)
dpkg -L 軟件.deb 流出已經(jīng)安裝的軟件包。
dpkg -s 軟件.deb 資料顯示已安裝的軟件包。
dpkg-reconfigure 軟件.deb 重新配置已安裝的軟件包。
man dpkg 查詢dpkg命令更多的使用。
內(nèi)核升級(jí)到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的博客
passwd 修改密碼。
掛載本地分區(qū):
mount /dev/hda1 /mnt/hda1 掛載。
ls -l /mnt/hda1 顯示分區(qū)的目錄和文件。
掛載windows網(wǎng)絡(luò)共享:
share <user> <targetIP> <remote share>--輸入密碼 掛載share文件。
ls -l /mnt/share/ 顯示內(nèi)容。
umount /mnt/share 卸載共享
編輯文件:
nano file.sh 創(chuàng)建文件。
ctrl+x 退出。
y 保存。
enter 寫入改變。
chmod 755 file 改變文件權(quán)限。
./file.sh 運(yùn)行腳本
編寫c程序:
gcc -o filename file.c 編譯c代碼。
./filename 運(yùn)行c程序。
源碼安裝軟件:
tar zxvf program.tar.gz 解壓(bz文件是jxvf參數(shù))
cd program 進(jìn)入解壓后的目錄。
./configure 配置makefile。
make 編譯。
make install 安裝。
顯卡不支持(vmware)
fix-vesa使用默認(rèn)顯卡配置。
dpkg-reconfigure xserver-xorg重新配置x服務(wù)器。
fix-vesa-vmware使用vmware的顯卡驅(qū)動(dòng)。
切換圖形界面:
dragon 圖形界面選擇工具。
desktop fiuxbox使用fiuxbox桌面。
quit退出。
網(wǎng)絡(luò)
動(dòng)態(tài)ip:
ifconfig eth0 up 打開網(wǎng)卡。
dhclient [eth0] dhcp給一個(gè)新的ip。
靜態(tài)ip:
ifconfig eth0 192.168.0.100/24 設(shè)置靜態(tài)ip。
route add default gw 192.168.0.1 設(shè)置網(wǎng)關(guān)。
echo nameserver 192.168.0.1 > /etc/resolv.conf 設(shè)置dns。
/etc/network/interfaces靜態(tài)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
開機(jī)自動(dòng)啟動(dòng)網(wǎng)絡(luò):
update-rc.d networking defaults
/etc/init.d/networking restart
無(wú)線
/etc/init.d/wicd start啟動(dòng)無(wú)線GUI工具
界面啟動(dòng):KDE > Internet > Wicd Network Manager
update-rc.d wicd defaults設(shè)置開機(jī)啟動(dòng)
服務(wù)
apache服務(wù):
apachectl start 打開服務(wù)(80端口)
apachectl stop 關(guān)閉服務(wù)。
ssh服務(wù):
sshd-generate 創(chuàng)建公鑰私鑰(第一次需要)
/etc/init.d/ssh start打開服務(wù)(22端口)
/etc/init.d/ssh stop 關(guān)閉服務(wù)。
ssh user@targetIP 連接ssh服務(wù)器。
update-rc.d -f ssh defaults設(shè)置開機(jī)啟動(dòng)。
tftp服務(wù):
atftpd --daemon --port 69 /tmp/ 打開tftp(端口69)
pkill tftpd 關(guān)閉服務(wù)。
vnc服務(wù):
vncserver 打開服務(wù)(5901)
pkill Xvnc 關(guān)閉服務(wù)。
檢查端口監(jiān)聽:
netstat -ant 顯示tcp監(jiān)聽端口。
netstat -anu 顯示udp監(jiān)聽端口。
netstat -ant | grep 22 顯示ssh的狀態(tài)。
netstat -anu | grep 69 顯示tftp的狀態(tài)。
幫助
man 命令
info 命令
命令--help
命令---h
軟件安裝:
apt命令
apt-get install 軟件名 下載全部依賴關(guān)系并安裝。
apt-get remove [--purge] 軟件名 移除軟件包。--purge 指定清除包.
apt-get update 更新安裝源的軟件包目錄。
apt-get upgrade 升級(jí)安裝過的所有軟件包。
apt-get dist-upgrade [-u] 和上面?zhèn)€想象要解決依賴關(guān)系。
apt-cache search 軟件 搜索軟件包的摘要信息。
apt-cache show 軟件 顯示安裝過的軟件包的完整說明。
apt-cache showpkg 軟件 顯示軟件包的詳細(xì)信息和依賴關(guān)系。
man apt 查詢apt命令更多的使用。
dpkg命令
dpkg -i 軟件.deb 安裝一個(gè)已下載的軟件包。
dpkg -c 軟件.deb 列出deb文件的信息。
dpkg -I 軟件.deb 提取的deb文件包信息。
dpkg -r 軟件.deb 移除一個(gè)已安裝的軟件包。
dpkg -P 軟件.deb 完全清除一個(gè)已安裝的軟件包(包括配置)
dpkg -L 軟件.deb 流出已經(jīng)安裝的軟件包。
dpkg -s 軟件.deb 資料顯示已安裝的軟件包。
dpkg-reconfigure 軟件.deb 重新配置已安裝的軟件包。
man dpkg 查詢dpkg命令更多的使用。
內(nèi)核升級(jí)到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的博客
版權(quán)聲明:本站文章來(lái)源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來(lái)源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來(lái)源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來(lái),僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。
相關(guān)文章
關(guān)注官方微信