Results 1 to 18 of 18

Thread: Icmp

  1. #1

    Thread Starter
    Addicted Member cyberwarpy's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    200

    Question Icmp

    Hiya,

    Whats the code to generate a RAW ICMP packet via VC++ 6? Anyone have the code?

    Thanks in advance...

  2. #2
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    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


  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  4. #4
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    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


  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  6. #6

    Thread Starter
    Addicted Member cyberwarpy's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    200
    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?

  7. #7
    Fanatic Member twanvl's Avatar
    Join Date
    Dec 2001
    Posts
    771
    You could try searching online at:
    http://msdn.microsoft.com

  8. #8

    Thread Starter
    Addicted Member cyberwarpy's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    200
    I did, the ICMP raw packets no longer seem to exist there.. it must have been removed

    Originally posted by twanvl
    You could try searching online at:
    http://msdn.microsoft.com

  9. #9
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    For obvious reasons...

    Why supply fodder to hackers who want to break XP?

  10. #10

    Thread Starter
    Addicted Member cyberwarpy's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    200
    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?

  11. #11
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    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.

  12. #12

    Thread Starter
    Addicted Member cyberwarpy's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    200
    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.

  13. #13
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    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.

  14. #14
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Originally posted by cyberwarpy
    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.
    I still stand by my viewpoint that you have to be a network maniac to need raw packets / sockets

    Anyway, I thought you could construct a ping packet without needing raw access (i.e. you can just give it the correct payload). Been a while since I read any RFCs on it though
    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

  15. #15
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    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.

  16. #16

    Thread Starter
    Addicted Member cyberwarpy's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    200
    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.

  17. #17
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  18. #18
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    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
  •  



Click Here to Expand Forum to Full Width