{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/osquery/pulls/comments/91174359","pull_request_review_id":11684160,"id":91174359,"diff_hunk":"@@ -0,0 +1,270 @@\n+/*\n+ *  Copyright (c) 2014-present, Facebook, Inc.\n+ *  All rights reserved.\n+ *\n+ *  This source code is licensed under the BSD-style license found in the\n+ *  LICENSE file in the root directory of this source tree. An additional grant\n+ *  of patent rights can be found in the PATENTS file in the same directory.\n+ *\n+ */\n+\n+#include <osquery/core.h>\n+#include <osquery/core/conversions.h>\n+#include <osquery/logger.h>\n+#include <osquery/tables.h>\n+\n+#include \"win_sockets.h\"\n+\n+namespace osquery {\n+namespace tables {\n+\n+WinSockets::WinSockets() : status_(Status(0, \"OK\")) {\n+  auto pSockTable = allocateSocketTable(IPPROTO_TCP, AF_INET);\n+  if (status_.ok()) {\n+    tcpTable_ = static_cast<MIB_TCPTABLE_OWNER_PID*>(pSockTable);\n+  } else {\n+    TLOG << \"Error allocating the TCP IPv4 Socket Table.\";","path":"osquery/tables/networking/windows/process_open_sockets.cpp","position":26,"original_position":26,"commit_id":"38b27877f2ed4cde1db42630ba0dfe8348edccab","original_commit_id":"38b27877f2ed4cde1db42630ba0dfe8348edccab","user":{"login":"theopolis","id":981645,"avatar_url":"https://avatars.githubusercontent.com/u/981645?v=3","gravatar_id":"","url":"https://api.github.com/users/theopolis","html_url":"https://github.com/theopolis","followers_url":"https://api.github.com/users/theopolis/followers","following_url":"https://api.github.com/users/theopolis/following{/other_user}","gists_url":"https://api.github.com/users/theopolis/gists{/gist_id}","starred_url":"https://api.github.com/users/theopolis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theopolis/subscriptions","organizations_url":"https://api.github.com/users/theopolis/orgs","repos_url":"https://api.github.com/users/theopolis/repos","events_url":"https://api.github.com/users/theopolis/events{/privacy}","received_events_url":"https://api.github.com/users/theopolis/received_events","type":"User","site_admin":false},"body":"nit, no `.` in log messages.","created_at":"2016-12-06T21:23:42Z","updated_at":"2016-12-06T21:26:12Z","html_url":"https://github.com/facebook/osquery/pull/2760#discussion_r91174359","pull_request_url":"https://api.github.com/repos/facebook/osquery/pulls/2760","_links":{"self":{"href":"https://api.github.com/repos/facebook/osquery/pulls/comments/91174359"},"html":{"href":"https://github.com/facebook/osquery/pull/2760#discussion_r91174359"},"pull_request":{"href":"https://api.github.com/repos/facebook/osquery/pulls/2760"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/osquery/pulls/2760","id":93713857,"html_url":"https://github.com/facebook/osquery/pull/2760","diff_url":"https://github.com/facebook/osquery/pull/2760.diff","patch_url":"https://github.com/facebook/osquery/pull/2760.patch","issue_url":"https://api.github.com/repos/facebook/osquery/issues/2760","number":2760,"state":"open","locked":false,"title":"Adding Windows process_open_ports and listening_sockets virtual tables","user":{"login":"PoppySeedPlehzr","id":1328916,"avatar_url":"https://avatars.githubusercontent.com/u/1328916?v=3","gravatar_id":"","url":"https://api.github.com/users/PoppySeedPlehzr","html_url":"https://github.com/PoppySeedPlehzr","followers_url":"https://api.github.com/users/PoppySeedPlehzr/followers","following_url":"https://api.github.com/users/PoppySeedPlehzr/following{/other_user}","gists_url":"https://api.github.com/users/PoppySeedPlehzr/gists{/gist_id}","starred_url":"https://api.github.com/users/PoppySeedPlehzr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PoppySeedPlehzr/subscriptions","organizations_url":"https://api.github.com/users/PoppySeedPlehzr/orgs","repos_url":"https://api.github.com/users/PoppySeedPlehzr/repos","events_url":"https://api.github.com/users/PoppySeedPlehzr/events{/privacy}","received_events_url":"https://api.github.com/users/PoppySeedPlehzr/received_events","type":"User","site_admin":false},"body":"This extends the `process_open_ports`, and inherently the `listening_sockets` virtual tables to Windows. Currently this table doesn't show the remote address and port of UDP connections. This behavior seems to hold with other Windows network enumeration utilities, and I can't seem to find any APIs that allow querying the remote component of UDP connections. If anyone has more insight into why this behavior exists, and how to get this information I'd be super excited to add it to this table.","created_at":"2016-11-15T07:28:01Z","updated_at":"2016-12-06T21:26:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"42ef113b10df0893f52ed8f301f0da81c335bee7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/osquery/pulls/2760/commits","review_comments_url":"https://api.github.com/repos/facebook/osquery/pulls/2760/comments","review_comment_url":"https://api.github.com/repos/facebook/osquery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/osquery/issues/2760/comments","statuses_url":"https://api.github.com/repos/facebook/osquery/statuses/38b27877f2ed4cde1db42630ba0dfe8348edccab","head":{"label":"PoppySeedPlehzr:win-listening-ports","ref":"win-listening-ports","sha":"38b27877f2ed4cde1db42630ba0dfe8348edccab","user":{"login":"PoppySeedPlehzr","id":1328916,"avatar_url":"https://avatars.githubusercontent.com/u/1328916?v=3","gravatar_id":"","url":"https://api.github.com/users/PoppySeedPlehzr","html_url":"https://github.com/PoppySeedPlehzr","followers_url":"https://api.github.com/users/PoppySeedPlehzr/followers","following_url":"https://api.github.com/users/PoppySeedPlehzr/following{/other_user}","gists_url":"https://api.github.com/users/PoppySeedPlehzr/gists{/gist_id}","starred_url":"https://api.github.com/users/PoppySeedPlehzr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PoppySeedPlehzr/subscriptions","organizations_url":"https://api.github.com/users/PoppySeedPlehzr/orgs","repos_url":"https://api.github.com/users/PoppySeedPlehzr/repos","events_url":"https://api.github.com/users/PoppySeedPlehzr/events{/privacy}","received_events_url":"https://api.github.com/users/PoppySeedPlehzr/received_events","type":"User","site_admin":false},"repo":{"id":55729085,"name":"osquery","full_name":"PoppySeedPlehzr/osquery","owner":{"login":"PoppySeedPlehzr","id":1328916,"avatar_url":"https://avatars.githubusercontent.com/u/1328916?v=3","gravatar_id":"","url":"https://api.github.com/users/PoppySeedPlehzr","html_url":"https://github.com/PoppySeedPlehzr","followers_url":"https://api.github.com/users/PoppySeedPlehzr/followers","following_url":"https://api.github.com/users/PoppySeedPlehzr/following{/other_user}","gists_url":"https://api.github.com/users/PoppySeedPlehzr/gists{/gist_id}","starred_url":"https://api.github.com/users/PoppySeedPlehzr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PoppySeedPlehzr/subscriptions","organizations_url":"https://api.github.com/users/PoppySeedPlehzr/orgs","repos_url":"https://api.github.com/users/PoppySeedPlehzr/repos","events_url":"https://api.github.com/users/PoppySeedPlehzr/events{/privacy}","received_events_url":"https://api.github.com/users/PoppySeedPlehzr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PoppySeedPlehzr/osquery","description":"SQL powered operating system instrumentation, monitoring, and analytics.","fork":true,"url":"https://api.github.com/repos/PoppySeedPlehzr/osquery","forks_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/forks","keys_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/teams","hooks_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/hooks","issue_events_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/issues/events{/number}","events_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/events","assignees_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/assignees{/user}","branches_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/branches{/branch}","tags_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/tags","blobs_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/statuses/{sha}","languages_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/languages","stargazers_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/stargazers","contributors_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/contributors","subscribers_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/subscribers","subscription_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/subscription","commits_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/contents/{+path}","compare_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/merges","archive_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/downloads","issues_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/issues{/number}","pulls_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/pulls{/number}","milestones_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/milestones{/number}","notifications_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/labels{/name}","releases_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/releases{/id}","deployments_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/deployments","created_at":"2016-04-07T21:23:03Z","updated_at":"2016-10-22T05:51:18Z","pushed_at":"2016-12-06T20:57:29Z","git_url":"git://github.com/PoppySeedPlehzr/osquery.git","ssh_url":"git@github.com:PoppySeedPlehzr/osquery.git","clone_url":"https://github.com/PoppySeedPlehzr/osquery.git","svn_url":"https://github.com/PoppySeedPlehzr/osquery","homepage":"https://osquery.io","size":9743,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"601ace89fa0fbfbb927b5e4ca2dc53da2360ebd1","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":22394357,"name":"osquery","full_name":"facebook/osquery","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/osquery","description":"SQL powered operating system instrumentation, monitoring, and analytics.","fork":false,"url":"https://api.github.com/repos/facebook/osquery","forks_url":"https://api.github.com/repos/facebook/osquery/forks","keys_url":"https://api.github.com/repos/facebook/osquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/osquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/osquery/teams","hooks_url":"https://api.github.com/repos/facebook/osquery/hooks","issue_events_url":"https://api.github.com/repos/facebook/osquery/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/osquery/events","assignees_url":"https://api.github.com/repos/facebook/osquery/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/osquery/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/osquery/tags","blobs_url":"https://api.github.com/repos/facebook/osquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/osquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/osquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/osquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/osquery/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/osquery/languages","stargazers_url":"https://api.github.com/repos/facebook/osquery/stargazers","contributors_url":"https://api.github.com/repos/facebook/osquery/contributors","subscribers_url":"https://api.github.com/repos/facebook/osquery/subscribers","subscription_url":"https://api.github.com/repos/facebook/osquery/subscription","commits_url":"https://api.github.com/repos/facebook/osquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/osquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/osquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/osquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/osquery/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/osquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/osquery/merges","archive_url":"https://api.github.com/repos/facebook/osquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/osquery/downloads","issues_url":"https://api.github.com/repos/facebook/osquery/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/osquery/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/osquery/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/osquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/osquery/labels{/name}","releases_url":"https://api.github.com/repos/facebook/osquery/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/osquery/deployments","created_at":"2014-07-29T20:27:33Z","updated_at":"2016-12-06T20:13:31Z","pushed_at":"2016-12-06T20:57:31Z","git_url":"git://github.com/facebook/osquery.git","ssh_url":"git@github.com:facebook/osquery.git","clone_url":"https://github.com/facebook/osquery.git","svn_url":"https://github.com/facebook/osquery","homepage":"https://osquery.io","size":13950,"stargazers_count":7508,"watchers_count":7508,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":868,"mirror_url":null,"open_issues_count":86,"forks":868,"open_issues":86,"watchers":7508,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/osquery/pulls/2760"},"html":{"href":"https://github.com/facebook/osquery/pull/2760"},"issue":{"href":"https://api.github.com/repos/facebook/osquery/issues/2760"},"comments":{"href":"https://api.github.com/repos/facebook/osquery/issues/2760/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/osquery/pulls/2760/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/osquery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/osquery/pulls/2760/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/osquery/statuses/38b27877f2ed4cde1db42630ba0dfe8348edccab"}}}}
{"actor":{"display_login":"theopolis"}}