Who are you? Who is logged in? Who has been logged in? Who else is there? Who can do what?
123456789
id
who
w
last
cat /etc/passwd | cut -d: -f1 # List of usersgrep -v -E "^#" /etc/passwd | awk -F: '$3 == 0 { print $1}'# List of super usersawk -F: '($3 == "0") {print}' /etc/passwd # List of super userscat /etc/sudoers
sudo -l
What sensitive files can be found?
1234
cat /etc/passwd
cat /etc/group
cat /etc/shadow
ls -alh /var/mail/
Anything "interesting" in the home directorie(s)? If it's possible to access
12
ls -ahlR /root/
ls -ahlR /home/
Are there any passwords in; scripts, databases, configuration files or log files? Default paths and locations for passwords
ls -alh /var/log
ls -alh /var/mail
ls -alh /var/spool
ls -alh /var/spool/lpd
ls -alh /var/lib/pgsql
ls -alh /var/lib/mysql
cat /var/lib/dhcp3/dhclient.leases
Any settings/files (hidden) on website? Any settings file with database information?
12345
ls -alhR /var/www/
ls -alhR /srv/www/htdocs/
ls -alhR /usr/local/www/apache22/data/
ls -alhR /opt/lampp/htdocs/
ls -alhR /var/www/html/
Is there anything in the log file(s) (Could help with "Local File Includes"!)
What "Advanced Linux File Permissions" are used? Sticky bits, SUID & GUID
123456789
find / -perm -1000 -type d 2>/dev/null # Sticky bit - Only the owner of the directory or the owner of a file can delete or rename here.find / -perm -g=s -type f 2>/dev/null # SGID (chmod 2000) - run as the group, not the user who started it.find / -perm -u=s -type f 2>/dev/null # SUID (chmod 4000) - run as the owner, not the user who started it.find / -perm -g=s -o -perm -u=s -type f 2>/dev/null # SGID or SUIDfor i in `locate -r "bin$"`;do find $i\( -perm -4000 -o -perm -2000 \) -type f 2>/dev/null;done# Looks in 'common' places: /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin and any other *bin, for SGID or SUID (Quicker search)# find starting at root (/), SGID or SUID, not Symbolic links, only 3 folders deep, list with more detail and hide any errors (e.g. permission denied)find / -perm -g=s -o -perm -4000 ! -type l -maxdepth 3 -exec ls -ld {}\; 2>/dev/null
Where can written to and executed from? A few 'common' places: /tmp, /var/tmp, /dev/shm
1234567
find / -writable -type d 2>/dev/null # world-writeable foldersfind / -perm -222 -type d 2>/dev/null # world-writeable foldersfind / -perm -o w -type d 2>/dev/null # world-writeable foldersfind / -perm -o x -type d 2>/dev/null # world-executable foldersfind / \( -perm -o w -perm -o x \) -type d 2>/dev/null # world-writeable & executable folders
Any "problem" files? Word-writeable, "nobody" files
Commands on Linux-like operating systems are either built-ins or external commands. The former are part of the shell. The latter consist of both executables, which are programs that have been written in a programming language (e.g., C, C++, Java or Python) and then compiled into a binary, and shell scripts. Note: A command is an instruction given by a user telling a computer to do something, such a run a single program or a group of linked programs.: SYSTEM INFORMATION # Display Linux system information uname -a # Display kernel release information uname -r # Show which version of redhat installed cat /etc/redhat-release # Show how long the system has been running + load uptime # Show system host name hostname # Display the IP addresses of the host hostname -I # Show system reboot history last reboot # Show the current date and time date # Show this month's calendar cal # Display who is online w # Who you are logged in as whoami HARDWARE INFORMATION # Display messages in ke...
Table of Contents HTTP Starting the Server Downloading the files FTP Starting the Server Downloading the files TFTP Starting the Server Downloading the Files SMB Setting up the Server Copying the Files Summary Often times on an engagement I find myself needing to copy a tool or a payload from my Kali linux attack box to a compromised Windows machine. As a perfect example, on a recent pentest, I found a vulnerable ColdFusion server and was able to upload a CFM webshell. It was a very limited, non-interactive shell and I wanted to download and execute a reverse Meterpreter binary from my attack machine. I generated the payload with Veil but needed a way to transfer the file to the Windows server running ColdFusion through simple commands. I’m putting this post together as a “cheat sheet” of sorts for my favorite ways to transfer files. For purposes of demonstration, the file I’ll be copying over using all these methods is called met8888.exe and is located in /root/shells...