28 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
---
 | 
						|
# Install Metasploit Framework
 | 
						|
 | 
						|
- name: General | Software | Metasploit | Facts
 | 
						|
  set_fact:
 | 
						|
    metasploit_installer: msfinstall
 | 
						|
  when: ansible_system in ("Linux", "Darwin")
 | 
						|
 | 
						|
- name: General | Software | Metasploit | Refresh Apt Files
 | 
						|
  shell: "{{ item }}"
 | 
						|
  loop:
 | 
						|
    - "mkdir -p /tmp/apt/"
 | 
						|
    - "mv -fv /usr/share/keyrings/metasploit-framework.gpg /tmp/apt/metasploit-framework.gpg.old"
 | 
						|
    - "mv -fv /etc/apt/sources.list.d/metasploit-framework.list /tmp/apt/metasploit-framework.list.old"
 | 
						|
    - "mv -fv /etc/apt/preferences.d/pin-metasploit.pref /tmp/apt/pin-metasploit.pref.old"
 | 
						|
  when: ansible_system in ("Linux")
 | 
						|
  ignore_errors: true
 | 
						|
 | 
						|
- name: General | Software | Metasploit | Install
 | 
						|
  shell: "{{ item }}"
 | 
						|
  loop:
 | 
						|
    - "curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > {{ metasploit_installer }}"
 | 
						|
    - "chmod 755 {{ metasploit_installer }}"
 | 
						|
    - "mkdir -p {{ global_bin }}"
 | 
						|
    - "mv -fv ./msfinstall {{ global_bin }}/{{ metasploit_installer }}"
 | 
						|
    - yes y | "{{ global_bin }}/{{ metasploit_installer }}"
 | 
						|
  when: ansible_system in ("Linux", "Darwin")
 |