Need Ownership Information In Netstat

71LoveTech 1 Reputation point
2022-03-03T03:34:16.01+00:00

179486-screenshot-20466netstat-can-not-obtain-ownership-i.pngI realize computer and code is very detailed, one little character could mess the real meaning up.

I really feel that there should be a script of code that should be patch on "Can not obtain owner information" in a Netstat -a -n -o run.

I have run Wireshark and in the Loopback I'm getting the loopback address of 127.0.0.1 that which is normal but it is connecting to a port 5037 which is a way to be a remote, I think part of my computer. That is an Android device.

I ran Netstat -a -n -o and I was offline. I had an active Time_Wait/Listening connection to 127.0.0.1 and it had a port of 135, then underneath this area it said "Can not obtain owner information".

Whoever is using this 127.0.0.1, since I am offline, Wireless settings in the Bios are disabled. No ethernet to my computer how is it possible for me to be getting traffic on this 127.0.0.1:135 Time_Wait/Listening when I run the Netstat. I have not tried to do both at the same time and or run in Netstat in intervals.

Help on this matter would be greatly appreciated

Windows for business Windows Client for IT Pros Networking Network connectivity and file sharing
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,746 Reputation points
    2022-03-10T08:20:06.463+00:00

    Hello @71LoveTech

    To answer your query kindly check this link.

    https://social.technet.microsoft.com/Forums/en-US/b286dcc3-75b9-4cf3-aa42-5ae1c7bff09c/the-list-of-open-ports-the-process-and-the-name-of-the-service

    Scroll down to the bottom and look at the Power shell script. It shows the listeners, process names, and the service name if one exists.

    To see if I could parse that output and possible incorporate it into the ShowListeners.ps1 script. I just left it as a second script. This may show you some of the "ownership information".

    This is "work in progress" script.

    1. Script: ShowSystemListeners.ps1

    2. Author: MotoX80

    3. cls
    4. $r = (netsh.exe http show servicestate view=requestq) -join "" # make it one long string
    5. $r = $r -replace " Request queue name", "============" # we only want these that are not indented
    6. $ra = $r -split "Request queue name: " # create an array of each entry to be processed
    7. $idx = 1 # skip over header
      8.while ($idx -lt $ra.count) {
    8. $tf = $ra[$idx] -match '(Process IDs:).*(URL groups:)'
    9. if ($tf) {
    10. $matches[0] # uncomment to see what we found.

    11. } else {
    12. "No pids???" # we didn't find the headings. not sure what kind of entry this is.

    13. $idx++ # go to next entry
    14. continue
    15. }
      1. $ids = $matches[0].split(" ") # get pids, but we only process the first one. I have not seen 2 pids on my machine
    16. $p = ($ids -match "^\d+$")[0]
    17. if ($p -eq $null) {
    18. "No pids2???"

    19. $tf = $ra[$idx] -match '(Controller process ID:).*(Process IDs:)'
    20. if ($tf) {
      24.#$matches[0] # uncomment to see what we found.
    21. } else {
    22. "No pids???" # we didn't find the headings. not sure what kind of entry this is.

    23. $idx++ # go to next entry
    24. continue
    25. }
    26. $ids = $matches[0].split(" ") # get pids
    27. $p = ($ids -match "^\d+$")[0] # our pid
      1. $idx++ # I think that each listener must have a controlling pid

    28. break

    29. continue

    30. }
    31. "======================== $idx ======================================================================="
      1. $tf = $ra[$idx] -match '(Registered URLs:).*(Server session)'42.
    32. if ($tf) {
    33. $matches[0]

    34. } else {
    35. "No HTTP addresses???"
    36. $ra[$idx]

    37. $idx++
    38. continue

    39. }
    40. $http = $matches[0].split(" ")
    41. $http -match ':/'
    42. ""
    43. "Process ID: $p"
      1. $s = Get-CimInstance win32_service -FIlter "ProcessId=$p"
    44. ""
    45. (Get-Process -Id $p -IncludeUserName| Format-List -Property Path, company, Description, Username | Out-String).trim()
    46. "ComandLine : {0}" -f (Get-CimInstance win32_process -FIlter "ProcessId=$p").Commandline
    47. ""
    48. if ($s) {
    49. (Get-Service -Name $No HTTP addresses???"
    50. $ra[$idx]

    51. $idx++
    52. continue

    53. }
    54. $http = $matches[0].split(" ")
    55. $http -match ':/'
    56. ""
    57. "Process ID: $p"
      1. $s = Get-CimInstance win32_service -FIlter "ProcessId=$p"
    58. ""
    59. (Get-Process -Id $p -IncludeUserName| Format-List -Property Path, company, Description, Username | Out-String).trim()
    60. "ComandLine : {0}" -f (Get-CimInstance win32_process -FIlter "ProcessId=$p").Commandline
    61. ""
    62. if ($s) {
    63. (Get-Service -Name $No HTTP addresses???"
    64. $ra[$idx]

    65. $idx++
    66. continue

    67. }
    68. $http = $matches[0].split(" ")
    69. $http -match ':/'
    70. ""
    71. "Process ID: $p"
      1. $s = Get-CimInstance win32_service -FIlter "ProcessId=$p"
    72. ""
    73. (Get-Process -Id $p -IncludeUserName| Format-List -Property Path, company, Description, Username | Out-String).trim()
    74. "ComandLine : {0}" -f (Get-CimInstance win32_process -FIlter "ProcessId=$p").Commandline
    75. ""
    76. if ($s) {
    77. (Get-Service -Name $"Process ID: $p"
      1. $s = Get-CimInstance win32_service -FIlter "ProcessId=$p"
    78. ""
    79. (Get-Process -Id $p -IncludeUserName| Format-List -Property Path, company, Description, Username | Out-String).trim()
    80. "ComandLine : {0}" -f (Get-CimInstance win32_process -FIlter "ProcessId=$p").Commandline
    81. ""
    82. if ($s) {
    83. (Get-Service -Name $"Process ID: $p"
      1. $s = Get-CimInstance win32_service -FIlter "ProcessId=$p"
    84. ""
    85. (Get-Process -Id $p -IncludeUserName| Format-List -Property Path, company, Description, Username | Out-String).trim()
    86. "ComandLine : {0}" -f (Get-CimInstance win32_process -FIlter "ProcessId=$p").Commandline
    87. ""
    88. if ($s) {
    89. (Get-Service -Name $if ($s) {
    90. (Get-Service -Name $if ($s) {
    91. (Get-Service -Name $s.name | Format-Table -AutoSize | Out-String).trim()
    92. ""
    93. }
      1. $idx++
    94. }

    --
    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.