Advertisement
ImDeepWithWindows

PortMonitor.cmd

Oct 12th, 2017
639
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. @goto :batch
  2. <html><!--
  3. :batch
  4. @echo off
  5. if NOT "%*"=="" goto :scan
  6. mode con: cols=31 lines=5
  7. title [%~n0]
  8. color 0b
  9. echo.
  10. echo.
  11. echo. loading ...
  12. for /f "tokens=3" %%A in ('netsh wlan show int ^| find /i "state"') do if /I NOT "%%A"=="connected" (
  13. echo.msgbox "You're not connected to any type of network so there's no foregn hosts for your your computer to have port-connects to. There are no connections in existance to monitor.",0,"[Network Scanner]" >"%temp%\NetScannerErrorMSG.vbs"
  14. call cscript //nologo "%temp%\NetScannerErrorMSG.vbs"
  15. del /f /q "%temp%\NetScannerErrorMSG.vbs" >nul
  16. exit
  17. )
  18. reg add HKCU\Software\Classes\%~x0 /d "htafile" /f >nul
  19. start "" mshta.exe "%~dpnx0" "%compip%"
  20. exit
  21. :scan
  22. echo.
  23. for /f "skip=4 tokens=1,2,3,4,5" %%A in ('netsh int ipv4 show tcpconnections') do (
  24. if NOT "%%C"=="0.0.0.0" (
  25. if NOT "%%C"=="127.0.0.1" (
  26. echo LocalPort[%%B] is connected to RemoteAddress[%%C:%%D]
  27. )
  28. )
  29. )
  30. exit
  31. -->
  32. <head>
  33. <title>[ImDeepWithWindows] - Port-Connections Monitorer</title>
  34. <HTA:APPLICATION ID="ThisApp"
  35. APPLICATIONNAME="[ImDeepWithWindows] - Port-Connections Monitorer"
  36. scroll="no"
  37. icon=""
  38. showintaskbar="yes"
  39. sysmenu="yes"
  40. caption="yes"
  41. maximizebutton="yes"
  42. minamizebutton="yes"
  43. >
  44. </head>
  45. <script language="VBScript">
  46. sub Window_OnLoad
  47. Ext = split(split(ThisApp.commandline,chr(34))(1),".")(ubound(split(split(ThisApp.commandline,chr(34))(1),".")))
  48. createobject("wscript.shell").run "reg add HKCU\Software\Classes\."&Ext&" /d "&chr(34)&Ext&"file"&chr(34)&" /f",0,true
  49.  
  50. window.resizeTo 500,400
  51. set x = createobject("wscript.shell")
  52. args = split(ThisApp.commandline,chr(34))
  53. cmmdline = chr(34)&"%comspec%"&chr(34)&" /D /C "
  54. do
  55. x.run cmmdline&"@call "&chr(34)&args(1)&chr(34)&" {scan} >"&chr(34)&"%temp%\TCPportConnectionsScan.dat"&chr(34),0,true
  56. set datfile = createobject("scripting.filesystemobject").opentextfile(x.expandenvironmentstrings("%temp%")&"\TCPportConnectionsScan.dat")
  57. document.all.scandisplay.value = datfile.readall
  58. datfile.close
  59. x.run cmmdline&"@timeout /t 4 >nul",0,true
  60. loop
  61. end sub
  62. </script>
  63. <body bgcolor=black style=border:0px;padding:0px;margin:0px;color:black;font-size:0;font-family:arial ><br/><font color=cyan size=2><b>
  64. <center><font size=4 face=terminal>
  65. <a style=color:red;text-decoration:none target=_blank href=https://hackforums.net/member.php?action=profile&uid=3089494 >by <u>ImDeepWithWindows</u></a>
  66. </font><br/>
  67. <hr noshade=noshade style=color:purple;border-color:purple;border-style:solid;padding:0px;margin:0px />
  68. <div align=left> Port-Connections Monitorer</div>
  69. <hr noshade=noshade style=color:purple;border-color:purple;border-style:solid;padding:0px;margin:0px /><br/>
  70. <textarea readonly name=scandisplay rows=16 wrap=off style=text-align:center;width:100%;margin:0px;padding:0px;border:0px;background-color:black;color:#00ff00;overflow:auto;font-family:arial >
  71. </textarea>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement