Skip to content

This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.

Create client_ssh.py

Abdul Wahab Junaid3865c2e0319e
diff --git a/Python Tools/SSH/AsyncSSH/client_ssh.py b/Python Tools/SSH/AsyncSSH/client_ssh.py
new file mode 100644
index 0000000..fe78434
--- /dev/null
+++ b/Python Tools/SSH/AsyncSSH/client_ssh.py
@@ -0,0 +1,17 @@
+import asyncssh
+import asyncio
+import getpass
+
+async def execute_command(host, command, username, password):
+ async with asyncssh.connect(host, username = username, password= password) as connection:
+ result = await connection.run(command)
+ return result.stdout
+
+if __name__ == '__main__':
+ hostname = input("Enter the target hostname: ")
+ command = input("Enter command: ")
+ username = input("Enter username: ")
+ password = getpass.getpass(prompt="Enter password: ")
+ loop = asyncio.get_event_loop()
+ output_command = loop.run_until_complete(execute_command(hostname, command, username, password))
+ print(output_command)