Hi,
I want to revise the nmap.xsl so that it would display IP addresses if a host has at least one port is opened AND group each IP into a group based on a SSH server. Here is the output that I want to get:
Open SSH:
Show each host’s IP address & host name in hyperlink that has at least one port is opened and it is running Open SSH
.....
BitWise:
F-secure:
Others SSH:
Here is the original nmap.xsl which displays all of the scanned host’s ip addresses. - <xsl:for-each select="host">
-
<xsl:sort select="substring ( address/@addr, 1, string-length ( sub string-before ( address/@addr, '.' ) ) )* (256*256*256) + substring ( substring-after (address/@addr, '.' ), 1, string-length ( substring-before ( substring-after ( address/@addr, '.' ), '.' ) ) )* (256*256) + substring ( substring-after (substring-after ( address/@addr, '.' ), '.' ), 1, string-length ( substring-before ( substring-after ( substring-after (address/@addr, '.' ), '.' ), '.' ) ) ) * 256 + substring ( substring-after ( substring-after ( substring-after ( address/@addr, '.' ), '.' ), '.' ), 1 )" order="ascending" data-type="number"/>
-
-
<li>
-
<xsl:element name="a">
-
-
<xsl:attribute name="href">#<xsl:value-of select="translate(address/@addr, '.', '_') " /></xsl:attribute>
-
-
<xsl:attribute name="class">
-
<xsl:choose>
-
<xsl:when test="status/@state ='up'">green</xsl:when>
-
<xsl:otherwise>red</xsl:otherwise>
-
</xsl:choose>
-
</xsl:attribute>
-
-
<xsl:value-of select="address/@addr"/>
-
-
<xsl:if test="count(hostnames/hostname) > 0">
-
<xsl:for-each select="hostnames/hostname">
-
<xsl:sort select="@name" order="ascending" data-type="text"/>
-
<xsl:text> / </xsl:text><xsl:value-of select="@name"/>
-
</xsl:for-each></xsl:if>
-
-
</xsl:element>
-
<xsl:text> | </xsl:text>
-
</li></xsl:for-each>
Couple examples of XML output: - <host><status state="up" />
-
<address addr="150.215.20.5" addrtype="ipv4" />
-
<hostnames />
-
<ports><extraports state="unknown" count="0" />
-
<port protocol="tcp" portid="22"><state state="open" /><service name="ssh" product="OpenSSH" version="1.2.3" extrainfo="protocol 1.5" method="probed" conf="10"/>
-
</port>
-
<port protocol="tcp" portid="2220"><state state="closed" /></port>
-
<port protocol="tcp" portid="2260"><state state="closed" /></port>
-
<port protocol="tcp" portid="2280"><state state="closed" /></port>
-
</ports>
-
</host>
- <host><status state="up" />
-
<address addr="150.215.20.40" addrtype="ipv4" />
-
<hostnames />
-
<ports><extraports state="unknown" count="0" />
-
<port protocol="tcp" portid="22"><state state="open" /><service name="ssh" product="SunSSH" version="1.1" extrainfo="protocol 2.0" method="probed" conf="10" />
-
</port>
-
<port protocol="tcp" portid="2220"><state state="closed" /></port>
-
<port protocol="tcp" portid="2260"><state state="closed" /></port>
-
<port protocol="tcp" portid="2280"><state state="closed" /></port>
-
</ports>
Any help is appreciated!!! Thank you very much.
Summer
0 1398 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Debbie Davis |
last post by:
Hi there,
SQL 2000
I have the following query:
SELECT sponsor, COUNT(sponsor) * 2 AS total FROM Referrals
GROUP BY sponsor
Works great, returns the sponsor and the total * 2 of their...
|
by: Graham |
last post by:
Hi,
I am having trouble getting XSL to count the members of a group. What
I am trying to do is group by <objectid.Contactid> and count the
number of <activityid>'s for each <objectid.contactid>....
|
by: Jody Greening |
last post by:
Transforming with XSLT, Grouping elements until difference found.
I am seeking some help with the following problem, I am fairly new at
XSLT transformations, and my problem may lie in looking at...
|
by: MEC6304 |
last post by:
I have the following fragment repeated mulitple times and need to sum the SKU_QUANTITY and transform the XML based upon a grouping of the SKU_TIE, SKU_NUMBER, and MFG_PART_NUM, ie display the...
|
by: Andreas Håkansson |
last post by:
Seeing how my previous post seem to have fallen between the
cracks, I thought I would have a second, more direct, go at it.
So my question is "Is it possible to group (Muenchian method)
over...
|
by: Brian Coy |
last post by:
I am creating a database to track scrap on a daily basis at my plant.
I have to provide a weekly scrap report with the amount of each part
scrapped per day. I have the basic database set up, and...
|
by: ahaque38 |
last post by:
Hello.
Using A2K SP3, I am having the following problem with a report using
"Sorting and Grouping".
I have recently added a grouping in the reports for
"Category2<>'CONTRACTS'".
I have...
|
by: Mike MacSween |
last post by:
tblCourses one to many to tblEvents.
A course may have an intro workshop (a type of event), a mid course
workshop, a final exam. Or any combination. Or something different in the
future.
At...
|
by: Corey |
last post by:
hello,
I’m trying to run a query and I’m getting error messages
Can anyone help me get though this problem?
1: Tried this and got this error message
ORA-00923
, decode...
|
by: Roman Bertle |
last post by:
Hello,
I try to format monetary values using the locale module, python2.5:
Python 2.5.2a0 (r251:54863, Jan 3 2008, 17:59:56)
on linux2
Type "help", "copyright", "credits" or "license" for...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |