|
-
Aug 20th, 2002, 07:29 AM
#1
Thread Starter
Addicted Member
Icmp
Hiya,
Whats the code to generate a RAW ICMP packet via VC++ 6? Anyone have the code?
Thanks in advance...
-
Aug 20th, 2002, 10:20 AM
#2
Frenzied Member
Do you just want to ping or is there something more you want to do with the packet?
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Aug 20th, 2002, 01:14 PM
#3
Monday Morning Lunatic
You can't do raw packets I don't think (not portably, you have to be root under a POSIX system, and Administrator for Windows 2000). They're not supported at all by any other Windows except XP which has them enabled for *everyone*...god what a stupid idea...
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 20th, 2002, 01:34 PM
#4
Frenzied Member
Why does XP have them for everyone??
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Aug 20th, 2002, 03:26 PM
#5
Monday Morning Lunatic
No idea. They're almost totally unnecessary and a huge security breach -- just think, DOS using zombie Windows XP computers that have already been compromised. You can forge the outgoing IP address and *nothing* will know where it's come from.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 20th, 2002, 08:57 PM
#6
Thread Starter
Addicted Member
I just wanted to PING. I did hear that "I could create RAW packets" in VC++ under Windows 2000/XP... so if its possible... why not? I just want to experiment around with it 
Plus... when I searched for ICMP on MSDN, I did come across a topic that was "ICMP raw (code sample)", but I don't have the 2nd MSDN CD to view it 
Originally posted by Technocrat
Do you just want to ping or is there something more you want to do with the packet?
-
Aug 21st, 2002, 09:31 AM
#7
You could try searching online at:
http://msdn.microsoft.com
-
Aug 21st, 2002, 09:58 AM
#8
Thread Starter
Addicted Member
I did, the ICMP raw packets no longer seem to exist there.. it must have been removed 
-
Aug 21st, 2002, 10:58 AM
#9
Frenzied Member
For obvious reasons... 
Why supply fodder to hackers who want to break XP?
-
Aug 22nd, 2002, 12:24 AM
#10
Thread Starter
Addicted Member
dude...Im not a hacker :P and I'm not a "packet kiddie". I'm just a University Student doing what hes supposed to be doing, that is, Programming. 
using icmp.dll is lame, winsock2 sdk has no examples on advanced icmp programming, the online msdn has taken the articles on advanced icmp off the board.
Originally posted by jim mcnamara
For obvious reasons... 
Why supply fodder to hackers who want to break XP?
-
Aug 22nd, 2002, 01:17 AM
#11
Frenzied Member
Code:
void ping(char* addy, char* ret_file)
{
char command[256];
sprintf(command, "ping -n 4 %s > %s", addy, ret_file);
system(command);
}
The results of the ping to the address "addy", will be in the text file "ret_file". You can then simplay parse what you want out of that =).
Z.
-
Aug 22nd, 2002, 07:04 AM
#12
Thread Starter
Addicted Member
Not quite what I wanted... but its quite interesting...
system(); -> which header file is that located in?
Originally posted by Zaei
Code:
void ping(char* addy, char* ret_file)
{
char command[256];
sprintf(command, "ping -n 4 %s > %s", addy, ret_file);
system(command);
}
The results of the ping to the address "addy", will be in the text file "ret_file". You can then simplay parse what you want out of that =).
Z.
-
Aug 22nd, 2002, 11:17 AM
#13
Frenzied Member
stdlib.h
Just be caureful with that command, as it sends the string you pass to the system command processor. This can lead to mishaps where on one OS, the command works fine, but on another, the command doesnt exist (example, "ps" would list all running processes on Linux/Unix, but not on a Windows box).
Z.
-
Aug 22nd, 2002, 11:33 AM
#14
Monday Morning Lunatic
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 22nd, 2002, 01:48 PM
#15
Frenzied Member
to follow up after Parksie -
Get onto a unix box and type: man socket
You'll see that what you can do with sockets (winsock is just MS answer to coding BSD unix sockets). It is fairly complex.
On your windows box: open socket.h and read thru it. Most All the same socket calls are in there; the unix screen above shows virtually the same ones, with the same structs. There is your docset for raw packets, if you want to go to the trouble.
In the windows world icmp isn't lame.
-
Aug 28th, 2002, 04:03 AM
#16
Thread Starter
Addicted Member
Are you telling me I would be able to compile a *BSD icmp code in VC++ just by using <winsock.h> ?
Originally posted by jim mcnamara
to follow up after Parksie -
Get onto a unix box and type: man socket
You'll see that what you can do with sockets (winsock is just MS answer to coding BSD unix sockets). It is fairly complex.
On your windows box: open socket.h and read thru it. Most All the same socket calls are in there; the unix screen above shows virtually the same ones, with the same structs. There is your docset for raw packets, if you want to go to the trouble.
In the windows world icmp isn't lame.
-
Aug 28th, 2002, 11:46 AM
#17
Monday Morning Lunatic
Mostly, yes. You need to look at WSStartup (or something like that, there's a function you need to call before sockets work in Windows).
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 28th, 2002, 03:14 PM
#18
Frenzied Member
I think that the function is "WSAStartup()".
Z.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|