The VX-Files
The VX-Files
  • README.txt
  • For updates, questions, suggestions or just chatting: @malcrvz
  • Download your own local copy or check my other libre projects: Github/malcrvz
  • 📕Cybersecurity Theory
    • Index
      • Malware types
        • Viruses, worms and Trojans
        • Backdoors, Rootkits and Spyware
        • Botnets, DDoS and Spammer
        • Ransomware
        • Scareware and Adware/PUP/PUA
        • Downloaders and Launchers
        • Hacktool
        • APT - Advanced Persistent Threat
      • Social engineering techniques
        • Phishing
        • Pretexting
        • Baiting
        • Quid pro quo
        • Tailgating
      • Cryptography
        • Hash functions
        • Symmetric, Asymmetric and Hybrid cryptography
        • Digital signatures & Digital certificates
        • TLS Protocol
      • Pentesting methodology & Techniques
        • CIA Triad - Confidentiality, Integrity & Availability
        • The methodology steps
        • Pre-Engagement
        • Information Gathering
          • HTTP status codes
          • robots.txt
        • Vulnerability Assessment
        • Exploitation
          • Password cracking
        • Post-Exploitation & Persistence
          • Types of Shells
        • Privilege Escalation & Lateral Movement
        • Reporting & Remediation
  • 🐧Linux Essentials
    • Index
      • 1, 0, bits, Bytes: Units of digital information
      • User management
      • Packet management
      • Privileges & sudo
      • Passwd & Shadow files
      • Managing files, links and regex
      • find
      • Terminal/TTY
      • SSH
  • 🪟Windows Essentials
    • Index
      • CLI user management
      • CMD File management
  • 🌍Networking Essentials
    • Index
      • Windows CLI IP management
      • Linux IP management
      • Linux CLI Wi-Fi connection
  • 🕸️Network Pentesting
    • Tools
      • 1. Pre-Engagement
        • OpenVPN
      • 2. Information gathering
        • cURL & wget
        • Nmap
        • arp
        • Netcat
        • whatweb
      • 3. Vulnerability assessment
        • smbclient
      • 4. Exploitation
        • Metasploit
        • Hashcat
        • John the Ripper
      • 5. Post-Exploitation & Persistence
        • SSH
      • 6. Privilege escalation & Lateral movement
        • Possible privilege escalation vectors - Auto-enumeration scripts
      • 7. Reporting & Remediation
    • Techniques
      • Upgrade reverse shell to interactive
      • Transferring files to/from remote victim
      • Possible privilege escalation vectors - Manual checklist
    • Resources
      • Manufacturer default passwords lists
        • IP Cameras
      • Get Shells
  • 💉Web App pentesting
    • Tools
      • CeWL
      • Gobuster
      • whatweb
    • Techniques
      • Command injection
    • Resources
      • Reverse Shells
      • Bind Shells
  • 📡Wireless pentesting
    • Tools
    • Techniques
    • Resources
  • 🔓On-Premises Pentesting
    • Tools
    • Techniques
      • Removing Linux user passwords
      • Removing Windows user passwords
    • Resources
  • 💽Disks & Forensics
    • Index
      • Getting a disk ready
      • Inodes & Sectors
      • Recover deleted files
      • BUILDING - Secure file deletion
  • 🕷️Bash scripts
    • coming soon
  • ⚡PowerShell Scripts
    • coming soon
  • 🟩HTB Walkthroughs
    • coming soon
  • 🏴‍☠️External Resources
    • Schools
    • Books & Wikis
    • Utilities
    • Interactive cheat sheets
    • Wordlists
Powered by GitBook
On this page
  • Syntax
  • Configure password policies
  1. Linux Essentials
  2. Index

User management

Syntax

useradd -m -s /bin/bash UserX           #Creates user, -m gives home directory and -s gives default shell
passwd UserX                            #Gives password to a user  ?To not give it by insecure plaintext, we first create the user, then use the passwd command on the new user
chage -M n UserX                        #Makes the password expire in n days for UserX
chage -l UserX                          #Shows password caducity configuration
chage -d 0 UserX                        #Forces to change password in next login
chage -m n UserX                        #Configures n days before user can change password again
adduser UserX                           #Creates user but step by step, easier
id UserX                                #Prints user ID and GID (Group ID)
su UserY                                #Changes user
deluser --remove-home UserX             #Removes user and files in home directory
userdel -r UserX                        #Removes user and files in home directory
cat /etc/group                          #File with all groups and its users in the system
getent group GroupX                     #Shows users in a group
getent group sudo                       #Check users with sudo privileges
usermod -aG GroupX UserX                #Adds user to a group
sudo usermod -aG sudo UserX             #Give sudo privileges to a user
gpasswd -d UserX GroupX                 #Removes user from group
usermod -G GroupY,GroupZ UserX          #Overwrites user to specified groups and removes it from others not listed  ?For example if he was on GroupX he would be removed and added to GroupY and GroupZ

Configure password policies

Using sudowill ignore all policies

#libpam-pwquality configuration file
sudo nano /etc/security/pwquality.conf         #Configuration file for pass polcies
minlen = n                                     #Minimum lenght for new passwords
ucredit = -n                                   #Minimum upper characters  ?ucredit = -2 would mean at least 2
dcreit = -n                                    #Minimum digits 
ocredit = -n                                   #Minimum others/symbols
badwords = P@ssword Passw0rd iloveyou          #Prohibits specified passwords
remember = n                                   #Prohibits using N last passwords used

Last updated 1 year ago

🐧