scan update
This commit is contained in:
101
scan.yml
101
scan.yml
@@ -16,7 +16,7 @@
|
|||||||
6137356332636431643830666461333862613835336631333037
|
6137356332636431643830666461333862613835336631333037
|
||||||
# 163.172.0.0/24
|
# 163.172.0.0/24
|
||||||
# 163.172.80.0/28
|
# 163.172.80.0/28
|
||||||
target_network: 163.172.80.10
|
target_network: 163.172.80.0/28
|
||||||
ansible_user: stephane
|
ansible_user: stephane
|
||||||
ansible_password: stephane
|
ansible_password: stephane
|
||||||
ansible_become_password: stephane
|
ansible_become_password: stephane
|
||||||
@@ -40,12 +40,9 @@
|
|||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
|
|
||||||
- name: Update repositories and install packages needed
|
- ansible.builtin.apt:
|
||||||
ansible.builtin.apt:
|
|
||||||
name: masscan
|
name: masscan
|
||||||
update_cache: true
|
update_cache: true
|
||||||
# delegate_to: localhost
|
|
||||||
|
|
||||||
|
|
||||||
- ansible.builtin.git:
|
- ansible.builtin.git:
|
||||||
repo: https://{{ user }}:{{ token }}@gitea.jingoh.fr/staffadmin/scan.git
|
repo: https://{{ user }}:{{ token }}@gitea.jingoh.fr/staffadmin/scan.git
|
||||||
@@ -57,14 +54,13 @@
|
|||||||
|
|
||||||
- ansible.builtin.git:
|
- ansible.builtin.git:
|
||||||
repo: https://github.com/maurosoria/dirsearch.git
|
repo: https://github.com/maurosoria/dirsearch.git
|
||||||
dest: "{{ playbook_dir }}/dirsearch"
|
dest: "/home/stephane/dirsearch"
|
||||||
single_branch: yes
|
single_branch: yes
|
||||||
force: true
|
force: true
|
||||||
delegate_to: localhost
|
|
||||||
|
|
||||||
- name: Install specified python requirements
|
- name: Install specified python requirements
|
||||||
ansible.builtin.pip:
|
ansible.builtin.pip:
|
||||||
requirements: "{{ playbook_dir }}/dirsearch/requirements.txt"
|
requirements: "/home/stephane/dirsearch/requirements.txt"
|
||||||
|
|
||||||
# apt install masscan
|
# apt install masscan
|
||||||
- ansible.builtin.command:
|
- ansible.builtin.command:
|
||||||
@@ -73,13 +69,13 @@
|
|||||||
register: scan_output
|
register: scan_output
|
||||||
|
|
||||||
|
|
||||||
- debug:
|
# - debug:
|
||||||
msg: "{{ item }}"
|
# msg: "{{ item }}"
|
||||||
loop: "{{ scan_output.stdout_lines }}"
|
# loop: "{{ scan_output.stdout_lines }}"
|
||||||
# - "{{ cert.not_after }}"
|
# # - "{{ cert.not_after }}"
|
||||||
# - "{{ ansible_date_time.iso8601_basic }}"
|
# # - "{{ ansible_date_time.iso8601_basic }}"
|
||||||
tags: test
|
# tags: test
|
||||||
delegate_to: localhost
|
# delegate_to: localhost
|
||||||
|
|
||||||
- name: Get a cert from an https por
|
- name: Get a cert from an https por
|
||||||
community.crypto.get_certificate:
|
community.crypto.get_certificate:
|
||||||
@@ -92,19 +88,19 @@
|
|||||||
register: cert
|
register: cert
|
||||||
tags: test
|
tags: test
|
||||||
|
|
||||||
# item.subject.CN
|
# # item.subject.CN
|
||||||
- debug:
|
# - debug:
|
||||||
msg: "{{ item.item.split('on')[-1].strip() }}"
|
# msg: "{{ item.item.split('on')[-1].strip() }}"
|
||||||
loop: "{{ cert.results }}"
|
# loop: "{{ cert.results }}"
|
||||||
# - "{{ cert.not_after }}"
|
# # - "{{ cert.not_after }}"
|
||||||
# - "{{ ansible_date_time.iso8601_basic }}"
|
# # - "{{ ansible_date_time.iso8601_basic }}"
|
||||||
tags: test
|
# tags: test
|
||||||
delegate_to: localhost
|
# delegate_to: localhost
|
||||||
|
|
||||||
|
|
||||||
# apt install masscan
|
# apt install masscan
|
||||||
- ansible.builtin.command:
|
- ansible.builtin.command:
|
||||||
cmd: "python3 {{ playbook_dir }}/dirsearch/dirsearch.py -u https://{{ item.item.split('on')[-1].strip() }} -i 200 -t 100"
|
cmd: "python3 /home/root/dirsearch/dirsearch.py -u https://{{ item.item.split('on')[-1].strip() }} --max-time 300"
|
||||||
become: true
|
become: true
|
||||||
loop: "{{ cert.results }}"
|
loop: "{{ cert.results }}"
|
||||||
# vars:
|
# vars:
|
||||||
@@ -122,16 +118,16 @@
|
|||||||
# tags: test
|
# tags: test
|
||||||
|
|
||||||
|
|
||||||
- debug:
|
# - debug:
|
||||||
msg: " URL =======> {{ item.subject }} || Host ====> {{ item.invocation.module_args.host }} || port ======> {{ item.invocation.module_args.port }} || proxy_port =========> {{ item.invocation.module_args.proxy_port }}"
|
# msg: " URL =======> {{ item.subject }} || Host ====> {{ item.invocation.module_args.host }} || port ======> {{ item.invocation.module_args.port }} || proxy_port =========> {{ item.invocation.module_args.proxy_port }}"
|
||||||
loop: "{{ cert.results }}"
|
# loop: "{{ cert.results }}"
|
||||||
when: item.subject is defined
|
# when: item.subject is defined
|
||||||
# loop: "{{ scan443.stdout_lines }}"
|
# # loop: "{{ scan443.stdout_lines }}"
|
||||||
# - "{{ cert.not_after }}"
|
# # - "{{ cert.not_after }}"
|
||||||
# - "{{ ansible_date_time.iso8601_basic }}"
|
# # - "{{ ansible_date_time.iso8601_basic }}"
|
||||||
tags: test
|
# tags: test
|
||||||
ignore_errors: true
|
# ignore_errors: true
|
||||||
delegate_to: localhost
|
# delegate_to: localhost
|
||||||
|
|
||||||
|
|
||||||
# - debug:
|
# - debug:
|
||||||
@@ -147,19 +143,38 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
- debug:
|
# - debug:
|
||||||
msg: "{{ fuff }}"
|
# msg: "{{ fuff }}"
|
||||||
|
|
||||||
- name: Copy
|
|
||||||
ansible.builtin.copy:
|
|
||||||
src: "{{ playbook_dir }}/reports"
|
- ansible.builtin.find:
|
||||||
|
paths: "/home/stephane/reports"
|
||||||
|
recurse: yes
|
||||||
|
register: scan_path
|
||||||
|
|
||||||
|
|
||||||
|
# - debug:
|
||||||
|
# msg: "{{ item.path }}"
|
||||||
|
# loop: "{{ scan_path.files }}"
|
||||||
|
# # - "{{ cert.not_after }}"
|
||||||
|
# # - "{{ ansible_date_time.iso8601_basic }}"
|
||||||
|
# delegate_to: localhost
|
||||||
|
|
||||||
|
- ansible.builtin.fetch:
|
||||||
|
src: "{{ item.path }}"
|
||||||
dest: "{{ playbook_dir }}/scan/"
|
dest: "{{ playbook_dir }}/scan/"
|
||||||
remote_src: yes
|
flat: false
|
||||||
|
loop: "{{ scan_path.files }}"
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
msg: "{{ item.path }}"
|
||||||
|
loop: "{{ scan_path.files }}"
|
||||||
|
# - "{{ cert.not_after }}"
|
||||||
|
# - "{{ ansible_date_time.iso8601_basic }}"
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
|
||||||
|
- ansible.builtin.shell: |
|
||||||
- name: Push backup to git
|
|
||||||
ansible.builtin.shell: |
|
|
||||||
git config user.email "stephane.gratiasquiquandon@gmail.com"
|
git config user.email "stephane.gratiasquiquandon@gmail.com"
|
||||||
git config user.name "staffadmin"
|
git config user.name "staffadmin"
|
||||||
git add .
|
git add .
|
||||||
|
|||||||
Reference in New Issue
Block a user