Skip to content

Instantly share code, notes, and snippets.

@TranKovak
TranKovak / pfx2pem.md
Last active December 15, 2020 12:46
Convert pfx file to pem file #pfx #pem #cert

Conversion to a combined PEM file

To convert a PFX file to a PEM file that contains both the certificate and private key, the following command needs to be used:

# openssl pkcs12 -in filename.pfx -out cert.pem -nodes

Conversion to separate PEM files

We can extract the private key form a PFX to a PEM file with this command:

@TranKovak
TranKovak / search_computer_and_os_in_ad.py
Created March 22, 2023 15:02
The purpose is to search all computer in AD and list them in case you have a messy AD and need to find where is these XP computer that you can't find but have an alert in the security audit
# -*- encoding: utf-8 -*-
#
# Following script need loguru, pywin32 and pyad
#
# should work on python 3.10+ (tested on 3.11.2)
#
# The purpose is to search all computer in AD and list them in case you have a messy AD
# and need to find where is these XP computer that you can't find but have an alert in the security audit
#