.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "OUTPUTPBNJ.MAN.1 1p" .TH OUTPUTPBNJ.MAN.1 1p "2006-11-06" "perl v5.20.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" OutputPBNJ - a program to query a PBNJ 2.0 database. .SH "SYNOPSIS" .IX Header "SYNOPSIS" outputpbnj [Query Options] [Database Options] [General Options] .SH "DESCRIPTION" .IX Header "DESCRIPTION" OutputPBNJ uses a query yaml config file to execute queries against the PBNJ 2.0 database. OutputPBNJ returns the result in various output types (csv, tab and html). Apart of PBNJ 2.0 suite of tools to monitor changes on a network. .SH "OPTIONS" .IX Header "OPTIONS" Usage: outputpbnj [Query Options] [Config Options] [General Options] Query Options: -q --query Perform sql query -t --type Output Type [csv,tab,html] -f --file Store the result in file otherwise stdout --both Print results and store them in a file --dir Store the result in this directory [def .] -l --lookup Lookup description based on name --list List of names and descriptions -n --name Lookup all the names -d --desc Lookup all the descriptions -s --sql Lookup all the sql queries Config Options: --qconfig Config of sql queries [def query.yaml] --dbconfig Config for accessing database [def config.yaml] --dbdir Directory for Config file [def .] --data SQLite Database override [def data.dbl] General Options: --test Test Level --debug Verbose information -v --version Display version -h --help Display this information Send Comments to Joshua D. Abraham ( jabra@ccs.neu.edu ) .SH "THINGS TO NOTE" .IX Header "THINGS TO NOTE" * OutputPBNJ requires root privileges to query a database that is owned by root. Thus, if you are scanning with ScanPBNJ you will need to run OutputPBNJ with root privileges to access the database. * If there are configs in the current directory, they are used instead of those in the user's config directory. .SH "Query Options" .IX Header "Query Options" .SS "\-q \-\-query Perform sql query" .IX Subsection "-q --query Perform sql query" This option is where the actual query is specified. Therefore, once you know the query you wish to use simply pass it as an argument to this option. .SS "\-t \-\-type Output Type [csv,tab,html]" .IX Subsection "-t --type Output Type [csv,tab,html]" This options is used to specify which output format you wish to use. For example, if you would like to have output that you can show someone else the CSV format is useful because you can simply pull the file into OpenOffice Calc or Excel as it is a comma delimited file. .SS "\-f \-\-file " .IX Subsection "-f --file " This option is used to specifiy output to a file rather than standard output. This is useful if you want to grow the results of queries as the result will be added onto the end of the file. .SS "\-\-both" .IX Subsection "--both" This option is used when you want both output to standard output, as well as to a file. This will save the result to a file if you are having the result sent to the screen or piped to your email which you may or may not disregard. .SS "\-\-dir Store the result in this directory [default .]" .IX Subsection "--dir Store the result in this directory [default .]" This option is used with the writing to a file. This option will store the file in a alternative directory than the current directory. .SS "\-l \-\-lookup " .IX Subsection "-l --lookup " This options is used to lookup the description of a specific query. This will return the description of the query. .SS "\-\-list List of names and descriptions" .IX Subsection "--list List of names and descriptions" This option is used to return a list of all the queries with the names and descriptions. This is very useful when you are starting to use OutputPBNJ or using a new query config. .SS "\-n \-\-name" .IX Subsection "-n --name" This option is used to print the all the query names. .SS "\-d \-\-desc" .IX Subsection "-d --desc" This option is used to print the all the query descriptions. This is useful to find out all the queries do. .SS "\-s \-\-sql" .IX Subsection "-s --sql" This option is used to print the all the queries. This is useful for developing new queries based on other queries. .SH "Config Options" .IX Header "Config Options" .SS "\-\-qconfig " .IX Subsection "--qconfig " Config of sql queries [default query.yaml] This option is used to specify an alternative query.yaml file. .SS "\-\-dbconfig " .IX Subsection "--dbconfig " Config for accessing results database [default config.yaml] This option is used to specify an alternative config.yaml file. .SS "\-\-dbdir " .IX Subsection "--dbdir " Directory for Config file [default .] This option is used to specify an alternative directory for the config.yaml file. .SH "GENERAL OPTIONS" .IX Header "GENERAL OPTIONS" .SS "\-\-test " .IX Subsection "--test " Increases the Test level, causing OutputPBNJ to print testing information about the Query. Using the Test level is mostly only using for testing. This will also print the debugging information so it can get rather lengthy. The greater the Test level the more output will be given. This option is also used for reporting bugs. All bug reports should be submitted using --test 1 and an additional report may be needed depending on the issue .SS "\-\-debug " .IX Subsection "--debug " Increases the Debug level, causing OutputPBNJ to print more information about the query in progress. The higher the debug leve the more output the user will receive. .SS "\-v \-\-version" .IX Subsection "-v --version" Prints the OutputPBNJ version number and exits. .SS "\-h \-\-help Display this information" .IX Subsection "-h --help Display this information" Prints a help screen with the command flags. Running OutputPBNJ without any arguments does the same thing. .SH "FILES" .IX Header "FILES" PBNJ's data files are stored in ScanPBNJ and OutputPBNJ. When either of these programs is run the configuration files will be generated for the user if they do not already exists and placed in the $HOME/.pbnj-2.0 directory. Again, if there is a configuration file in the current directory it is used instead of the version in the configuration directory. $HOME/.pbnj-2.0/config.yaml - holds settings for connecting to the database which store the information from PBNJ scans. $HOME/.pbnj-2.0/query.yaml - lists all queries that can be used to retrieve information from the database. Also, includes the name and description for each query. This is only generated when you executed OutputPBNJ. For Windows, the pbnj-2.0 config directory is in the APPDATA directory, which contains both config.yaml and query.yaml. Depending on your environment, the APPDATA directory may be a different location from other environments. Therefore, when the configs are executed for the first time they will display the path where the configs were generated. .SH "QUERY" .IX Header "QUERY" The query.yaml file contains the list of various names, descriptions and sql queries that can be executed by OutputPBNJ. Here is one example: - name: vulnssh desc: list all of the services that have old ssh running sql: |- select S.updated_on,M.ip,S.service,S.port,S.version from services as S, machines as M where service='ssh' and state='up' and version!='4.1p1' This examples shows how the name, description and sql are layed out in the yaml format. Therefore, we know the name of the query is vulnssh and it's purpose is to list SSH servers which are not running a version 4.1p1. It is very easy to create another script that would check for the latest version of a given service and therefore the user would be able to verify that that particular service needed to be updated on the machine that was scanned. .SH "FEATURE REQUESTS" .IX Header "FEATURE REQUESTS" Any feature requests should be reported to the online feature-request-tracking system available on the web at: http://sourceforge.net/tracker/?func=add&group_id=149390&atid=774489 Before requesting a feature, please check to see if the features has already been requested. .SH "BUG REPORTS" .IX Header "BUG REPORTS" Any bugs found should be reported to the online bug-tracking system available on the web at : http://sourceforge.net/tracker/?func=add&group_id=149390&atid=774488. Before reporting bugs, please check to see if the bug has already been reported. When reporting PBNJ bugs, it is important to include a reliable way to reproduce the bug, version number of PBNJ and Nmap, OS name and version, and any relevant hardware specs. And of course, patches to rectify the bug are even better. .SH "SUPPORTED DATABASES" .IX Header "SUPPORTED DATABASES" The following databases are supported: * SQLite [default] * MySQL * Postgres * CSV .SH "DATABASE SCHEMA" .IX Header "DATABASE SCHEMA" The following is the SQLite version of the database schema: CREATE TABLE machines ( mid INTEGER PRIMARY KEY AUTOINCREMENT, ip TEXT, host TEXT, localh INTEGER, os TEXT, machine_created TEXT, created_on TEXT); CREATE TABLE services ( mid INTEGER, service TEXT, state TEXT, port INTEGER, protocol TEXT, version TEXT, banner TEXT, machine_updated TEXT, updated_on TEXT); .SH "SEE ALSO" .IX Header "SEE ALSO" scanpbnj(1), genlist(1), nmap(1) .SH "AUTHORS" .IX Header "AUTHORS" Joshua D. Abraham ( jabra@ccs.neu.edu ) .SH "LEGAL NOTICES" .IX Header "LEGAL NOTICES" 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 at http://www.gnu.org/copyleft/gpl.html, or in the COPYING file included with PBNJ. It should also be noted that PBNJ has occasionally been known to crash poorly written applications, TCP/IP stacks, and even operating systems. While this is extremely rare, it is important to keep in mind. PBNJ should never be run against mission critical systems unless you are prepared to suffer downtime. We acknowledge here that PBNJ may crash your systems or networks and we disclaim all liability for any damage or problems PBNJ could cause.