![]() | |
| |||||||
| Home | Register | Projects | Blogs | FAQ | Calendar | Search | Today's Posts | Mark Forums Read | Free Directory | Free DNSReport | Tags |
| Notices |
| Public Proof-of-concept codes made publics everydays, feel free to discuss about |
Dameware scannerThis is a discussion on "Dameware scanner" within the Public part of the Exploits section; Code: /* * Dameware Scannner with OS Detection * * wuzzlerer@web.de * * gunknown@oleco.net * * * usage: dwscanner.exe <startip> <endip> <threads> * the maximum number of threads is 1000 * * * credits to Adik netmaniac@hotmail.KG * for his OS ... |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| Code: /*
* Dameware Scannner with OS Detection
*
* wuzzlerer@web.de
*
* gunknown@oleco.net
*
*
* usage: dwscanner.exe <startip> <endip> <threads>
* the maximum number of threads is 1000
*
*
* credits to Adik netmaniac@hotmail.KG
* for his OS Detection Code
*
*
* September '05
*/
#include <string.h>
#include <iostream.h>
#include <sstream>
#include <fstream.h>
#include <ctime>
#include <winsock2.h>
using namespace std;
#define WIN2K 0
#define WINXP 1
#define WIN2K3 2
#define WINNT 3
#define UNKNOWN 4
unsigned char buff[40] = { // OS Detection
"\x30\x11\x00\x00\x00\x00\x00\x00\xC3\xF5\x28\x5C\x 8F\xC2\x0D\x40"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x 00\x00\x00\x00"
"\x00\x00\x00\x00\x01\x00\x00\x00"
};
ofstream output("results.txt", ios::out | ios::app);
string next;
string endip;
int ende = 0;
int check(string host);
DWORD WINAPI ThreadFunc( LPVOID lpParam );
string nextip(std::string);
int main (int argc, char* argv[])
{
DWORD dwThreadId;
DWORD dwThrdParam;
HANDLE hThread[1000];
WSADATA wsa;
WSAStartup(MAKEWORD(2,0), &wsa);
// get local time
struct tm *zeit;
time_t sec;
time(&sec);
zeit = localtime(&sec);
// header
cout << endl << " # DameWare Scanner" << endl;
cout << " # Coded in cooperation of gunknown and wuzzler" << endl << " #" << endl;
cout << " # Contact us for any feedback [gunknown@oleco.net] [wuzzlerer@web.de]" << endl << endl;
if(argc != 4){
cout << " usage: dwscanner <startip> <endip> <threads>" << endl << endl;
return 0;}
if(atoi(argv[3]) > 1000){
argv[3] = "1000";
cout << " Only 1000 threads are allowed!" << endl << endl;}
next = argv[1];
endip = argv[2];
output << "Started at " << zeit->tm_mday << "." <<(zeit->tm_mon + 1) << "." << (1900+zeit->tm_year) << " " << zeit->tm_hour << ":"
<< zeit->tm_min << endl << "command: dwscanner " << argv[1] << " " << argv[2] << " " << argv[3] << endl << endl;
cout << " Scanning ..." << endl << endl;
// create threads
for (int i = 0; i < atoi(argv[3]); i++)
{
if(ende == 1){break;}
dwThrdParam=i;
hThread[i] = CreateThread(NULL, 0,ThreadFunc,&dwThrdParam, 0, &dwThreadId);
if (hThread == NULL) {
printf("CreateThread failed." );
getchar();}
else {
Sleep(1000);}
}
// wait until threads ends
while(ende != 1){Sleep(10);}
output << endl << "Done." << endl << endl << endl;
cout << endl << " Done." << endl << endl;
WSACleanup();
return 0;
}
DWORD WINAPI ThreadFunc( LPVOID lpParam )
{
while(inet_addr(next.c_str()) != inet_addr(endip.c_str()))
{
string ip = next;
next = nextip(next);
switch ( check(ip) )
{
case WIN2K:
cout << " Found DameWare Server (Windows 2000) " << ip << endl;
output << "Found DameWare Server (Windows 2000) " << ip << endl;
break;
case WINXP:
cout << " Found DameWare Server (Windows XP) " << ip << endl;
output << "Found DameWare Server (Windows XP) " << ip << endl;
break;
case WIN2K3:
cout << " Found DameWare Server (Windows 2003) " << ip << endl;
output << "Found DameWare Server (Windows 2003) " << ip << endl;
break;
case WINNT:
cout << " Found DameWare Server (Windows NT) " << ip << endl;
output << "Found DameWare Server (Windows NT) " << ip << endl;
break;
case UNKNOWN:
break;
}
}
ende = 1;
return 0;
}
string nextip(string ip)
{
// fourth block
string buf = ip;
string fourthblock = buf;
int p = fourthblock.rfind(".");
fourthblock.erase(0, (p+1));
int fourth = atoi(fourthblock.c_str());
// third block
buf.erase(p);
string thirdblock = buf;
p = thirdblock.rfind(".");
thirdblock.erase(0, (p+1));
int third = atoi(thirdblock.c_str());
// second block
buf.erase(p);
string secondblock = buf;
p = secondblock.rfind(".");
secondblock.erase(0, (p+1));
int second = atoi(secondblock.c_str());
// first block
string firstblock = buf.erase(p);
int first = atoi(firstblock.c_str());
// checks for valid ip
if(fourth > 256 || third > 256 || second > 256 || first > 256){
cout << "invalid ip adress" << endl;
return 0;}
//create next ip
if(fourth <= 256)
{
++fourth;
if(third <= 256 && fourth == 256)
{
fourth = 0;
++third;
if(second <= 256 && third == 256)
{
third = 0;
++second;
if(first <= 256 && second == 256)
{
second = 0;
++third;
}
}
}
}
stringstream build;
string newip;
build << first << "." << second << "." << third << "." << fourth;
build >> newip;
return newip;
}
int check(string host)
{
int dw_sock;
struct sockaddr_in dw_addr;
char buff1[5000]="";
//Set Connection Options
dw_addr.sin_family = AF_INET;
dw_addr.sin_addr.s_addr = inet_addr(host.c_str());
dw_addr.sin_port = htons (6129);
//Initialize Socket
dw_sock = socket(AF_INET, SOCK_STREAM, 0);
//Connect to Server
connect(dw_sock,(struct sockaddr *)&dw_addr, sizeof(dw_addr));
//Receivce Welcome Msg
recv(dw_sock, buff1, sizeof(buff1),0);
//Send OS Detection code by Adik
send(dw_sock, buff, sizeof(buff),0);
//Receive OS Code
recv(dw_sock, buff1, sizeof(buff1),0);
//Close Socket
closesocket(dw_sock);
//Re-initialize dw_addr
ZeroMemory(&dw_addr, sizeof(sockaddr_in));
//Filter and Return OS Version
if(buff1[8]==5)
return buff1[12];
else if(buff1[8]==4)
return WINNT;
else
return UNKNOWN;
} |
| Sponsor | ||
| ||
| |
| |||
| it works like a charm m8. ![]() ![]() ![]() I have tested the scanner with some IPS where I know there is DAMEWAREs running . -------------------------------------------------------------------------------- Started at 29.9.2005 17:2 command: dwscanner xxx.xxx.197.46 xxx.xxx.197.60 100 Found DameWare Server (Windows 2003) xxx.xxx.197.46 Found DameWare Server (Windows 2000) xxx.xxx.197.59 Done. -------------------------------------------------------------------------------- GretZ..... ![]() |
| ||||
| because it's not DFind scanner, hehe joking ;D |
| |||
| Oui, bien sur tu peux le "compilè" en Windows. C'est un programme pour Windows, c'est pas pour Linux. Regard ici dans le code: Quote:
TRANSLATION: Yes, of course you can compile it under Windows! It's a program designed for Windows, not for Linux flavor. Have a look: QUOTE winsock2.h means that it works under Windows only. Ciao Yog-multi-language ![]() |
| Sponsor | ||
| ||
| |
![]() |
| | |
| dameware, scanner | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CVE-2008-1073 (Internet Scanner) | Heap | Advisories | 0 | 29-02-08 21:40 |
| CVE-2007-6189 (Online Anti-Virus Scanner) | Heap | Advisories | 0 | 01-12-07 14:25 |
| New DameWare Mini Remote Control Client Overflow | mxmxje | Public | 12 | 20-09-05 17:23 |
| scanner perso | fredo | Hacking | 9 | 11-07-05 12:18 |