Announcement

Collapse
No announcement yet.

Windows command line ping with timestamp

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Windows command line ping with timestamp

    I got this little gem from raymond.cc. If you need to setup a quick run command to ping a source and log the output to a file, whip up a "run" box and do this:


    cmd.exe /k "ping -t 4.2.2.2|cmd /q /v /c "(pause&pause)>nul & for /l %a in () do (set /p "data=" && echo(!date! !time! !data!)&ping -n 2 4.2.2.2>nul" > %userprofile%\desktop\ping-google.txt
    Last edited by 7MinSec; 04-26-2020, 06:10 PM. Reason: Put in @xoke's change for %userprofile%
    Brian Johnson
    7 Minute Security
    Podcaster | Security Consultant

  • #2
    c:\users\me?

    How about %userprofile% which will correctly go to the current user

    Comment


    • #3
      I can get behind that! Edited my original post to reflect this suggestion, thanks!
      Brian Johnson
      7 Minute Security
      Podcaster | Security Consultant

      Comment


      • #4
        HRPING will do this too https://www.cfos.de/en/ping/ping.htm

        Comment


        • #5
          That looks good too PEBCAK I just like to use the built-in Windows goods whenever possible.
          Brian Johnson
          7 Minute Security
          Podcaster | Security Consultant

          Comment


          • #6
            I will add this quick little gem to the pile. If you want to do a quick ping sweep from the windows command line
            ​​​​​​
            FOR /L %i IN (1,1,254) DO ping -n 1 192.168.1.%i | FIND /i "Reply"

            This will normally fly below the radar for most monitoring. I have been caught several times running nmap to early on a test. So this is a pretty quiet way to see what is alive around you.
            Gh0sthax
            Principal Security Engineer

            Comment


            • #7
              OOooooo, love it!
              Brian Johnson
              7 Minute Security
              Podcaster | Security Consultant

              Comment

              Working...
              X