{"id":46,"date":"2016-04-23T18:14:40","date_gmt":"2016-04-23T22:14:40","guid":{"rendered":"http:\/\/www.hackspot.net\/CircleBlog\/?p=46"},"modified":"2016-04-24T11:15:39","modified_gmt":"2016-04-24T15:15:39","slug":"which-tasks-are-listening-to-which-ports","status":"publish","type":"post","link":"http:\/\/www.hackspot.net\/CircleBlog\/2016\/04\/23\/which-tasks-are-listening-to-which-ports\/","title":{"rendered":"Which tasks are listening to which ports?"},"content":{"rendered":"<p>Here&#8217;s the output of netstat, showing which tasks are listening to which ports:<\/p>\n<pre>root@circle:~# netstat -tulpn\r\nActive Internet connections (only servers)\r\nProto Recv-Q Send-Q Local Address Foreign Address State PID\/Program name\r\ntcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1099\/webd\r\ntcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1263\/dnsmasq\r\ntcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 850\/dropbear\r\ntcp 0 0 0.0.0.0:4567 0.0.0.0:* LISTEN 4670\/apid\r\ntcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 1099\/webd\r\ntcp 0 0 0.0.0.0:4444 0.0.0.0:* LISTEN 4670\/apid\r\ntcp 0 0 :::22 :::* LISTEN 850\/dropbear\r\nudp 0 0 0.0.0.0:53 0.0.0.0:* 1263\/dnsmasq\r\nudp 0 0 0.0.0.0:67 0.0.0.0:* 1263\/dnsmasq\r\nudp 0 0 0.0.0.0:4445 0.0.0.0:* 1086\/pingpongd\r\nudp 0 0 0.0.0.0:37518 0.0.0.0:* 1327\/rclient\r\nudp 0 0 127.0.0.1:3001 0.0.0.0:* 1097\/sitedbd\r\nudp 0 0 224.0.0.251:5353 0.0.0.0:* 1232\/mdns-scan\r\nudp 0 0 0.0.0.0:5353 0.0.0.0:* 1228\/mdnsd<\/pre>\n<p>Port 4567 is used by the &#8220;apid&#8221; (API daemon) &#8211; it&#8217;s an https interface to send commands\/request data from the Circle device.<\/p>\n<p>For example, here&#8217;s one of the simplest queries using &#8220;curl&#8221; (this requests a list of access points seen by the Circle device):<\/p>\n<pre>$ curl -k \"https:\/\/10.123.234.1:4567<strong>\/api\/SCAN<\/strong>\"\r\n{\r\n\"result\":\"success\",\r\n\"scan\":[\r\n{\r\n\"signal\":\"-83\",\r\n\"ssid\":\"ap name 1\"\r\n},\r\n{\r\n\"signal\":\"-85\",\r\n\"ssid\":\"nknown\"\r\n},\r\n{\r\n\"signal\":\"-86\",\r\n\"ssid\":\"HOME-E7A4-2.4\"\r\n},\r\n{\r\n\"signal\":\"-60\",\r\n\"ssid\":\"ap name 2\"\r\n},\r\n{\r\n\"signal\":\"-85\",\r\n\"ssid\":\"JZSYR\"\r\n},\r\n{\r\n\"signal\":\"-87\",\r\n\"ssid\":\"xfinitywifi\"\r\n},\r\n{\r\n\"signal\":\"-89\",\r\n\"ssid\":\"HOME-B7A4\"\r\n}\r\n]\r\n\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>Note that &#8220;apid&#8221; is also listening on port 4444. \u00a0This seems to be a convenience for locally-run commands (run from the Circle device itself). It allows for non-encrypted (non-https) queries\/commands, but only when the socket connection is from inside the Circle device.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s the output of netstat, showing which tasks are listening to which ports: root@circle:~# netstat -tulpn Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID\/Program name tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1099\/webd tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1263\/dnsmasq tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 850\/dropbear tcp 0 0 &hellip; <a href=\"http:\/\/www.hackspot.net\/CircleBlog\/2016\/04\/23\/which-tasks-are-listening-to-which-ports\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Which tasks are listening to which ports?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/www.hackspot.net\/CircleBlog\/wp-json\/wp\/v2\/posts\/46"}],"collection":[{"href":"http:\/\/www.hackspot.net\/CircleBlog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hackspot.net\/CircleBlog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hackspot.net\/CircleBlog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hackspot.net\/CircleBlog\/wp-json\/wp\/v2\/comments?post=46"}],"version-history":[{"count":4,"href":"http:\/\/www.hackspot.net\/CircleBlog\/wp-json\/wp\/v2\/posts\/46\/revisions"}],"predecessor-version":[{"id":50,"href":"http:\/\/www.hackspot.net\/CircleBlog\/wp-json\/wp\/v2\/posts\/46\/revisions\/50"}],"wp:attachment":[{"href":"http:\/\/www.hackspot.net\/CircleBlog\/wp-json\/wp\/v2\/media?parent=46"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hackspot.net\/CircleBlog\/wp-json\/wp\/v2\/categories?post=46"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hackspot.net\/CircleBlog\/wp-json\/wp\/v2\/tags?post=46"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}