|
9 | 9 | <table id="service-inventory" class="table table-striped table-hover table-bordered align-middle dataTable" role="grid"> |
10 | 10 | <thead class="table-light"> |
11 | 11 | <tr> |
12 | | - <th scope="col" class="service-inventory-name-column">Service Name</th> |
13 | | - <th scope="col" class="service-inventory-count-column">Host Count</th> |
14 | 12 | <th scope="col">Host Details</th> |
15 | 13 | </tr> |
16 | 14 | </thead> |
|
22 | 20 | <xsl:variable name="effective-hostname"> |
23 | 21 | <xsl:call-template name="resolve-effective-hostname"/> |
24 | 22 | </xsl:variable> |
| 23 | + <xsl:variable name="http-headers-output" select="script[@id='http-headers']/@output"/> |
| 24 | + <xsl:variable name="http-fingerprint-output" select="script[@id='fingerprint-strings']/elem[@key='GetRequest']"/> |
| 25 | + <xsl:variable name="http-title"> |
| 26 | + <xsl:choose> |
| 27 | + <xsl:when test="count(script[@id='http-title']/elem[@key='title']) > 0"> |
| 28 | + <xsl:value-of select="script[@id='http-title']/elem[@key='title']"/> |
| 29 | + </xsl:when> |
| 30 | + <xsl:otherwise> |
| 31 | + <xsl:value-of select="script[@id='http-title']/@output"/> |
| 32 | + </xsl:otherwise> |
| 33 | + </xsl:choose> |
| 34 | + </xsl:variable> |
| 35 | + <xsl:variable name="http-location"> |
| 36 | + <xsl:choose> |
| 37 | + <xsl:when test="count(script[@id='http-title']/elem[@key='redirect_url']) > 0"> |
| 38 | + <xsl:value-of select="script[@id='http-title']/elem[@key='redirect_url']"/> |
| 39 | + </xsl:when> |
| 40 | + <xsl:when test="contains($http-headers-output, 'Location:')"> |
| 41 | + <xsl:call-template name="extract-header-value"> |
| 42 | + <xsl:with-param name="text" select="$http-headers-output"/> |
| 43 | + <xsl:with-param name="label" select="'Location'"/> |
| 44 | + </xsl:call-template> |
| 45 | + </xsl:when> |
| 46 | + <xsl:otherwise> |
| 47 | + <xsl:call-template name="extract-header-value"> |
| 48 | + <xsl:with-param name="text" select="$http-fingerprint-output"/> |
| 49 | + <xsl:with-param name="label" select="'Location'"/> |
| 50 | + </xsl:call-template> |
| 51 | + </xsl:otherwise> |
| 52 | + </xsl:choose> |
| 53 | + </xsl:variable> |
| 54 | + <xsl:variable name="http-server"> |
| 55 | + <xsl:choose> |
| 56 | + <xsl:when test="count(script[@id='http-server-header']/elem) > 0"> |
| 57 | + <xsl:value-of select="script[@id='http-server-header']/elem[1]"/> |
| 58 | + </xsl:when> |
| 59 | + <xsl:when test="string(script[@id='http-server-header']/@output) != ''"> |
| 60 | + <xsl:value-of select="script[@id='http-server-header']/@output"/> |
| 61 | + </xsl:when> |
| 62 | + <xsl:when test="contains($http-headers-output, 'Server:')"> |
| 63 | + <xsl:call-template name="extract-header-value"> |
| 64 | + <xsl:with-param name="text" select="$http-headers-output"/> |
| 65 | + <xsl:with-param name="label" select="'Server'"/> |
| 66 | + </xsl:call-template> |
| 67 | + </xsl:when> |
| 68 | + <xsl:otherwise> |
| 69 | + <xsl:call-template name="extract-header-value"> |
| 70 | + <xsl:with-param name="text" select="$http-fingerprint-output"/> |
| 71 | + <xsl:with-param name="label" select="'Server'"/> |
| 72 | + </xsl:call-template> |
| 73 | + </xsl:otherwise> |
| 74 | + </xsl:choose> |
| 75 | + </xsl:variable> |
| 76 | + <xsl:variable name="http-powered-by"> |
| 77 | + <xsl:choose> |
| 78 | + <xsl:when test="contains(translate($http-headers-output, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), 'powered-by:')"> |
| 79 | + <xsl:call-template name="extract-powered-by-value"> |
| 80 | + <xsl:with-param name="text" select="$http-headers-output"/> |
| 81 | + </xsl:call-template> |
| 82 | + </xsl:when> |
| 83 | + <xsl:otherwise> |
| 84 | + <xsl:call-template name="extract-powered-by-value"> |
| 85 | + <xsl:with-param name="text" select="$http-fingerprint-output"/> |
| 86 | + </xsl:call-template> |
| 87 | + </xsl:otherwise> |
| 88 | + </xsl:choose> |
| 89 | + </xsl:variable> |
| 90 | + <xsl:variable name="http-stack-source" select="concat($http-headers-output, '
', $http-fingerprint-output)"/> |
| 91 | + <xsl:variable name="http-stack-hint"> |
| 92 | + <xsl:call-template name="extract-stack-hint-line"> |
| 93 | + <xsl:with-param name="text" select="$http-stack-source"/> |
| 94 | + </xsl:call-template> |
| 95 | + </xsl:variable> |
| 96 | + <xsl:variable name="http-powered-by-evidence"> |
| 97 | + <xsl:choose> |
| 98 | + <xsl:when test="string($http-powered-by) != ''"> |
| 99 | + <xsl:value-of select="$http-powered-by"/> |
| 100 | + </xsl:when> |
| 101 | + <xsl:otherwise> |
| 102 | + <xsl:value-of select="$http-stack-hint"/> |
| 103 | + </xsl:otherwise> |
| 104 | + </xsl:choose> |
| 105 | + </xsl:variable> |
| 106 | + <xsl:variable name="http-powered-by-stack"> |
| 107 | + <xsl:call-template name="normalize-powered-by-stack"> |
| 108 | + <xsl:with-param name="value" select="$http-stack-source"/> |
| 109 | + </xsl:call-template> |
| 110 | + </xsl:variable> |
25 | 111 | <span class="service-inventory-entry"> |
26 | 112 | <xsl:attribute name="data-service"> |
27 | 113 | <xsl:call-template name="render-service-name"/> |
|
44 | 130 | <xsl:attribute name="data-protocol"> |
45 | 131 | <xsl:value-of select="@protocol"/> |
46 | 132 | </xsl:attribute> |
| 133 | + <xsl:attribute name="data-http-title"> |
| 134 | + <xsl:value-of select="$http-title"/> |
| 135 | + </xsl:attribute> |
| 136 | + <xsl:attribute name="data-http-location"> |
| 137 | + <xsl:value-of select="$http-location"/> |
| 138 | + </xsl:attribute> |
| 139 | + <xsl:attribute name="data-http-server"> |
| 140 | + <xsl:value-of select="$http-server"/> |
| 141 | + </xsl:attribute> |
| 142 | + <xsl:attribute name="data-http-stack"> |
| 143 | + <xsl:value-of select="$http-powered-by-stack"/> |
| 144 | + </xsl:attribute> |
| 145 | + <xsl:attribute name="data-http-powered-by"> |
| 146 | + <xsl:value-of select="$http-powered-by-evidence"/> |
| 147 | + </xsl:attribute> |
| 148 | + <xsl:attribute name="data-vulners"> |
| 149 | + <xsl:value-of select=".//script[@id='vulners']/@output"/> |
| 150 | + </xsl:attribute> |
| 151 | + <xsl:for-each select="script[string(@output) != '' and not(contains(@output, 'ERROR: '))]"> |
| 152 | + <span class="service-inventory-script"> |
| 153 | + <xsl:attribute name="data-id"> |
| 154 | + <xsl:value-of select="@id"/> |
| 155 | + </xsl:attribute> |
| 156 | + <xsl:attribute name="data-port"> |
| 157 | + <xsl:value-of select="../@portid"/> |
| 158 | + </xsl:attribute> |
| 159 | + <xsl:attribute name="data-protocol"> |
| 160 | + <xsl:value-of select="../@protocol"/> |
| 161 | + </xsl:attribute> |
| 162 | + <xsl:attribute name="data-valid-from"> |
| 163 | + <xsl:value-of select="table[@key='validity']/elem[@key='notBefore']"/> |
| 164 | + </xsl:attribute> |
| 165 | + <xsl:attribute name="data-valid-to"> |
| 166 | + <xsl:value-of select="table[@key='validity']/elem[@key='notAfter']"/> |
| 167 | + </xsl:attribute> |
| 168 | + <xsl:attribute name="data-self-signed"> |
| 169 | + <xsl:choose> |
| 170 | + <xsl:when test="@id = 'ssl-cert' and normalize-space(concat(table[@key='subject']/elem[@key='commonName'], '|', table[@key='subject']/elem[@key='organizationName'])) != '' and normalize-space(concat(table[@key='subject']/elem[@key='commonName'], '|', table[@key='subject']/elem[@key='organizationName'])) = normalize-space(concat(table[@key='issuer']/elem[@key='commonName'], '|', table[@key='issuer']/elem[@key='organizationName']))">true</xsl:when> |
| 171 | + <xsl:otherwise>false</xsl:otherwise> |
| 172 | + </xsl:choose> |
| 173 | + </xsl:attribute> |
| 174 | + <xsl:value-of select="@output"/> |
| 175 | + </span> |
| 176 | + </xsl:for-each> |
47 | 177 | </span> |
48 | 178 | </xsl:for-each> |
49 | 179 | </div> |
|
0 commit comments