smb req signing check

This commit is contained in:
van Hauser 2017-07-07 18:26:17 +02:00
commit cea00533ea
2 changed files with 9 additions and 2 deletions

View file

@ -1480,7 +1480,7 @@ int32_t service_smb_init(char *ip, int32_t sp, unsigned char options, char *misc
ctime = time(NULL);
do {
usleepn(300);
} while ((ready = hydra_data_ready(sock)) <= 0 && ctime + 5 < time(NULL));
} while ((ready = hydra_data_ready(sock)) <= 0 && ctime + 5 <= time(NULL));
if (ready <= 0) {
fprintf(stderr, "[ERROR] no reply from target smb://%s:%d/\n", hostname, port);
@ -1491,12 +1491,19 @@ int32_t service_smb_init(char *ip, int32_t sp, unsigned char options, char *misc
fprintf(stderr, "[ERROR] invalid reply from target smb://%s:%d/\n", hostname, port);
return -1;
}
close(sock);
if (buf[37] == buf[38] && buf[38] == 0xff) {
fprintf(stderr, "[ERROR] target smb://%s:%d/ does not support SMBv1\n", hostname, port);
return -1;
}
if (buf[15] & 16 == 16) {
fprintf(stderr, "[ERROR] target smb://%s:%d/ requires signing which we do not support\n", hostname, port);
return -1;
}
return 0;
}