Author |
Message |
|
JoeImp Enlightened
Active Member
Joined: 24 May 2003 Posts: 747
|
Posted: 13 Aug 2003 11:28:56 am Post subject: |
|
|
Check it out, made this in about 2 - 3 hours. It works OK, its not the fastest, but I think its pretty cool. Im going to fix a few things like you are able to just enter "232.33.521.8" instead of in sections. Ive tested it out on Windows 98 and Windows XP. Compiles under Visual C++ 6.0 and probly most others.
///////////////////////////////////////////////////////////////////////////////////////////////////////
[EDIT] You need mpr.lib and wsock32.lib included in the project to make the exe. [READ]
///////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////
Start Program
/////////////////////////////////////
Code: #include <iostream.h>
#include <stdio.h>
#include <windows.h>
void Welcome();
void SetupAndScan();
int IP1;
int IP2;
int IP3;
int IP4;
int IPAddressLen;
int StartPort;
int EndPort;
int totalOpen = 0;
int totalClosed = 0;
int hours;
int minutes;
int seconds;
int error;
char Exit[50];
char nameBuf[128];
unsigned long nameSize = 128;
unsigned long* pnameSize =& nameSize;
void main()
{
Welcome();
SetupAndScan();
}
void Welcome()
{
GetUserName(nameBuf,pnameSize);
cout << "Welcome " << nameBuf << "!";
cout << "\n\nIceScan Version 1.0 \nMade By Joe Impellizzieri (A.K.A. IcEmAn2oo0, TheGrim, GuyOnYourRoof)";
cout << "\nMember Of Groups: UnitedTI, HDC, Prokul Interactive";
cout << "\nContact At: IcEmAn2oo0@hotmail.com";
cout << "\n\nWARNING: Product Intended For Educational And Self-Use Only. Coder Not At Fault For Illegal Usage";
cout << "\n\nEnter The IP Address 1 section at a time: ";
cout << "\n\nFirst Part: ";
cin >> IP1;
cout << "Second Part: ";
cin >> IP2;
cout << "Third Part: ";
cin >> IP3;
cout << "Fourth Part: ";
cin >> IP4;
cout << "\nIP Address Recieved";
cout << "\n\nEnter Starting Port Number: ";
cin >> StartPort;
cout << "\nEnter Ending Port Number: ";
cin >> EndPort;
cout << "\n\n---------------------";
cout << "\nAll Information Recieved, Starting Scanner ... ";
}
void SetupAndScan()
{
WSADATA WsaDat;
if (WSAStartup(MAKEWORD(1,1), &WsaDat) != 0)
{
cout << "\nWSA Unable To Start";
}
else
{
cout << "\nWSA Successfully Started";
}
SOCKADDR_IN SockAddr;
SockAddr.sin_family = AF_INET;
SockAddr.sin_addr.S_un.S_un_b.s_b1 = IP1;
SockAddr.sin_addr.S_un.S_un_b.s_b2 = IP2;
SockAddr.sin_addr.S_un.S_un_b.s_b3 = IP3;
SockAddr.sin_addr.S_un.S_un_b.s_b4 = IP4;
cout << "\nSock Addr Setup Successfully";
cout << "\n\nBeginning Port Scan ... \n\n";
cout.flush();
SYSTEMTIME localtime1;
GetLocalTime(&localtime1);
while (StartPort != (EndPort + 1))
{
SOCKET Socket;
Socket = socket(AF_INET, SOCK_STREAM, 0);
SockAddr.sin_port = StartPort;
if (connect(Socket, (SOCKADDR *)(&SockAddr), sizeof(SockAddr)) != 0)
{
error = WSAGetLastError();
cout << "\nSocket " << StartPort << " Closed: Error (" << error;
switch (error)
{
case 10061:
cout << " (Connection Refused) ";
break;
case 10065:
cout << " (Host Unreachable) ";
break;
case 10035:
cout << " (Resource temporarily unavailable) ";
break;
case 10050:
cout << " (Network is down) ";
break;
case 10048:
cout << " (Address already in use) ";
break;
case 10047:
cout << " (Wrong Protocol, Not Supported) ";
break;
case 10060:
cout << " (Connection timed out) ";
break;
}
cout << ")";
totalClosed++;
}
else
{
cout << "\nSocket " << StartPort << " --------------- OPEN ---------------";
totalOpen++;
}
cout.flush();
closesocket(Socket);
StartPort++;
}
SYSTEMTIME localtime2;
GetLocalTime(&localtime2);
hours = (localtime2.wHour - localtime1.wHour);
minutes = (localtime2.wMinute - localtime1.wMinute);
seconds = (localtime2.wSecond - localtime1.wSecond);
cout << "\n\n\n ------ Scan Complete! ------ ";
cout << "\n\nStatistics: ";
cout << "\n\nStarted At: " << localtime1.wHour << ":" << localtime1.wMinute << "(" << localtime1.wSecond << ")"
<< " Ended At: " << localtime2.wHour << ":" << localtime2.wMinute << "(" << localtime2.wSecond << ")";
cout << "\nTotal Ports Open: " << totalOpen;
cout << "\nTotal Ports Closed: " << totalClosed << "\n\n";
cout << "\n\nThank You For Using IceScan!\n";
cout.flush();
cin >> Exit;
}
There Ya Go, All Thoughts On It Appreciated.
Last edited by Guest on 14 Aug 2003 02:10:58 pm; edited 1 time in total |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 13 Aug 2003 11:47:33 am Post subject: |
|
|
what exactly does it do? srry if i sound dumb :)
i know it is C++ though... |
|
Back to top |
|
|
JoeImp Enlightened
Active Member
Joined: 24 May 2003 Posts: 747
|
|
Back to top |
|
|
JoeImp Enlightened
Active Member
Joined: 24 May 2003 Posts: 747
|
Posted: 13 Aug 2003 12:02:57 pm Post subject: |
|
|
Soooo ... did it compile OK? What do 'ya think? I Put UnitedTI on the second line, I guess in the next one ill put a link to it too.
[EDIT] aahh some on someone, tell me what you think
Last edited by Guest on 13 Aug 2003 02:05:21 pm; edited 1 time in total |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 13 Aug 2003 04:38:02 pm Post subject: |
|
|
JoeImp wrote:
Actually there are many more ports, you can pretty much use any number as a port.
I'll try it out tomorrow, I haven't got VC++ installed on this system so I'll have to save it on a floppy and compile it on my other pc, which doesn't have an internet connection, then save the executable on a floppy, copy it to this system and then I can finally try it. :|
If anybody want's to try it out on my ip: 62.194.134.7
Last edited by Guest on 13 Aug 2003 04:41:00 pm; edited 1 time in total |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 13 Aug 2003 07:10:42 pm Post subject: |
|
|
if u want to try it out on urself, type in : 127.0.0.1
i think that is it, not sure though...
it is supposed to be like "Home" for all comps...
Last edited by Guest on 13 Aug 2003 07:11:50 pm; edited 1 time in total |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 14 Aug 2003 06:23:09 am Post subject: |
|
|
Yes, that's it, there's no place like 127.0.0.1.
*runs of to get a floppy disk*
*saves the source to the floppy*
*runs of with floppy*
Hmm, it won't compile:
--------------------Configuration: portscanner - Win32 Debug--------------------
Linking...
portscanner.obj : error LNK2001: unresolved external symbol _closesocket@4
portscanner.obj : error LNK2001: unresolved external symbol _WSAGetLastError@0
portscanner.obj : error LNK2001: unresolved external symbol _connect@12
portscanner.obj : error LNK2001: unresolved external symbol _socket@12
portscanner.obj : error LNK2001: unresolved external symbol _WSAStartup@8
Debug/portscanner.exe : fatal error LNK1120: 5 unresolved externals
Error executing link.exe.
portscanner.exe - 6 error(s), 0 warning(s) |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 14 Aug 2003 12:30:12 pm Post subject: |
|
|
i tried compiling it, and it came up with about 27 errors... btw, i was using the Windows Turbo C++... what do u use? |
|
Back to top |
|
|
JoeImp Enlightened
Active Member
Joined: 24 May 2003 Posts: 747
|
Posted: 14 Aug 2003 02:10:13 pm Post subject: |
|
|
Read the edit above, you need to include mpr.lib and wsock32.lib. Plus, there are somewhere around 65,000 ports. Yes, 127.0.0.1 is localhost. Never used Turbo C++, compile it like you would regulary I guess, make sure you have the libs in. Yeah, you probly shouldn't use this to another comp, unless you knew what you were doing
Last edited by Guest on 14 Aug 2003 02:12:50 pm; edited 1 time in total |
|
Back to top |
|
|
JoeImp Enlightened
Active Member
Joined: 24 May 2003 Posts: 747
|
Posted: 15 Aug 2003 12:37:01 pm Post subject: |
|
|
Did it compile right? I still wanna know what you guys think |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 16 Aug 2003 11:59:21 am Post subject: |
|
|
well, im on the wrong comp to try again, but as soon as i get a turn on the other one, ill try it... |
|
Back to top |
|
|
JoeImp Enlightened
Active Member
Joined: 24 May 2003 Posts: 747
|
Posted: 16 Aug 2003 12:31:01 pm Post subject: |
|
|
I see your on the site now, check out the new one instead of this one |
|
Back to top |
|
|
|