404 check + Webcamxp

This commit is contained in:
cora32 2015-04-23 08:23:02 +03:00
parent fae165357d
commit 8c910fd88c
12 changed files with 116 additions and 111 deletions

View File

@ -16,10 +16,7 @@ int BA::checkOutput(const string *buffer, const char *ip, const int port) {
return 1;
}
else if (Utils::ustrstr(*buffer, "http/1.1 404") != -1
|| Utils::ustrstr(*buffer, "http/1.0 404") != -1) {
stt->doEmitionRedFoundData("BA - 404 " + QString(ip) + ":" + QString::number(port));
return -2;
}
|| Utils::ustrstr(*buffer, "http/1.0 404") != -1) return -2;
else if (Utils::ustrstr(*buffer, "503 service unavailable") != -1
|| Utils::ustrstr(*buffer, "http/1.1 503") != -1
|| Utils::ustrstr(*buffer, "http/1.0 503") != -1
@ -76,7 +73,10 @@ lopaStr BA::BABrute(const char *ip, const int port, bool digestMode) {
if (res == -2) return lps;
else if (res != -1) {
res = checkOutput(&buffer, ip, port);
if (res == -2) return lps;
if (res == -2) {
strcpy(lps.other, "404");
return lps;
}
if (res == -1) {
++i;
break;

View File

@ -124,47 +124,48 @@ int Connector::nConnect(const char* ip, const int port, std::string *buffer,
buffer->clear();
CURL *curl = curl_easy_init();
if (curl != NULL)
{
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);
if (MapWidgetOpened) {
struct data config;
config.trace_ascii = 1; /* enable ascii tracing */
curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace);
curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &config);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
}
curl_easy_setopt(curl, CURLOPT_URL, ip);
curl_easy_setopt(curl, CURLOPT_PORT, port);
curl_easy_setopt(curl, CURLOPT_USERAGENT,
"Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0");
curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, nWriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, buffer);
int proxyPort = std::atoi(gProxyPort);
if(strlen(gProxyIP) != 0 && (proxyPort > 0 && proxyPort < 65535)) {
curl_easy_setopt(curl, CURLOPT_PROXY, gProxyIP);
curl_easy_setopt(curl, CURLOPT_PROXYPORT, proxyPort);
} else {
curl_easy_setopt(curl, CURLOPT_PROXY, "");
}
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, gTimeOut);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, gTimeOut + 3);
if (curl != NULL)
{
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);
if (MapWidgetOpened) {
struct data config;
config.trace_ascii = 1; /* enable ascii tracing */
curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace);
curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &config);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
}
curl_easy_setopt(curl, CURLOPT_URL, ip);
curl_easy_setopt(curl, CURLOPT_PORT, port);
curl_easy_setopt(curl, CURLOPT_USERAGENT,
"Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0");
curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, nWriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, buffer);
int proxyPort = std::atoi(gProxyPort);
if (strlen(gProxyIP) != 0 && (proxyPort > 0 && proxyPort < 65535)) {
curl_easy_setopt(curl, CURLOPT_PROXY, gProxyIP);
curl_easy_setopt(curl, CURLOPT_PROXYPORT, proxyPort);
}
else {
curl_easy_setopt(curl, CURLOPT_PROXY, "");
}
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, gTimeOut);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, gTimeOut + 3);
if(postData != NULL) curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postData);
if (postData != NULL) curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postData);
if(customHeaders != NULL) {
if (customHeaders != NULL) {
struct curl_slist *chunk = NULL;
struct curl_slist *chunk = NULL;
for(auto &ch : *customHeaders) chunk = curl_slist_append(chunk, ch.c_str());
for (auto &ch : *customHeaders) chunk = curl_slist_append(chunk, ch.c_str());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
}
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
}
int res = 0;

View File

