On my previous post I set out to do some reverse engineering on portuguese software. This time I took a look at a billing software. Since the requirement to use billing software came into law, their market has grown a lot. With some good and bad examples.
The software in question uses a lot of open source, it uses the Eclipse Rich Client Platform, with a couple of plugins like Birt.
Until now my only experience with Java was on android apps by doing some assessments but I never had to write code.
After downloading and browsing the content a bit I decided to download Eclipse to check the jars for exposed functions.
With that in mind I added every jar I could find some of them were inside other jars and then I started poking around and found that the PRP used was Blowfish after that I found some functions with a name that suggested that they were used to handling the licences.
Looking at the arguments the functions could accept it was possible to call these functions on my own application and then encrypt them without even knowing the key or the mode in which they were being encrypted.
First the licences were limited to the existing functions but after a couple of tries I wrote my own.
A couple of hours later I had made my first Java application which was able to generate valid licences. This was a good example to demonstrate that even with a good cryptographic implementation doesn’t mean that the application will be safe.
The code below is an already expired licence provided as proof so don’t try to use as it may lock your access to the software.