.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .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" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" 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.8.8" "User Contributed Perl Documentation" .SH "NAME" .Vb 1 \& OutputPBNJ \- a program to query a PBNJ 2.0 database. .Ve .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& outputpbnj [Query Options] [Database Options] [General Options] .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" .Vb 3 \& 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). .Ve .PP .Vb 1 \& Apart of PBNJ 2.0 suite of tools to monitor changes on a network. .Ve .SH "OPTIONS" .IX Header "OPTIONS" .Vb 7 \& 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 .] .Ve .PP .Vb 5 \& \-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 .Ve .PP .Vb 4 \& Config Options: \& \-\-qconfig Config of sql queries [def query.yaml] \& \-\-dbconfig Config for accessing database [def config.yaml] \& \-\-dbdir Directory for Config file [def .] .Ve .PP .Vb 1 \& \-\-data SQLite Database override [def data.dbl] .Ve .PP .Vb 5 \& General Options: \& \-\-test Test Level \& \-\-debug Verbose information \& \-v \-\-version Display version \& \-h \-\-help Display this information .Ve .PP .Vb 1 \& Send Comments to Joshua D. Abraham ( jabra@ccs.neu.edu ) .Ve .SH "THINGS TO NOTE" .IX Header "THINGS TO NOTE" .Vb 3 \& * 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. .Ve .PP .Vb 2 \& * If there are configs in the current directory, they are used \& instead of those in the user's config directory. .Ve .SH "Query Options" .IX Header "Query Options" .Sh "\-q \-\-query Perform sql query" .IX Subsection "-q --query Perform sql query" .Vb 3 \& 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. .Ve .Sh "\-t \-\-type Output Type [csv,tab,html]" .IX Subsection "-t --type Output Type [csv,tab,html]" .Vb 4 \& 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. .Ve .Sh "\-f \-\-file " .IX Subsection "-f --file " .Vb 3 \& 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. .Ve .Sh "\-\-both" .IX Subsection "--both" .Vb 4 \& 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. .Ve .Sh "\-\-dir Store the result in this directory [default .]" .IX Subsection "--dir Store the result in this directory [default .]" .Vb 2 \& This option is used with the writing to a file. This option will \& store the file in a alternative directory than the current directory. .Ve .Sh "\-l \-\-lookup " .IX Subsection "-l --lookup " .Vb 2 \& This options is used to lookup the description of a specific query. \& This will return the description of the query. .Ve .Sh "\-\-list List of names and descriptions" .IX Subsection "--list List of names and descriptions" .Vb 3 \& 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. .Ve .Sh "\-n \-\-name" .IX Subsection "-n --name" .Vb 1 \& This option is used to print the all the query names. .Ve .Sh "\-d \-\-desc" .IX Subsection "-d --desc" .Vb 2 \& This option is used to print the all the query descriptions. This is \& useful to find out all the queries do. .Ve .Sh "\-s \-\-sql" .IX Subsection "-s --sql" .Vb 2 \& This option is used to print the all the queries. This is useful for \& developing new queries based on other queries. .Ve .SH "Config Options" .IX Header "Config Options" .Sh "\-\-qconfig " .IX Subsection "--qconfig " .Vb 1 \& Config of sql queries [default query.yaml] .Ve .PP .Vb 1 \& This option is used to specify an alternative query.yaml file. .Ve .Sh "\-\-dbconfig " .IX Subsection "--dbconfig " .Vb 1 \& Config for accessing results database [default config.yaml] .Ve .PP .Vb 1 \& This option is used to specify an alternative config.yaml file. .Ve .Sh "\-\-dbdir " .IX Subsection "--dbdir " .Vb 1 \& Directory for Config file [default .] .Ve .PP .Vb 2 \& This option is used to specify an alternative directory for the \& config.yaml file. .Ve .SH "GENERAL OPTIONS" .IX Header "GENERAL OPTIONS" .Sh "\-\-test " .IX Subsection "--test " .Vb 5 \& 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. .Ve .PP .Vb 3 \& 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 .Ve .Sh "\-\-debug " .IX Subsection "--debug " .Vb 3 \& 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. .Ve .Sh "\-v \-\-version" .IX Subsection "-v --version" .Vb 1 \& Prints the OutputPBNJ version number and exits. .Ve .Sh "\-h \-\-help Display this information" .IX Subsection "-h --help Display this information" .Vb 2 \& Prints a help screen with the command flags. \& Running OutputPBNJ without any arguments does the same thing. .Ve .SH "FILES" .IX Header "FILES" .Vb 6 \& 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. .Ve .PP .Vb 2 \& $HOME/.pbnj\-2.0/config.yaml \- holds settings for connecting to the \& database which store the information from PBNJ scans. .Ve .PP .Vb 4 \& $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. .Ve .PP .Vb 6 \& 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. .Ve .SH "QUERY" .IX Header "QUERY" .Vb 2 \& The query.yaml file contains the list of various names, descriptions \& and sql queries that can be executed by OutputPBNJ. .Ve .PP .Vb 1 \& Here is one example: .Ve .PP .Vb 6 \& \- 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' .Ve .PP .Vb 7 \& 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. .Ve .SH "FEATURE REQUESTS" .IX Header "FEATURE REQUESTS" .Vb 5 \& 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. .Ve .SH "BUG REPORTS" .IX Header "BUG REPORTS" .Vb 5 \& 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. .Ve .PP .Vb 4 \& 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. .Ve .SH "SUPPORTED DATABASES" .IX Header "SUPPORTED DATABASES" .Vb 1 \& The following databases are supported: .Ve .PP .Vb 4 \& * SQLite [default] \& * MySQL \& * Postgres \& * CSV .Ve .SH "DATABASE SCHEMA" .IX Header "DATABASE SCHEMA" .Vb 1 \& The following is the SQLite version of the database schema: .Ve .PP .Vb 18 \& 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); .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" .Vb 1 \& scanpbnj(1), genlist(1), nmap(1) .Ve .SH "AUTHORS" .IX Header "AUTHORS" .Vb 1 \& Joshua D. Abraham ( jabra@ccs.neu.edu ) .Ve .SH "LEGAL NOTICES" .IX Header "LEGAL NOTICES" .Vb 6 \& 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. .Ve .PP .Vb 7 \& 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. .Ve