Читать книгу Kali Linux Penetration Testing Bible - Gus Khawaja - Страница 63
TIP
ОглавлениеIf you want to download files from GitHub, then you can use the git
command:
$git clone [git project URL]
Another way to securely transfer files using the SSH protocol is the scp
command tool. It's important to understand that you will need the SSH service to be started for this process to work properly. As usual, you see a practical example of how the workflow of copying works from source to destination.
First, we will start the SSH server on a remote Ubuntu Linux host, and this is where you're going to download my files. (By default SSH server is not installed on Ubuntu. To get the job done, execute the command $sudo apt install openssh‐server ‐y
.) In this example, we are downloading a passwords.txt
file from the remote Ubuntu server:
gus@ubuntu:~$ ls Desktop Downloads passwords.txt Public Videos Documents Music Pictures Templates
To get the job done of downloading the file, use the scp
command with the following pattern (the dot at the end means that we are copying the file to our current directory in Kali):
$scp [remote-username@remote-ip:/remote-path] [destination local path] root@kali:~# scp gus@ubuntu.ksec.local:/home/gus/passwords.txt . gus@ubuntu.ksec.local's password: passwords.txt 100% 17 16.7KB/s 00:00
Next, we will try to push a file called test.txt
from my Kali to the remote SSH server (we will copy the file on the user's home directory in Ubuntu) using the scp
command again:
$scp [file local path] [remote-username@remote-ip:/remote-path] root@kali:~# scp /root/test.txt gus@ubuntu.ksec.local:/home/gus gus@ubuntu.ksec.local's password: test.txt 100% 5 0.4KB/s 00:00
Later in this book, you will see even more ways to transfer files such as Samba, FTP, etc. For the time being, you just learned the most common ways that you need to be aware of.