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 "SSHAuth.h"
#include "Filter.h"
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
int _pingMyTarget(const char *ip)
@ -170,13 +171,19 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
}
if (lpString != NULL) {
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY);
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY);
curl_easy_setopt(curl, CURLOPT_UNRESTRICTED_AUTH, 1L);
curl_easy_setopt(curl, CURLOPT_FTPLISTONLY, 1L);
curl_easy_setopt(curl, CURLOPT_USERPWD, lpString->c_str());
};
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);
if (res == CURLE_OK ||
@ -233,7 +240,7 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
return buffer->size();
}
int Connector::_ConnectToPort(char* ip, int port)
int Connector::connectToPort(char* ip, int port)
{
if(gPingNScan)
{
@ -251,13 +258,7 @@ int Connector::_ConnectToPort(char* ip, int port)
++Alive;//ME2
++found;//PieStat
Lexems lx;
lx._filler(port, buffer, ip, size, &lx);
//if (Filter::negativeFilter(&buffer)) {
// if (Filter::resultFilter(&buffer)) {
// saveNode();
// }
//}
lx.filler(ip, port, &buffer, size, &lx);
}
else if (size == -2) return -2;
return 0;

View File

@ -17,6 +17,6 @@ public:
const char *postData = NULL,
const std::vector<std::string> *customHeaders = NULL,
const std::string *lpString = NULL);
static int _ConnectToPort(char *ip, int port);
static int connectToPort(char *ip, int port);
};
#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)
{
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;
stt->doEmitionUpdateArc(gTargets);

29
Utils.h
View File

@ -32,18 +32,29 @@ public:
my_equal<typename T::value_type>(loc));
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()) {
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;
}
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;
}
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;
}
static QString GetNSErrorDefinition(const char *str, const char *elem){
const char *temp = strstr(str, elem);

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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