This file is indexed.

/usr/share/openvas/openvasmd/global_report_formats/9e5e5deb-879e-4ecc-8be6-a71cd0875cdd/hostvisdot-summary.xsl is in openvas-manager-common 6.0.9-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output
    method = "text"
    indent = "no" />

<!--
OpenVAS Manager
$Id$
Description: Stylesheet for generating results as dot file.

Authors:
Michael Wiegand <michael.wiegand@greenbone.net>
Timo Pollmeier <timo.pollmeier@greenbone.net>

Copyright:
Copyright (C) 2010, 2013 Greenbone Networks GmbH

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-->

  <xsl:template name="newline">
    <xsl:text>
</xsl:text>
  </xsl:template>

<xsl:template match="report">
digraph scan {
  <xsl:choose>
    <xsl:when test="report_format/param[name = 'Node Distance']">
      <xsl:text>  nodesep = </xsl:text>
      <xsl:value-of select="report_format/param[name = 'Node Distance']/value"/>
      <xsl:text>;</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>  nodesep = 8;</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:call-template name="newline"/>
  ranksep = 2;
  overlap = "true";
  fontsize = 8.0;
  concentrate = "true";
  root = "OpenVAS";
  "OpenVAS" [label="OpenVAS", style=filled, color=chartreuse3];
    <xsl:for-each select="host" >
      <xsl:variable name="current_host" select="ip"/>
      <xsl:choose>
        <xsl:when test="count(../results/result[host/text() = $current_host][threat/text() = 'High']) &gt; 0">
  "<xsl:value-of select="$current_host"/>" [label="<xsl:value-of select="$current_host"/>", style=filled, shape=Mrecord, color=red, fontcolor=white];
        </xsl:when>
        <xsl:otherwise>
          <xsl:choose>
            <xsl:when test="count(../results/result[host/text() = $current_host][threat/text() = 'Medium']) &gt; 0">
  "<xsl:value-of select="$current_host"/>" [label="<xsl:value-of select="$current_host"/>", style=filled, shape=Mrecord, color=orange, fontcolor=white];
            </xsl:when>
            <xsl:otherwise>
              <xsl:choose>
                <xsl:when test="count(../results/result[host/text() = $current_host][threat/text() = 'Low']) &gt; 0">
  "<xsl:value-of select="$current_host"/>" [label="<xsl:value-of select="$current_host"/>", style=filled, shape=Mrecord, color=cornflowerblue, fontcolor=white];
                </xsl:when>
              </xsl:choose>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="detail[name='traceroute']" mode="trace">
        <xsl:with-param name="host" select="$current_host" />
      </xsl:apply-templates>
      <xsl:call-template name="port_recurse">
        <xsl:with-param name="port_host" select="$current_host"/>
        <xsl:with-param name="port_list" select="detail[name='ports']/value"/>
      </xsl:call-template>
    </xsl:for-each>
}
  </xsl:template>

  <xsl:template match="detail" mode="trace">
    <xsl:param name="host"/>
    <xsl:variable name="fullroute" select="value" />
    <xsl:variable name="gsm" select="substring-before($fullroute, ',')" />
    <xsl:variable name="route" select="substring-after($fullroute, ',')" />
    <xsl:variable name="nexthop" select="substring-before($route, ',')" />
    <xsl:choose>
      <xsl:when test="contains($route, ',')">
        "OpenVAS" -> "<xsl:value-of select="$nexthop"/>";
        <xsl:call-template name="trace_recurse">
          <xsl:with-param name="trace_list" select="$route"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:choose>
          <xsl:when test="$route">
            "OpenVAS" -> "<xsl:value-of select="$route"/>";
          </xsl:when>
          <xsl:otherwise>
            "OpenVAS" -> "127.0.0.1" [style=dashed];
          </xsl:otherwise>
        </xsl:choose>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <xsl:template name="trace_recurse">
    <xsl:param name="trace_list"/>
    <xsl:choose>
      <xsl:when test="contains($trace_list, ',')">
        <xsl:variable name="head" select="substring-before($trace_list, ',')" />
        <xsl:variable name="tail" select="substring-after($trace_list, ',')"/>
        <xsl:variable name="next" select="substring-before($tail, ',')"/>
        <xsl:choose>
          <xsl:when test="($next) and not ($head = $next) and not (contains ($head, '*')) and not (contains ($next, '*'))">
            "<xsl:value-of select="$head"/>" -> "<xsl:value-of select="$next"/>";
          </xsl:when>
          <xsl:when test="not ($next) and ($tail) and not ($head = $tail) and not (contains ($head, '*')) and not (contains ($tail, '*'))">
            "<xsl:value-of select="$head"/>" -> "<xsl:value-of select="$tail"/>";
          </xsl:when>
        </xsl:choose>
        <xsl:call-template name="trace_recurse">
          <xsl:with-param name="trace_list" select="$tail"/>
        </xsl:call-template>
      </xsl:when>
    </xsl:choose>
  </xsl:template>

  <xsl:template name="port_recurse">
    <xsl:param name="port_list"/>
    <xsl:param name="port_host"/>
    <xsl:choose>
      <xsl:when test="contains($port_list, ',')">
        <xsl:variable name="head" select="substring-before($port_list, ',')" />
        <xsl:variable name="tail" select="substring-after($port_list, ',')"/>
        "<xsl:value-of select="$port_host"/>:<xsl:value-of select="$head"/>" [label ="<xsl:value-of select="$head"/>", shape="Mrecord"];
        "<xsl:value-of select="$port_host"/>" -> "<xsl:value-of select="$port_host"/>:<xsl:value-of select="$head"/>" [len = 0.2, arrowhead="none"];
        <xsl:call-template name="port_recurse">
          <xsl:with-param name="port_list" select="$tail"/>
          <xsl:with-param name="port_host" select="$port_host"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:when test="$port_list and not (contains($port_list, ','))">
        "<xsl:value-of select="$port_host"/>:<xsl:value-of select="$port_list"/>" [label ="<xsl:value-of select="$port_list"/>", shape="Mrecord"];
        "<xsl:value-of select="$port_host"/>" -> "<xsl:value-of select="$port_host"/>:<xsl:value-of select="$port_list"/>" [len = 0.2, arrowhead="none"];
      </xsl:when>
    </xsl:choose>
  </xsl:template>

  <xsl:template match="/">
    <xsl:choose>
      <xsl:when test="report/@extension='xml'">
        <xsl:apply-templates select="report/report"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:apply-templates select="report"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

</xsl:stylesheet>