poush
This commit is contained in:
23
scan.yml
23
scan.yml
@@ -82,9 +82,10 @@
|
||||
register: cert
|
||||
tags: test
|
||||
|
||||
- ansible.builtin.command: "dig -x {{ item.split('on')[-1].strip() }} +short"
|
||||
register: reverse_dns
|
||||
loop: "{{ scan_output.stdout_lines }}"
|
||||
# - ansible.builtin.command: "dig -x {{ item.split('on')[-1].strip() }} +short"
|
||||
# register: reverse_dns
|
||||
# ignore_errors: true
|
||||
# loop: "{{ scan_output.stdout_lines }}"
|
||||
|
||||
|
||||
|
||||
@@ -108,32 +109,32 @@
|
||||
path: "{{ playbook_dir }}/scan/https/{{ item.invocation.module_args.host.split('.')[0] }}/{{ item.invocation.module_args.host.split('.')[1] }}/"
|
||||
state: directory
|
||||
loop: "{{ cert.results }}"
|
||||
run_once: true
|
||||
# run_once: true
|
||||
when: item.invocation is defined
|
||||
|
||||
#! take time, can be better
|
||||
- ansible.builtin.lineinfile:
|
||||
path: "{{ playbook_dir }}/scan/https/{{ item.invocation.module_args.host.split('.')[0] }}/{{ item.invocation.module_args.host.split('.')[1] }}/{{ item.invocation.module_args.host.split('.')[2] }}.csv"
|
||||
line: "IP,PORT,CN,ISSUER COUNTRY,ISSUER ORGA,REVERSE"
|
||||
line: "IP,PORT,CN,ISSUER COUNTRY,ISSUER ORGA"
|
||||
insertbefore: BOF
|
||||
create: yes
|
||||
loop: "{{ cert.results }}"
|
||||
loop_control:
|
||||
index_var: my_idx
|
||||
# loop_control:
|
||||
# index_var: my_idx
|
||||
delegate_to: localhost
|
||||
#run_once: true
|
||||
when:
|
||||
- item.invocation is defined
|
||||
- cert.results[my_idx].invocation.module_args.host.split('.')[2] != cert.results[my_idx+1].invocation.module_args.host.split('.')[2]
|
||||
# - cert.results[my_idx].invocation.module_args.host.split('.')[2] != cert.results[my_idx+1].invocation.module_args.host.split('.')[2]
|
||||
|
||||
- ansible.builtin.lineinfile:
|
||||
path: "{{ playbook_dir }}/scan/https/{{ item.invocation.module_args.host.split('.')[0] }}/{{ item.invocation.module_args.host.split('.')[1] }}/{{ item.invocation.module_args.host.split('.')[2] }}.csv"
|
||||
line: "{{ item.invocation.module_args.host }},{{ item.invocation.module_args.port }},{{ item.subject.CN | default('no CN') }},{{ item.issuer.C | default('no issuer Country') }},{{ item.issuer.O| default('no issuer Orga') }},{{ reverse_dns_list[my_idx]|default('no reverse') }}"
|
||||
line: "{{ item.invocation.module_args.host }},{{ item.invocation.module_args.port }},{{ item.subject.CN | default('no CN') }},{{ item.issuer.C | default('no issuer Country') }},{{ item.issuer.O| default('no issuer Orga') }}"
|
||||
create: yes
|
||||
state: present
|
||||
loop: "{{ cert.results }}"
|
||||
loop_control:
|
||||
index_var: my_idx
|
||||
# loop_control:
|
||||
# index_var: my_idx
|
||||
delegate_to: localhost
|
||||
when: item.invocation is defined
|
||||
|
||||
|
||||
Reference in New Issue
Block a user