Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Effective Python Penetration Testing

You're reading from   Effective Python Penetration Testing Pen test your system like a pro and overcome vulnerabilities by leveraging Python scripts, libraries, and tools

Arrow left icon
Product type Paperback
Published in Jun 2016
Publisher Packt
ISBN-13 9781785280696
Length 164 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Rejah Rehim Rejah Rehim
Author Profile Icon Rejah Rehim
Rejah Rehim
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Effective Python Penetration Testing
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Python Scripting Essentials 2. Analyzing Network Traffic with Scapy FREE CHAPTER 3. Application Fingerprinting with Python 4. Attack Scripting with Python 5. Fuzzing and Brute-Forcing 6. Debugging and Reverse Engineering 7. Crypto, Hash, and Conversion Functions 8. Keylogging and Screen Grabbing 9. Attack Automation 10. Looking Forward

Paramiko


Running commands in remote systems via SSH is one of the most common components of automation. The Python module paramiko makes this easy by providing a programmatic interface to SSH. Paramiko gives you an easy way to use SSH functions in Python through an imported library. This allows us to drive SSH tasks, which you would normally perform manually.

Establish SSH connection with paramiko

The main class of paramiko is paramiko.SSHClient, which provides a basic interface to initiate server connections:

This will create a new SSHClient instance, and we then call the connect() method, which connects to the SSH server.

When we connect to a remote machine with any SSH client, that remote host's key will be automatically stored in the .ssh/known_hosts file in our home directory. So, the first time we connect to a remote system, we will get a message, as follows:

When you type yes for this message, it will add an entry in the known_hosts file. By accepting this message, a level of trust is...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images