Government Security
Network Security Resources

Jump to content

Photo

Ping With Timestamp


  • Please log in to reply
10 replies to this topic

#1 grindcore

grindcore

    Specialist

  • Members
  • 105 posts

Posted 20 February 2008 - 07:24 PM

Hi all,

Here is normal ping -t to 10.21.11.81

Reply from 10.21.11.81: bytes=32 time=3889ms TTL=238
Reply from 10.21.11.81: bytes=32 time=3738ms TTL=238
Reply from 10.21.11.81: bytes=32 time=3379ms TTL=238

Are there any possibilities to make it like this

10:13:29.421875 Reply from 10.21.11.81: bytes=32 time=3889ms TTL=238
10:13:29.468750 Reply from 10.21.11.81: bytes=32 time=3738ms TTL=238
10:13:29.468751 Reply from 10.21.11.81: bytes=32 time=3379ms TTL=238
Or is there any similar program in command line that can make continuous ping like this

Thanks in advance :)

#2 jg60533

jg60533

    Private First Class

  • Members
  • 42 posts

Posted 21 February 2008 - 07:21 AM

Hi grindcore,

There is a ping utility I know of called HRPing (I'm sure there are others). It can be found: hxxp://www.cfos.de/ping/ping.htm
Using the "-T" switch (notice a capital T) the responses will include a date and time stamp on each reply in a similar format to what you have demonstrated above.

Also here is a simple windows loop script that will do close to the same thing:


:TOP

echo %time% >> C:\PingServer.txt

ping IP.IP.IP.IP>> C:\PingServer.txt

GOTO TOP


Obviously replace the IP with whatever you are pinging.

Hope that helps

#3 grindcore

grindcore

    Specialist

  • Members
  • 105 posts

Posted 22 February 2008 - 07:24 PM

Thanks jg60533 for your reply. I really appreciate it.

I tried both methods; however they seem didn't work as expected.

Hrping there are a lot of blank spaces...

D:\PenTest>hrping.exe -T -t google.com
This is hrPING v2.38 by cFos Software GmbH -- http://www.cfos.de

Using source IP address 10.164.16.59 to send packets
Pinging google.com [64.233.167.99]
with 64 bytes data (92 bytes IP):






[Aborting...]
79 Requests timed out.

Statistics for google.com:
Packets: sent=79, rcvd=0, error=0, lost=79 (100% loss) in 0.000000 sec


Here is the output of batch file

11:19:26.32

C:\>echo 11:19:28.56 1>>C:\PingServer.txt

C:\>ping google.com 1>>C:\PingServer.txt

C:\>echo 11:19:28.56 1>>C:\PingServer.txt

C:\>ping google.com 1>>C:\PingServer.txt

C:\>echo 11:19:28.56 1>>C:\PingServer.txt

C:\>ping google.com 1>>C:\PingServer.txt

C:\>echo 11:19:28.57 1>>C:\PingServer.txt

C:\>ping google.com 1>>C:\PingServer.txt

C:\>echo 11:19:28.57 1>>C:\PingServer.txt

C:\>ping google.com 1>>C:\PingServer.txt
Terminate batch job (Y/N)?

C:\>echo 11:19:28.79 1>>C:\PingServer.txt
Terminate batch job (Y/N)?

Here is the message when I double click the batch file

The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.



#4 kabor

kabor

    Private First Class

  • Members
  • 22 posts

Posted 23 February 2008 - 10:44 AM

Mmm... question: why don't u simply edit the source code to add a timestamp?

#5 jg60533

jg60533

    Private First Class

  • Members
  • 42 posts

Posted 23 February 2008 - 11:51 AM

grindcore,

I am looking at hrping right now...I have not used it in a while and it is also giving me blank responses and time outs. I just read that it has known issues with Vista...which is what I'm running on the machine I'm on right now.

#6 jg60533

jg60533

    Private First Class

  • Members
  • 42 posts

Posted 23 February 2008 - 12:55 PM

Okay make a bat file with the following and you will be in business:
[codebox]:22
ping xxx.xxx.xxx.xxx -n 3 >>log.txt
echo. |time >>log.txt
goto 22[/codebox]
(Replace xxx.xxx.xxx.xxx with IP or address)
Make sure to have "log.txt" in the same folder.
Sorry about the first bit of code it was just in theory and I hadn't tested it. It appears that it was just giving a single time stamp. The above bat file will give a timestamp on every response.

#7 Jeremy

Jeremy

    Commander in Chief

  • Retired Admin
  • 2,459 posts

Posted 24 February 2008 - 03:52 PM

Create a simple ping app using the ping API at http://msdn2.microso...ation.ping.aspx There is even code. Just add the time using Console.WriteLine before list rest of the PingReply arguments are output.

#8 grindcore

grindcore

    Specialist

  • Members
  • 105 posts

Posted 18 August 2010 - 07:14 AM

Thanks all for your reply. I've found another tools and it works with Windows Vista.

Download
hxxp://www.kwakkelflap.com/fping.html

Example

C:\>fping google.com -T -c

Fast pinger version 2.17
© Wouter Dhondt (http://www.kwakkelflap.com)

Pinging google.com [64.233.181.104] with 32 bytes of data every 1000 ms:

23:10:43 : Reply[1] from 64.233.181.104: bytes=32 time=29.8 ms TTL=54
23:10:44 : Reply[2] from 64.233.181.104: bytes=32 time=226.6 ms TTL=54
23:10:45 : Reply[3] from 64.233.181.104: bytes=32 time=29.4 ms TTL=54
23:10:46 : Reply[4] from 64.233.181.104: bytes=32 time=29.1 ms TTL=54
23:10:47 : Reply[5] from 64.233.181.104: bytes=32 time=35.7 ms TTL=54


Other options

C:\>fping

Fast pinger version 2.17
© Wouter Dhondt (http://www.kwakkelflap.com)

Usage:
fping <host(-list)> [-s data_size] [-S size1/size2] [-c] [-t time] [-w timeout]
[-n count] [-h TTL] [-v TOS] [-r routes] [-R min/max] [-a] [-f]
[-b(-)] [-i] [-l] [-T] [-D] [-d ping_data] [-g host1/host2]
[-H filename] [-L filename]

Options:
-s : data_size in bytes up to 65500
-S : size sweep. Ping with size1, size1 + 1, ..., size 2 datalength
-c : continuous ping (higher priority than -n)
to see statistics and continue - type Control-Break;
to stop - type Control-C.
-t : time between 2 pings in ms up to 1000000
-w : timeout in ms to wait for each reply
-n : number of echo requests to send
-h : number of hops (TTL: 1 to 128)
-v : Type Of Service (0 to 255)
-r : record route (1 to 9 routes)
-R : random length between min and max (disabled when using -S)
-a : resolve addresses to hostnames
-f : set Don't Fragment flag in packet
-b : beep on every successful reply (- to beep on timeout)
-i : use ICMP dll instead of raw socket (disables -r)
-l : limit the output to ping results and errors
-T : print timestamp with each reply
-D : print datestamp and timestamp with each reply
-d : ping with specified data (disabled when using -R)
-g : ping IP range from host1 to host2
-H : get hosts from filename (comma delimited, filename with full path)
-L : logging to a text file



#9 illwill

illwill

    Specialist

  • Sergeant Major
  • 570 posts

Posted 21 August 2010 - 08:37 AM

took you 2 yrs to find it?

#10 Edu

Edu

    First Sergeant

  • Members
  • 2,269 posts

Posted 21 August 2010 - 11:01 AM

actually 2 years and a half, roughly hehe :D

anyway, good he bumped the topic to post an alternative tool instead of a "thks" post ;)
http://www.secumania.net - Secumania security blog.


Embed any executable in a JPEG image and get it to run upon opening the image with this cool tool that abuses a feature of GDI in Windows systems. for governmentsecurity.org members only! click here to get it!

#11 Schism

Schism

    Private

  • Members
  • 1 posts

Posted 18 November 2012 - 04:54 PM

Two and a half years later, I'd just like to say thanks as fping is what I've been looking for...




6 user(s) are reading this topic

0 members, 6 guests, 0 anonymous users