diff --git a/c/meterpreter/source/extensions/priv/server/ntds_jet.c b/c/meterpreter/source/extensions/priv/server/ntds_jet.c index f22cb367..b0c3d39a 100755 --- a/c/meterpreter/source/extensions/priv/server/ntds_jet.c +++ b/c/meterpreter/source/extensions/priv/server/ntds_jet.c @@ -77,40 +77,28 @@ JET_ERR find_first(jetState *ntdsState){ */ JET_ERR get_column_info(jetState *ntdsState, ntdsColumns *accountColumns){ JET_ERR columnError; - const char attributeNames[][25] = { - "ATTm590045", - "ATTj590126", - "ATTq589983", - "ATTk590689", - "ATTq589876", - "ATTk589879", - "ATTk589984", - "ATTj589993", - "ATTk589914", - "ATTk589918", - "ATTm13", - "ATTj589832", - "ATTq589920", - "ATTr589970" + struct { + char *name; + JET_COLUMNDEF *column; + }columns[] = { + { "ATTm590045", &accountColumns->accountName }, + { "ATTj590126", &accountColumns->accountType }, + { "ATTq589983", &accountColumns->accountExpiry }, + { "ATTk590689", &accountColumns->encryptionKey }, + { "ATTq589876", &accountColumns->lastLogon }, + { "ATTk589879", &accountColumns->lmHash }, + { "ATTk589984", &accountColumns->lmHistory }, + { "ATTj589993", &accountColumns->logonCount }, + { "ATTk589914", &accountColumns->ntHash }, + { "ATTk589918", &accountColumns->ntHistory }, + { "ATTm13", &accountColumns->accountDescription }, + { "ATTj589832", &accountColumns->accountControl }, + { "ATTq589920", &accountColumns->lastPasswordChange }, + { "ATTr589970", &accountColumns->accountSID } }; - JET_COLUMNDEF *columnDefs[] = { - &accountColumns->accountName, - &accountColumns->accountType, - &accountColumns->accountExpiry, - &accountColumns->encryptionKey, - &accountColumns->lastLogon, - &accountColumns->lmHash, - &accountColumns->lmHistory, - &accountColumns->logonCount, - &accountColumns->ntHash, - &accountColumns->ntHistory, - &accountColumns->accountDescription, - &accountColumns->accountControl, - &accountColumns->lastPasswordChange, - &accountColumns->accountSID, - }; - for (int i = 0; i < 14; i++){ - columnError = JetGetTableColumnInfo(ntdsState->jetSession, ntdsState->jetTable, attributeNames[i], columnDefs[i], sizeof(JET_COLUMNDEF), JET_ColInfo); + int countColumns = sizeof(columns) / sizeof(columns[0]); + for (int i = 0; i < countColumns; i++){ + columnError = JetGetTableColumnInfo(ntdsState->jetSession, ntdsState->jetTable, columns[i].name, columns[i].column, sizeof(JET_COLUMNDEF), JET_ColInfo); if (columnError != JET_errSuccess){ return columnError; }