diff --git a/Connector.cpp b/Connector.cpp index b624985..60018e7 100644 --- a/Connector.cpp +++ b/Connector.cpp @@ -301,7 +301,7 @@ 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_FTPLISTONLY, TRUE); + curl_easy_setopt(curl, CURLOPT_FTPLISTONLY, 1L); curl_easy_setopt(curl, CURLOPT_USERPWD, lpString->c_str()); }; diff --git a/connector_old.cpp b/connector_old.cpp index 1da6549..89719c5 100644 --- a/connector_old.cpp +++ b/connector_old.cpp @@ -143,66 +143,66 @@ int OpenConnection(SOCKET *sock, const char *hostname, int port) return 0; } -void _baSSLWorker(char *ip, char *request, char *rvBuff) -{ - const SSL_METHOD *method = SSLv3_client_method(); /* Create new client-method instance */ - SSL_CTX *ctx = SSL_CTX_new(method); /* Create new context */ +//void _baSSLWorker(char *ip, char *request, char *rvBuff) +//{ +// const SSL_METHOD *method = SSLv3_client_method(); /* Create new client-method instance */ +// SSL_CTX *ctx = SSL_CTX_new(method); /* Create new context */ - if(ctx != NULL) - { - SOCKET sock; - SSL_CTX_set_timeout(ctx, gTimeOut); - int result = OpenConnection(&sock, ip, 443); - if(result >= 0) - { - SSL *ssl = NULL; - ssl = SSL_new(ctx); /* create new SSL connection state */ - if(ssl != NULL) - { - SSL_set_fd(ssl, sock); /* attach the socket descriptor */ - if(SSL_connect(ssl)) - { - SSL_write(ssl, request, strlen(request)); - if(MapWidgetOpened) stt->doEmitionAddOutData(QString(request)); +// if(ctx != NULL) +// { +// SOCKET sock; +// SSL_CTX_set_timeout(ctx, gTimeOut); +// int result = OpenConnection(&sock, ip, 443); +// if(result >= 0) +// { +// SSL *ssl = NULL; +// ssl = SSL_new(ctx); /* create new SSL connection state */ +// if(ssl != NULL) +// { +// SSL_set_fd(ssl, sock); /* attach the socket descriptor */ +// if(SSL_connect(ssl)) +// { +// SSL_write(ssl, request, strlen(request)); +// if(MapWidgetOpened) stt->doEmitionAddOutData(QString(request)); - char tempBuff[128] = {0}; - int x = 1; - int xx = 0; +// char tempBuff[128] = {0}; +// int x = 1; +// int xx = 0; - ZeroMemory(rvBuff, sizeof(*rvBuff)); - while(xx < 512) - { - x = SSL_read(ssl, tempBuff, sizeof(tempBuff)); - if(x <= 0) break; - Activity += x; - xx += x; - strncat(rvBuff, tempBuff, x); - ZeroMemory(tempBuff, sizeof(tempBuff)); - }; +// ZeroMemory(rvBuff, sizeof(*rvBuff)); +// while(xx < 512) +// { +// x = SSL_read(ssl, tempBuff, sizeof(tempBuff)); +// if(x <= 0) break; +// Activity += x; +// xx += x; +// strncat(rvBuff, tempBuff, x); +// ZeroMemory(tempBuff, sizeof(tempBuff)); +// }; - if(MapWidgetOpened) stt->doEmitionAddIncData(QString(ip), QString(rvBuff)); - if(HTMLDebugMode) _DebugWriteHTMLToFile(request, rvBuff); - }; - SSL_shutdown(ssl); - SSL_free(ssl); - CSSOCKET(sock); - SSL_CTX_free(ctx); /* release context */ - return; - }; - }; - CSSOCKET(sock); - SSL_CTX_free(ctx); /* release context */ - } - else - { - char buff1[512] = {0}; - char buff2[512] = {0}; +// if(MapWidgetOpened) stt->doEmitionAddIncData(QString(ip), QString(rvBuff)); +// if(HTMLDebugMode) _DebugWriteHTMLToFile(request, rvBuff); +// }; +// SSL_shutdown(ssl); +// SSL_free(ssl); +// CSSOCKET(sock); +// SSL_CTX_free(ctx); /* release context */ +// return; +// }; +// }; +// CSSOCKET(sock); +// SSL_CTX_free(ctx); /* release context */ +// } +// else +// { +// char buff1[512] = {0}; +// char buff2[512] = {0}; - ERR_error_string(ERR_peek_error(), buff1); - ERR_error_string(ERR_peek_last_error(), buff2); - stt->doEmitionRedFoundData(QString(ip) + " SSL(InitCTX) 1:" + QString(buff1) + " 2:" + QString(buff2)); - }; -} +// ERR_error_string(ERR_peek_error(), buff1); +// ERR_error_string(ERR_peek_last_error(), buff2); +// stt->doEmitionRedFoundData(QString(ip) + " SSL(InitCTX) 1:" + QString(buff1) + " 2:" + QString(buff2)); +// }; +//} char *_getAttributeValue(char *str, char *val, char *ip, int port) { diff --git a/mainResources.h b/mainResources.h index baf7e0b..3fed2f5 100644 --- a/mainResources.h +++ b/mainResources.h @@ -2,7 +2,6 @@ #include "base64.h" #include -#include #include #include #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) diff --git a/nesca.pro b/nesca.pro index 6f76b91..5df5184 100644 --- a/nesca.pro +++ b/nesca.pro @@ -86,12 +86,8 @@ OTHER_FILES += \ nesca_3.rc -unix|win32: LIBS += -lssl - unix|win32: LIBS += -lssh unix|win32: LIBS += -lcrypto -unix|win32: LIBS += -lpthread - unix|win32: LIBS += -lcurl diff --git a/nesca.pro.user b/nesca.pro.user index 1662361..71414b8 100644 --- a/nesca.pro.user +++ b/nesca.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/nesca_startModule.cpp b/nesca_startModule.cpp index 67e82bd..d9ce21e 100644 --- a/nesca_startModule.cpp +++ b/nesca_startModule.cpp @@ -2124,9 +2124,9 @@ void runAuxiliaryThreads() { int startScan(char* args) { curl_global_init(CURL_GLOBAL_ALL); - SSL_library_init(); - OpenSSL_add_all_algorithms(); /* Load cryptos, et.al. */ - SSL_load_error_strings(); /* Bring in and register error messages */ + //SSL_library_init(); +// OpenSSL_add_all_algorithms(); /* Load cryptos, et.al. */ +// SSL_load_error_strings(); /* Bring in and register error messages */ horLineFlag = false; flCounter = 0; @@ -2183,10 +2183,10 @@ int startScan(char* args) { _passLoginLoader(); _NegativeLoader(); - if (gMode == 0) - { - runAuxiliaryThreads(); + runAuxiliaryThreads(); + if (gMode == 0) + { unsigned long ip1 = (ipsstart[0] * 16777216) + (ipsstart[1] * 65536) + (ipsstart[2] * 256) + ipsstart[3]; unsigned long ip2 = (ipsend[0] * 16777216) + (ipsend[1] * 65536) + (ipsend[2] * 256) + ipsend[3]; @@ -2247,9 +2247,7 @@ int startScan(char* args) { } } else if (gMode == 1) - { - runAuxiliaryThreads(); - + { strcpy(top_level_domain, gFirstDom); char dataEntry[1024] = { 0 }; @@ -2376,8 +2374,6 @@ int startScan(char* args) { return -1; }; - runAuxiliaryThreads(); - stt->doEmitionChangeStatus("Scanning..."); for (gC = 0; gC < flCounter; ++gC) {