Which tasks are listening to which ports?

Here’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 0.0.0.0:4567 0.0.0.0:* LISTEN 4670/apid
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 1099/webd
tcp 0 0 0.0.0.0:4444 0.0.0.0:* LISTEN 4670/apid
tcp 0 0 :::22 :::* LISTEN 850/dropbear
udp 0 0 0.0.0.0:53 0.0.0.0:* 1263/dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0:* 1263/dnsmasq
udp 0 0 0.0.0.0:4445 0.0.0.0:* 1086/pingpongd
udp 0 0 0.0.0.0:37518 0.0.0.0:* 1327/rclient
udp 0 0 127.0.0.1:3001 0.0.0.0:* 1097/sitedbd
udp 0 0 224.0.0.251:5353 0.0.0.0:* 1232/mdns-scan
udp 0 0 0.0.0.0:5353 0.0.0.0:* 1228/mdnsd

Port 4567 is used by the “apid” (API daemon) – it’s an https interface to send commands/request data from the Circle device.

For example, here’s one of the simplest queries using “curl” (this requests a list of access points seen by the Circle device):

$ curl -k "https://10.123.234.1:4567/api/SCAN"
{
"result":"success",
"scan":[
{
"signal":"-83",
"ssid":"ap name 1"
},
{
"signal":"-85",
"ssid":"nknown"
},
{
"signal":"-86",
"ssid":"HOME-E7A4-2.4"
},
{
"signal":"-60",
"ssid":"ap name 2"
},
{
"signal":"-85",
"ssid":"JZSYR"
},
{
"signal":"-87",
"ssid":"xfinitywifi"
},
{
"signal":"-89",
"ssid":"HOME-B7A4"
}
]

}

 

Note that “apid” is also listening on port 4444.  This 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.

 

 

Leave a Reply