@ -66,6 +66,10 @@ lopaStr IPC::IPCBrute(const char *ip, int port, char *SPEC)
{
negVector.push_back("action=\"setup_login.cgi\"");
}
else if (strcmp(SPEC, "WEBCAMXP") == 0)
{
negVector.push_back("Not logged in");
}
else
{
stt->doEmitionRedFoundData("[_IPCameraBrute] No \"SPEC\" specified!");
@ -144,6 +148,12 @@ lopaStr IPC::IPCBrute(const char *ip, int port, char *SPEC)
sprintf(request, "%s:%d/setup_login.cgi", ip, port);
sprintf(postData, "check_username=%s&check_password=%s&login=", login, pass);
}
else if (strcmp(SPEC, "WEBCAMXP") == 0)
{
doPost = true;
sprintf(request, "%s:%d/login.html", ip, port);
sprintf(postData, "username=%s&password=%s&Redir=/", login, pass);
}
std::string buffer;
if(doPost) res = Connector::nConnect(request, port, &buffer, postData);

View File

@ -24,23 +24,16 @@ char gTLD[128] = { 0 };
char gPorts[65536] = { 0 };
char currentIP[MAX_ADDR_LEN] = { 0 };
char finalIP[32] = { 0 };
bool gPingNScan = false;
std::atomic<int> cons = 0, BrutingThrds = 0, gThreads;
std::vector<int> MainStarter::portVector;
int MainStarter::flCounter = 0;
bool MainStarter::savingBackUpFile = false;
QJsonArray *jsonArr = new QJsonArray();
bool horLineFlag = false;
bool gShuffle = true;
int ipCounter = 0;
long long unsigned gTargets = 0, gTargetsNumber = 1;
char currentMask[128] = { 0 };
char metaRange[256] = { 0 };
char metaPercent[256] = { 0 };
@ -49,6 +42,10 @@ char metaTargets[256] = { 0 };
char metaETA[256] = { 0 };
char metaOffline[256] = { 0 };
void MainStarter::unBlockButtons(){
stt->doEmitionBlockButton(false);
}
int MainStarter::fileLoader(const char *fileName) {
char curIP[256] = { 0 }, curIPCopy[256] = { 0 };
@ -1286,6 +1283,17 @@ void MainStarter::runAuxiliaryThreads() {
}
void MainStarter::start(const char* targets, const char* ports) {
curl_global_init(CURL_GLOBAL_ALL);
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
bool res = CreateDirectoryA(RESULT_DIR_NAME, NULL);
#else
struct stat str = { 0 };
if (stat(RESULT_DIR_NAME, &str) == -1) {
mkdir(RESULT_DIR_NAME, 0700);
}
#endif
if (loadTargets(targets) == -1 ||
loadPorts(ports, ',') == -1) {

View File

@ -44,18 +44,6 @@ public:
ZeroMemory(ipsstart, sizeof(ipsstart));
ZeroMemory(ipsend, sizeof(ipsend));
curl_global_init(CURL_GLOBAL_ALL);
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
bool res = CreateDirectoryA(RESULT_DIR_NAME, NULL);
#else
struct stat str = { 0 };
if (stat(RESULT_DIR_NAME, &str) == -1) {
mkdir(RESULT_DIR_NAME, 0700);
}
#endif
}
~MainStarter(){
FileUpdater::FUClear();
@ -107,8 +95,11 @@ public:
delete[]ipsendfl;
ipsendfl = NULL;
};
unBlockButtons();
}
void unBlockButtons();
void runAuxiliaryThreads();
void saver();
void saveBackupToFile();

View File

@ -71,7 +71,11 @@ void STh::doEmitionDataSaved(bool status)
}
void STh::doEmitionUpdateArc(unsigned long gTargets)
{
emit stt->signalUpdateArc(gTargets);
emit stt->signalUpdateArc(gTargets);
}
void STh::doEmitionBlockButton(bool value)
{
emit stt->signalBlockButton(value);
}
void STh::setMode(short mode) {

8
STh.h
View File

@ -37,7 +37,8 @@ public:
static void doEmitionBAData(QString str);
static void doEmitionDebugFoundData(QString);
static void doEmitionShowRedVersion();
static void doEmitionUpdateArc(unsigned long gTargets);
static void doEmitionUpdateArc(unsigned long gTargets);
static void doEmitionBlockButton(bool value);
signals:
public: signals: void showRedVersion();
@ -56,8 +57,9 @@ public: signals: void changeDebugFoundData(QString);
public: signals: void changeStatus(QString);
public: signals: void killSttThread();
public: signals: void sIncData(QString, QString);
public: signals: void sOutData(QString);
public: signals: void signalUpdateArc(unsigned long);
public: signals : void sOutData(QString);
public: signals : void signalUpdateArc(unsigned long);
public: signals : void signalBlockButton(bool);
protected:
void run();

View File

@ -381,6 +381,9 @@ int sharedDetector(const char * ip, int port, const std::string *buffcpy, const
|| Utils::ustrstr(buffcpy, "/app/live/sim/single.asp") != -1)
) return 50; //Network Video System
if (Utils::ustrstr(buffcpy, "MASPRO DENKOH") != -1) return 51; //MASPRO
if (Utils::ustrstr(buffcpy, "webcamXP") != -1
&& Utils::ustrstr(buffcpy, "a valid username/password") != -1
) return 52; //Webcamxp5
if(((Utils::ustrstr(buffcpy, "220") != -1) && (port == 21)) ||
(Utils::ustrstr(buffcpy, "220 diskStation ftp server ready") != -1) ||
@ -1193,10 +1196,8 @@ void _specWFBrute(const char *ip, int port, const char *buff, int flag, char *pa
void _specWEBIPCAMBrute(const char *ip, int port, char *finalstr, int flag, char *comment, char *cp, int size, char *SPEC)
{
lopaStr lps = {"UNKNOWN", "", ""};
IPC ipc;
lps = ipc.IPCLobby(ip, port, SPEC);
IPC ipc;
lopaStr lps = ipc.IPCLobby(ip, port, SPEC);
if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0)
{
@ -1206,12 +1207,19 @@ void _specWEBIPCAMBrute(const char *ip, int port, char *finalstr, int flag, char
};
}
void _specBrute(const char *ip, int port,
int _specBrute(const char *ip, int port,
char *finalstr, int flag,
char *path, char *comment, char *cp, int size)
{
const lopaStr &lps = BA::BALobby((string(ip) + string(path)).c_str(), port, (strcmp(comment, "[DIGEST]") == 0 ? true : false));
if (strcmp(lps.other, "404") == 0) {
stt->doEmitionRedFoundData("BA - 404 <a style=\"color:#717171;\" href=\"http://" + QString(ip) + ":" + QString::number(port) + QString(path) + "/\">" +
QString(ip) + ":" + QString::number(port) + QString(path) + "</a>");
return -1;
}
if(strstr(lps.login, "UNKNOWN") == NULL && strlen(lps.other) == 0)
{
_specFillerBA(ip, port, finalstr, lps.login, lps.pass, flag);
@ -2572,9 +2580,15 @@ int Lexems::filler(char* ip, int port, const std::string *buffcpy, int size, Lex
{
_specWEBIPCAMBrute(ip, port, "[MASPRO] WEB IP Camera", flag, "WEB Authorization", cp, size, "MASPRO");
}
else if (flag == 52) //webcamxp5
{
_specWEBIPCAMBrute(ip, port, "[WEBCAMXP] WEB IP Camera", flag, "WEB Authorization", cp, size, "WEBCAMXP");
}
else if (flag == 20) //AXIS Camera
{
_specBrute(ip, port, "AXIS Camera", flag, "/axis-cgi/com/ptz.cgi?", "Basic Authorization", cp, size);
if (_specBrute(ip, port, "AXIS Camera", flag, "/axis-cgi/com/ptz.cgi?", "Basic Authorization", cp, size) == -1){
_specBrute(ip, port, "AXIS Camera", flag, "/view/viewer_index.shtml?", "Basic Authorization", cp, size);
}
}
else if (flag == 19) //reecam cameras
{

View File

@ -1,3 +1,4 @@
Unable to open
WebDAV
Ruckus Wireless
Company Limited

View File

@ -59,7 +59,6 @@ DrawerTh_GridQoSScanner *dtGridQoS = new DrawerTh_GridQoSScanner();
CheckKey_Th *chKTh = new CheckKey_Th();
ActivityDrawerTh_HorNet *adtHN = new ActivityDrawerTh_HorNet();
DrawerTh_VoiceScanner *vsTh = new DrawerTh_VoiceScanner();
//IRC_NMBlinker *irc_nmb = new IRC_NMBlinker();
PieStat *psTh = new PieStat();
ProgressbarDrawer *pbTh = new ProgressbarDrawer();
@ -1315,6 +1314,7 @@ void nesca_3::importAndScan()
);
ui->importButton->setText("STOP!");
stt->doEmitionBlockButton(true);
stt->doEmitionYellowFoundData("Trying to stop. Please, wait...");
importFileName = "";
}
@ -2045,43 +2045,7 @@ void nesca_3::IPScanSeq()
);
ui->dataText->clear();
}
else
{
stt->doEmitionRedFoundData("No ports specified!");
};
}
else
{
if(stopFirst == false)
{
stopFirst = true;
globalScanFlag = false;
ui->startScanButton_3->setStyleSheet(
" QPushButton {"
"background-color: qlineargradient(spread:none, x1:1, y1:0, x2:1, y2:1, stop:0.681818 rgba(0, 0, 0, 250), stop:1 rgba(255, 255, 255, 130));"
"color: red;"
"border: 0.5px solid qlineargradient(spread:reflect, x1:0.54, y1:0.488591, x2:0.54, y2:0, stop:0 rgba(255, 255, 255, 130), stop:1 rgba(0, 0, 0, 255));"
"}"
);
ui->startScanButton_3->setText("STOP!");
stt->doEmitionYellowFoundData("Trying to stop. Please, wait...");
}
else
{
globalScanFlag = false;
ui->startScanButton_3->setStyleSheet(
" QPushButton {"
"background-color: qlineargradient(spread:none, x1:1, y1:0, x2:1, y2:1, stop:0.681818 rgba(0, 0, 0, 250), stop:1 rgba(255, 255, 255, 130));"
"color: yellow;"
"border: 0.5px solid qlineargradient(spread:reflect, x1:0.54, y1:0.488591, x2:0.54, y2:0, stop:0 rgba(255, 255, 255, 130), stop:1 rgba(0, 0, 0, 255));"
"}"
);
ui->startScanButton_3->setText("Wait...");
stt->doEmitionYellowFoundData("Wait, killing threads...");
STTTerminate();
};
else stt->doEmitionRedFoundData("No ports specified!");
};
}
@ -2277,9 +2241,16 @@ void nesca_3::onLinkClicked(QUrl link)
QDesktopServices::openUrl(link);
}
void nesca_3::slotBlockButtons(bool value) {
ui->startScanButton_3->setEnabled(!value);
ui->startScanButton_4->setEnabled(!value);
ui->importButton->setEnabled(!value);
}
void nesca_3::ConnectEvrthng()
{
connect ( pbTh, SIGNAL(upd()), this, SLOT(slotPBUpdate()));
connect(stt, SIGNAL(signalBlockButton(bool)), this, SLOT(slotBlockButtons(bool)));
connect(pbTh, SIGNAL(upd()), this, SLOT(slotPBUpdate()));
connect ( ui->secretMessageBut_1, SIGNAL( clicked() ), this, SLOT( smReaction() ) );
connect ( ui->secretMessageBut_2, SIGNAL( clicked() ), this, SLOT( smReaction() ) );
connect ( ui->secretMessageBut_3, SIGNAL( clicked() ), this, SLOT( smReaction() ) );
@ -2777,6 +2748,7 @@ void nesca_3::startScanButtonClicked()
);
ui->startScanButton_3->setText("STOP!");
stt->doEmitionBlockButton(true);
stt->doEmitionYellowFoundData("Trying to stop. Please, wait...");
}
else
@ -2832,6 +2804,7 @@ void nesca_3::startScanButtonClickedDNS()
);
ui->startScanButton_4->setText("STOP!");
stt->doEmitionBlockButton(true);
stt->doEmitionYellowFoundData("Trying to stop. Please, wait...");
}
else
@ -2889,7 +2862,7 @@ void nesca_3::MaxBrutingThr_ChangeValue(QString str)
void nesca_3::appendRedBAData(QString str)
{
ui->BAText->append("<span style=\"color:red;background-color:#313131;\">" + QString::fromUtf8(str.toLocal8Bit().data()) + "</span>");
ui->BAText->append("<span style=\"color:red;\">" + QString::fromUtf8(str.toLocal8Bit().data()) + "</span>");
}
void nesca_3::appendGreenBAData(QString str)

View File

@ -116,6 +116,7 @@ protected:
void appendRedBAData(QString str);
void STTTerminate();
void drawVerboseArcs(unsigned long gTargets);
void slotBlockButtons(bool value);
private:
QPoint dragPosition;
};

View File

@ -1 +1 @@
24B94-34
24B95-4C1