<commit_before>---

- name: Chocolatey installation
  win_chocolatey:
    name: "{{ item }}"
    state: present
    upgrade: no
  with_items:
    - python3
    - git

- set_fact:
    ansible_become_password: <PASSWORD>"

# http://www.kitploit.com/2017/11/kernelpop-kernel-privilege-escalation.html
# https://github.com/spencerdodd/kernelpop
# FIXME: FATAL ERROR DURING FILE TRANSFER / winrm_send_input failed
- name: retrieve kernelpop
  win_command: "git.exe clone https://github.com/spencerdodd/kernelpop \"{{ harden_win_temp_dir }}\\kernelpop\""
#  git:
#    name: 'https://github.com/spencerdodd/kernelpop'
#    dest: "{{ harden_win_temp_dir }}/kernelpop"
#    version: HEAD
#  become: yes
#  become_user: _test

- name: debug
  win_shell: "Get-ChildItem -Recurse -Path {{ item }}"
  with_items:
    - c:\Python36
    - c:\Python3
    - c:\Python
    - c:\ProgramData\chocolatey\lib
  ignore_errors: true
  changed_when: false

- name: execute kernelpop
  win_shell: "c:\\Python36\\python.exe kernelpop.py -b > kernelpop.out"
  args:
    chdir: "{{ harden_win_temp_dir }}/kernelpop"
  become: yes
  become_user: _test<commit_msg>remove debug code<commit_after>---

- name: Chocolatey installation
  win_chocolatey:
    name: "{{ item }}"
    state: present
    upgrade: no
  with_items:
    - python3
    - git

- set_fact:
    ansible_become_password: <PASSWORD>"

# http://www.kitploit.com/2017/11/kernelpop-kernel-privilege-escalation.html
# https://github.com/spencerdodd/kernelpop
# FIXME: FATAL ERROR DURING FILE TRANSFER / winrm_send_input failed
- name: retrieve kernelpop
  win_command: "git.exe clone https://github.com/spencerdodd/kernelpop \"{{ harden_win_temp_dir }}\\kernelpop\""
#  git:
#    name: 'https://github.com/spencerdodd/kernelpop'
#    dest: "{{ harden_win_temp_dir }}/kernelpop"
#    version: HEAD
#  become: yes
#  become_user: _test

- name: execute kernelpop
  win_shell: "c:\\Python36\\python.exe kernelpop.py -b > kernelpop.out"
  args:
    chdir: "{{ harden_win_temp_dir }}/kernelpop"
  become: yes
  become_user: _test
{'fraction_non_alphanumeric': 0.13576642335766423, 'fraction_numerical': 0.010218978102189781, 'mean_word_length': 3.5386313465783665, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5185351', 'n_tokens_mistral': 779, 'n_tokens_neox': 759, 'n_words': 145}