[KeygenMe] Creating Your Own Key Generator


#1

Suh dudes, been a while since I posted a challenge, so here we go!

Difficulty

The difficulty depends on how well you can think and apply your knowledge.

  • EZPZ
  • Not bad
  • Challenging
  • Dark Souls
  • M/o/Vfuscator

0 voters

Goal

The aim of this task is to create your own keygen, i.e. you must program an application or write a script which will output a correct key. You must show at least 3 working keys (post a screenshot or some evidence) using your keygen.
Note: Long inputs seem buggy, so smaller inputs are accepted.

Example Keygen

Rules of Engagement

This is a KeygenMe, there is to be no tampering with the binary in any way, shape or form such that its behaviour is different from the original.

Hints

Hint #1: There is a correlation between the registrant name and the serial key.
Hint #2: If you haven’t located the key check routine, try to identify a particular control structure.
Hint #3: Perhaps you can replicate the key check routine somehow.
Hint #4: Git gud, lern2reverse.

Binaries

Use the following command to recover the binary:

cat out | base64 -d | gunzip > a.out && chmod +x a.out

Easy mode (not stripped)

H4sICO/wE1kAA2tleWdlbm1lAO1ZW2xUxxmec3xsFlivF7MFO5iyIaaYFjZr6iAMbsr6ApiYS4wN
qUgYr3ePvVvvxT3nLNgRTYHlZjmWrCpCeUiD01R5ctVIqShqqsiwBEpfalIUVarSW0JrB1rRJHX8
QNj+/8ycs2e3plKe+uKx/p35Zr6Z/59/Zo7n8oOWtu2SJBEzyKSIIOo6pTjqIO5YwvPriJcsJDXk
q2QFKWEY5DhwQLxQAaUY8hSQIqwHuOOE4kBZCnipKJOEsAB1UU4tIAQF6xM3L3eUgVxQHCjYdg1I
iSiXIfJAuQfKUKYAo5QIHSgR4EdAN0oz4GZb2b7bRngAyANnFAdKneiPWf40lJM5QglXT9qh3G7f
LOTN2vr3eCza/XgsvCEWTaQGfHrSt5GXuUX5jj2dwte8zQpR1yN8h+UfrHx98d8jF1b+aOn5v953
P9B+UaGmTT62wXzllVebdm3+ZLjqp099OFFo8yO2dDnIbhv2gqwqKN9agL9WgNFPNWOKA+1dQirJ
YojXnzExOAX6HsI+byK0dS/VjXA0QVO6Gib9KUMnuqHF1AShtKdfiyaMHhqK9EFmW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
Axf3OzGtx73uwdlvWn5nzetxv/PgLgB3Abi/LYD7IyjInDW237hC8zIvjq7UIY6j72DgPrhJbpdw
dEkO3wf3Vx4Twtlve6H5dz0XR+t2zTMevd3cXmA8or97cPSdpQVQFsB97sEpwClhx069f1Vun3B0
d4/fB/cVHy/JecJ596XgIZ+nfx9ws3U4Kt8C/mNUnKQVAAA=

Good luck.


(pico) #2

My three keys ;)…

$ ./k dtm | xxd -p
d4b80102
$ ./k pico | xxd -p
a48a9204
$ ./k 0x00sec | xxd -p
844cad11

Thanks for taking the time to write this challenge!!!

For the LuLz… this is my keygen code, after some obfuscation :slight_smile:. It works in my box, but that is not the right way to write code :stuck_out_tongue:

#include <unistd.h>

int main (int __, char *_[]) {for (__^=__;*_[1]; __+=(__+= (2**_[1]**_[1]**_[1])),_[1]++);write (1, &__, 4);} 

#3

You’re too good, dude! You stole my serial key too! :fearful:

I’ll make the next one a bit more challenging.

P.S. This isn’t how you use Perl! :sweat_smile:


#4

Come get ya keys

python keygen.py Wunkolo | xxd -p 0c8ae91f python keygen.py 0x00sec.org | xxd -p 4cc0491d python keygen.py dtm | xxd -p d4b80102 python keygen.py Customer | xxd -p b8efdc37

My “Keygen” using python

import struct
import sys

def keygen(Name):
        Key = 0
        for char in Name:
                CurChar = ord(char)
                Key = 2 * ( 2 * CurChar * ((2 * CurChar * CurChar) / 2) + Key)
        return Key

sys.stdout.write(struct.pack('<I',keygen(sys.argv[1])))

#5

Thanks for the challenge;
here is my solution :

$ ./keygen.py neolex | xxd -p
0856cc12
$ ./keygen.py pseudo | xxd -p
6cded014
$ ./keygen.py overflow | xxd -p
945a9954

[spoiler][code]#!/usr/bin/env python2

import struct
import sys

pseudo = str(sys.argv[1])

key= 0
for letter in pseudo:
edx = ord(letter)
ebx = edx2
edx = (edx
ebx)/2
edx = ebx*edx
key = (edx+key) *2
sys.stdout.write(struct.pack("<I",key))[/code][/spoiler]