{ FIT-HACK#2017 } - Binary 300 - mYFIT

Binary 300 - mYFIT

Pour ce dernier challenge, nous avons un programme python compilé. En utilisant uncompyle2 pour décompiler le code du binaire, on obtient le code source. Ce programme permet aux étudiants et professeurs (admin) myFIT d'accéder aux notes. Une fois connecté sur le serveur, 2 commandes sont disponibles:
  • Une pour se connecter avec son identifiant
  • Une autre pour se connecter en tant que professeur (admin) avec nom d'utilisateur et mot de passe
En regardant la fonction, process_admin_command(c) on comprend comment les identifiants d'étudiants sont générés:
def process_admin_command(c):
    if c[0] == 'help':
        print_admin_help()
    elif c[0] == 'add':
        sys.stdout.write('Name of student to add: ')
        sys.stdout.flush()
        name = sys.stdin.readline().strip()
        print 'Enter student\'s grades in the format "Discrete mathematics A", with the class first then the letter grade. End with an empty line.'
        sys.stdout.flush()
        usergrades = {}
        g = True
        while g:
            g = sys.stdin.readline().strip().split()
            usergrades[' '.join(g[:-1])] = g[-1]

        grades[max(grades.keys()) + 1] = {'name': name,
         'Student ID': hashlib.sha256(salt + name).hexdigest(),
         'grades': usergrades}
        write_grades()
    else:
        print 'Invalid command. More coming in myFIT.'
        sys.stdout.flush()
La variable Student ID est le sha256 du nom de l'étudiant précéder d'un salt (EzA1CVFsmRf8BGubQNrd). On récupère alors l'identifiant de Wilhelmina Braunschweig Ingenohl Friedeburg :
import hashlib

salt = 'EzA1CVFsmRf8BGubQNrd'
login = 'Wilhelmina Braunschweig Ingenohl Friedeburg'

h = hashlib.sha256(salt + login)
k3y = h.hexdigest()
print(k3y)
On se connecte sur le serveur et on entre la commande :
$ login fbf832b18bde7cb48fff1f79e07c8c3cdaaabcc726ca99b6f69ff7801d2b873c
On est alors connecté en tant que Wilhelmina Braunschweig Ingenohl Friedeburg, on fait la commande "view" pour voir ses notes et on obtient le flag.
Malheuresement, le serveur n'étant plus en ligne je n'ai pas pu récupérer le flag.

Commentaires

Posts les plus consultés de ce blog

Excel 4.0 macro Trojan Downloader

TROJAN AGENT TESLA – MALWARE ANALYSIS

{ UIUCT#2017 } - REV 350P - ARE WE OUT OF THE WOODS YET?