mirror of
https://github.com/ChronosX88/nesca.git
synced 2024-12-26 09:21:47 +00:00
Test devel branch
This commit is contained in:
parent
fcacfafb98
commit
b2d36743be
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -2124,9 +2124,6 @@ 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 */
|
||||
|
||||
horLineFlag = false;
|
||||
flCounter = 0;
|
||||
@ -2146,7 +2143,6 @@ int startScan(char* args) {
|
||||
ZeroMemory(ipsend, sizeof(ipsend));
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
|
||||
//std::string OutputFolder = std::string(RESULT_DIR_NAME);
|
||||
CreateDirectoryA(RESULT_DIR_NAME, NULL);
|
||||
#else
|
||||
struct stat str = {0};
|
||||
@ -2183,10 +2179,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 +2243,7 @@ int startScan(char* args) {
|
||||
}
|
||||
}
|
||||
else if (gMode == 1)
|
||||
{
|
||||
runAuxiliaryThreads();
|
||||
|
||||
{
|
||||
strcpy(top_level_domain, gFirstDom);
|
||||
|
||||
char dataEntry[1024] = { 0 };
|
||||
@ -2301,6 +2295,7 @@ int startScan(char* args) {
|
||||
memset(dataEntry + innerCounter++, saveEndIP[i], 1);
|
||||
};
|
||||
};
|
||||
|
||||
memset(dataEntry + innerCounter + 1, '\0', 1);
|
||||
|
||||
for (int i = 0; i < sz; ++i)
|
||||
@ -2376,8 +2371,6 @@ int startScan(char* args) {
|
||||
return -1;
|
||||
};
|
||||
|
||||
runAuxiliaryThreads();
|
||||
|
||||
stt->doEmitionChangeStatus("Scanning...");
|
||||
for (gC = 0; gC < flCounter; ++gC)
|
||||
{
|
||||
@ -2476,6 +2469,7 @@ int startScan(char* args) {
|
||||
|
||||
void nCleanup(){
|
||||
Threader::cleanUp();
|
||||
curl_global_cleanup();
|
||||
|
||||
if(loginLst != NULL)
|
||||
{
|
||||
@ -2491,10 +2485,7 @@ void nCleanup(){
|
||||
};
|
||||
if(GlobalNegatives != NULL)
|
||||
{
|
||||
for(int i = 0; i < GlobalNegativeSize; ++i)
|
||||
{
|
||||
delete []GlobalNegatives[i];
|
||||
};
|
||||
for(int i = 0; i < GlobalNegativeSize; ++i) delete []GlobalNegatives[i];
|
||||
delete []GlobalNegatives;
|
||||
GlobalNegatives = NULL;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user