forked from tjnull/TJ-JPT
-
Notifications
You must be signed in to change notification settings - Fork 7
SSH_ Generate OpenSSL RSA Key Pair from the Comman
TheGetch edited this page Jan 5, 2021
·
1 revision
SSH: Generate OpenSSL RSA Key Pair from the Command Line
https://rietta.com/blog/openssl-generating-rsa-key-from-command/ https://en.wikibooks.org/wiki/Cryptography/Generate_a_keypair_using_OpenSSL
You can generate a public and private RSA key pair like this:
openssl genrsa -aes256 -out private.pem 2048
Public key:
openssl rsa -in private.pem -outform PEM -pubout -out public.pem
Use key for ssh:
- Copy private.pem to a text file: i.e. key.txt (note you don't HAVE to create a new file. You can do steps 2 and 3 with the private.pem).
- Set permission to not be too open:
- chmod 400 key.txt
- Ssh with that key:
- ssh -i key.txt demo@192.168.1.150
Using ssh-keygen (github example)
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Then add the key to ssh:
$ ssh-add ~/.ssh/id_rsa
$ ssh -i ssh_key.txt user@IP
_Sidebar
1. Recon
- Ping Sweep: Windows Method
- Ping Sweep: Bash Method
- NetDiscover (ARP Scanning
- Nbtscan
- Ping Sweep: Python Method
- Ping Sweep: PowerShell Method
- Ping Sweep: Nmap method
- HTTP General Notes
- Cross-Site Scripting (XSS)
- SQL Injection (SQLi)
- Deserialization
- Directory Fuzzing
- IDOR Testing
- Intigriti Bug Bounty Tips
- Out of band exploitation
- Server-Side Template Injection (SSTI) Help
- Subdomain Enumeration
- WebFOCUS
- XXE Cheatsheet
- C2 Frameworks
- BloodHound
- Powershell Empire Quick Start Cheatsheet
- Pivoting/Tunneling
- Impacket
- Rubeus
- Mimikatz
- Identifying Hash Types
-
Dumping Hashes
-
- Cracking Hashes Offline
-
- Cracking Hashes Online
-
- Metasploit Meterpreter Migrate Process
- VMWare Port Forwarding
- Veil Simple Usage
- SSH: Generate OpenSSL RSA Key Pair from the Command Line
- Skipfish
- sed & awk: set root password in etc/shadow
- Search for ssh key quickly
- Python Proxy to Burp
- Python Convert .py to .exe
- PuttySCP Commands
- Powershell tidbits
- Password List - Generate quick list
- OS Enumeration - Ping
- Kerberos: Get KDC name and DNS name
- Impacket Scripts Error
- Gcc Compile Windows Executable in Linux
- Find Command: Filter out permission denied errors
- Excel Injection
- Digitally Sign Files (PowerShell Example)
- CSRF Tokens as Cookie Note
- Clear bash
- Burp Intruder Match/Replace
- Apache headers Test
- Windows Trial VMs
- Subdomain Brute Force
- Spawning TTY Shell
- Reserve Shell Cheat Sheet
- Pass-the-Hash
- Common Meterpreter Commands
- gcc & wine
- File Transfers
- Enable RDP - Windows
- DNS Reverse Lookup Brute Force
- Adding Users