Ubuntu Server - Google Authenticator

by Vince
in Blog
Hits: 2232

I ran into an issue while installing Google Authenticator on Ubuntu 18 and although the solution is simple, it's given me an opportunity to discuss three items.

First, the issue:

You attempt to install Google Authenticator using the following:

sudo apt install libpam-google-authenticator

And you're presented with the following error:

E: Unable to locate package libpam-google-authenticator

Read more

Pastebin Malware

by Vince
in Blog
Hits: 3286

I've never really understood the purpose of Pastebin from a practical sense.  I think I get the concept, I just don't know why you'd use it.  That being said, its darker side is breach data dumping for the world to see.  

Yesterday, I was thinking about the API and wondering if I wanted to write a script to search the pastes for client email addresses.  While digging around on the site, I checked out a few pastes.  Lots of people dumping code snippets and then I saw something.  Among the code snippets, I saw what looked to be base64.  I grabbed it, decoded it, and what I saw looked to be binary gibberish.  I thought it was going to be something clever like a message but that's just me playing too much CTF.  But then I did a Google search for "What is the purpose of Pastebin?" and I saw a search result talking about base64 encoded malware.  What!?!?  After reading the article, I was left with only a partial picture.  Perhaps the author didn't want to spell things out completely?  I don't know.  So I started working it through on my own.

Read more

Python Script: DOCX Password Hunter

by Vince
in Blog
Hits: 1765

I tried writing this with fewer lines of code using a list of passwords and another attempt with IGNORECASE but neither worked or worked with 100% accuracy.  Rather than spin my wheels, I just went this route with elif.  

We're recursively searching inside of Word docx files for either:  password, Password, or PASSWORD

When we get a match, we print the document location and the line containing our string match. 

Storing passwords in a Word document is a bad practice -- this script shows you why it's a bad practice and why you should use a password manager.

#!/usr/bin/python
import os
import re
import docx
document_list = []
for path, subdirs, files in os.walk(r"./"):
    for name in files:
        if os.path.splitext(os.path.join(path, name))[1] == ".docx":
            document_list.append(os.path.join(path, name))
for document_path in document_list:
    document = docx.Document(document_path)
    for paragraph in document.paragraphs:
        if "password" in paragraph.text:
            print(document_path+':'+paragraph.text)
        elif "Password" in paragraph.text:
            print(document_path+':'+paragraph.text)
        elif "PASSWORD" in paragraph.text:
            print(document_path+':'+paragraph.text)