# Scan Assit Agent not listening on port 21047

**URL:** <https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576>\
**Category:** InsightVM\
**Tags:** InsightVM\
**Created:** [November 30, 2022, 9:55pm UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576 "2022-11-30T21:55:34Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![ppmcgrail](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/p/848f3c/32.png) [@ppmcgrail](https://discuss.rapid7.com/u/ppmcgrail)\
**Post date:** [November 30, 2022, 9:55pm UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/1 "2022-11-30T21:55:35Z")

</div>

We have the Scan Assist agent installed on our Windows 10 device and the agent is running, but is not listening on port 21047 as the documentation states. Every policy scan we run fail with and error and no details on what that error might be…

2022-11-30T19:41:23 [INFO] [Thread: [WP-Policy-Evaluation@10.200.1.107](mailto:WP-Policy-Evaluation@10.200.1.107)] [Site: WP-Policy-Evaluation] [10.200.1.107] Finalizing policy check result data.

2022-11-30T19:41:23 [INFO] [Thread: [WP-Policy-Evaluation@10.200.1.107](mailto:WP-Policy-Evaluation@10.200.1.107)] [Site: WP-Policy-Evaluation] xccdf\_org.cisecurity.benchmarks\_benchmark\_1.10.1\_CIS\_Microsoft\_Windows\_10\_Enterprise\_Release\_20H2\_Benchmark:1.10.1:xccdf\_org.cisecurity.benchmarks\_profile\_Level\_1\_L1\_\_Next\_Generation\_Windows\_Security\_NG:xccdf\_org.cisecurity.benchmarks\_rule\_18.9.46.4\_NG\_Ensure\_Allow\_files\_to\_download\_and\_save\_to\_the\_host\_operating\_system\_from\_Microsoft\_Defender\_Application\_Guard\_is\_set\_to\_Disabled (CIS-1.10.1/CIS\_WINDOWS\_10\_20H2/CIS\_Microsoft\_Windows\_10\_Enterprise\_Release\_20H2\_Benchmark\_v1.10.1-oval.xml/oval-org.cisecurity.benchmarks.windows\_10-def-1638254) - ERROR

---

<div class="post-metadata">

**Author:** ![john\_hartman](https://discuss.rapid7.com/user_avatar/discuss.rapid7.com/john_hartman/32/1255_2.png) [@john\_hartman](https://discuss.rapid7.com/u/john_hartman)\
**Post date:** [November 30, 2022, 10:27pm UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/2 "2022-11-30T22:27:35Z")

</div>

Does the scan result clearly state that there was a failed authentication or no credentials provided?

---

<div class="post-metadata">

**Author:** ![john\_hartman](https://discuss.rapid7.com/user_avatar/discuss.rapid7.com/john_hartman/32/1255_2.png) [@john\_hartman](https://discuss.rapid7.com/u/john_hartman)\
**Post date:** [November 30, 2022, 10:32pm UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/3 "2022-11-30T22:32:03Z")

</div>

something like this:  
 ![Screen Shot 2022-11-30 at 5.31.42 PM](https://forum-uploads-hub-prod-1-us-east-1-rapid7-com.s3.dualstack.us-east-1.amazonaws.com/original/2X/2/294d163c9b1b1b3f4bbb05226c8532dfb8aeaee4.png)

---

<div class="post-metadata">

**Author:** ![ppmcgrail](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/p/848f3c/32.png) [@ppmcgrail](https://discuss.rapid7.com/u/ppmcgrail)\
**Post date:** [December 1, 2022, 2:50am UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/4 "2022-12-01T02:50:10Z")

</div>

We are using Scan Assist so no credentials are provided, the agent is installed on the OS Instance and communication between the scanner and the device is supposed to be done with a Certificate of port 21047, but the agent is not listening on port 21047 for some reason…  
The attached file show the service is running, but the service is not listening on port 21047, so I can only assume that is the cause of the error, but the scan log has now information pointing at the cause of the failure

snippet from the log…  
2022-11-19T05:02:03 [INFO] [Thread: Scan 59] [Site: WP-Policy-Evaluation] NMAP: IPV4 ARGUMENTS: /opt/rapid7/nexpose/nse/nmap/nmap --privileged -n -PS21047 -PU21047 -sS -sU -p T:1-1040,1080,1098-1099,1125,1194,1214,1220,1352,1433,1500,1503,1521,1524,1526,1720,1723,1731,1812-1813,1818-1819,1895,1953,1959,1981,2000,2002,2030,2049,2100,2200,2222,2301,2375,2379,2381,2401,2433,2456,2500,2556,2745,3000-3001,3121,3127-3128,3230-3235,3268-3269,3306,3339,3389,3460,3527,4000,4045,4100,4242,4430,4443-4444,4505-4506,4661-4662,4711,4786,4848,5000,5010,5059-5061,5101,5180,5190-5193,5250,5432,5554-5555,5560,5566,5631,5678,5800-5803,5900-6009,6101,6106,6112,6346,6379,6588,6777,7001-7002,7070,7100,7510,7777-7778,7990,8000-8001,8004-8005,8008,8080-8083,8095,8098-8100,8153-8154,8180-8181,8383-8384,8443-8444,8470-8480,8500,8787,8866,8888,9090,9100-9102,9343,9443,9470-9476,9480,9495,9996,9999-10000,10025,10168,11211,12345-12346,13659,16080,18181-18185,18207-18208,18231-18232,18983,19190-19191,20034,21047,22226,27000-27010,27017,27374,27665,31337,32764,32771,33333,49152,49400,50000,51080,51443,54320,60000,60148,63148,U:7,9,11,13,17,19,37,53,67-69,88,111,123,135,137-139,161-162,177,213,259-260,445,464,500,514,520,523,623,631,749-751,1194,1434,1701,1812-1813,1900,2049,2746,3230-3235,3401,4045,4500,4665-4666,4672,5059-5061,5351,5353,5632,6429,7777,9100-9102,11211,17185,18233,21047,23945,26000-26004,26198,27015-27030,27444,27960-27964,30720-30724,31337,31400,32771,34555,44400,47545,49152,54321 --max-retries 3 --min-rtt-timeout 500ms --max-rtt-timeout 3000ms --initial-rtt-timeout 500ms --defeat-rst-ratelimit --min-rate 450 --max-rate 15000 --script-args=vulns.showall --script=mobileiron-sentry-detection.nse,ssh-hostkey.nse,ssh2-enum-algos.nse,mobileiron-core-detection.nse,codemeter-detection.nse,microsoft-exchange-server-detection.nse,pulse-connect-secure-detection.nse,kaseya-vsa-detection.nse,accellion-fta-detection.nse --script-timeout 180 --datadir /opt/rapid7/nexpose/plugins/nmap-config -oX - -v  
2022-11-19T05:02:03 [INFO] [Thread: Scan 59] [Site: WP-Policy-Evaluation] NMAP: IPV6 ARGUMENTS: /opt/rapid7/nexpose/nse/nmap/nmap --privileged -n -PS21047 -PU21047 -sS -sU -p T:1-1040,1080,1098-1099,1125,1194,1214,1220,1352,1433,1500,1503,1521,1524,1526,1720,1723,1731,1812-1813,1818-1819,1895,1953,1959,1981,2000,2002,2030,2049,2100,2200,2222,2301,2375,2379,2381,2401,2433,2456,2500,2556,2745,3000-3001,3121,3127-3128,3230-3235,3268-3269,3306,3339,3389,3460,3527,4000,4045,4100,4242,4430,4443-4444,4505-4506,4661-4662,4711,4786,4848,5000,5010,5059-5061,5101,5180,5190-5193,5250,5432,5554-5555,5560,5566,5631,5678,5800-5803,5900-6009,6101,6106,6112,6346,6379,6588,6777,7001-7002,7070,7100,7510,7777-7778,7990,8000-8001,8004-8005,8008,8080-8083,8095,8098-8100,8153-8154,8180-8181,8383-8384,8443-8444,8470-8480,8500,8787,8866,8888,9090,9100-9102,9343,9443,9470-9476,9480,9495,9996,9999-10000,10025,10168,11211,12345-12346,13659,16080,18181-18185,18207-18208,18231-18232,18983,19190-19191,20034,21047,22226,27000-27010,27017,27374,27665,31337,32764,32771,33333,49152,49400,50000,51080,51443,54320,60000,60148,63148,U:7,9,11,13,17,19,37,53,67-69,88,111,123,135,137-139,161-162,177,213,259-260,445,464,500,514,520,523,623,631,749-751,1194,1434,1701,1812-1813,1900,2049,2746,3230-3235,3401,4045,4500,4665-4666,4672,5059-5061,5351,5353,5632,6429,7777,9100-9102,11211,17185,18233,21047,23945,26000-26004,26198,27015-27030,27444,27960-27964,30720-30724,31337,31400,32771,34555,44400,47545,49152,54321 --max-retries 3 --min-rtt-timeout 500ms --max-rtt-timeout 3000ms --initial-rtt-timeout 500ms --defeat-rst-ratelimit --min-rate 450 --max-rate 15000 --script-args=vulns.showall --script=mobileiron-sentry-detection.nse,ssh-hostkey.nse,ssh2-enum-algos.nse,mobileiron-core-detection.nse,codemeter-detection.nse,microsoft-exchange-server-detection.nse,pulse-connect-secure-detection.nse,kaseya-vsa-detection.nse,accellion-fta-detection.nse --script-timeout 180 --datadir /opt/rapid7/nexpose/plugins/nmap-config -oX - -v -6

![Rapid7-agent-netstat](https://forum-uploads-hub-prod-1-us-east-1-rapid7-com.s3.dualstack.us-east-1.amazonaws.com/original/2X/2/27b217f343c2650d7b3fd22ae60b085e57603e8b.jpeg)

---

<div class="post-metadata">

**Author:** ![john\_hartman](https://discuss.rapid7.com/user_avatar/discuss.rapid7.com/john_hartman/32/1255_2.png) [@john\_hartman](https://discuss.rapid7.com/u/john_hartman)\
**Post date:** [December 1, 2022, 3:37am UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/5 "2022-12-01T03:37:00Z")

</div>

Ok so I think there is some confusion here around the difference between the Insight Agent and the Scan Assistant.

The Scan Assistant does use the certificate as you mentioned that it displays on port 21047. However, it is not the Insight Agent service that is listening on that port.

The scan assistant is the “credentials” used as far as InsightVM is concerned. So if you’re scanning an asset and using the Scan Assistant as the credentials then the scan result page will tell you whether or not they succeeded.

---

<div class="post-metadata">

**Author:** ![john\_hartman](https://discuss.rapid7.com/user_avatar/discuss.rapid7.com/john_hartman/32/1255_2.png) [@john\_hartman](https://discuss.rapid7.com/u/john_hartman)\
**Post date:** [December 1, 2022, 3:38am UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/6 "2022-12-01T03:38:33Z")

</div>

> **[Using the Scan Assistant | InsightVM Documentation](https://docs.rapid7.com/insightvm/scan-assistant-combined/)**
>
> Overview of the Scan Assistant and how it works for Linux and Windows.

Everything you need to know regarding the scan assistant should be in the link above, keep in mind that this is completely separate from the InsightAgent.

---

<div class="post-metadata">

**Author:** ![ppmcgrail](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/p/848f3c/32.png) [@ppmcgrail](https://discuss.rapid7.com/u/ppmcgrail)\
**Post date:** [December 1, 2022, 3:39am UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/7 "2022-12-01T03:39:17Z")

</div>

Rapid7 scan assist error

No SiteSynopsis entry has ID: 3

Testing the Scan Assist from port fails with invalid Credentials

---

<div class="post-metadata">

**Author:** ![john\_hartman](https://discuss.rapid7.com/user_avatar/discuss.rapid7.com/john_hartman/32/1255_2.png) [@john\_hartman](https://discuss.rapid7.com/u/john_hartman)\
**Post date:** [December 1, 2022, 3:41am UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/8 "2022-12-01T03:41:59Z")

</div>

I’m not sure the “test Credentials” in the setup actually works the way it should for certificate type credentials like the SSH Key and Scan Assistant.

The Site Synopsis error can most likely be ignored, I assume that the credentials was set to be shared with all sites or something and was trying to apply to the Rapid7 Insight Agents or something.

---

<div class="post-metadata">

**Author:** ![john\_hartman](https://discuss.rapid7.com/user_avatar/discuss.rapid7.com/john_hartman/32/1255_2.png) [@john\_hartman](https://discuss.rapid7.com/u/john_hartman)\
**Post date:** [December 1, 2022, 3:43am UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/9 "2022-12-01T03:43:46Z")

</div>

Can you show a screenshot of the endpoint where the scan assistant is installed showing the installed applications? The scan assistant should be listed there.

Also the scan template you’re using to scan with should have port 21047 listed in both the Asset and Service discovery portions.

If that’s all set, we can look at the actual scan result and see what it’s saying for the credentials.

---

<div class="post-metadata">

**Author:** ![ppmcgrail](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/p/848f3c/32.png) [@ppmcgrail](https://discuss.rapid7.com/u/ppmcgrail)\
**Post date:** [December 1, 2022, 3:48am UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/10 "2022-12-01T03:48:27Z")

</div>

![Screenshot 2022-11-30 at 10.47.43 PM](https://forum-uploads-hub-prod-1-us-east-1-rapid7-com.s3.dualstack.us-east-1.amazonaws.com/original/2X/a/a69e0a64b6cf4233196466dd784a7b34aa0100eb.png)  
Portal settings for Scan assistant

---

<div class="post-metadata">

**Author:** ![ppmcgrail](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/p/848f3c/32.png) [@ppmcgrail](https://discuss.rapid7.com/u/ppmcgrail)\
**Post date:** [December 1, 2022, 3:52am UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/11 "2022-12-01T03:52:41Z")

</div>

![Screenshot 2022-11-30 at 10.50.32 PM](https://forum-uploads-hub-prod-1-us-east-1-rapid7-com.s3.dualstack.us-east-1.amazonaws.com/original/2X/a/a52e7284c214291079421ebbc6e78d3570c224ae.jpeg)

So the issue now may be the Cert/PEM file…

msiexec /i ScanAssistantInstaller.msi CLIENT\_CERTIFICATE="-----BEGIN CERTIFICATE----- PEM from Rapid7 Console -----END CERTIFICATE----- "

---

<div class="post-metadata">

**Author:** ![john\_hartman](https://discuss.rapid7.com/user_avatar/discuss.rapid7.com/john_hartman/32/1255_2.png) [@john\_hartman](https://discuss.rapid7.com/u/john_hartman)\
**Post date:** [December 1, 2022, 4:03am UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/12 "2022-12-01T04:03:35Z")

</div>

Yea so when you install the scan certifiacte you have to do it with the CLI and replace that PEM with the certificate you were showing in the scan assistant credential

---

<div class="post-metadata">

**Author:** ![ppmcgrail](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/p/848f3c/32.png) [@ppmcgrail](https://discuss.rapid7.com/u/ppmcgrail)\
**Post date:** [December 1, 2022, 4:13am UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/13 "2022-12-01T04:13:46Z")

</div>

msiexec /i ScanAssistantInstaller.msi CLIENT\_CERTIFICATE="-----BEGIN CERTIFICATE----- PEM from Portal -----END CERTIFICATE-----"

C:\Gemini-Setup\Rapid7-agent\>netstat -a |find “21047”  
TCP 0.0.0.0:21047 GT-4Q22:0 LISTENING  
TCP [::]:21047 GT-4Q22:0 LISTENING

Scan is running now, we shall see what happens

---

<div class="post-metadata">

**Author:** ![ppmcgrail](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/p/848f3c/32.png) [@ppmcgrail](https://discuss.rapid7.com/u/ppmcgrail)\
**Post date:** [December 1, 2022, 4:15am UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/14 "2022-12-01T04:15:44Z")

</div>

Much better now

2022-12-01T04:12:34 [DEBUG] [Thread: [September-Scan@10.200.1.107](mailto:September-Scan@10.200.1.107)] [Site: September-Scan] PolicyResults: Policy rule count: 469  
2022-12-01T04:12:34 [DEBUG] [Thread: [September-Scan@10.200.1.107](mailto:September-Scan@10.200.1.107)] [Site: September-Scan] PolicyResults: Policy rule pass count: 402  
2022-12-01T04:12:34 [DEBUG] [Thread: [September-Scan@10.200.1.107](mailto:September-Scan@10.200.1.107)] [Site: September-Scan] PolicyResults: Policy rule fail count: 67

More work to do, but much better

---

<div class="post-metadata">

**Author:** ![ppmcgrail](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/p/848f3c/32.png) [@ppmcgrail](https://discuss.rapid7.com/u/ppmcgrail)\
**Post date:** [December 1, 2022, 4:29am UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/15 "2022-12-01T04:29:20Z")

</div>

@john_hartman - Thanks for the assistenance, we are now seeing Policy results  
[Gemini-Base-OS-Template-Compliance.pdf](https://discuss.rapid7.com/uploads/short-url/8vT3BG19R7SZBqXMTtKyrI6l871.pdf) (218.2 KB)

---

<div class="post-metadata">

**Author:** ![ntorres1](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/n/b5e925/32.png) [@ntorres1](https://discuss.rapid7.com/u/ntorres1)\
**Post date:** [December 7, 2022, 4:29pm UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/16 "2022-12-07T16:29:27Z")

</div>

I am having the same issue, but from what I read in here, I don’t see an distinct resolution that resolved my issue. I followed everything in here.

I used the install command with the PEM from the instructions. I check to see if the computer is listening on port 21047 and find that it is not. The ScanAssistant service is running and still not listening on port 21047.

---

<div class="post-metadata">

**Author:** ![ben\_fallon1](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/b/ac8455/32.png) [@ben\_fallon1](https://discuss.rapid7.com/u/ben_fallon1)\
**Post date:** [December 8, 2022, 1:59pm UTC](https://discuss.rapid7.com/t/scan-assit-agent-not-listening-on-port-21047/17576/17 "2022-12-08T13:59:55Z")

</div>

Good morning ntorres,

If you see the Scan Assistant in Add/Remove programs and listed as a service on your endpoints but it is still not listening on 21047, that is usually a good indicator that the install did not complete correctly and the most common cause is that the install didn’t accept the PEM during the install. If you add the following switch to the install command the installer will generate an install log and let you see where the process is failing:

```auto
/le install_log.txt

```
