31 lines
1.1 KiB
YAML
Raw Normal View History

---
# Nmap port test
- name: General | Tests | nmap | Set Facts
set_fact:
nmap_file: "{{ user_user.home }}/Reports/{{ nmap_report }}"
nmap_separator: "\n*******************************\n\n"
2021-02-03 21:29:45 -06:00
- name: General | Tests | nmap | Set Facts 2
set_fact:
nmap_temp_file: "{{ nmap_file }}.tmp"
- name: General | Tests | nmap | Create Report
shell: "{{ item }}"
loop:
- "date > {{ nmap_temp_file }}"
- "printf '{{ nmap_separator }}' >> {{ nmap_temp_file }}"
- "echo '-=Open Ports=-' >> {{ nmap_temp_file }}"
- "printf 'Number of open ports: ' >> {{ nmap_temp_file }}"
- "nmap --open localhost | grep -c open >> {{ nmap_temp_file }}; echo success"
- "nmap --open localhost | grep open >> {{ nmap_temp_file }}; echo success"
- "printf '{{ nmap_separator }}' >> {{ nmap_temp_file }}"
- "echo '-=Aggressive Vulnerability Check=-' >> {{ nmap_temp_file }}"
- "nmap -A localhost >> {{ nmap_temp_file }}; echo success"
- "mv {{ nmap_temp_file }} {{ nmap_file }}"
2021-02-03 21:39:24 -06:00
- name: General | Tests | nmap | Make Viewable
2021-02-03 21:29:45 -06:00
file:
path: "{{ nmap_file }}"
mode: '0644'