Create an Interactive SSH Shell using the Paramiko Library - Python Network Programming Tutorial
Chau Hong Ngan Chau Hong Ngan
182 subscribers
20,256 views
246

 Published On Nov 2, 2020

Create an Interactive SSH Shell using the Paramiko Library is a free tutorial by Phillip Aaron from Python Network Programming course
Link to this course(Special Discount):
https://www.udemy.com/course/python-3...
This is the best Python Network Programming Course
Course summary:
5.5 hours of Full HD video material comprised of 25 lectures.
Become familiar with basics of networking: internet architecture, IP addresses, Python TCP connections, Ports and Sockets
Discover core concepts of network communication and python networking
Learn how to use Python 3 TCP sockets to create client and server network applications.
Create over 15 different Python 3 networking applications for hackers.
Build a Python 3 IRC Bot and learn how to process IRC server responses using TCP sockets.
Create a Python 3 banner grabbing tool using TCP sockets to connect to remote services and log banner messages.
Code your own Web Server enumerator tool to scan web servers to find hidden directories or files using the requests library.
Create a Client/Server tool for transferring files to and from remote systems using TCP sockets.
Learn how to build a Stealth Port Scanner to scan remote servers using scapy without making a complete connection to the server.
Use the Paramiko library to make an interactive SSH Shell connection to a remote SSH server using Python 3.
Build your own SMTP Username Enumerator to find user accounts on remote systems using TCP sockets.
Develop a Python 3 sFTP tool to securely download and upload files to and from remote servers in Python 3.
Learn how to connect to a remote POP Mail Server and retrieve email from a remote server.
Create a Man-in-The-Middle Python 3 tool to sniff internet traffic from a remote system.
Code your own Host Discovery tool in Python 3 using scapy to locate live systems on a network using ARP, ICMP, and TCP methods.
Build a Data Scraping tool to harvest information from remote websites to locate IP Addresses, Email Addresses, and Phone Numbers of your target.
English [Auto]
In this video we're going to create a SSA client script in python. Now before we do that we want to go ahead and enable RSS H server. And if you're running Kelly Linux or Most Linux distributions you'll have an SSA show ever present stall and you simply need to start it up. And we're also going to need to install the pyramid pair Emiko python library. Let's go ahead and get that stalled all right. Perfect. All right. So let's go ahead and open up our code editor and create a new file. We'll call it SSA H clients. All right so the first thing we want to do is import param eco. We need to define our hostname. The port of the SSA server which will be 20 to the user name and the password all right now let's go ahead and create a try except block just to catch any generic errors. All right the first thing we want to do is create a client object from the apparent Mico library. So we create a client variable and create our client object. Next we want to load the system host keys from our system. And next we want to set a policy for any missing keys when we're connecting to a remote server and we'll set that to the auto add policy. This way if we connect to a server and we're missing the host keys it will automatically add them. All right. Now with that all way. Now we can actually connect to the remote SSA server so we'll do that using the Connect method pass and the hostname port the user name and the password. All right. In this instance we're going to create an interactive shell so we'll connect to the server will hold that connection and we'll create a prompt so we can type in commands and then get the output from the SSA server. So let's create an infinite loop and inside there let's create another try except block and when the user presses control see Let's go ahead and exit the loop. All right. Now let's get some input from the user. We'll do that using the input function and we'll create a prompt. Now we want an exit function. So if we type the exit command we'll go ahead and exit our while loop. All right. Now we need to exit a command on the remote SSA server. So we're going to need some variables and then we'll use client and the exact command function when we execute this function by passing in our command. It will then place the standard input output and error from the remote server into the appropriate variables. Now at this point all we need to do is simply display that to the screen. So we'll take the standard output use the read function to read the results and then decode that byte array into a string so we can display it to the screen. Finally the last thing we need to do is simply close our connection when we are complete change that variable. All right. So let's let's go

show more

Share/Embed