C# // .NET General discussions about C# and .Net

InterN0T Affiliates:
EvilZonepy1337

SirCapsAlot.NET

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 28th November 2009, 18:12
Tsukasa's Avatar
-=Ninja Pirate=-
 
Join Date: Jun 2008
Location: ::1
Posts: 491
Rep Power: 14
Reputation: 319
Tsukasa is a light in the darkTsukasa is a light in the darkTsukasa is a light in the darkTsukasa is a light in the dark
C# ping

ping be it simple is a great tool and sometimes ya may need your program to see if a computer is up so here is some code.

Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.NetworkInformation;

namespace ICMP
{
    class Program
    {
        static void Main(string[] args)
        {
            Ping pingSender = new Ping();
            string data = "http://www.intern0t.net";
            byte[] buffer = Encoding.ASCII.GetBytes(data);

            int timeout = 1000;

            PingOptions options = new PingOptions(64, true);

            PingReply reply = pingSender.Send("127.0.0.1", timeout, buffer, options);

            if (reply.Status == IPStatus.Success)
            {
                Console.WriteLine("Address: {0}", reply.Address.ToString());
                Console.WriteLine("Roundtrip time: {0}", reply.RoundtripTime);
                Console.WriteLine("Time to live: {0}", reply.Options.Ttl);
                Console.WriteLine("Fragment: {0}", reply.Options.DontFragment);
                Console.WriteLine("Buffer size: {0}", reply.Buffer.Length);
                Console.ReadLine();
            }
            else
            {
                Console.WriteLine(reply.Status);
                Console.ReadLine();
            }
        }
    }
}
demo:
Ping.rar
__________________
"...a computer is a stupid machine with the ability to do incredibly
smart things, while computer programmers are smart people with the
ability to do incredibly stupid things. They are, in short, a perfect
match".
Reply With Quote
  #2  
Old 30th November 2009, 16:34
MaXe's Avatar
Studying shellcode..
 
Join Date: Jun 2008
Location: Sweden - Ljusdal
Posts: 3,424
Blog Entries: 36
Rep Power: 10
Reputation: 200
MaXe has made his way up the systemMaXe has made his way up the systemMaXe has made his way up the system
Re: C# ping

Nice, it looks pretty cool.

Now build us a ping application where you can modify everything xD Just kidding :-)

Nice clean and simple code hehe :-P
__________________

Quote:
Originally Posted by Norph
MaXe, I really doubt that you are able to browse ANY site more than 2 minutes before you start pwning it xD
Reply With Quote
  #3  
Old 30th November 2009, 21:52
Tsukasa's Avatar
-=Ninja Pirate=-
 
Join Date: Jun 2008
Location: ::1
Posts: 491
Rep Power: 14
Reputation: 319
Tsukasa is a light in the darkTsukasa is a light in the darkTsukasa is a light in the darkTsukasa is a light in the dark
Re: C# ping

xD I kinda did u know where it is.
__________________
"...a computer is a stupid machine with the ability to do incredibly
smart things, while computer programmers are smart people with the
ability to do incredibly stupid things. They are, in short, a perfect
match".
Reply With Quote
  #4  
Old 1st December 2009, 15:50
MaXe's Avatar
Studying shellcode..
 
Join Date: Jun 2008
Location: Sweden - Ljusdal
Posts: 3,424
Blog Entries: 36
Rep Power: 10
Reputation: 200
MaXe has made his way up the systemMaXe has made his way up the systemMaXe has made his way up the system
Re: C# ping

Yeah I found it afterwards ;-) hehe
__________________

Quote:
Originally Posted by Norph
MaXe, I really doubt that you are able to browse ANY site more than 2 minutes before you start pwning it xD
Reply With Quote
  #5  
Old 25th December 2009, 07:37
crazydevil360's Avatar
 
Join Date: Dec 2009
Posts: 5
Rep Power: 3
Reputation: 1
crazydevil360 is an unknown memory address at this point
Re: C# ping

I found that xD. Nice code snippet
__________________
Hacking is not an illegal act. It's an Art
Reply With Quote
  #6  
Old 26th December 2009, 14:19
MaXe's Avatar
Studying shellcode..
 
Join Date: Jun 2008
Location: Sweden - Ljusdal
Posts: 3,424
Blog Entries: 36
Rep Power: 10
Reputation: 200
MaXe has made his way up the systemMaXe has made his way up the systemMaXe has made his way up the system
Re: C# ping

Quote:
Originally Posted by crazydevil360 View Post
I found that xD. ... (more text)
Heh no cause it's not public
__________________

Quote:
Originally Posted by Norph
MaXe, I really doubt that you are able to browse ANY site more than 2 minutes before you start pwning it xD
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ping Blazer hestas The Offtopic Section 14 26th July 2009 15:40
History Hacks and Ping Sweeping MaXe Web Hacking & War Games 0 24th July 2009 20:53


All times are GMT +2. The time now is 17:36.
Copyright ©2007 - Forever, InterN0T & Teh Unkwon

Hosted by 1and1