1, sensitive directory and Linux basic commands

Linux common commands
who view the current user
whoami displayed on linux currently logged in user
clear clean up the terminal screen
exit to exit
by default creates bang group when useradd bang to create a user and then bang the user to join
passwd bang password
userdel bang delete a user
groupadd test create a group
gpasswd -a username user1 user group name to add to the test group of users
groups bang View user's group
gpasswd -d a gROUP delete
last display last logged on user

View server version:
CAT / etc / Issue
CAT / etc / * - Release

Sensitive files
cat / etc / passwd / store all user information
cat / etc / shadow to store user password information
cat / etc / group group of files
cat ~ / .bash_history command history log file
grep -i pass [filename] Find user names stored in plain text password
find.-name ". * php " -print0 | xargs -0 grep -i -n "var $ password" Finding password file

ls-l view the file permissions
d represents the folder

  • On behalf of a common document
    file permissions three fields each field there are three characters represent the permissions
    three fields corresponding to the three corresponding rights object
    root privileges (for all file permissions) root group permissions other people permission to
    r: read read take w: write write x: execute execution
    - do not have permission on behalf of
    touch to create a file echo write something >> file location to write files

su switch user
chmod modify write permission
chmod u + w filename
o behalf of the owner for all modified to have write permission
chmod g + w filename
g represents the group
chmod o + w filename
o behalf of someone else
chmod A + w
A representative of all person / group / others
rm file name to delete files the Remove
(file can not be deleted is whether the file directory has write access)

Looking sensitive directory
find / -writable -type d 2> / dev / null writable directory
find / -perm -222 -type d 2> / dev / null writable directory
find / -perm -ow -type d 2> / dev / null writable directory
find / -perm -ox -type d 2> / dev / null executable directory
find / (- perm -ow -perm -ox ) -type d 2> / dev / null write executables
find files Find command
(phpstudy)

Guess you like

Origin blog.csdn.net/qq_35811830/article/details/90216512