📄 nt_password_hash.c
字号:
/* * hostapd - Plaintext password to NtPasswordHash * Copyright (c) 2005, Jouni Malinen <jkmaline@cc.hut.fi> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Alternatively, this software may be distributed under the terms of BSD * license. * * See README and COPYING for more details. */#include "includes.h"#include "common.h"#include "ms_funcs.h"int main(int argc, char *argv[]){ unsigned char password_hash[16]; int i; char *password, buf[64], *pos; if (argc > 1) password = argv[1]; else { if (fgets(buf, sizeof(buf), stdin) == NULL) { printf("Failed to read password\n"); return 1; } buf[sizeof(buf) - 1] = '\0'; pos = buf; while (*pos != '\0') { if (*pos == '\r' || *pos == '\n') { *pos = '\0'; break; } pos++; } password = buf; } nt_password_hash(password, strlen(password), password_hash); for (i = 0; i < sizeof(password_hash); i++) printf("%02x", password_hash[i]); printf("\n"); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -