Anonymní profil maléB – Programujte.com
 x   TIP: Přetáhni ikonu na hlavní panel pro připnutí webu

Anonymní profil maléB – Programujte.comAnonymní profil maléB – Programujte.com

 

Příspěvky odeslané z IP adresy 85.207.4.–

maléB
XML / XSL(T) › xml do tabulky
26. 2. 2021   #387551

#2 gna
Díky. to je ono.

maléB
XML / XSL(T) › xml do tabulky
26. 2. 2021   #387549

Ahoj, pomohl by mi prosím někdo s transformací následujícího xml souboru do html tabulky?

Narazil jsem na problém u table/elem kdy to dokážu vypsat jako řádku, ale potřeboval bych to vypsat takto:

<tr>

<td>cvss:</td><td>5.8</td>

<td>type:</td><td>exploitpack</td>

....

</tr>

<host starttime="1613406192" endtime="1613406215"><status state="up" reason="echo-reply" reason_ttl="61"/>
<address addr="10.0.0.1" addrtype="ipv4"/>
<hostnames>
</hostnames>
<ports><extraports state="filtered" count="996">
<extrareasons reason="no-responses" count="972"/>
<extrareasons reason="host-prohibiteds" count="24"/>
</extraports>
<port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="61"/><service name="ssh" product="OpenSSH" version="7.4" extrainfo="protocol 2.0" method="probed" conf="10"><cpe>cpe:/a:openbsd:openssh:7.4</cpe></service><script id="vulners" output="&#xa;  cpe:/a:openbsd:openssh:7.4: &#xa;    &#x9;EXPLOITPACK:98FE96309F9524B8C84C508837551A19&#x9;5.8&#x9;https://vulners.com/exploitpack/EXPLOITPACK:98FE96309F9524B8C84C508837551A19&#x9;*EXPLOIT*&#xa;    &#x9;EXPLOITPACK:5330EA02EBDE345BFC9D6DDDD97F9E97&#x9;5.8&#x9;https://vulners.com/exploitpack/EXPLOITPACK:5330EA02EBDE345BFC9D6DDDD97F9E97&#x9;*EXPLOIT*&#xa;    &#x9;EDB-ID:46516&#x9;5.8&#x9;https://vulners.com/exploitdb/EDB-ID:46516&#x9;*EXPLOIT*&#xa;    &#x9;CVE-2019-6111&#x9;5.8&#x9;https://vulners.com/cve/CVE-2019-6111&#xa;    &#x9;SSH_ENUM&#x9;5.0&#x9;https://vulners.com/canvas/SSH_ENUM&#x9;*EXPLOIT*&#xa;    &#x9;PACKETSTORM:150621&#x9;5.0&#x9;https://vulners.com/packetstorm/PACKETSTORM:150621&#x9;*EXPLOIT*&#xa;    &#x9;MSF:AUXILIARY/SCANNER/SSH/SSH_ENUMUSERS&#x9;5.0&#x9;https://vulners.com/metasploit/MSF:AUXILIARY/SCANNER/SSH/SSH_ENUMUSERS&#x9;*EXPLOIT*&#xa;    &#x9;EXPLOITPACK:F957D7E8A0CC1E23C3C649B764E13FB0&#x9;5.0&#x9;https://vulners.com/exploitpack/EXPLOITPACK:F957D7E8A0CC1E23C3C649B764E13FB0&#x9;*EXPLOIT*&#xa;    &#x9;EXPLOITPACK:EBDBC5685E3276D648B4D14B75563283&#x9;5.0&#x9;https://vulners.com/exploitpack/EXPLOITPACK:EBDBC5685E3276D648B4D14B75563283&#x9;*EXPLOIT*&#xa;    &#x9;EDB-ID:45939&#x9;5.0&#x9;https://vulners.com/exploitdb/EDB-ID:45939&#x9;*EXPLOIT*&#xa;    &#x9;CVE-2018-15919&#x9;5.0&#x9;https://vulners.com/cve/CVE-2018-15919&#xa;    &#x9;CVE-2018-15473&#x9;5.0&#x9;https://vulners.com/cve/CVE-2018-15473&#xa;    &#x9;CVE-2017-15906&#x9;5.0&#x9;https://vulners.com/cve/CVE-2017-15906&#xa;    &#x9;1337DAY-ID-31730&#x9;5.0&#x9;https://vulners.com/zdt/1337DAY-ID-31730&#x9;*EXPLOIT*&#xa;    &#x9;EDB-ID:45233&#x9;4.6&#x9;https://vulners.com/exploitdb/EDB-ID:45233&#x9;*EXPLOIT*&#xa;    &#x9;CVE-2020-14145&#x9;4.3&#x9;https://vulners.com/cve/CVE-2020-14145&#xa;    &#x9;CVE-2019-6110&#x9;4.0&#x9;https://vulners.com/cve/CVE-2019-6110&#xa;    &#x9;CVE-2019-6109&#x9;4.0&#x9;https://vulners.com/cve/CVE-2019-6109&#xa;    &#x9;CVE-2018-20685&#x9;2.6&#x9;https://vulners.com/cve/CVE-2018-20685&#xa;    &#x9;PACKETSTORM:151227&#x9;0.0&#x9;https://vulners.com/packetstorm/PACKETSTORM:151227&#x9;*EXPLOIT*&#xa;    &#x9;EDB-ID:46193&#x9;0.0&#x9;https://vulners.com/exploitdb/EDB-ID:46193&#x9;*EXPLOIT*&#xa;    &#x9;1337DAY-ID-32009&#x9;0.0&#x9;https://vulners.com/zdt/1337DAY-ID-32009&#x9;*EXPLOIT*&#xa;    &#x9;1337DAY-ID-30937&#x9;0.0&#x9;https://vulners.com/zdt/1337DAY-ID-30937&#x9;*EXPLOIT*"><table key="cpe:/a:openbsd:openssh:7.4">
<table>
<elem key="cvss">5.8</elem>
<elem key="type">exploitpack</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EXPLOITPACK:98FE96309F9524B8C84C508837551A19</elem>
</table>
<table>
<elem key="cvss">5.8</elem>
<elem key="type">exploitpack</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EXPLOITPACK:5330EA02EBDE345BFC9D6DDDD97F9E97</elem>
</table>
<table>
<elem key="cvss">5.8</elem>
<elem key="type">exploitdb</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EDB-ID:46516</elem>
</table>
<table>
<elem key="cvss">5.8</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2019-6111</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">canvas</elem>
<elem key="is_exploit">true</elem>
<elem key="id">SSH_ENUM</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">packetstorm</elem>
<elem key="is_exploit">true</elem>
<elem key="id">PACKETSTORM:150621</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">metasploit</elem>
<elem key="is_exploit">true</elem>
<elem key="id">MSF:AUXILIARY/SCANNER/SSH/SSH_ENUMUSERS</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">exploitpack</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EXPLOITPACK:F957D7E8A0CC1E23C3C649B764E13FB0</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">exploitpack</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EXPLOITPACK:EBDBC5685E3276D648B4D14B75563283</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">exploitdb</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EDB-ID:45939</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2018-15919</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2018-15473</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2017-15906</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">zdt</elem>
<elem key="is_exploit">true</elem>
<elem key="id">1337DAY-ID-31730</elem>
</table>
<table>
<elem key="cvss">4.6</elem>
<elem key="type">exploitdb</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EDB-ID:45233</elem>
</table>
<table>
<elem key="cvss">4.3</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2020-14145</elem>
</table>
<table>
<elem key="cvss">4.0</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2019-6110</elem>
</table>
<table>
<elem key="cvss">4.0</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2019-6109</elem>
</table>
<table>
<elem key="cvss">2.6</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2018-20685</elem>
</table>
<table>
<elem key="cvss">0.0</elem>
<elem key="type">packetstorm</elem>
<elem key="is_exploit">true</elem>
<elem key="id">PACKETSTORM:151227</elem>
</table>
<table>
<elem key="cvss">0.0</elem>
<elem key="type">exploitdb</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EDB-ID:46193</elem>
</table>
<table>
<elem key="cvss">0.0</elem>
<elem key="type">zdt</elem>
<elem key="is_exploit">true</elem>
<elem key="id">1337DAY-ID-32009</elem>
</table>
<table>
<elem key="cvss">0.0</elem>
<elem key="type">zdt</elem>
<elem key="is_exploit">true</elem>
<elem key="id">1337DAY-ID-30937</elem>
</table>
</table>
</script></port>
<port protocol="tcp" portid="80"><state state="closed" reason="reset" reason_ttl="61"/><service name="http" method="table" conf="3"/></port>
<port protocol="tcp" portid="113"><state state="closed" reason="reset" reason_ttl="64"/><service name="ident" method="table" conf="3"/></port>
<port protocol="tcp" portid="443"><state state="closed" reason="reset" reason_ttl="61"/><service name="https" method="table" conf="3"/></port>
</ports>
<times srtt="1578" rttvar="246" to="100000"/>
</host>
 <xsl:template match="/">
     <xsl:for-each select="host">
      <tr>
       <td><xsl:value-of select="address/@addr"/></td>
       <td><xsl:value-of select="address/@addrtype"/></td>
       <td><xsl:value-of select="@starttime"/></td>
       <td><xsl:value-of select="@endtime"/></td>
       <td><xsl:value-of select="ports/port/@protocol"/></td>
       <td><xsl:value-of select="ports/port/@portid"/></td>
       <td><xsl:value-of select="ports/port/state/@state"/></td>
       <td><xsl:value-of select="ports/port/state/@reason"/></td>
       <td><xsl:value-of select="ports/port/state/@reason_ttl"/></td>
       <td><xsl:value-of select="ports/port/service/@name"/></td>
       <td><xsl:value-of select="ports/port/service/@method"/></td>
       <td><xsl:value-of select="ports/port/service/@conf"/></td>
       <td><xsl:value-of select="ports/port/service/cpe"/></td>
       <td><xsl:value-of select="ports/port/script/@id"/></td>
       <xsl:for-each select="ports/port/script/table/elem">
        <td><xsl:value-of select="@key"/></td>
       </xsl:for-each>
       <td><xsl:value-of select="ports/port/script/@output"/></td>
      </tr>
     </xsl:for-each>
    </table>
 </xsl:template>
</xsl:stylesheet>

 

 

Hostujeme u Českého hostingu       ISSN 1801-1586       ⇡ Nahoru Webtea.cz logo © 20032024 Programujte.com
Zasadilo a pěstuje Webtea.cz, šéfredaktor Lukáš Churý