ntlm-parser
Version:
Check and understand the content of a NTLM message
26 lines • 1.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ParserFactory = void 0;
const misc_1 = require("../misc");
const AbstractParser_1 = require("./AbstractParser");
const NTLMType1Parser_1 = require("./NTLMType1Parser");
const NTLMType2Parser_1 = require("./NTLMType2Parser");
const NTLMType3Parser_1 = require("./NTLMType3Parser");
class ParserFactory {
static instantiateFromContent(buffer) {
const str = misc_1.toHex(buffer);
const prefix = str.substring(0, 24);
if (prefix === '4e544c4d5353500001000000') {
return new NTLMType1Parser_1.NTLMType1Parser(buffer);
}
if (prefix === '4e544c4d5353500002000000') {
return new NTLMType2Parser_1.NTLMType2Parser(buffer);
}
if (prefix === '4e544c4d5353500003000000') {
return new NTLMType3Parser_1.NTLMType3Parser(buffer);
}
return new AbstractParser_1.AbstractParser(buffer);
}
}
exports.ParserFactory = ParserFactory;
//# sourceMappingURL=ParserFactory.js.map