-1

I'm digging into a log file of telephony data on a mac, there are a few entries that are intelligible plaintext but most of it is base64 and without knowing what it originally represented I haven't been able to figure out how to decode it into anything meaningful. They're 108-character blocks that I am completely certain are base64 (all the right characters for base64 and none that aren't, end in equals signs), but I am at a loss as to how to get anything useful out of them.

Someone previously was able to use this data productively, but how isn't documented. Does anyone have an idea what it would have been before it was base64 or how to get it back into a usable format?

1 Answers1

0

Why don't you try a Python script?

There is a post that can help you:

Python base64 data decode

Check it out! There is an answer that can really help you.

If you don't know how to use python, here is an official Beginner's Guide:

https://www.python.org/about/gettingstarted/

Download it from here: https://www.python.org/downloads/mac-osx/

I would write a Python program like this:

import base64

file = open('yourlog.log','r')
outputfile = open('result.log','wb')

for line in file:
    decoded_line = base64.b64decode(line)
    outputfile.write(decoded_line)

file.close()
outputfile.close()
print('Finished!')
francovici
  • 536
  • 6
  • 14
  • You could have some encoding obstacles, but if you get this script to work, then you can adapt it and use it from now on to convert any file! – francovici Feb 17 '19 at 21:25
  • Unfortunately I think encoding is where the problem is; I've tried running a straight base64 decode on it already and with every encoding I can think of it's still just gibberish. I'm thinking it might be a base64 dump of binary telephony information and without knowing how it was originally formatted or how it was meant to be read it seems like it's going to stay gibberish. So really what I'm trying to figure out is 'what kind of telephony data would present as just under a kilobyte of data to be logged, and how would I read it?' – Aaron Sanders Feb 17 '19 at 21:35
  • I see... Maybe if you give more information about the log file we can know what we're dealing with. Is it a freepbx log ? A queue log ? An error log ? – francovici Feb 18 '19 at 10:10
  • It's not an error log, it's a use log. It should be logging regular traffic, I'm not sure if it logs queue data. I don't have access to any of the internal workings of the program that's outputting it, so as far as I'm concerned that's a black box, but it IS for a pbx. Not sure if they'd have used freepbx in their implementation, but worth a shot; I'll try and see how freepbx log files go down. If all else fails I can just go through every type of telephony log system I can find to see which one would lay down 856-864 byte entries in the log every time. – Aaron Sanders Feb 18 '19 at 20:36