Advertisement
ImDeepWithWindows

GetHiddenComputerIPs.cmd

Sep 16th, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @goto :batch
  2.  
  3.  
  4. =========================================================================================
  5. if there are any updates made to this App newest
  6. version can be found at http://batch.nhserver.ml
  7.  
  8. by ImDeepWithWindows from http://HackForums.net
  9. =========================================================================================
  10.  
  11.  
  12. :batch
  13. @echo off
  14. setlocal EnableDelayedExpansion
  15. :rescan
  16. cls
  17. title [%~n0] - scanning ...
  18. color 0e
  19. for /f "tokens=2 skip=4" %%A in ('mode con: /status') do set "WindowColumns=%%A" & goto :GotColumnCount
  20. :GotColumnCount
  21. set "LineAcrossScreen=echo."
  22. for /L %%A in (1,1,%WindowColumns%) do set "LineAcrossScreen=!LineAcrossScreen!_"
  23. for /f "tokens=2 delims=:" %%A in ('netsh int ipv4 show address ^| find /I "Default Gateway"') do set "Dgateway=%%A" & set "Dgateway=!Dgateway: =!"
  24. for /f "tokens=5 skip=5" %%A in ('netsh int ipv4 show ipaddress') do set "ThisComputersIP=%%A" & goto :GotIP
  25. :GotIP
  26. echo.
  27. echo.getting the IP-Addresses of all other computers on this network including hidden computers ...
  28. echo.
  29. %LineAcrossScreen%
  30. echo.
  31. for /f "tokens=1,2,3,4 delims=." %%A in ('echo %Dgateway%') do set "IPrange=%%A.%%B.%%C." & set /a "StartAt=%%D+1"
  32. set /a "CompCount=0+0"
  33. for /l %%A in (%StartAt%,1,255) do (
  34. if NOT "!IPrange!%%A"=="%ThisComputersIP%" (
  35. for /f "tokens=8 skip=2" %%B in ('tracert -d -h 1 -w 1000 !IPrange!%%A') do (
  36. if NOT "%%B"=="%Dgateway%" ( echo.New computer found [ !IPrange!%%A ] & set /a "CompCount+=1" )
  37. )
  38. )
  39. )
  40. color 0b
  41. title [%~n0] - done scanning
  42. %LineAcrossScreen%
  43. echo.
  44. echo.--
  45. echo.total number of other computers on this network: !CompCount!
  46. echo.--
  47. echo.
  48. echo.
  49. echo.tap ^<space^> to re-scan
  50. pause >nul
  51. goto :rescan
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement