A journey in infosec
  • Home
  • ✍️ Blog
    • Research
      • Brother Printer Automatic Certificate Renewal
      • Lost your Bitwarden Master Password?
    • Training & Certification
      • OSEP Review
      • DSO1: Malware Dev Training
      • SLAE
        • 0x01 SLAE - Bind TCP
        • 0x02 SLAE - Reverse TCP
        • 0x03 SLAE - Egg Hunter Shellcode
        • 0x04 SLAE - Insertion Encoder
        • 0x05 SLAE - Msfvenom samples
        • 0x06 SLAE - Polymorphic versions
        • 0x07 SLAE - Custom Crypter
  • 📖Wiki
    • Active Directory
      • ADCS
        • Golden Certificate Attack
  • Homelab
    • Page 1
Powered by GitBook
On this page
  • Description
  • Phase of the script
  • Generate the certificate
  • Running the script
  • Repository

Was this helpful?

  1. ✍️ Blog
  2. Research

Brother Printer Automatic Certificate Renewal

This script will automate the certificate renewal of Brother printers.

PreviousResearchNextLost your Bitwarden Master Password?

Last updated 3 years ago

Was this helpful?

Description

I recently decided to build a home lab and started to put SSL Certificate on web application hosted internally. My certificate is generated using by automatically generate a new valid certificate on *.mydomain.com. This way, I can use the certificate on multiple web application.

I was trying to find a way to automate the certificate renewal of my printer Brother MFC-L3750CDW and I didn't find any way to do it. Even online, there was no existing script from my research.

So, I created this python script that will automatically renew the certificate by doing request on the web administrative portal.

The only prerequisites is to pass the following arguments:

  • Protocol

  • Hostname or ip of your printer

  • Filepath of the certificate

Phase of the script

  1. Authenticate on the web portal

  2. Delete any existing certificate

  3. Upload the new certificate

  4. Select the new uploaded certificate in the dropdown menu

Generate the certificate

My certificate was generated this way by:

I'm using Cloudflare for my domain management.

#!/bin/bash
export CF_Token="";
export CF_Account_ID="";
export CF_Zone_ID="";
export CF_Key="";
export CF_Email="";

/root/.acme.sh/acme.sh --issue --dns dns_cf -d *.mydomain.com

Then, once the certificate is generated, I export it in the PKCS12 format because this is the only format accepted on the Brother portal.

openssl pkcs12 -export -out brother.pfx -inkey .acme.sh/*.mydomain.com/*.mydomain.com.key -in .acme.sh/*.mydomain.com/*.mydomain.com.cer

brother.pfx is the file used to pass in the python script

Running the script

Here is a preview of the execution of the script.

Repository

The script can be accessed on the following Github repository.

ACME.SH
Logodavidlebr1/brother-certificate-renewalGitHub
Certificate table list