This commit is contained in:
cora32 2015-04-18 16:05:35 +03:00
parent 10e605d5ae
commit 9bba24c952
10 changed files with 475 additions and 461 deletions

View File

@ -1,5 +1,6 @@
#include "Connector.h" #include "Connector.h"
#include "SSHAuth.h" #include "SSHAuth.h"
#include "Filter.h"
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
int _pingMyTarget(const char *ip) int _pingMyTarget(const char *ip)
@ -177,6 +178,12 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
}; };
int res = curl_easy_perform(curl); int res = curl_easy_perform(curl);
if (port != 21 && lpString != NULL) {
int pos = Utils::ustrstr(*buffer, "\r\n\r\n");
if (pos != -1) {
*buffer = buffer->substr(pos + 4);
}
}
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
if (res == CURLE_OK || if (res == CURLE_OK ||
@ -233,7 +240,7 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
return buffer->size(); return buffer->size();
} }
int Connector::_ConnectToPort(char* ip, int port) int Connector::connectToPort(char* ip, int port)
{ {
if(gPingNScan) if(gPingNScan)
{ {
@ -251,13 +258,7 @@ int Connector::_ConnectToPort(char* ip, int port)
++Alive;//ME2 ++Alive;//ME2
++found;//PieStat ++found;//PieStat
Lexems lx; Lexems lx;
lx._filler(port, buffer, ip, size, &lx); lx.filler(ip, port, &buffer, size, &lx);
//if (Filter::negativeFilter(&buffer)) {
// if (Filter::resultFilter(&buffer)) {
// saveNode();
// }
//}
} }
else if (size == -2) return -2; else if (size == -2) return -2;
return 0; return 0;

View File

@ -17,6 +17,6 @@ public:
const char *postData = NULL, const char *postData = NULL,
const std::vector<std::string> *customHeaders = NULL, const std::vector<std::string> *customHeaders = NULL,
const std::string *lpString = NULL); const std::string *lpString = NULL);
static int _ConnectToPort(char *ip, int port); static int connectToPort(char *ip, int port);
}; };
#endif // CONNECTOR_H #endif // CONNECTOR_H

View File

@ -1,5 +0,0 @@
#include "Filter.h"
bool Filter::resultFilter() {
return false;
}

View File

@ -1,9 +0,0 @@
#ifndef MAINSTARTER_H
#define MAINSTARTER_H
class Filter {
public:
bool resultFilter();
};
#endif // MAINSTARTER_H

View File

@ -958,7 +958,7 @@ void _connect() {
for (int i = 0; i < MainStarter::portVector.size(); ++i) for (int i = 0; i < MainStarter::portVector.size(); ++i)
{ {
if (!globalScanFlag) break; if (!globalScanFlag) break;
if (Connector::_ConnectToPort((char*)ip.c_str(), MainStarter::portVector[i]) == -2) break; if (Connector::connectToPort((char*)ip.c_str(), MainStarter::portVector[i]) == -2) break;
}; };
--cons; --cons;
stt->doEmitionUpdateArc(gTargets); stt->doEmitionUpdateArc(gTargets);

13
Utils.h
View File

@ -41,7 +41,18 @@ public:
std::string str2 = std::string(str2c); std::string str2 = std::string(str2c);
auto it = std::search(str1.begin(), str1.end(), str2.begin(), str2.end(), auto it = std::search(str1.begin(), str1.end(), str2.begin(), str2.end(),
my_equal<typename T::value_type>(loc)); my_equal<typename T::value_type>(loc));
if(it != str1.end()) return it - str1.begin(); if (it != str1.end()) return it - str1.begin();
else return -1;
}
template<typename T> static int ustrstr(const T *str1,
const char* str2c,
const locale& loc = locale()) {
std::string str2 = std::string(str2c);
auto it = std::search(str1->begin(), str1->end(), str2.begin(), str2.end(),
my_equal<typename T::value_type>(loc));
if (it != str1->end()) return it - str1->begin();
else return -1; else return -1;
} }

File diff suppressed because it is too large Load Diff

View File

@ -123,16 +123,16 @@ public:
iterationCount = 0; iterationCount = 0;
} }
int _header(char *ip, int header(char *ip,
int port, int port,
const char str[], const char str[],
Lexems *l, Lexems *l,
PathStr *ps, PathStr *ps,
std::vector<std::string> *lst, int size); std::vector<std::string> *lst, int size);
int _filler(int port, int filler(char* ip,
const std::string buffcpy, int port,
char* ip, const std::string *buffcpy,
int size, int size,
Lexems *lx); Lexems *lx);
}; };

View File

@ -1,4 +1,5 @@
WebDAV WebDAV
Ruckus Wireless
Company Limited Company Limited
ЮПЕМДЮ ЯЕПБ ЮПЕМДЮ ЯЕПБ
И╕√И║╣ И╕√И║╣

View File

@ -1 +1 @@
24B91-DB 24B92-5F3