From dc390d39219a9bd056e5bfc24d84254bd6fc1e3d Mon Sep 17 00:00:00 2001 From: cora32 Date: Tue, 24 Mar 2015 00:00:53 +0300 Subject: [PATCH] Added sshpass checking. --- SSHAuth.cpp | 4 ++++ sshpass.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/SSHAuth.cpp b/SSHAuth.cpp index 82b3f63..3398382 100644 --- a/SSHAuth.cpp +++ b/SSHAuth.cpp @@ -94,6 +94,10 @@ int SSHBrute(const char* host, int port, std::string *buffer, const char *banner if(!globalScanFlag) break; strcpy(temp, sshlpLst[i]); ptr1 = strstr(temp, ":"); + if (ptr1 == NULL) { + stt->doEmitionRedFoundData("[SSH]Wrong format: " + QString(temp)); + return -1; + } sz = ptr1 - temp; strncpy(login, temp, sz); strcpy(pass, ptr1 + 1); diff --git a/sshpass.txt b/sshpass.txt index 9589491..6510a24 100644 --- a/sshpass.txt +++ b/sshpass.txt @@ -22,5 +22,5 @@ admin:123123 admin:654321 root:password admin:pasword -test:test root:1qazXSW@ +test:test \ No newline at end of file