How-to: SCP files from ASA

This is a quick and simple blog. Just notes really on how to use SCP/SSH to download files off of an ASA. It comes in handy for scripting purposes, but I thought I would at least share for everyone to see.

First things first, we need to enable SSH and SCopy on our ASA. We can accomplish this by entering config mode, and then issuing 2 different “ssh” commands:

steve @ phiberoptiklmde ~ :) ##  ssh steve@1.1.1.1
pomeroy@1.1.1.1's password:
Type help or '?' for a list of available commands.
MyASA5510> en
Password: ***********
MyASA5510# conf t
MyASA5510(config)#ssh 0.0.0.0 0.0.0.0 Inside
MyASA5510(config)#ssh scopy enable
MyASA5510(config)#wr
Cryptochecksum: 0d46cc75 79177ae7 9069c9a8 94153d78

8184 bytes copied in 0.690 secs
[OK]
MyASA5510(config)#exit
MyASA5510#exit

The first “ssh” command allows anyone to connect to this from the “Inside” interface of our ASA. This is NOT secure. In a real production environment, we should lock this down to a specific IP address, a handful of IP addresses, or a management network.

The second “ssh” command tells the ASA to enable “scopy”. Which basically means that you can connect to the ASA with a SCP client and download files.

From here we can just use our Linux machine to download the file to whatever folder you want to save your files to. See below on how to do that.
Start with “scp”, then your user account at the IP of the machine: “scp steve@1.1.1.1”.
From here, it needs to call an actual file that exists on the ASA. If you log into the ASA and issue the “dir” command from enable mode, you can get a listing of all files on the local flash drive on the machine.
Lastly, you just need to specify the path that you want to save the file to.

It’s that easy!

steve @ phiberoptiklmde ~ :) ##   scp steve@1.1.1.1:anyconnect-win-3.1.05152-k9.pkg /home/steve/Desktop/anyconnect-win-3.1.05152-k9.pkg
serdman@1.1.1.1's password:
anyconnect-win-3.1.05152-k9.pkg                                                                                                                                                                           100%   34MB 212.0KB/s   02:42    
Connection to 1.1.1.1 closed by remote host.
steve @ phiberoptiklmde ~ :) ##   scp steve@1.1.1.1:anyconnect-macosx-i386-3.1.02040-k9.pkg /home/steve/Desktop/penvpn01-anyconnect/anyconnect-macosx-i386-3.1.02040-k9.pkg
serdman@1.1.1.1's password:
anyconnect-macosx-i386-3.1.02040-k9.pkg                                                                                                                                                                   100%   11MB 226.7KB/s   00:48    
Connection to 1.1.1.1 closed by remote host.
steve @ phiberoptiklmde ~ :) ##   scp steve@1.1.1.1:anyconnect-linux-3.1.02040-k9.pkg /home/steve/Desktop/anyconnect-linux-3.1.02040-k9.pkg
serdman@1.1.1.1's password:
anyconnect-linux-3.1.02040-k9.pkg                                                                                                                                                                         100%   11MB 317.9KB/s   00:34    
Connection to 1.1.1.1 closed by remote host.
steve @ phiberoptiklmde ~ :) ##   scp steve@1.1.1.1:anyconnect-linux-64-3.1.02040-k9.pkg /home/steve/Desktop/anyconnect-linux-64-3.1.02040-k9.pkg
serdman@1.1.1.1's password:
anyconnect-linux-64-3.1.02040-k9.pkg                                                                                                                                                                      100% 9735KB 314.0KB/s   00:31    
Connection to 1.1.1.1 closed by remote host.
steve @ phiberoptiklmde ~ :) ##   scp steve@1.1.1.1:anyconnect-macosx-i386-3.1.05152-k9.pkg /home/steve/Desktop/anyconnect-macosx-i386-3.1.05152-k9.pkg
serdman@1.1.1.1's password:
anyconnect-macosx-i386-3.1.05152-k9.pkg                                                                                                                                                                   100%   11MB 334.6KB/s   00:34  
Connection to 1.1.1.1 closed by remote host.  
steve @ phiberoptiklmde ~ :) ##   scp steve@1.1.1.1:anyconnect-linux-64-3.1.05152-k9.pkg /home/steve/Desktop/anyconnect-linux-64-3.1.05152-k9.pkg
serdman@1.1.1.1's password:
anyconnect-linux-64-3.1.05152-k9.pkg                                                                                                                                                                      100%   10MB 343.9KB/s   00:31  
Connection to 1.1.1.1 closed by remote host.
steve @ phiberoptiklmde ~ :) ##   scp steve@1.1.1.1:anyconnect-linux-3.1.05152-k9.pkg /home/steve/Desktop/anyconnect-linux-3.1.05152-k9.pkg
serdman@1.1.1.1's password:
anyconnect-linux-3.1.05152-k9.pkg                                                                                                                                                                         100%   10MB 341.5KB/s   00:31    
Connection to 1.1.1.1 closed by remote host.
steve @ phiberoptiklmde ~ :) ##

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Tagged , , , , , , . Bookmark the permalink.

Comments are closed.