├── CHANGELOG.txt ├── COPYING.txt ├── EXAMPLES.txt ├── INSTALL.txt ├── LICENSE ├── MANIFEST ├── META.yml ├── MYMETA.yml ├── Makefile ├── Makefile.PL ├── README.txt ├── blib ├── arch │ ├── .exists │ └── auto │ │ └── giskismet │ │ └── .exists ├── bin │ └── .exists ├── lib │ ├── .exists │ └── auto │ │ └── giskismet │ │ └── .exists ├── man1 │ ├── .exists │ └── giskismet.1p ├── man3 │ └── .exists └── script │ ├── .exists │ └── giskismet ├── giskismet ├── giskismet.man.1 └── pm_to_blib /CHANGELOG.txt: -------------------------------------------------------------------------------- 1 | Mon May 3 00:25:17 EDT 2010 2 | * handle cloaked ssids. 3 | * added digininja's ignore-gps patch. 4 | * warning the user if a bssid does not contain gps data. 5 | Sat Jul 11 17:27:31 EDT 2009 6 | * Importing multiple netxml (cid bug) 7 | * String based comparison for filters 8 | == GISKismet .02 == 9 | Mon Feb 2 23:35:26 EST 2009 10 | * Fixed kml output of clients information 11 | * Fixed bug where XML::LibXML tries to access the dtd online 12 | -------------------------------------------------------------------------------- /COPYING.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) year name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | -------------------------------------------------------------------------------- /EXAMPLES.txt: -------------------------------------------------------------------------------- 1 | 2 | 1) Insert all data from a Kismet-newcore .netxml file into the 3 | GISKismet database 4 | 5 | perl giskismet -x examples/Kismet-Feb-05-2009-1.netxml 6 | 7 | 2) Insert only the APs on channel 2 8 | 9 | perl giskismet -x examples/Kismet-Feb-05-2009-1.netxml --channel 2 10 | 11 | 3) Generate a graph based on the GISKismet database 12 | 13 | perl giskismet -q "select * from wireless" -o ex1.kml 14 | 15 | 4) Insert all the information from a Kismet-newcore .netxml file and 16 | generate a graph of all APs named linksys without encryption 17 | 18 | perl giskismet -x examples/Kismet-Feb-05-2009-1.netxml \ 19 | -q "select * from wireless where ESSID='linksys' and Encryption='None'" -o ex2.kml 20 | 21 | -------------------------------------------------------------------------------- /INSTALL.txt: -------------------------------------------------------------------------------- 1 | #################################### 2 | GISKismet Install Directions 3 | #################################### 4 | 5 | 6 | Quick Install - simply run from this directory 7 | 8 | To Install GISKismet Properly ( make sure you have the needed deps) 9 | 10 | perl Makefile.PL 11 | make 12 | ** Then as root ** 13 | make install 14 | 15 | 16 | You will need to install the following modules for GISKismet to work 17 | DBI 18 | XML::LibXML 19 | DBD::SQLite 20 | 21 | If you are running Ubuntu, I suggest you use the packages whenever 22 | possible. 23 | 24 | 25 | sudo apt-get install \ 26 | libxml-libxml-perl \ 27 | libdbi-perl \ 28 | libdbd-sqlite3-perl 29 | 30 | 31 | If you are running FreeBSD here are the packages: 32 | 33 | pkg_add -r p5-DBI 34 | pkg_add -r p5-DBD-SQLite 35 | pkg_add -r p5-XML-LibXML 36 | 37 | To install a module using CPAN 38 | 39 | $ sudo cpan 40 | 41 | # make sure you have the latest version of CPAN installed 42 | cpan> install CPAN 43 | cpan> install Bundle::CPAN 44 | # then when you see the cpan> prompt type install and the name of 45 | # the module 46 | cpan> install XML::LibXML 47 | 48 | cpan> install DBI 49 | 50 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /MANIFEST: -------------------------------------------------------------------------------- 1 | COPYING.txt 2 | README.txt 3 | INSTALL.txt 4 | MANIFEST 5 | Makefile.PL 6 | EXAMPLES.txt 7 | giskismet 8 | giskismet.man.1 9 | CHANGELOG.txt 10 | examples/Kismet-Feb-05-2009-1.netxml.gz 11 | examples/Kismet-Feb-05-2009-1.dbl 12 | examples/ex1.kml 13 | examples/ex2.kml 14 | META.yml Module meta-data (added by MakeMaker) 15 | -------------------------------------------------------------------------------- /META.yml: -------------------------------------------------------------------------------- 1 | --- #YAML:1.0 2 | name: giskismet 3 | version: 0.02 4 | abstract: ~ 5 | license: ~ 6 | author: 7 | - Joshua D. Abraham 8 | generated_by: ExtUtils::MakeMaker version 6.40 9 | distribution_type: module 10 | requires: 11 | DBD::SQLite: 1.11 12 | DBI: 1.50 13 | XML::LibXML: 1.01 14 | meta-spec: 15 | url: http://module-build.sourceforge.net/META-spec-v1.3.html 16 | version: 1.3 17 | -------------------------------------------------------------------------------- /MYMETA.yml: -------------------------------------------------------------------------------- 1 | --- 2 | abstract: ~ 3 | author: 4 | - 'Joshua D. Abraham' 5 | build_requires: 6 | ExtUtils::MakeMaker: 0 7 | configure_requires: 8 | ExtUtils::MakeMaker: 0 9 | distribution_type: module 10 | dynamic_config: 0 11 | generated_by: 'ExtUtils::MakeMaker version 6.57_05' 12 | license: unknown 13 | meta-spec: 14 | url: http://module-build.sourceforge.net/META-spec-v1.4.html 15 | version: 1.4 16 | name: giskismet 17 | no_index: 18 | directory: 19 | - t 20 | - inc 21 | requires: 22 | DBD::SQLite: 1.11 23 | DBI: 1.50 24 | XML::LibXML: 1.01 25 | version: 0.02 26 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # This Makefile is for the giskismet extension to perl. 2 | # 3 | # It was generated automatically by MakeMaker version 4 | # 6.57_05 (Revision: 65705) from the contents of 5 | # Makefile.PL. Don't edit this file, edit Makefile.PL instead. 6 | # 7 | # ANY CHANGES MADE HERE WILL BE LOST! 8 | # 9 | # MakeMaker ARGV: () 10 | # 11 | 12 | # MakeMaker Parameters: 13 | 14 | # AUTHOR => [q[Joshua D. Abraham]] 15 | # BUILD_REQUIRES => { } 16 | # EXE_FILES => [q[giskismet]] 17 | # INSTALLDIRS => q[site] 18 | # MAN1PODS => { giskismet.man.1=>q[blib/man1/giskismet.1p] } 19 | # NAME => q[giskismet] 20 | # PREREQ_PM => { DBD::SQLite=>q[1.11], XML::LibXML=>q[1.01], DBI=>q[1.50] } 21 | # VERSION => q[0.02] 22 | # clean => { FILES=>q[] } 23 | # dist => { DIST_DEFAULT=>q[all tardist], COMPRESS=>q[gzip -9f], SUFFIX=>q[.gz] } 24 | # realclean => { FILES=>q[] } 25 | 26 | # --- MakeMaker post_initialize section: 27 | 28 | 29 | # --- MakeMaker const_config section: 30 | 31 | # These definitions are from config.sh (via /usr/lib/perl/5.14/Config.pm). 32 | # They may have been overridden via Makefile.PL or on the command line. 33 | AR = ar 34 | CC = cc 35 | CCCDLFLAGS = -fPIC 36 | CCDLFLAGS = -Wl,-E 37 | DLEXT = so 38 | DLSRC = dl_dlopen.xs 39 | EXE_EXT = 40 | FULL_AR = /usr/bin/ar 41 | LD = cc 42 | LDDLFLAGS = -shared -L/usr/local/lib -fstack-protector 43 | LDFLAGS = -fstack-protector -L/usr/local/lib 44 | LIBC = 45 | LIB_EXT = .a 46 | OBJ_EXT = .o 47 | OSNAME = linux 48 | OSVERS = 3.2.0-4-amd64 49 | RANLIB = : 50 | SITELIBEXP = /usr/local/share/perl/5.14.2 51 | SITEARCHEXP = /usr/local/lib/perl/5.14.2 52 | SO = so 53 | VENDORARCHEXP = /usr/lib/perl5 54 | VENDORLIBEXP = /usr/share/perl5 55 | 56 | 57 | # --- MakeMaker constants section: 58 | AR_STATIC_ARGS = cr 59 | DIRFILESEP = / 60 | DFSEP = $(DIRFILESEP) 61 | NAME = giskismet 62 | NAME_SYM = giskismet 63 | VERSION = 0.02 64 | VERSION_MACRO = VERSION 65 | VERSION_SYM = 0_02 66 | DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" 67 | XS_VERSION = 0.02 68 | XS_VERSION_MACRO = XS_VERSION 69 | XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" 70 | INST_ARCHLIB = blib/arch 71 | INST_SCRIPT = blib/script 72 | INST_BIN = blib/bin 73 | INST_LIB = blib/lib 74 | INST_MAN1DIR = blib/man1 75 | INST_MAN3DIR = blib/man3 76 | MAN1EXT = 1p 77 | MAN3EXT = 3pm 78 | INSTALLDIRS = site 79 | DESTDIR = 80 | PREFIX = /usr 81 | PERLPREFIX = $(PREFIX) 82 | SITEPREFIX = $(PREFIX)/local 83 | VENDORPREFIX = $(PREFIX) 84 | INSTALLPRIVLIB = $(PERLPREFIX)/share/perl/5.14 85 | DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB) 86 | INSTALLSITELIB = $(SITEPREFIX)/share/perl/5.14.2 87 | DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB) 88 | INSTALLVENDORLIB = $(VENDORPREFIX)/share/perl5 89 | DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB) 90 | INSTALLARCHLIB = $(PERLPREFIX)/lib/perl/5.14 91 | DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB) 92 | INSTALLSITEARCH = $(SITEPREFIX)/lib/perl/5.14.2 93 | DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH) 94 | INSTALLVENDORARCH = $(VENDORPREFIX)/lib/perl5 95 | DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH) 96 | INSTALLBIN = $(PERLPREFIX)/bin 97 | DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN) 98 | INSTALLSITEBIN = $(SITEPREFIX)/bin 99 | DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN) 100 | INSTALLVENDORBIN = $(VENDORPREFIX)/bin 101 | DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN) 102 | INSTALLSCRIPT = $(PERLPREFIX)/bin 103 | DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT) 104 | INSTALLSITESCRIPT = $(SITEPREFIX)/bin 105 | DESTINSTALLSITESCRIPT = $(DESTDIR)$(INSTALLSITESCRIPT) 106 | INSTALLVENDORSCRIPT = $(VENDORPREFIX)/bin 107 | DESTINSTALLVENDORSCRIPT = $(DESTDIR)$(INSTALLVENDORSCRIPT) 108 | INSTALLMAN1DIR = $(PERLPREFIX)/share/man/man1 109 | DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR) 110 | INSTALLSITEMAN1DIR = $(SITEPREFIX)/man/man1 111 | DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR) 112 | INSTALLVENDORMAN1DIR = $(VENDORPREFIX)/share/man/man1 113 | DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR) 114 | INSTALLMAN3DIR = $(PERLPREFIX)/share/man/man3 115 | DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR) 116 | INSTALLSITEMAN3DIR = $(SITEPREFIX)/man/man3 117 | DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR) 118 | INSTALLVENDORMAN3DIR = $(VENDORPREFIX)/share/man/man3 119 | DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR) 120 | PERL_LIB = /usr/share/perl/5.14 121 | PERL_ARCHLIB = /usr/lib/perl/5.14 122 | LIBPERL_A = libperl.a 123 | FIRST_MAKEFILE = Makefile 124 | MAKEFILE_OLD = Makefile.old 125 | MAKE_APERL_FILE = Makefile.aperl 126 | PERLMAINCC = $(CC) 127 | PERL_INC = /usr/lib/perl/5.14/CORE 128 | PERL = /usr/bin/perl 129 | FULLPERL = /usr/bin/perl 130 | ABSPERL = $(PERL) 131 | PERLRUN = $(PERL) 132 | FULLPERLRUN = $(FULLPERL) 133 | ABSPERLRUN = $(ABSPERL) 134 | PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" 135 | FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" 136 | ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" 137 | PERL_CORE = 0 138 | PERM_DIR = 755 139 | PERM_RW = 644 140 | PERM_RWX = 755 141 | 142 | MAKEMAKER = /usr/share/perl/5.14/ExtUtils/MakeMaker.pm 143 | MM_VERSION = 6.57_05 144 | MM_REVISION = 65705 145 | 146 | # FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle). 147 | # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle) 148 | # PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar) 149 | # DLBASE = Basename part of dynamic library. May be just equal BASEEXT. 150 | MAKE = make 151 | FULLEXT = giskismet 152 | BASEEXT = giskismet 153 | PARENT_NAME = 154 | DLBASE = $(BASEEXT) 155 | VERSION_FROM = 156 | OBJECT = 157 | LDFROM = $(OBJECT) 158 | LINKTYPE = dynamic 159 | BOOTDEP = 160 | 161 | # Handy lists of source code files: 162 | XS_FILES = 163 | C_FILES = 164 | O_FILES = 165 | H_FILES = 166 | MAN1PODS = giskismet.man.1 167 | MAN3PODS = 168 | 169 | # Where is the Config information that we are using/depend on 170 | CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h 171 | 172 | # Where to build things 173 | INST_LIBDIR = $(INST_LIB) 174 | INST_ARCHLIBDIR = $(INST_ARCHLIB) 175 | 176 | INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT) 177 | INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT) 178 | 179 | INST_STATIC = 180 | INST_DYNAMIC = 181 | INST_BOOT = 182 | 183 | # Extra linker info 184 | EXPORT_LIST = 185 | PERL_ARCHIVE = 186 | PERL_ARCHIVE_AFTER = 187 | 188 | 189 | TO_INST_PM = 190 | 191 | PM_TO_BLIB = 192 | 193 | 194 | # --- MakeMaker platform_constants section: 195 | MM_Unix_VERSION = 6.57_05 196 | PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc 197 | 198 | 199 | # --- MakeMaker tool_autosplit section: 200 | # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto 201 | AUTOSPLITFILE = $(ABSPERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1)' -- 202 | 203 | 204 | 205 | # --- MakeMaker tool_xsubpp section: 206 | 207 | 208 | # --- MakeMaker tools_other section: 209 | SHELL = /bin/sh 210 | CHMOD = chmod 211 | CP = cp 212 | MV = mv 213 | NOOP = $(TRUE) 214 | NOECHO = @ 215 | RM_F = rm -f 216 | RM_RF = rm -rf 217 | TEST_F = test -f 218 | TOUCH = touch 219 | UMASK_NULL = umask 0 220 | DEV_NULL = > /dev/null 2>&1 221 | MKPATH = $(ABSPERLRUN) -MExtUtils::Command -e 'mkpath' -- 222 | EQUALIZE_TIMESTAMP = $(ABSPERLRUN) -MExtUtils::Command -e 'eqtime' -- 223 | FALSE = false 224 | TRUE = true 225 | ECHO = echo 226 | ECHO_N = echo -n 227 | UNINST = 0 228 | VERBINST = 0 229 | MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install([ from_to => {@ARGV}, verbose => '\''$(VERBINST)'\'', uninstall_shadows => '\''$(UNINST)'\'', dir_mode => '\''$(PERM_DIR)'\'' ]);' -- 230 | DOC_INSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'perllocal_install' -- 231 | UNINSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'uninstall' -- 232 | WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'warn_if_old_packlist' -- 233 | MACROSTART = 234 | MACROEND = 235 | USEMAKEFILE = -f 236 | FIXIN = $(ABSPERLRUN) -MExtUtils::MY -e 'MY->fixin(shift)' -- 237 | 238 | 239 | # --- MakeMaker makemakerdflt section: 240 | makemakerdflt : all 241 | $(NOECHO) $(NOOP) 242 | 243 | 244 | # --- MakeMaker dist section: 245 | TAR = tar 246 | TARFLAGS = cvf 247 | ZIP = zip 248 | ZIPFLAGS = -r 249 | COMPRESS = gzip -9f 250 | SUFFIX = .gz 251 | SHAR = shar 252 | PREOP = $(NOECHO) $(NOOP) 253 | POSTOP = $(NOECHO) $(NOOP) 254 | TO_UNIX = $(NOECHO) $(NOOP) 255 | CI = ci -u 256 | RCS_LABEL = rcs -Nv$(VERSION_SYM): -q 257 | DIST_CP = best 258 | DIST_DEFAULT = all tardist 259 | DISTNAME = giskismet 260 | DISTVNAME = giskismet-0.02 261 | 262 | 263 | # --- MakeMaker macro section: 264 | 265 | 266 | # --- MakeMaker depend section: 267 | 268 | 269 | # --- MakeMaker cflags section: 270 | 271 | 272 | # --- MakeMaker const_loadlibs section: 273 | 274 | 275 | # --- MakeMaker const_cccmd section: 276 | 277 | 278 | # --- MakeMaker post_constants section: 279 | 280 | 281 | # --- MakeMaker pasthru section: 282 | 283 | PASTHRU = LIBPERL_A="$(LIBPERL_A)"\ 284 | LINKTYPE="$(LINKTYPE)"\ 285 | LD="$(LD)"\ 286 | PREFIX="$(PREFIX)" 287 | 288 | 289 | # --- MakeMaker special_targets section: 290 | .SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT) 291 | 292 | .PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir 293 | 294 | 295 | 296 | # --- MakeMaker c_o section: 297 | 298 | 299 | # --- MakeMaker xs_c section: 300 | 301 | 302 | # --- MakeMaker xs_o section: 303 | 304 | 305 | # --- MakeMaker top_targets section: 306 | all :: pure_all manifypods 307 | $(NOECHO) $(NOOP) 308 | 309 | 310 | pure_all :: config pm_to_blib subdirs linkext 311 | $(NOECHO) $(NOOP) 312 | 313 | subdirs :: $(MYEXTLIB) 314 | $(NOECHO) $(NOOP) 315 | 316 | config :: $(FIRST_MAKEFILE) blibdirs 317 | $(NOECHO) $(NOOP) 318 | 319 | help : 320 | perldoc ExtUtils::MakeMaker 321 | 322 | 323 | # --- MakeMaker blibdirs section: 324 | blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists 325 | $(NOECHO) $(NOOP) 326 | 327 | # Backwards compat with 6.18 through 6.25 328 | blibdirs.ts : blibdirs 329 | $(NOECHO) $(NOOP) 330 | 331 | $(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL 332 | $(NOECHO) $(MKPATH) $(INST_LIBDIR) 333 | $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_LIBDIR) 334 | $(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists 335 | 336 | $(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL 337 | $(NOECHO) $(MKPATH) $(INST_ARCHLIB) 338 | $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHLIB) 339 | $(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists 340 | 341 | $(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL 342 | $(NOECHO) $(MKPATH) $(INST_AUTODIR) 343 | $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_AUTODIR) 344 | $(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists 345 | 346 | $(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL 347 | $(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR) 348 | $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHAUTODIR) 349 | $(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists 350 | 351 | $(INST_BIN)$(DFSEP).exists :: Makefile.PL 352 | $(NOECHO) $(MKPATH) $(INST_BIN) 353 | $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_BIN) 354 | $(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists 355 | 356 | $(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL 357 | $(NOECHO) $(MKPATH) $(INST_SCRIPT) 358 | $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_SCRIPT) 359 | $(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists 360 | 361 | $(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL 362 | $(NOECHO) $(MKPATH) $(INST_MAN1DIR) 363 | $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN1DIR) 364 | $(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists 365 | 366 | $(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL 367 | $(NOECHO) $(MKPATH) $(INST_MAN3DIR) 368 | $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN3DIR) 369 | $(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists 370 | 371 | 372 | 373 | # --- MakeMaker linkext section: 374 | 375 | linkext :: $(LINKTYPE) 376 | $(NOECHO) $(NOOP) 377 | 378 | 379 | # --- MakeMaker dlsyms section: 380 | 381 | 382 | # --- MakeMaker dynamic section: 383 | 384 | dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT) 385 | $(NOECHO) $(NOOP) 386 | 387 | 388 | # --- MakeMaker dynamic_bs section: 389 | 390 | BOOTSTRAP = 391 | 392 | 393 | # --- MakeMaker dynamic_lib section: 394 | 395 | 396 | # --- MakeMaker static section: 397 | 398 | ## $(INST_PM) has been moved to the all: target. 399 | ## It remains here for awhile to allow for old usage: "make static" 400 | static :: $(FIRST_MAKEFILE) $(INST_STATIC) 401 | $(NOECHO) $(NOOP) 402 | 403 | 404 | # --- MakeMaker static_lib section: 405 | 406 | 407 | # --- MakeMaker manifypods section: 408 | 409 | POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--" 410 | POD2MAN = $(POD2MAN_EXE) 411 | 412 | 413 | manifypods : pure_all \ 414 | giskismet.man.1 415 | $(NOECHO) $(POD2MAN) --section=$(MAN1EXT) --perm_rw=$(PERM_RW) \ 416 | giskismet.man.1 blib/man1/giskismet.1p 417 | 418 | 419 | 420 | 421 | # --- MakeMaker processPL section: 422 | 423 | 424 | # --- MakeMaker installbin section: 425 | 426 | EXE_FILES = giskismet 427 | 428 | pure_all :: $(INST_SCRIPT)/giskismet 429 | $(NOECHO) $(NOOP) 430 | 431 | realclean :: 432 | $(RM_F) \ 433 | $(INST_SCRIPT)/giskismet 434 | 435 | $(INST_SCRIPT)/giskismet : giskismet $(FIRST_MAKEFILE) $(INST_SCRIPT)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists 436 | $(NOECHO) $(RM_F) $(INST_SCRIPT)/giskismet 437 | $(CP) giskismet $(INST_SCRIPT)/giskismet 438 | $(FIXIN) $(INST_SCRIPT)/giskismet 439 | -$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_SCRIPT)/giskismet 440 | 441 | 442 | 443 | # --- MakeMaker subdirs section: 444 | 445 | # none 446 | 447 | # --- MakeMaker clean_subdirs section: 448 | clean_subdirs : 449 | $(NOECHO) $(NOOP) 450 | 451 | 452 | # --- MakeMaker clean section: 453 | 454 | # Delete temporary files but do not touch installed files. We don't delete 455 | # the Makefile here so a later make realclean still has a makefile to use. 456 | 457 | clean :: clean_subdirs 458 | - $(RM_F) \ 459 | *$(LIB_EXT) core \ 460 | core.[0-9] $(INST_ARCHAUTODIR)/extralibs.all \ 461 | core.[0-9][0-9] $(BASEEXT).bso \ 462 | pm_to_blib.ts core.[0-9][0-9][0-9][0-9] \ 463 | MYMETA.yml $(BASEEXT).x \ 464 | $(BOOTSTRAP) perl$(EXE_EXT) \ 465 | tmon.out *$(OBJ_EXT) \ 466 | pm_to_blib $(INST_ARCHAUTODIR)/extralibs.ld \ 467 | blibdirs.ts core.[0-9][0-9][0-9][0-9][0-9] \ 468 | *perl.core core.*perl.*.? \ 469 | $(MAKE_APERL_FILE) $(BASEEXT).def \ 470 | perl core.[0-9][0-9][0-9] \ 471 | mon.out lib$(BASEEXT).def \ 472 | perlmain.c perl.exe \ 473 | so_locations $(BASEEXT).exp 474 | - $(RM_RF) \ 475 | blib 476 | - $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL) 477 | 478 | 479 | # --- MakeMaker realclean_subdirs section: 480 | realclean_subdirs : 481 | $(NOECHO) $(NOOP) 482 | 483 | 484 | # --- MakeMaker realclean section: 485 | # Delete temporary files (via clean) and also delete dist files 486 | realclean purge :: clean realclean_subdirs 487 | - $(RM_F) \ 488 | $(MAKEFILE_OLD) $(FIRST_MAKEFILE) 489 | - $(RM_RF) \ 490 | $(DISTVNAME) 491 | 492 | 493 | # --- MakeMaker metafile section: 494 | metafile : create_distdir 495 | $(NOECHO) $(ECHO) Generating META.yml 496 | $(NOECHO) $(ECHO) '--- #YAML:1.0' > META_new.yml 497 | $(NOECHO) $(ECHO) 'name: giskismet' >> META_new.yml 498 | $(NOECHO) $(ECHO) 'version: 0.02' >> META_new.yml 499 | $(NOECHO) $(ECHO) 'abstract: ~' >> META_new.yml 500 | $(NOECHO) $(ECHO) 'author:' >> META_new.yml 501 | $(NOECHO) $(ECHO) ' - Joshua D. Abraham' >> META_new.yml 502 | $(NOECHO) $(ECHO) 'license: unknown' >> META_new.yml 503 | $(NOECHO) $(ECHO) 'distribution_type: module' >> META_new.yml 504 | $(NOECHO) $(ECHO) 'configure_requires:' >> META_new.yml 505 | $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: 0' >> META_new.yml 506 | $(NOECHO) $(ECHO) 'build_requires:' >> META_new.yml 507 | $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: 0' >> META_new.yml 508 | $(NOECHO) $(ECHO) 'requires:' >> META_new.yml 509 | $(NOECHO) $(ECHO) ' DBD::SQLite: 1.11' >> META_new.yml 510 | $(NOECHO) $(ECHO) ' DBI: 1.50' >> META_new.yml 511 | $(NOECHO) $(ECHO) ' XML::LibXML: 1.01' >> META_new.yml 512 | $(NOECHO) $(ECHO) 'no_index:' >> META_new.yml 513 | $(NOECHO) $(ECHO) ' directory:' >> META_new.yml 514 | $(NOECHO) $(ECHO) ' - t' >> META_new.yml 515 | $(NOECHO) $(ECHO) ' - inc' >> META_new.yml 516 | $(NOECHO) $(ECHO) 'generated_by: ExtUtils::MakeMaker version 6.57_05' >> META_new.yml 517 | $(NOECHO) $(ECHO) 'meta-spec:' >> META_new.yml 518 | $(NOECHO) $(ECHO) ' url: http://module-build.sourceforge.net/META-spec-v1.4.html' >> META_new.yml 519 | $(NOECHO) $(ECHO) ' version: 1.4' >> META_new.yml 520 | -$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml 521 | 522 | 523 | # --- MakeMaker signature section: 524 | signature : 525 | cpansign -s 526 | 527 | 528 | # --- MakeMaker dist_basics section: 529 | distclean :: realclean distcheck 530 | $(NOECHO) $(NOOP) 531 | 532 | distcheck : 533 | $(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck 534 | 535 | skipcheck : 536 | $(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck 537 | 538 | manifest : 539 | $(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest 540 | 541 | veryclean : realclean 542 | $(RM_F) *~ */*~ *.orig */*.orig *.bak */*.bak *.old */*.old 543 | 544 | 545 | 546 | # --- MakeMaker dist_core section: 547 | 548 | dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE) 549 | $(NOECHO) $(ABSPERLRUN) -l -e 'print '\''Warning: Makefile possibly out of date with $(VERSION_FROM)'\''' \ 550 | -e ' if -e '\''$(VERSION_FROM)'\'' and -M '\''$(VERSION_FROM)'\'' < -M '\''$(FIRST_MAKEFILE)'\'';' -- 551 | 552 | tardist : $(DISTVNAME).tar$(SUFFIX) 553 | $(NOECHO) $(NOOP) 554 | 555 | uutardist : $(DISTVNAME).tar$(SUFFIX) 556 | uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu 557 | 558 | $(DISTVNAME).tar$(SUFFIX) : distdir 559 | $(PREOP) 560 | $(TO_UNIX) 561 | $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME) 562 | $(RM_RF) $(DISTVNAME) 563 | $(COMPRESS) $(DISTVNAME).tar 564 | $(POSTOP) 565 | 566 | zipdist : $(DISTVNAME).zip 567 | $(NOECHO) $(NOOP) 568 | 569 | $(DISTVNAME).zip : distdir 570 | $(PREOP) 571 | $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME) 572 | $(RM_RF) $(DISTVNAME) 573 | $(POSTOP) 574 | 575 | shdist : distdir 576 | $(PREOP) 577 | $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar 578 | $(RM_RF) $(DISTVNAME) 579 | $(POSTOP) 580 | 581 | 582 | # --- MakeMaker distdir section: 583 | create_distdir : 584 | $(RM_RF) $(DISTVNAME) 585 | $(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \ 586 | -e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');" 587 | 588 | distdir : create_distdir distmeta 589 | $(NOECHO) $(NOOP) 590 | 591 | 592 | 593 | # --- MakeMaker dist_test section: 594 | disttest : distdir 595 | cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL 596 | cd $(DISTVNAME) && $(MAKE) $(PASTHRU) 597 | cd $(DISTVNAME) && $(MAKE) test $(PASTHRU) 598 | 599 | 600 | 601 | # --- MakeMaker dist_ci section: 602 | 603 | ci : 604 | $(PERLRUN) "-MExtUtils::Manifest=maniread" \ 605 | -e "@all = keys %{ maniread() };" \ 606 | -e "print(qq{Executing $(CI) @all\n}); system(qq{$(CI) @all});" \ 607 | -e "print(qq{Executing $(RCS_LABEL) ...\n}); system(qq{$(RCS_LABEL) @all});" 608 | 609 | 610 | # --- MakeMaker distmeta section: 611 | distmeta : create_distdir metafile 612 | $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}}) } ' \ 613 | -e ' or print "Could not add META.yml to MANIFEST: $${'\''@'\''}\n"' -- 614 | 615 | 616 | 617 | # --- MakeMaker distsignature section: 618 | distsignature : create_distdir 619 | $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) } ' \ 620 | -e ' or print "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}\n"' -- 621 | $(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE 622 | cd $(DISTVNAME) && cpansign -s 623 | 624 | 625 | 626 | # --- MakeMaker install section: 627 | 628 | install :: pure_install doc_install 629 | $(NOECHO) $(NOOP) 630 | 631 | install_perl :: pure_perl_install doc_perl_install 632 | $(NOECHO) $(NOOP) 633 | 634 | install_site :: pure_site_install doc_site_install 635 | $(NOECHO) $(NOOP) 636 | 637 | install_vendor :: pure_vendor_install doc_vendor_install 638 | $(NOECHO) $(NOOP) 639 | 640 | pure_install :: pure_$(INSTALLDIRS)_install 641 | $(NOECHO) $(NOOP) 642 | 643 | doc_install :: doc_$(INSTALLDIRS)_install 644 | $(NOECHO) $(NOOP) 645 | 646 | pure__install : pure_site_install 647 | $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site 648 | 649 | doc__install : doc_site_install 650 | $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site 651 | 652 | pure_perl_install :: all 653 | $(NOECHO) umask 022; $(MOD_INSTALL) \ 654 | $(INST_LIB) $(DESTINSTALLPRIVLIB) \ 655 | $(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \ 656 | $(INST_BIN) $(DESTINSTALLBIN) \ 657 | $(INST_SCRIPT) $(DESTINSTALLSCRIPT) \ 658 | $(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \ 659 | $(INST_MAN3DIR) $(DESTINSTALLMAN3DIR) 660 | $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ 661 | $(SITEARCHEXP)/auto/$(FULLEXT) 662 | 663 | 664 | pure_site_install :: all 665 | $(NOECHO) umask 02; $(MOD_INSTALL) \ 666 | read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \ 667 | write $(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \ 668 | $(INST_LIB) $(DESTINSTALLSITELIB) \ 669 | $(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \ 670 | $(INST_BIN) $(DESTINSTALLSITEBIN) \ 671 | $(INST_SCRIPT) $(DESTINSTALLSITESCRIPT) \ 672 | $(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \ 673 | $(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR) 674 | $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ 675 | $(PERL_ARCHLIB)/auto/$(FULLEXT) 676 | 677 | pure_vendor_install :: all 678 | $(NOECHO) umask 022; $(MOD_INSTALL) \ 679 | $(INST_LIB) $(DESTINSTALLVENDORLIB) \ 680 | $(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \ 681 | $(INST_BIN) $(DESTINSTALLVENDORBIN) \ 682 | $(INST_SCRIPT) $(DESTINSTALLVENDORSCRIPT) \ 683 | $(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \ 684 | $(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR) 685 | 686 | doc_perl_install :: all 687 | 688 | doc_site_install :: all 689 | $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLSITEARCH)/perllocal.pod 690 | -$(NOECHO) umask 02; $(MKPATH) $(DESTINSTALLSITEARCH) 691 | -$(NOECHO) umask 02; $(DOC_INSTALL) \ 692 | "Module" "$(NAME)" \ 693 | "installed into" "$(INSTALLSITELIB)" \ 694 | LINKTYPE "$(LINKTYPE)" \ 695 | VERSION "$(VERSION)" \ 696 | EXE_FILES "$(EXE_FILES)" \ 697 | >> $(DESTINSTALLSITEARCH)/perllocal.pod 698 | 699 | doc_vendor_install :: all 700 | 701 | 702 | uninstall :: uninstall_from_$(INSTALLDIRS)dirs 703 | $(NOECHO) $(NOOP) 704 | 705 | uninstall_from_perldirs :: 706 | 707 | uninstall_from_sitedirs :: 708 | $(NOECHO) $(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist 709 | 710 | uninstall_from_vendordirs :: 711 | 712 | 713 | 714 | # --- MakeMaker force section: 715 | # Phony target to force checking subdirectories. 716 | FORCE : 717 | $(NOECHO) $(NOOP) 718 | 719 | 720 | # --- MakeMaker perldepend section: 721 | 722 | 723 | # --- MakeMaker makefile section: 724 | # We take a very conservative approach here, but it's worth it. 725 | # We move Makefile to Makefile.old here to avoid gnu make looping. 726 | $(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP) 727 | $(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?" 728 | $(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..." 729 | -$(NOECHO) $(RM_F) $(MAKEFILE_OLD) 730 | -$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) 731 | - $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL) 732 | $(PERLRUN) Makefile.PL 733 | $(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <==" 734 | $(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <==" 735 | $(FALSE) 736 | 737 | 738 | 739 | # --- MakeMaker staticmake section: 740 | 741 | # --- MakeMaker makeaperl section --- 742 | MAP_TARGET = perl 743 | FULLPERL = /usr/bin/perl 744 | 745 | $(MAP_TARGET) :: static $(MAKE_APERL_FILE) 746 | $(MAKE) $(USEMAKEFILE) $(MAKE_APERL_FILE) $@ 747 | 748 | $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib 749 | $(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET) 750 | $(NOECHO) $(PERLRUNINST) \ 751 | Makefile.PL DIR= \ 752 | MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \ 753 | MAKEAPERL=1 NORECURS=1 CCCDLFLAGS= 754 | 755 | 756 | # --- MakeMaker test section: 757 | 758 | TEST_VERBOSE=0 759 | TEST_TYPE=test_$(LINKTYPE) 760 | TEST_FILE = test.pl 761 | TEST_FILES = 762 | TESTDB_SW = -d 763 | 764 | testdb :: testdb_$(LINKTYPE) 765 | 766 | test :: $(TEST_TYPE) subdirs-test 767 | 768 | subdirs-test :: 769 | $(NOECHO) $(NOOP) 770 | 771 | $(NOECHO) $(ECHO) 'No tests defined for $(NAME) extension.' 772 | 773 | test_dynamic :: pure_all 774 | 775 | testdb_dynamic :: pure_all 776 | PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) 777 | 778 | test_ : test_dynamic 779 | 780 | test_static :: test_dynamic 781 | testdb_static :: testdb_dynamic 782 | 783 | 784 | # --- MakeMaker ppd section: 785 | # Creates a PPD (Perl Package Description) for a binary distribution. 786 | ppd : 787 | $(NOECHO) $(ECHO) '' > $(DISTNAME).ppd 788 | $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd 789 | $(NOECHO) $(ECHO) ' Joshua D. Abraham' >> $(DISTNAME).ppd 790 | $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd 791 | $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd 792 | $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd 793 | $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd 794 | $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd 795 | $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd 796 | $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd 797 | $(NOECHO) $(ECHO) '' >> $(DISTNAME).ppd 798 | 799 | 800 | # --- MakeMaker pm_to_blib section: 801 | 802 | pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM) 803 | $(NOECHO) $(TOUCH) pm_to_blib 804 | 805 | 806 | # --- MakeMaker selfdocument section: 807 | 808 | 809 | # --- MakeMaker postamble section: 810 | 811 | 812 | # End. 813 | -------------------------------------------------------------------------------- /Makefile.PL: -------------------------------------------------------------------------------- 1 | use ExtUtils::MakeMaker; 2 | 3 | # See lib/ExtUtils/MakeMaker.pm for details of how to influence 4 | # the contents of the Makefile that is written. 5 | 6 | WriteMakefile( 7 | 'NAME' => 'giskismet', 8 | 'AUTHOR' => 'Joshua D. Abraham', 9 | 'VERSION' => '0.02', 10 | 'EXE_FILES' => [ 'giskismet' ], 11 | 'INSTALLDIRS' => 'site', 12 | 'MAN1PODS' => { 13 | 'giskismet.man.1' => 'blib/man1/giskismet.1p', 14 | }, 15 | 'PREREQ_PM' => { 16 | 'XML::LibXML' => '1.01', 17 | 'DBI' => '1.50', 18 | 'DBD::SQLite' => '1.11', 19 | }, 20 | 'dist' => { 21 | 'SUFFIX' => ".gz", 22 | 'DIST_DEFAULT' => 'all tardist', 23 | 'COMPRESS' => "gzip -9f" 24 | }, 25 | 'realclean' => { 'FILES' => '' }, 26 | 'clean' => { 'FILES' => '' }, 27 | ); 28 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | GISKismet - Version .02 ( http://www.giskismet.org ) 2 | 3 | GISKismet is a wireless recon visualization tool to represent data gathered 4 | using Kismet in a flexible manner. GISKismet stores the information in a 5 | database so that the user can generate graphs using SQL. GISKismet currently 6 | uses SQLite for the database and GoogleEarth / KML files for graphing. 7 | 8 | GISKismet supports Kismet-newcore and Kismet-devel. 9 | 10 | Let me know what you think. 11 | 12 | Joshua D. Abraham (jabra@spl0it.org) 13 | -------------------------------------------------------------------------------- /blib/arch/.exists: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtr4nge/giskismet/9ebe9d026f0112096ace24fe14c2f22dbffe67bb/blib/arch/.exists -------------------------------------------------------------------------------- /blib/arch/auto/giskismet/.exists: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtr4nge/giskismet/9ebe9d026f0112096ace24fe14c2f22dbffe67bb/blib/arch/auto/giskismet/.exists -------------------------------------------------------------------------------- /blib/bin/.exists: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtr4nge/giskismet/9ebe9d026f0112096ace24fe14c2f22dbffe67bb/blib/bin/.exists -------------------------------------------------------------------------------- /blib/lib/.exists: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtr4nge/giskismet/9ebe9d026f0112096ace24fe14c2f22dbffe67bb/blib/lib/.exists -------------------------------------------------------------------------------- /blib/lib/auto/giskismet/.exists: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtr4nge/giskismet/9ebe9d026f0112096ace24fe14c2f22dbffe67bb/blib/lib/auto/giskismet/.exists -------------------------------------------------------------------------------- /blib/man1/.exists: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtr4nge/giskismet/9ebe9d026f0112096ace24fe14c2f22dbffe67bb/blib/man1/.exists -------------------------------------------------------------------------------- /blib/man1/giskismet.1p: -------------------------------------------------------------------------------- 1 | .\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) 2 | .\" 3 | .\" Standard preamble: 4 | .\" ======================================================================== 5 | .de Sp \" Vertical space (when we can't use .PP) 6 | .if t .sp .5v 7 | .if n .sp 8 | .. 9 | .de Vb \" Begin verbatim text 10 | .ft CW 11 | .nf 12 | .ne \\$1 13 | .. 14 | .de Ve \" End verbatim text 15 | .ft R 16 | .fi 17 | .. 18 | .\" Set up some character translations and predefined strings. \*(-- will 19 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left 20 | .\" double quote, and \*(R" will give a right double quote. \*(C+ will 21 | .\" give a nicer C++. Capital omega is used to do unbreakable dashes and 22 | .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, 23 | .\" nothing in troff, for use with C<>. 24 | .tr \(*W- 25 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' 26 | .ie n \{\ 27 | . ds -- \(*W- 28 | . ds PI pi 29 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch 30 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch 31 | . ds L" "" 32 | . ds R" "" 33 | . ds C` "" 34 | . ds C' "" 35 | 'br\} 36 | .el\{\ 37 | . ds -- \|\(em\| 38 | . ds PI \(*p 39 | . ds L" `` 40 | . ds R" '' 41 | 'br\} 42 | .\" 43 | .\" Escape single quotes in literal strings from groff's Unicode transform. 44 | .ie \n(.g .ds Aq \(aq 45 | .el .ds Aq ' 46 | .\" 47 | .\" If the F register is turned on, we'll generate index entries on stderr for 48 | .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index 49 | .\" entries marked with X<> in POD. Of course, you'll have to process the 50 | .\" output yourself in some meaningful fashion. 51 | .ie \nF \{\ 52 | . de IX 53 | . tm Index:\\$1\t\\n%\t"\\$2" 54 | .. 55 | . nr % 0 56 | . rr F 57 | .\} 58 | .el \{\ 59 | . de IX 60 | .. 61 | .\} 62 | .\" 63 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). 64 | .\" Fear. Run. Save yourself. No user-serviceable parts. 65 | . \" fudge factors for nroff and troff 66 | .if n \{\ 67 | . ds #H 0 68 | . ds #V .8m 69 | . ds #F .3m 70 | . ds #[ \f1 71 | . ds #] \fP 72 | .\} 73 | .if t \{\ 74 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) 75 | . ds #V .6m 76 | . ds #F 0 77 | . ds #[ \& 78 | . ds #] \& 79 | .\} 80 | . \" simple accents for nroff and troff 81 | .if n \{\ 82 | . ds ' \& 83 | . ds ` \& 84 | . ds ^ \& 85 | . ds , \& 86 | . ds ~ ~ 87 | . ds / 88 | .\} 89 | .if t \{\ 90 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" 91 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' 92 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' 93 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' 94 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' 95 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' 96 | .\} 97 | . \" troff and (daisy-wheel) nroff accents 98 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' 99 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' 100 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] 101 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' 102 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' 103 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] 104 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] 105 | .ds ae a\h'-(\w'a'u*4/10)'e 106 | .ds Ae A\h'-(\w'A'u*4/10)'E 107 | . \" corrections for vroff 108 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' 109 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' 110 | . \" for low resolution devices (crt and lpr) 111 | .if \n(.H>23 .if \n(.V>19 \ 112 | \{\ 113 | . ds : e 114 | . ds 8 ss 115 | . ds o a 116 | . ds d- d\h'-1'\(ga 117 | . ds D- D\h'-1'\(hy 118 | . ds th \o'bp' 119 | . ds Th \o'LP' 120 | . ds ae ae 121 | . ds Ae AE 122 | .\} 123 | .rm #[ #] #H #V #F C 124 | .\" ======================================================================== 125 | .\" 126 | .IX Title "GISKISMET.MAN.1 1p" 127 | .TH GISKISMET.MAN.1 1p "2015-06-23" "perl v5.14.2" "User Contributed Perl Documentation" 128 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes 129 | .\" way too many mistakes in technical documents. 130 | .if n .ad l 131 | .nh 132 | .SH "NAME" 133 | GISKismet - a program to visually represent the Kismet data in 134 | a flexible manner. 135 | .SH "SYNOPSIS" 136 | .IX Header "SYNOPSIS" 137 | giskismet [Options] 138 | .SH "DESCRIPTION" 139 | .IX Header "DESCRIPTION" 140 | GISKismet is a wireless recon visualization tool to represent data 141 | gathered using Kismet in a flexible manner. GISKismet stores the 142 | information in a database so that the user can generate graphs using 143 | SQL. GISKismet currently uses SQLite for the database and GoogleEarth 144 | / KML files for graphing. 145 | .SH "OPTIONS" 146 | .IX Header "OPTIONS" 147 | Usage: giskismet.pl [Options] 148 | 149 | Input File: 150 | --csv Parse the input from Kismet-devel CSV 151 | -x --xml Parse the input from Kismet-newcore NETXML 152 | 153 | Input Filters: 154 | --bssid file | list Filter based on BSSID 155 | --essid file | list Filter based on ESSID 156 | --encryption file | list Filter based on Encryption 157 | --channel file | list Filter based on Channel 158 | 159 | file | list (list = comma separted lists(needs quotes) 160 | 161 | Kismet-newcore Options: 162 | -a --ap Insert only the APs 163 | 164 | Query 165 | -q --query [sql] SQL query 166 | -m --manual [csv] CSV output of manual SQL query 167 | 168 | -o --output [file] Output filename 169 | -n --name [str] Name of the KML layer 170 | --desc [str] Description of the KML layer 171 | 172 | General Options: 173 | -d --debug [num] Display debug information 174 | -s --silent No output when adding APs 175 | -v --version Display version 176 | -h --help Display this information 177 | 178 | Send Comments to Joshua D. Abraham ( jabra@spl0it.org ) 179 | 180 | .SH "EXAMPLE SINGLE SCAN" 181 | .IX Header "EXAMPLE SINGLE SCAN" 182 | 1) Insert all data from a Kismet-newcore netxml file into the 183 | GISKismet database 184 | 185 | perl giskismet -x examples/Kismet-Feb-05-2009-1.netxml 186 | 187 | 2) Insert only the APs on channel 2 188 | 189 | perl giskismet -x examples/Kismet-Feb-05-2009-1.netxml --channel 2 190 | 191 | 3) Generate a graph based on the GISKismet database 192 | 193 | perl giskismet -q "select * from wireless" -o ex1.kml 194 | 195 | 4) Insert all the information from a Kismet-newcore netxml file and 196 | generate a graph of all the APs named linksys without encryption 197 | 198 | perl giskismet -x examples/Kismet-Feb-05-2009-1.netxml 199 | -q "select * from wireless where ESSID='linksys' and Encryption='None'" -o ex2.kml 200 | .SH "FEATURE REQUESTS" 201 | .IX Header "FEATURE REQUESTS" 202 | Any feature requests should be reported to the online 203 | feature-request-tracking system available on the web at : 204 | 205 | http://my-trac.assembla.com/giskismet/newticket 206 | 207 | Before requesting a feature, please check to see if the features has 208 | already been requested. 209 | .SH "BUG REPORTS" 210 | .IX Header "BUG REPORTS" 211 | Any bugs found should be reported to the online bug-tracking system 212 | available on the web at : 213 | 214 | http://my-trac.assembla.com/giskismet/newticket 215 | 216 | Before reporting a bug, please check to see if the bug has already 217 | been reported. 218 | .SH "SUPPORTED DATABASES" 219 | .IX Header "SUPPORTED DATABASES" 220 | The following databases are supported: 221 | 222 | * SQLite 223 | .SH "DATABASE SCHEMA" 224 | .IX Header "DATABASE SCHEMA" 225 | The following is the SQLite version of the database schema: 226 | 227 | CREATE TABLE clients ( 228 | cid INTEGER PRIMARY KEY AUTOINCREMENT, 229 | nid INTEGER NULL, 230 | mac text default NULL, 231 | manuf text default NULL, 232 | iptype text default NULL, 233 | ip text default NULL); 234 | CREATE TABLE wireless ( 235 | Id INTEGER PRIMARY KEY AUTOINCREMENT, 236 | NetworkID INTEGER NULL, 237 | NetType text default NULL, 238 | ESSID text default NULL, 239 | BSSID text default NULL, 240 | Manuf text default NULL, 241 | Info text default NULL, 242 | Channel INTEGER NULL, 243 | Cloaked text default NULL, 244 | Encryption text default NULL, 245 | Decrypted text default NULL, 246 | MaxRate INTEGER NULL, 247 | MaxSeenRate INTEGER NULL, 248 | Beacon INTEGER NULL, 249 | LLC INTEGER NULL, 250 | Data INTEGER NULL, 251 | Crypt INTEGER NULL, 252 | Weak INTEGER NULL, 253 | Total INTEGER NULL, 254 | Carrier text default NULL, 255 | Encoding text default NULL, 256 | FirstTime text default NULL, 257 | LastTime text default NULL, 258 | BestQuality INTEGER NULL, 259 | BestSignal INTEGER NULL, 260 | BestNoise INTEGER NULL, 261 | GPSMinLat float NULL, 262 | GPSMinLon float NULL, 263 | GPSMinAlt float NULL, 264 | GPSMinSpd float NULL, 265 | GPSMaxLat float NULL, 266 | GPSMaxLon float NULL, 267 | GPSMaxAlt float NULL, 268 | GPSMaxSpd float NULL, 269 | GPSBestLat float NULL, 270 | GPSBestLon float NULL, 271 | GPSBestAlt float NULL, 272 | DataSize INTEGER NULL, 273 | IPType text default NULL, 274 | IP text default NULL); 275 | .SH "AUTHORS" 276 | .IX Header "AUTHORS" 277 | Joshua D. Abraham ( jabra@spl0it.org ) 278 | -------------------------------------------------------------------------------- /blib/man3/.exists: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtr4nge/giskismet/9ebe9d026f0112096ace24fe14c2f22dbffe67bb/blib/man3/.exists -------------------------------------------------------------------------------- /blib/script/.exists: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtr4nge/giskismet/9ebe9d026f0112096ace24fe14c2f22dbffe67bb/blib/script/.exists -------------------------------------------------------------------------------- /blib/script/giskismet: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' 4 | if 0; # not running under some shell 5 | # 6 | # Copyright (C) 2009-2010 Joshua D. Abraham < jabra@spl0it.org > 7 | # 8 | # This program is released under the terms of the GNU General Public License 9 | # (GPL), which is distributed with this software in the file "COPYING". 10 | # The GPL specifies the terms under which users may copy and use this software. 11 | # 12 | # GISKismet 0.02 13 | # 14 | use strict; 15 | use warnings; 16 | use XML::LibXML; 17 | use Getopt::Long; 18 | use Data::Dumper; 19 | use POSIX; 20 | use DBI; 21 | use vars qw( $PROG ); 22 | 23 | ( $PROG = $0 ) =~ s/^.*[\/\\]//; # Truncate calling path from the prog name 24 | my $AUTH = 'Joshua "Jabra" Abraham'; # author 25 | my $EMAIL = 'jabra@spl0it.org'; # email 26 | my $VERSION = '0.02'; # version 27 | 28 | my %options; # getopts hash 29 | my $host = '127.0.0.1'; 30 | my $user = ''; 31 | my $password = ''; 32 | my $dbase = 'wireless.dbl'; 33 | my $format; 34 | my $file; 35 | my $id; # initialized later 36 | my $cid; # initialized later 37 | my $input = 'Kismet'; 38 | my $name = 'name'; 39 | my $description = 'description'; 40 | my ( $ap, $client ); 41 | 42 | ## Import filters 43 | my $filters = 'none'; 44 | my @bssid_filters; 45 | my @essid_filters; 46 | my @channel_filters; 47 | my @encryption_filters; 48 | 49 | $options{debug} = 0; 50 | $options{silent} = 0; 51 | $options{ignoregps} = 0; 52 | 53 | my $OPACITY = 127; # transparency 54 | my $ALPHA = sprintf( "%x", $OPACITY ); 55 | 56 | my $RED = '0000FF'; 57 | my $ORANGE = '0090FF'; 58 | my $YELLOW = '00FFFF'; 59 | my $GREEN = '00FF00'; 60 | my $GREY = '7E7E7E'; 61 | 62 | my $CALCRANGE = 0; # calculate network range 63 | my $DRAWCENTER = 1; # draw center of network 64 | my $CENTERSIZE = 1; # size for network center 65 | 66 | my $dbh; # DBI connector 67 | 68 | my $parser = XML::LibXML->new(); 69 | $parser->validation(0); 70 | $parser->load_ext_dtd(0); 71 | my ( $doc, $xpc ); 72 | 73 | sub output { 74 | my ( $filename, $output ) = @_; 75 | if ( -e $filename ) { # file exists 76 | print "File already exists, do you want to overwrite it? [Y|N] "; 77 | chomp( my $overwrite = ); 78 | if ( $overwrite eq 'y' || $overwrite eq 'Y' ) { 79 | open FILE, '>', $filename 80 | or die "Having trouble opening $filename anyway\n"; 81 | print FILE $output; 82 | } 83 | else { 84 | die "Okay, giving up\n"; 85 | } 86 | } 87 | else { 88 | open FILE, '>', $filename 89 | or die "Having trouble opening $filename\n"; 90 | print FILE $output; 91 | } 92 | 93 | close(FILE); 94 | } 95 | 96 | ############################################################################## 97 | # 98 | # runSql: sql str -> array ref 99 | # execute sql and return arrayref to the result 100 | # 101 | # ############################################################################ 102 | sub runSql { 103 | my ($sql) = @_; 104 | 105 | my $sth = $dbh->selectall_arrayref($sql); 106 | return $sth; 107 | } 108 | 109 | ############################################################################## 110 | # 111 | # create_wireless_table: -> int 112 | # create the table to store the wireless kismet information 113 | # 114 | # ############################################################################ 115 | sub create_wireless_table { 116 | eval { 117 | $dbh->do( 118 | "CREATE TABLE wireless ( 119 | Id INTEGER PRIMARY KEY AUTOINCREMENT, 120 | NetworkID INTEGER NULL, 121 | NetType text default NULL, 122 | ESSID text default NULL, 123 | BSSID text default NULL, 124 | Manuf text default NULL, 125 | Info text default NULL, 126 | Channel INTEGER NULL, 127 | Cloaked text default NULL, 128 | Encryption text default NULL, 129 | Decrypted text default NULL, 130 | MaxRate INTEGER NULL, 131 | MaxSeenRate INTEGER NULL, 132 | Beacon INTEGER NULL, 133 | LLC INTEGER NULL, 134 | Data INTEGER NULL, 135 | Crypt INTEGER NULL, 136 | Weak INTEGER NULL, 137 | Total INTEGER NULL, 138 | Carrier text default NULL, 139 | Encoding text default NULL, 140 | FirstTime text default NULL, 141 | LastTime text default NULL, 142 | BestQuality INTEGER NULL, 143 | BestSignal INTEGER NULL, 144 | BestNoise INTEGER NULL, 145 | GPSMinLat float NULL, 146 | GPSMinLon float NULL, 147 | GPSMinAlt float NULL, 148 | GPSMinSpd float NULL, 149 | GPSMaxLat float NULL, 150 | GPSMaxLon float NULL, 151 | GPSMaxAlt float NULL, 152 | GPSMaxSpd float NULL, 153 | GPSBestLat float NULL, 154 | GPSBestLon float NULL, 155 | GPSBestAlt float NULL, 156 | DataSize INTEGER NULL, 157 | IPType text default NULL, 158 | IP text default NULL)" 159 | ); 160 | }; 161 | if ($@) { 162 | return 0; 163 | } 164 | else { 165 | return 1; 166 | } 167 | 168 | } 169 | 170 | ############################################################################## 171 | # 172 | # create_clients_table: -> int 173 | # create the table to store the wireless kismet information 174 | # 175 | # ############################################################################ 176 | sub create_clients_table { 177 | eval { 178 | $dbh->do( 179 | "CREATE TABLE clients ( 180 | cid INTEGER PRIMARY KEY AUTOINCREMENT, 181 | nid INTEGER NULL, 182 | mac text default NULL, 183 | manuf text default NULL, 184 | iptype text default NULL, 185 | ip text default NULL)" 186 | ); 187 | }; 188 | if ($@) { 189 | return 0; 190 | } 191 | else { 192 | return 1; 193 | } 194 | 195 | } 196 | 197 | ######## 198 | ## NOTE: this aspect was taken from kisgearth 199 | ######## 200 | # This is based on the signal strength which isn't used for 201 | # computation. Only using the ranges to make sure all APs fit on the 202 | # screen when the map is loaded. 203 | # 204 | # 205 | # This will be rewritten later. 206 | # 207 | # calculate network position (and range - rudimentary) 208 | sub calc_pos { 209 | 210 | my ( $minlon_in, $minlat_in, $maxlon_in, $maxlat_in, $bssid ) = @_; 211 | my $altitude_out = 0; 212 | my $range_out = 7; 213 | my $heading_out = 0; 214 | my $tilt_out = 0; 215 | my $coords_out = "0.0,0.0"; 216 | my $lon_out = 0.0; 217 | my $lat_out = 0.0; 218 | my $scale_out = 0.0; 219 | my $dummy = 0; 220 | my $tmp_netgps_cnt = 0; 221 | 222 | my @data = @{ runSql("select * from wireless where BSSID='$bssid'") }; 223 | if ( scalar(@data) == 1 ) { 224 | 225 | } 226 | else { 227 | $dummy = ( $maxlon_in - $minlon_in ) / 2; 228 | $lon_out = $minlon_in + $dummy; 229 | 230 | $dummy = ( $maxlat_in - $minlat_in ) / 2; 231 | $lat_out = $minlat_in + $dummy; 232 | } 233 | 234 | $coords_out = "$lon_out,$lat_out,0"; 235 | 236 | if ( $CALCRANGE == 1 ) { 237 | $scale_out 238 | = ( ( ( $maxlat_in - $minlat_in ) + ( $maxlon_in - $minlon_in ) ) 239 | / 2 ) * 1850; 240 | 241 | if ( $scale_out < 0.8 ) { 242 | $scale_out = 0.8; 243 | } 244 | elsif ( $scale_out > 4.0 ) { 245 | $scale_out = 4.0; 246 | } 247 | } 248 | else { 249 | $scale_out = $CENTERSIZE; 250 | } 251 | 252 | return 253 | "$lon_out|$lat_out|$coords_out|$altitude_out|$range_out|$heading_out|$tilt_out|$scale_out"; 254 | 255 | } # sub calc_pos 256 | 257 | ############################################################################## 258 | # 259 | # help -> 260 | # display help information 261 | # side effect: exits program 262 | # 263 | ############################################################################## 264 | sub help { 265 | print "Usage: $PROG [Options] 266 | 267 | Input File: 268 | --csv Parse the input from Kismet-devel CSV 269 | -x --xml Parse the input from Kismet-newcore NETXML 270 | 271 | Input Filters: 272 | --bssid file | list Filter based on BSSID 273 | --essid file | list Filter based on ESSID 274 | --encryption file | list Filter based on Encryption 275 | --channel file | list Filter based on Channel 276 | 277 | file | list (list = comma separated lists(needs quotes) 278 | 279 | Kismet-newcore Options: 280 | -a --ap Insert only the APs 281 | 282 | Query 283 | -q --query [sql] SQL query 284 | -m --manual [csv] CSV output of manual SQL query 285 | 286 | -o --output [file] Output filename 287 | -n --name [str] Name of the KML layer 288 | --desc [str] Description of the KML layer 289 | 290 | General Options: 291 | --ignore-gps Import data even when GPS fields are missing 292 | --database [file] SQLite3 database name [default: wireless.dbl] 293 | -d --debug [num] Display debug information 294 | -s --silent No output when adding APs 295 | -v --version Display version 296 | -h --help Display this information 297 | 298 | Send Comments to $AUTH ( $EMAIL )\n"; 299 | exit; 300 | } 301 | 302 | ############################################################################## 303 | # 304 | # print_version -> 305 | # displays version 306 | # side effect: exits program 307 | # 308 | ############################################################################## 309 | sub print_version { 310 | print "$PROG version $VERSION by $AUTH\n"; 311 | exit; 312 | } 313 | 314 | ############################################################################## 315 | if ( @ARGV == 0 ) { 316 | help; 317 | exit; 318 | } 319 | GetOptions( 320 | \%options, 321 | 'xml|x=s', 'csv=s', 'query|q=s', 'manual|m=s', 'database=s', 'output|o=s', 322 | 'ap|a=s', 323 | 'bssid=s', 'essid=s', 'channel=s', 'encryption=s', 324 | 'name|n=s', 'desc=s', 325 | 'help|h' => sub { help(); }, 326 | 'version|v' => sub { print_version(); }, 327 | 'debug|d=s' => sub { $options{debug} = 2 }, 328 | 'silent|s' => sub { $options{silent} = 1 }, 329 | 'ignore-gps' => sub { $options{ignoregps} = 1 }, 330 | ) or exit 1; 331 | 332 | if ( $options{xml} ) { 333 | $format = 'xml'; 334 | $file = $options{xml}; 335 | } 336 | elsif ( $options{csv} ) { 337 | $format = 'csv'; 338 | $file = $options{csv}; 339 | } 340 | else { 341 | 342 | } 343 | 344 | if ( !$options{xml} 345 | and !$options{csv} 346 | and !$options{query} 347 | and !$options{manual} ) 348 | { 349 | help; 350 | } 351 | 352 | if ( $options{database} ) { 353 | $dbase = $options{database}; 354 | } 355 | 356 | $dbh = DBI->connect( 357 | "dbi:SQLite:$dbase", 358 | "$user", 359 | $password, 360 | { PrintError => 0, 361 | RaiseError => 0, 362 | AutoCommit => 1 363 | } 364 | ) || die "Cannot connect: $DBI::errstr"; 365 | 366 | if ( $options{bssid} ) { 367 | if ( -r $options{bssid} ) { 368 | open( IN, $options{bssid} ) or die "can't open bssid file\n"; 369 | @bssid_filters = ; 370 | close(IN); 371 | } 372 | else { 373 | $options{bssid} =~ s/\s+/,/g; 374 | push( @bssid_filters, $options{bssid} ); 375 | @bssid_filters = split( /,/, $options{bssid} ); 376 | } 377 | chomp(@bssid_filters); 378 | $filters .= 'bssid'; 379 | } 380 | 381 | if ( $options{essid} ) { 382 | if ( -r $options{essid} ) { 383 | open( IN, $options{essid} ) or die "can't open essid file\n"; 384 | @essid_filters = ; 385 | close(IN); 386 | } 387 | else { 388 | $options{essid} =~ s/\s+/,/g; 389 | @essid_filters = split( /,/, $options{essid} ); 390 | } 391 | chomp(@essid_filters); 392 | $filters .= 'essid'; 393 | } 394 | 395 | if ( $options{encryption} ) { 396 | if ( -r $options{encryption} ) { 397 | 398 | # TODO add encryption verification 399 | open( IN, $options{encryption} ) or die "can't open encryption 400 | file\n"; 401 | @encryption_filters = ; 402 | close(IN); 403 | } 404 | else { 405 | $options{encryption} =~ s/\s+/,/g; 406 | @encryption_filters = split( /,/, $options{encryption} ); 407 | } 408 | chomp(@encryption_filters); 409 | $filters .= 'encryption'; 410 | } 411 | 412 | if ( $options{channel} ) { 413 | if ( -r $options{channel} ) { 414 | 415 | # TODO add channel verification 416 | open( IN, $options{channel} ) or die "can't open channel file\n"; 417 | @channel_filters = ; 418 | close(IN); 419 | } 420 | else { 421 | $options{channel} =~ s/\s+/,/g; 422 | @channel_filters = split( /,/, $options{channel} ); 423 | } 424 | chomp(@channel_filters); 425 | $filters .= 'channel'; 426 | } 427 | 428 | my $wcreate = create_wireless_table(); 429 | my $ccreate = create_clients_table(); 430 | 431 | my $sth = $dbh->selectrow_hashref("select max(id) from wireless"); 432 | $id = $sth->{'max(id)'}; 433 | if ( !defined($id) ) { 434 | $id = 1; 435 | } 436 | else { 437 | $id++; 438 | } 439 | 440 | my $sth_cid = $dbh->selectrow_hashref("select max(cid) from clients"); 441 | $cid = $sth_cid->{'max(cid)'}; 442 | if ( !defined($cid) ) { 443 | $cid = 1; 444 | } 445 | else { 446 | $cid++; 447 | } 448 | 449 | #print "id is $id\n"; 450 | if ( $options{xml} ) { 451 | ####################### 452 | # Parse the XML file 453 | ####################### 454 | $doc = $parser->parse_file($file); 455 | $xpc = XML::LibXML::XPathContext->new($doc); 456 | 457 | foreach my $wn ( $xpc->findnodes("//detection-run/wireless-network") ) { 458 | my $network_id = return_avalue( $wn, 'number' ); 459 | my $type = return_avalue( $wn, 'type' ); 460 | next if ( $type ne 'infrastructure' ); 461 | 462 | my $bssid = return_evalue( $wn, 'BSSID' ); 463 | my $manuf = return_evalue( $wn, 'manuf' ); 464 | my $first_time = return_avalue( $wn, 'first-time' ); 465 | my $last_time = return_avalue( $wn, 'first-time' ); 466 | 467 | my $ssid = ${ $wn->getElementsByTagName('SSID') }[0]; 468 | my ($ssid_first_time, $ssid_last_time, $ssid_type, 469 | $ssid_max_rate, $ssid_packets, $ssid_beaconrate, 470 | $ssid_essid, $ssid_cloaked 471 | ) = 'undefined'; 472 | my $ssid_encryption = ''; 473 | if ( defined($ssid) ) { 474 | $ssid_first_time = return_avalue( $ssid, 'first-time' ); 475 | $ssid_last_time = return_avalue( $ssid, 'last-time' ); 476 | $ssid_type = return_evalue( $ssid, 'type' ); 477 | $ssid_max_rate = return_evalue( $ssid, 'max-rate' ); 478 | $ssid_packets = return_evalue( $ssid, 'packets' ); 479 | $ssid_beaconrate = return_evalue( $ssid, 'beaconrate' ); 480 | 481 | $ssid_essid = return_evalue( $ssid, 'essid' ); 482 | my $essid = ${ $wn->getElementsByTagName('essid') }[0]; 483 | if ( defined($essid) ) { 484 | $ssid_cloaked = return_avalue( $essid, 'cloaked' ); 485 | if ( $ssid_cloaked eq 'true' ){ 486 | my $second_ssid = ${ $wn->getElementsByTagName('SSID') }[1]; 487 | if (defined($second_ssid) ) { 488 | $ssid_essid = return_evalue( $second_ssid, 'essid' ); 489 | } 490 | } 491 | 492 | } 493 | foreach my $s ( @{ $wn->getElementsByTagName('SSID') } ) { 494 | if ( !defined($ssid_encryption) 495 | or $ssid_encryption ne 496 | return_evalue_all( $s, 'encryption' ) ) 497 | { 498 | $ssid_encryption = return_evalue_all( $s, 'encryption' ); 499 | } 500 | } 501 | } 502 | else { 503 | next; 504 | } 505 | my $channel = return_evalue( $wn, 'channel' ); 506 | 507 | my $maxseenrate = return_evalue( $wn, 'maxseenrate' ); 508 | my $carrier = return_evalue( $wn, 'carrier' ); 509 | 510 | if ( $filters =~ /bssid/i ) { 511 | next if ( scalar( grep( $_ eq $bssid, @bssid_filters ) ) == 0 ); 512 | } 513 | 514 | if ( $filters =~ /channel/i ) { 515 | next 516 | if ( 517 | scalar( grep( $_ eq $channel, @channel_filters ) ) == 0 ); 518 | } 519 | if ( $filters =~ /essid/i ) { 520 | next 521 | if ( 522 | scalar( grep( $_ eq $ssid_essid, @essid_filters ) ) == 0 ); 523 | } 524 | 525 | if ( $filters =~ /encryption/i ) { 526 | next 527 | if ( 528 | scalar( grep( $_ eq $ssid_encryption, @encryption_filters ) ) 529 | == 0 ); 530 | } 531 | 532 | my $datasize = return_evalue( $wn, 'datasize' ); 533 | 534 | #print "Print Clients\n"; 535 | my %node; 536 | $node{'ClientID'} = 0; 537 | $node{'ClientMac'} = 'undefined'; 538 | $node{'NetworkID'} = $network_id; 539 | $node{'NetType'} = $type; 540 | $node{'ESSID'} = $ssid_essid; 541 | $node{'ESSID'} =~ s/\/_/g; 543 | $node{'BSSID'} = $bssid; 544 | $node{'Manuf'} = $manuf; 545 | $node{'Info'} = 'info'; 546 | $node{'Channel'} = $channel; 547 | $node{'Cloaked'} = $ssid_cloaked; 548 | $ssid_encryption = 'None' if ( $ssid_encryption eq '' ); 549 | $node{'Encryption'} = $ssid_encryption; 550 | $node{'Decrypted'} = 'decrypted'; 551 | $node{'MaxRate'} = $ssid_max_rate; 552 | $node{'MaxSeenRate'} = $maxseenrate; 553 | $node{'Beacon'} = $ssid_beaconrate; 554 | 555 | $node{'FirstTime'} = return_avalue( $wn, 'first-time' ); 556 | $node{'LastTime'} = return_avalue( $wn, 'last-time' ); 557 | 558 | my $wn_gps = ${ $wn->getElementsByTagName('gps-info') }[0]; 559 | if ( defined($wn_gps) ) { 560 | $node{'GPSMinLat'} = return_evalue( $wn_gps, 'min-lat' ); 561 | $node{'GPSMinLon'} = return_evalue( $wn_gps, 'min-lon' ); 562 | $node{'GPSMinAlt'} = return_evalue( $wn_gps, 'min-alt' ); 563 | $node{'GPSMinSpd'} = return_evalue( $wn_gps, 'min-spd' ); 564 | 565 | $node{'GPSMaxLat'} = return_evalue( $wn_gps, 'max-lat' ); 566 | $node{'GPSMaxLon'} = return_evalue( $wn_gps, 'max-lon' ); 567 | $node{'GPSMaxAlt'} = return_evalue( $wn_gps, 'max-alt' ); 568 | $node{'GPSMaxSpd'} = return_evalue( $wn_gps, 'max-spd' ); 569 | 570 | $node{'GPSBestLat'} = return_evalue( $wn_gps, 'peak-lat' ); 571 | $node{'GPSBestLon'} = return_evalue( $wn_gps, 'peak-lon' ); 572 | $node{'GPSBestAlt'} = return_evalue( $wn_gps, 'peak-alt' ); 573 | } 574 | elsif ( $options{ignoregps} ) { 575 | $node{'GPSMinLat'} = 0; 576 | $node{'GPSMinLon'} = 0; 577 | $node{'GPSMinAlt'} = 0; 578 | $node{'GPSMinSpd'} = 0; 579 | 580 | $node{'GPSMaxLat'} = 0; 581 | $node{'GPSMaxLon'} = 0; 582 | $node{'GPSMaxAlt'} = 0; 583 | $node{'GPSMaxSpd'} = 0; 584 | 585 | $node{'GPSBestLat'} = 0; 586 | $node{'GPSBestLon'} = 0; 587 | $node{'GPSBestAlt'} = 0; 588 | } 589 | else { 590 | print "Warning: no gps data found for BSSID: " . $node{'BSSID'} . " ESSID: " . $node{'ESSID'} . "\n"; 591 | next; 592 | } 593 | 594 | my $wn_pkts = ${ $wn->getElementsByTagName('packets') }[0]; 595 | if ( defined($wn_pkts) ) { 596 | 597 | $node{'LLC'} = return_evalue( $wn_pkts, 'LLC' ); 598 | $node{'Data'} = return_evalue( $wn_pkts, 'data' ); 599 | $node{'Crypt'} = return_evalue( $wn_pkts, 'crypt' ); 600 | $node{'Weak'} = 0; 601 | $node{'Total'} = return_evalue( $wn_pkts, 'total' ); 602 | } 603 | else { 604 | $node{'LLC'} = 0; 605 | $node{'Data'} = 0; 606 | $node{'Crypt'} = 0; 607 | $node{'Weak'} = 0; 608 | $node{'Total'} = 0; 609 | } 610 | 611 | my $wn_ipaddr = ${ $wn->getElementsByTagName('ip-address') }[0]; 612 | if ( defined($wn_ipaddr) ) { 613 | $node{'IPType'} = return_avalue( $wn_ipaddr, 'type' ); 614 | $node{'IP'} = return_evalue( $wn_ipaddr, 'ip-block' ); 615 | } 616 | else { 617 | $node{'IPType'} = 'undefined'; 618 | $node{'IP'} = 'undefined'; 619 | } 620 | 621 | $node{'BestSignal'} = 0; 622 | $node{'BestNoise'} = 0; 623 | $node{'BestQuality'} = 0; 624 | 625 | $node{Encoding} = 0; 626 | $node{Carrier} = $carrier; 627 | $node{DataSize} = $datasize; 628 | 629 | # ok see if the BSSID is known 630 | my $sql 631 | = qq/SELECT BSSID FROM wireless WHERE BSSID="$node{'BSSID'}"; /; 632 | 633 | if ( $node{'NetType'} ne "infrastructure" ) { 634 | next; 635 | } elsif ( ( !$options{ignoregps} ) and ( $node{'GPSBestLat'} == 0 or $node{'GPSBestLat'} == 0 ) ) 636 | { 637 | next; 638 | } 639 | if ( $options{silent} == 0 ) { 640 | print("Checking Database for BSSID: $node{'BSSID'} ... "); 641 | } 642 | 643 | my $sth = $dbh->prepare("$sql"); 644 | $sth->execute(); 645 | my $rows = 0; 646 | while ( my $row = $sth->fetchrow_arrayref ) { 647 | $rows = $rows + 1; 648 | } 649 | if ( $rows != 0 ) { 650 | if ( $options{silent} == 0 ) { 651 | print "\n"; 652 | } 653 | next; 654 | } 655 | 656 | my $insert = $dbh->prepare( 657 | 'INSERT INTO wireless VALUES 658 | (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)' 659 | ); 660 | if ( $options{debug} > 2 ) { 661 | foreach my $key ( sort keys %node ) { 662 | print "$key => " . $node{$key} . "\n"; 663 | } 664 | } 665 | my $wn_success = 1; 666 | $wn_success &&= $insert->execute( 667 | $id, $node{'NetworkID'}, 668 | $node{'NetType'}, $node{'ESSID'}, 669 | $node{'BSSID'}, $node{'Manuf'}, 670 | $node{'Info'}, $node{'Channel'}, 671 | $node{'Cloaked'}, $node{'Encryption'}, 672 | $node{'Decrypted'}, $node{'MaxRate'}, 673 | $node{'MaxSeenRate'}, $node{'Beacon'}, 674 | $node{'LLC'}, $node{'Data'}, 675 | $node{'Crypt'}, $node{'Weak'}, 676 | $node{'Total'}, $node{'Carrier'}, 677 | $node{'Encoding'}, $node{'FirstTime'}, 678 | $node{'LastTime'}, $node{'BestQuality'}, 679 | $node{'BestSignal'}, $node{'BestNoise'}, 680 | $node{'GPSMinLat'}, $node{'GPSMinLon'}, 681 | $node{'GPSMinAlt'}, $node{'GPSMinSpd'}, 682 | $node{'GPSMaxLat'}, $node{'GPSMaxLon'}, 683 | $node{'GPSMaxAlt'}, $node{'GPSMaxSpd'}, 684 | $node{'GPSBestLat'}, $node{'GPSBestLon'}, 685 | $node{'GPSBestAlt'}, $node{'DataSize'}, 686 | $node{'IPType'}, $node{'IP'} 687 | ) or die "Error inserting AP: $!\n"; 688 | 689 | $id++; 690 | if ( $options{silent} == 0 ) { 691 | print "AP added\n"; 692 | } 693 | 694 | foreach my $client ( $wn->getElementsByTagName('wireless-client') ) { 695 | 696 | $node{'FirstTime'} = return_avalue( $client, 'first-time' ); 697 | $node{'LastTime'} = return_avalue( $client, 'last-time' ); 698 | $node{'ClientMac'} = return_evalue( $client, 'client-mac' ); 699 | my $mac = return_evalue( $client, 'client-mac' ); 700 | my $manuf = return_evalue( $client, 'client-manuf' ); 701 | 702 | my $ipaddr = ${ $client->getElementsByTagName('ip-address') }[0]; 703 | if ( defined($ipaddr) ) { 704 | $node{'IPType'} = return_avalue( $ipaddr, 'type' ); 705 | $node{'IP'} = return_evalue( $ipaddr, 'ip-block' ); 706 | } 707 | else { 708 | $node{'IPType'} = 'undefined'; 709 | $node{'IP'} = 'undefined'; 710 | } 711 | my $pkts = ${ $client->getElementsByTagName('packets') }[0]; 712 | 713 | if ( defined($pkts) ) { 714 | 715 | $node{'LLC'} = return_evalue( $pkts, 'LLC' ); 716 | $node{'Data'} = return_evalue( $pkts, 'data' ); 717 | $node{'Crypt'} = return_evalue( $pkts, 'crypt' ); 718 | $node{'Weak'} = 0; 719 | $node{'Total'} = return_evalue( $pkts, 'total' ); 720 | } 721 | else { 722 | $node{'LLC'} = 0; 723 | $node{'Data'} = 0; 724 | $node{'Crypt'} = 0; 725 | $node{'Weak'} = 0; 726 | $node{'Total'} = 0; 727 | } 728 | 729 | my $gps = ${ $client->getElementsByTagName('gps-info') }[0]; 730 | if ( defined($gps) ) { 731 | $node{'GPSMinLat'} = return_evalue( $gps, 'min-lat' ); 732 | $node{'GPSMinLon'} = return_evalue( $gps, 'min-lon' ); 733 | $node{'GPSMinAlt'} = return_evalue( $gps, 'min-alt' ); 734 | $node{'GPSMinSpd'} = return_evalue( $gps, 'min-spd' ); 735 | 736 | $node{'GPSMaxLat'} = return_evalue( $gps, 'max-lat' ); 737 | $node{'GPSMaxLon'} = return_evalue( $gps, 'max-lon' ); 738 | $node{'GPSMaxAlt'} = return_evalue( $gps, 'max-alt' ); 739 | $node{'GPSMaxSpd'} = return_evalue( $gps, 'max-spd' ); 740 | 741 | $node{'GPSBestLat'} = return_evalue( $gps, 'peak-lat' ); 742 | $node{'GPSBestLon'} = return_evalue( $gps, 'peak-lon' ); 743 | $node{'GPSBestAlt'} = return_evalue( $gps, 'peak-alt' ); 744 | } 745 | elsif ( $options{ignoregps} ) { 746 | $node{'GPSMinLat'} = 0; 747 | $node{'GPSMinLon'} = 0; 748 | $node{'GPSMinAlt'} = 0; 749 | $node{'GPSMinSpd'} = 0; 750 | 751 | $node{'GPSMaxLat'} = 0; 752 | $node{'GPSMaxLon'} = 0; 753 | $node{'GPSMaxAlt'} = 0; 754 | $node{'GPSMaxSpd'} = 0; 755 | 756 | $node{'GPSBestLat'} = 0; 757 | $node{'GPSBestLon'} = 0; 758 | $node{'GPSBestAlt'} = 0; 759 | } 760 | else { 761 | next; 762 | } 763 | 764 | my $insert = $dbh->prepare( 765 | 'INSERT INTO clients VALUES 766 | (?,?,?,?,?,?)' 767 | ); 768 | my $success = 1; 769 | $success 770 | &&= $insert->execute( $cid, $node{'NetworkID'}, $mac, $manuf, 771 | $node{'IPType'}, $node{'IP'} ) 772 | or die "Error inserting client $!\n"; 773 | 774 | $cid++; 775 | } 776 | } 777 | } 778 | elsif ( $options{csv} ) { 779 | my $filename = $options{csv}; 780 | open( TMP, "<$filename" ) or die "Unable to open $filename\n"; 781 | 782 | my $counter = 0; 783 | my $id = 1; 784 | while () { 785 | if ( $counter == 0 ) { 786 | $counter = $counter + 1; 787 | next; 788 | } 789 | my @WD = split( ';', $_ ); 790 | my @mykeys = ( 791 | "NetworkID", "NetType", "ESSID", "BSSID", 792 | "Info", "Channel", "Cloaked", "Encryption", 793 | "Decrypted", "MaxRate", "MaxSeenRate", "Beacon", 794 | "LLC", "Data", "Crypt", "Weak", 795 | "Total", "Carrier", "Encoding", "FirstTime", 796 | "LastTime", "BestQuality", "BestSignal", "BestNoise", 797 | "GPSMinLat", "GPSMinLon", "GPSMinAlt", "GPSMinSpd", 798 | "GPSMaxLat", "GPSMaxLon", "GPSMaxAlt", "GPSMaxSpd", 799 | "GPSBestLat", "GPSBestLon", "GPSBestAlt", "DataSize", 800 | "IPType", "IP" 801 | ); 802 | my %node = (); 803 | my $index = 0; 804 | foreach my $thekey (@mykeys) { 805 | $node{$thekey} = $WD[$index]; 806 | $index++; 807 | } 808 | $node{'ESSID'} =~ s/\/_/g; 810 | $node{'ESSID'} =~ s/\"/_/g; 811 | 812 | # ok see if the BSSID is known 813 | my $sql 814 | = qq/SELECT BSSID FROM wireless WHERE BSSID="$node{'BSSID'}"; /; 815 | if ( $node{'NetType'} ne "infrastructure" ) 816 | { 817 | next; 818 | } elsif ( ( !$options{ignoregps} ) and ( $node{'GPSBestLat'} == 0 or $node{'GPSBestLat'} == 0 ) ) 819 | { 820 | next; 821 | } 822 | if ( $options{silent} == 0 ) { 823 | print("Checking Database for BSSID: $node{'BSSID'} ... "); 824 | } 825 | 826 | my $sth = $dbh->prepare("$sql"); 827 | $sth->execute(); 828 | my $rows = 0; 829 | while ( my $row = $sth->fetchrow_arrayref ) { 830 | $rows = $rows + 1; 831 | } 832 | if ( $rows == 0 ) { 833 | if ( $options{silent} == 0 ) { 834 | print "AP added\n"; 835 | } 836 | my $insert = $dbh->prepare( 837 | 'INSERT INTO wireless VALUES 838 | (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)' 839 | ); 840 | 841 | if ( $options{debug} > 2 ) { 842 | foreach my $key ( sort keys %node ) { 843 | print "$key => " . $node{$key} . "\n"; 844 | } 845 | } 846 | 847 | my $success = 1; 848 | $success &&= $insert->execute( 849 | $id, $node{'NetworkID'}, 850 | $node{'NetType'}, $node{'ESSID'}, 851 | $node{'BSSID'}, $node{'Manuf'}, 852 | $node{'Info'}, $node{'Channel'}, 853 | $node{'Cloaked'}, $node{'Encryption'}, 854 | $node{'Decrypted'}, $node{'MaxRate'}, 855 | $node{'MaxSeenRate'}, $node{'Beacon'}, 856 | $node{'LLC'}, $node{'Data'}, 857 | $node{'Crypt'}, $node{'Weak'}, 858 | $node{'Total'}, $node{'Carrier'}, 859 | $node{'Encoding'}, $node{'FirstTime'}, 860 | $node{'LastTime'}, $node{'BestQuality'}, 861 | $node{'BestSignal'}, $node{'BestNoise'}, 862 | $node{'GPSMinLat'}, $node{'GPSMinLon'}, 863 | $node{'GPSMinAlt'}, $node{'GPSMinSpd'}, 864 | $node{'GPSMaxLat'}, $node{'GPSMaxLon'}, 865 | $node{'GPSMaxAlt'}, $node{'GPSMaxSpd'}, 866 | $node{'GPSBestLat'}, $node{'GPSBestLon'}, 867 | $node{'GPSBestAlt'}, $node{'DataSize'}, 868 | $node{'IPType'}, $node{'IP'} 869 | ); 870 | $id++; 871 | } 872 | elsif ( $rows == 1 ) { 873 | if ( $options{silent} == 0 ) { 874 | print(" Already listed\n"); 875 | } 876 | } 877 | elsif ( $rows > 1 ) { 878 | if ( $options{silent} == 0 ) { 879 | print("Multiple entries detected\n"); 880 | } 881 | } 882 | else { 883 | if ( $options{silent} == 0 ) { 884 | print "\n"; 885 | } 886 | } 887 | $counter = $counter + 1; 888 | } 889 | } 890 | else { 891 | 892 | } 893 | 894 | if ( $options{query} ) { 895 | if ( $options{name} ) { 896 | $name = $options{name}; 897 | } 898 | else { 899 | $name = $input; 900 | } 901 | if ( $options{desc} ) { 902 | $description = $options{desc}; 903 | } 904 | else { 905 | $description = $options{query}; 906 | } 907 | my $kml = "\n"; 908 | $kml .= "\n"; 909 | $kml .= "\n"; 910 | $kml .= " $name\n"; 911 | 912 | if ( defined($description) ) { 913 | $kml .= " $description\n"; 914 | } 915 | 916 | my @data; 917 | my %node; 918 | my @mykeys = ( 919 | "Id", "NetworkID", "NetType", "ESSID", 920 | "BSSID", "Manuf", "Info", "Channel", 921 | "Cloaked", "Encryption", "Decrypted", "MaxRate", 922 | "MaxSeenRate", "Beacon", "LLC", "Data", 923 | "Crypt", "Weak", "Total", "Carrier", 924 | "Encoding", "FirstTime", "LastTime", "BestQuality", 925 | "BestSignal", "BestNoise", "GPSMinLat", "GPSMinLon", 926 | "GPSMinAlt", "GPSMinSpd", "GPSMaxLat", "GPSMaxLon", 927 | "GPSMaxAlt", "GPSMaxSpd", "GPSBestLat", "GPSBestLon", 928 | "GPSBestAlt", "DataSize", "IPType", "IP" 929 | ); 930 | 931 | if ( $options{query} ) { 932 | my @data = @{ runSql( $options{query} ) }; 933 | foreach my $i (@data) { 934 | my $num = 0; 935 | my $counter = 0; 936 | my $color; 937 | foreach my $mykey (@mykeys) { 938 | $node{$mykey} = $$i[$num]; 939 | $num++; 940 | } 941 | if ( $node{'NetType'} ne "infrastructure" ) { 942 | next; 943 | } 944 | if ( $node{'GPSBestLat'} == 0 or $node{'GPSBestLat'} == 0 ) { 945 | next; 946 | } 947 | $node{'ESSID'} =~ s/\/_/g; 949 | $node{'ESSID'} =~ s/\&/_/g; 950 | $node{'ESSID'} =~ s/\"/_/g; 951 | 952 | if ( !defined( $node{Encryption} ) ) { 953 | $node{Encryption} = 'None'; 954 | } 955 | 956 | if ( $node{Encryption} =~ /AES\-CCM/i ) { 957 | $color = $GREEN; 958 | } 959 | elsif ( $node{Encryption} =~ /TKIP/i ) { 960 | $color = $YELLOW; 961 | } 962 | elsif ( $node{Encryption} =~ /WEP/i ) { 963 | $color = $ORANGE; 964 | } 965 | else { 966 | $color = $RED; 967 | } 968 | 969 | # ok see if the BSSID is known 970 | my $sql 971 | = qq/SELECT * FROM clients WHERE nid="$node{'NetworkID'}"; /; 972 | my $sth = $dbh->prepare("$sql"); 973 | $sth->execute(); 974 | my $clients = ''; 975 | my $client_list = $sth->fetchall_hashref('cid'); 976 | foreach my $i ( sort keys %{$client_list} ) { 977 | if ( $client_list->{$i}->{mac} ne $node{BSSID} ) { 978 | $clients .= "MAC Address:\t" 979 | . $client_list->{$i}->{mac} . "
"; 980 | $clients .= "Manufacturer:\t" 981 | . $client_list->{$i}->{manuf} . '
'; 982 | $clients .= '
'; 983 | } 984 | } 985 | $clients .= '
'; 986 | my ( $net_lon, $net_lat, $net_coords, $net_alt, $net_range, 987 | $net_head, $net_tilt, $net_scale_range ) 988 | = split( 989 | /\|/, 990 | &calc_pos( 991 | $node{GPSMinLon}, $node{GPSMaxLat}, $node{GPSMaxLon}, 992 | $node{GPSMaxLat}, $node{BSSID} 993 | ) 994 | ); 995 | $net_lon = $node{GPSBestLon}; 996 | $net_lat = $node{GPSBestLat}; 997 | 998 | my $essid = $node{'ESSID'}; 999 | $kml .= " 1008 | 1017 | 1018 | 1019 | normal 1020 | #${essid}_normal 1021 | 1022 | 1023 | highlight 1024 | #${essid}_highlight 1025 | 1026 | 1027 | "; 1028 | 1029 | $kml .= "\n"; 1030 | $kml .= " $node{'ESSID'}\n"; 1031 | $kml .= "#${essid}_styleMap"; 1032 | $kml .= " '; 1034 | $kml .= 'Encryption: ' . $node{'Encryption'} . '
'; 1035 | $kml .= 'Channel: ' . $node{'Channel'} . '

'; 1036 | $kml .= 'Current Clients: ' . "
"; 1037 | $kml .= $clients . '
'; 1038 | $kml .= "]]>
\n"; 1039 | $kml .= " \n"; 1040 | $kml .= ''; 1041 | $kml .= "$net_lon"; 1042 | $kml .= "$net_lat"; 1043 | $kml .= "1"; 1044 | $kml .= "$net_scale_range"; 1045 | $kml .= "1"; 1046 | $kml .= "1"; 1047 | $kml .= ""; 1048 | $kml 1049 | .= " $node{'GPSBestLon'},$node{'GPSBestLat'},0\n"; 1050 | $kml .= " \n"; 1051 | $kml .= "
\n"; 1052 | $counter = $counter + 1; 1053 | } 1054 | } 1055 | else { 1056 | 1057 | #my $manual = $options{manual}; 1058 | #open(IN,">$manual") or die "can't open manual query file\n"; 1059 | #my @input = ; 1060 | my $counter = 0; 1061 | my @input; 1062 | foreach (@input) { 1063 | my @data = split( ';', $_ ); 1064 | my %node = (); 1065 | my $index = 0; 1066 | 1067 | foreach my $thekey (@mykeys) { 1068 | $node{$thekey} = $mykeys[$index]; 1069 | $index++; 1070 | } 1071 | 1072 | if ( $node{'NetType'} ne "infrastructure" ) { 1073 | next; 1074 | } 1075 | if ( $node{'GPSBestLat'} == 0 or $node{'GPSBestLat'} == 0 ) { 1076 | next; 1077 | } 1078 | 1079 | $kml .= "\n \n"; 1080 | $node{'ESSID'} =~ s/\/_/g; 1082 | $kml .= " $node{'ESSID'}\n"; 1083 | $kml .= " "; 1084 | $kml .= 'channel: ' . $node{'Channel'} . '
'; 1085 | $kml 1086 | .= 'encryption: ' 1087 | . $node{'Encryption'} 1088 | . '
'; 1089 | $kml .= "]]>
\n"; 1090 | $kml .= " \n"; 1091 | $kml 1092 | .= " $node{'GPSBestLon'},$node{'GPSBestLat'},0\n"; 1093 | $kml .= " \n"; 1094 | $kml .= "
\n"; 1095 | $counter = $counter + 1; 1096 | } 1097 | } 1098 | $kml .= "\n
\n"; 1099 | $kml .= "
\n"; 1100 | 1101 | if ( $options{output} ) { 1102 | 1103 | output( $options{output}, $kml ); 1104 | } 1105 | else { 1106 | print $kml; 1107 | } 1108 | } 1109 | 1110 | sub print_avalue { 1111 | my ( $node, $key ) = @_; 1112 | print "$key: " . $node->getAttribute("$key") . "\n"; 1113 | } 1114 | 1115 | sub return_avalue { 1116 | my ( $node, $key ) = @_; 1117 | return $node->getAttribute("$key"); 1118 | } 1119 | 1120 | sub print_evalue { 1121 | my ( $node, $key ) = @_; 1122 | print "$key : "; 1123 | if ( scalar( @{ $node->getElementsByTagName("$key") } ) > 0 ) { 1124 | print ${ $node->getElementsByTagName("$key") }[0]->textContent . "\n"; 1125 | } 1126 | else { 1127 | print "undefined\n"; 1128 | } 1129 | } 1130 | 1131 | sub return_evalue { 1132 | my ( $node, $key ) = @_; 1133 | 1134 | if ( scalar( @{ $node->getElementsByTagName("$key") } ) > 0 ) { 1135 | return ${ $node->getElementsByTagName("$key") }[0]->textContent; 1136 | } 1137 | else { 1138 | return "undefined"; 1139 | } 1140 | } 1141 | 1142 | sub return_evalue_all { 1143 | my ( $node, $key ) = @_; 1144 | my $value = ''; 1145 | if ( scalar( @{ $node->getElementsByTagName("$key") } ) > 0 ) { 1146 | foreach my $line ( @{ $node->getElementsByTagName("$key") } ) { 1147 | $value .= " " . $line->textContent; 1148 | } 1149 | } 1150 | $value =~ s/^\s//; 1151 | return $value; 1152 | } 1153 | 1154 | sub print_packets { 1155 | my ($node) = @_; 1156 | 1157 | print "Printing Packets\n"; 1158 | foreach my $pkts ( $node->getElementsByTagName('packets') ) { 1159 | print_evalue( $pkts, 'LLC' ); 1160 | print_evalue( $pkts, 'data' ); 1161 | 1162 | print_evalue( $pkts, 'crypt' ); 1163 | print_evalue( $pkts, 'total' ); 1164 | print_evalue( $pkts, 'framents' ); 1165 | print_evalue( $pkts, 'retries' ); 1166 | } 1167 | } 1168 | 1169 | sub print_snr_info { 1170 | my ($node) = @_; 1171 | 1172 | print "Printing snr-info\n"; 1173 | foreach my $snr ( $node->getElementsByTagName('snr-info') ) { 1174 | print_evalue( $snr, 'last_signal_dbm' ); 1175 | print_evalue( $snr, 'last_noise_dbm' ); 1176 | print_evalue( $snr, 'last_signal_rssi' ); 1177 | print_evalue( $snr, 'last_noise_rssi' ); 1178 | 1179 | print_evalue( $snr, 'min_signal_dbm' ); 1180 | print_evalue( $snr, 'min_noise_dbm' ); 1181 | print_evalue( $snr, 'min_signal_rssi' ); 1182 | print_evalue( $snr, 'min_noise_rssi' ); 1183 | 1184 | print_evalue( $snr, 'max_signal_dbm' ); 1185 | print_evalue( $snr, 'max_noise_dbm' ); 1186 | print_evalue( $snr, 'max_signal_rssi' ); 1187 | print_evalue( $snr, 'max_noise_rssi' ); 1188 | } 1189 | } 1190 | 1191 | sub print_gps_info { 1192 | my ($node) = @_; 1193 | 1194 | print "Printing gps-info\n"; 1195 | foreach my $gps ( $node->getElementsByTagName('gps-info') ) { 1196 | print_evalue( $gps, 'min-lat' ); 1197 | print_evalue( $gps, 'min-lon' ); 1198 | print_evalue( $gps, 'min-alt' ); 1199 | print_evalue( $gps, 'min-spd' ); 1200 | 1201 | print_evalue( $gps, 'max-lat' ); 1202 | print_evalue( $gps, 'max-mon' ); 1203 | print_evalue( $gps, 'max-alt' ); 1204 | print_evalue( $gps, 'max-spd' ); 1205 | 1206 | print_evalue( $gps, 'peak-lat' ); 1207 | print_evalue( $gps, 'peak-lon' ); 1208 | print_evalue( $gps, 'peak-alt' ); 1209 | 1210 | print_evalue( $gps, 'avg-lat' ); 1211 | print_evalue( $gps, 'avg-lon' ); 1212 | print_evalue( $gps, 'avg-alt' ); 1213 | 1214 | print_evalue( $gps, 'agg-points' ); 1215 | } 1216 | } 1217 | -------------------------------------------------------------------------------- /giskismet: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # Copyright (C) 2009-2010 Joshua D. Abraham < jabra@spl0it.org > 4 | # 5 | # This program is released under the terms of the GNU General Public License 6 | # (GPL), which is distributed with this software in the file "COPYING". 7 | # The GPL specifies the terms under which users may copy and use this software. 8 | # 9 | # GISKismet 0.02 10 | # 11 | use strict; 12 | use warnings; 13 | use XML::LibXML; 14 | use Getopt::Long; 15 | use Data::Dumper; 16 | use POSIX; 17 | use DBI; 18 | use vars qw( $PROG ); 19 | 20 | ( $PROG = $0 ) =~ s/^.*[\/\\]//; # Truncate calling path from the prog name 21 | my $AUTH = 'Joshua "Jabra" Abraham'; # author 22 | my $EMAIL = 'jabra@spl0it.org'; # email 23 | my $VERSION = '0.02'; # version 24 | 25 | my %options; # getopts hash 26 | my $host = '127.0.0.1'; 27 | my $user = ''; 28 | my $password = ''; 29 | my $dbase = 'wireless.dbl'; 30 | my $format; 31 | my $file; 32 | my $id; # initialized later 33 | my $cid; # initialized later 34 | my $input = 'Kismet'; 35 | my $name = 'name'; 36 | my $description = 'description'; 37 | my ( $ap, $client ); 38 | 39 | ## Import filters 40 | my $filters = 'none'; 41 | my @bssid_filters; 42 | my @essid_filters; 43 | my @channel_filters; 44 | my @encryption_filters; 45 | 46 | $options{debug} = 0; 47 | $options{silent} = 0; 48 | $options{ignoregps} = 0; 49 | 50 | my $OPACITY = 127; # transparency 51 | my $ALPHA = sprintf( "%x", $OPACITY ); 52 | 53 | my $RED = '0000FF'; 54 | my $ORANGE = '0090FF'; 55 | my $YELLOW = '00FFFF'; 56 | my $GREEN = '00FF00'; 57 | my $GREY = '7E7E7E'; 58 | 59 | my $CALCRANGE = 0; # calculate network range 60 | my $DRAWCENTER = 1; # draw center of network 61 | my $CENTERSIZE = 1; # size for network center 62 | 63 | my $dbh; # DBI connector 64 | 65 | my $parser = XML::LibXML->new(); 66 | $parser->validation(0); 67 | $parser->load_ext_dtd(0); 68 | my ( $doc, $xpc ); 69 | 70 | sub output { 71 | my ( $filename, $output ) = @_; 72 | if ( -e $filename ) { # file exists 73 | print "File already exists, do you want to overwrite it? [Y|N] "; 74 | chomp( my $overwrite = ); 75 | if ( $overwrite eq 'y' || $overwrite eq 'Y' ) { 76 | open FILE, '>', $filename 77 | or die "Having trouble opening $filename anyway\n"; 78 | print FILE $output; 79 | } 80 | else { 81 | die "Okay, giving up\n"; 82 | } 83 | } 84 | else { 85 | open FILE, '>', $filename 86 | or die "Having trouble opening $filename\n"; 87 | print FILE $output; 88 | } 89 | 90 | close(FILE); 91 | } 92 | 93 | ############################################################################## 94 | # 95 | # runSql: sql str -> array ref 96 | # execute sql and return arrayref to the result 97 | # 98 | # ############################################################################ 99 | sub runSql { 100 | my ($sql) = @_; 101 | 102 | my $sth = $dbh->selectall_arrayref($sql); 103 | return $sth; 104 | } 105 | 106 | ############################################################################## 107 | # 108 | # create_wireless_table: -> int 109 | # create the table to store the wireless kismet information 110 | # 111 | # ############################################################################ 112 | sub create_wireless_table { 113 | eval { 114 | $dbh->do( 115 | "CREATE TABLE wireless ( 116 | Id INTEGER PRIMARY KEY AUTOINCREMENT, 117 | NetworkID INTEGER NULL, 118 | NetType text default NULL, 119 | ESSID text default NULL, 120 | BSSID text default NULL, 121 | Manuf text default NULL, 122 | Info text default NULL, 123 | Channel INTEGER NULL, 124 | Cloaked text default NULL, 125 | Encryption text default NULL, 126 | Decrypted text default NULL, 127 | MaxRate INTEGER NULL, 128 | MaxSeenRate INTEGER NULL, 129 | Beacon INTEGER NULL, 130 | LLC INTEGER NULL, 131 | Data INTEGER NULL, 132 | Crypt INTEGER NULL, 133 | Weak INTEGER NULL, 134 | Total INTEGER NULL, 135 | Carrier text default NULL, 136 | Encoding text default NULL, 137 | FirstTime text default NULL, 138 | LastTime text default NULL, 139 | BestQuality INTEGER NULL, 140 | BestSignal INTEGER NULL, 141 | BestNoise INTEGER NULL, 142 | GPSMinLat float NULL, 143 | GPSMinLon float NULL, 144 | GPSMinAlt float NULL, 145 | GPSMinSpd float NULL, 146 | GPSMaxLat float NULL, 147 | GPSMaxLon float NULL, 148 | GPSMaxAlt float NULL, 149 | GPSMaxSpd float NULL, 150 | GPSBestLat float NULL, 151 | GPSBestLon float NULL, 152 | GPSBestAlt float NULL, 153 | DataSize INTEGER NULL, 154 | IPType text default NULL, 155 | IP text default NULL)" 156 | ); 157 | }; 158 | if ($@) { 159 | return 0; 160 | } 161 | else { 162 | return 1; 163 | } 164 | 165 | } 166 | 167 | ############################################################################## 168 | # 169 | # create_clients_table: -> int 170 | # create the table to store the wireless kismet information 171 | # 172 | # ############################################################################ 173 | sub create_clients_table { 174 | eval { 175 | $dbh->do( 176 | "CREATE TABLE clients ( 177 | cid INTEGER PRIMARY KEY AUTOINCREMENT, 178 | nid INTEGER NULL, 179 | mac text default NULL, 180 | manuf text default NULL, 181 | iptype text default NULL, 182 | ip text default NULL)" 183 | ); 184 | }; 185 | if ($@) { 186 | return 0; 187 | } 188 | else { 189 | return 1; 190 | } 191 | 192 | } 193 | 194 | ######## 195 | ## NOTE: this aspect was taken from kisgearth 196 | ######## 197 | # This is based on the signal strength which isn't used for 198 | # computation. Only using the ranges to make sure all APs fit on the 199 | # screen when the map is loaded. 200 | # 201 | # 202 | # This will be rewritten later. 203 | # 204 | # calculate network position (and range - rudimentary) 205 | sub calc_pos { 206 | 207 | my ( $minlon_in, $minlat_in, $maxlon_in, $maxlat_in, $bssid ) = @_; 208 | my $altitude_out = 0; 209 | my $range_out = 7; 210 | my $heading_out = 0; 211 | my $tilt_out = 0; 212 | my $coords_out = "0.0,0.0"; 213 | my $lon_out = 0.0; 214 | my $lat_out = 0.0; 215 | my $scale_out = 0.0; 216 | my $dummy = 0; 217 | my $tmp_netgps_cnt = 0; 218 | 219 | my @data = @{ runSql("select * from wireless where BSSID='$bssid'") }; 220 | if ( scalar(@data) == 1 ) { 221 | 222 | } 223 | else { 224 | $dummy = ( $maxlon_in - $minlon_in ) / 2; 225 | $lon_out = $minlon_in + $dummy; 226 | 227 | $dummy = ( $maxlat_in - $minlat_in ) / 2; 228 | $lat_out = $minlat_in + $dummy; 229 | } 230 | 231 | $coords_out = "$lon_out,$lat_out,0"; 232 | 233 | if ( $CALCRANGE == 1 ) { 234 | $scale_out 235 | = ( ( ( $maxlat_in - $minlat_in ) + ( $maxlon_in - $minlon_in ) ) 236 | / 2 ) * 1850; 237 | 238 | if ( $scale_out < 0.8 ) { 239 | $scale_out = 0.8; 240 | } 241 | elsif ( $scale_out > 4.0 ) { 242 | $scale_out = 4.0; 243 | } 244 | } 245 | else { 246 | $scale_out = $CENTERSIZE; 247 | } 248 | 249 | return 250 | "$lon_out|$lat_out|$coords_out|$altitude_out|$range_out|$heading_out|$tilt_out|$scale_out"; 251 | 252 | } # sub calc_pos 253 | 254 | ############################################################################## 255 | # 256 | # help -> 257 | # display help information 258 | # side effect: exits program 259 | # 260 | ############################################################################## 261 | sub help { 262 | print "Usage: $PROG [Options] 263 | 264 | Input File: 265 | --csv Parse the input from Kismet-devel CSV 266 | -x --xml Parse the input from Kismet-newcore NETXML 267 | 268 | Input Filters: 269 | --bssid file | list Filter based on BSSID 270 | --essid file | list Filter based on ESSID 271 | --encryption file | list Filter based on Encryption 272 | --channel file | list Filter based on Channel 273 | 274 | file | list (list = comma separated lists(needs quotes) 275 | 276 | Kismet-newcore Options: 277 | -a --ap Insert only the APs 278 | 279 | Query 280 | -q --query [sql] SQL query 281 | -m --manual [csv] CSV output of manual SQL query 282 | 283 | -o --output [file] Output filename 284 | -n --name [str] Name of the KML layer 285 | --desc [str] Description of the KML layer 286 | 287 | General Options: 288 | --ignore-gps Import data even when GPS fields are missing 289 | --database [file] SQLite3 database name [default: wireless.dbl] 290 | -d --debug [num] Display debug information 291 | -s --silent No output when adding APs 292 | -v --version Display version 293 | -h --help Display this information 294 | 295 | Send Comments to $AUTH ( $EMAIL )\n"; 296 | exit; 297 | } 298 | 299 | ############################################################################## 300 | # 301 | # print_version -> 302 | # displays version 303 | # side effect: exits program 304 | # 305 | ############################################################################## 306 | sub print_version { 307 | print "$PROG version $VERSION by $AUTH\n"; 308 | exit; 309 | } 310 | 311 | ############################################################################## 312 | if ( @ARGV == 0 ) { 313 | help; 314 | exit; 315 | } 316 | GetOptions( 317 | \%options, 318 | 'xml|x=s', 'csv=s', 'query|q=s', 'manual|m=s', 'database=s', 'output|o=s', 319 | 'ap|a=s', 320 | 'bssid=s', 'essid=s', 'channel=s', 'encryption=s', 321 | 'name|n=s', 'desc=s', 322 | 'help|h' => sub { help(); }, 323 | 'version|v' => sub { print_version(); }, 324 | 'debug|d=s' => sub { $options{debug} = 2 }, 325 | 'silent|s' => sub { $options{silent} = 1 }, 326 | 'ignore-gps' => sub { $options{ignoregps} = 1 }, 327 | ) or exit 1; 328 | 329 | if ( $options{xml} ) { 330 | $format = 'xml'; 331 | $file = $options{xml}; 332 | } 333 | elsif ( $options{csv} ) { 334 | $format = 'csv'; 335 | $file = $options{csv}; 336 | } 337 | else { 338 | 339 | } 340 | 341 | if ( !$options{xml} 342 | and !$options{csv} 343 | and !$options{query} 344 | and !$options{manual} ) 345 | { 346 | help; 347 | } 348 | 349 | if ( $options{database} ) { 350 | $dbase = $options{database}; 351 | } 352 | 353 | $dbh = DBI->connect( 354 | "dbi:SQLite:$dbase", 355 | "$user", 356 | $password, 357 | { PrintError => 0, 358 | RaiseError => 0, 359 | AutoCommit => 1 360 | } 361 | ) || die "Cannot connect: $DBI::errstr"; 362 | 363 | if ( $options{bssid} ) { 364 | if ( -r $options{bssid} ) { 365 | open( IN, $options{bssid} ) or die "can't open bssid file\n"; 366 | @bssid_filters = ; 367 | close(IN); 368 | } 369 | else { 370 | $options{bssid} =~ s/\s+/,/g; 371 | push( @bssid_filters, $options{bssid} ); 372 | @bssid_filters = split( /,/, $options{bssid} ); 373 | } 374 | chomp(@bssid_filters); 375 | $filters .= 'bssid'; 376 | } 377 | 378 | if ( $options{essid} ) { 379 | if ( -r $options{essid} ) { 380 | open( IN, $options{essid} ) or die "can't open essid file\n"; 381 | @essid_filters = ; 382 | close(IN); 383 | } 384 | else { 385 | $options{essid} =~ s/\s+/,/g; 386 | @essid_filters = split( /,/, $options{essid} ); 387 | } 388 | chomp(@essid_filters); 389 | $filters .= 'essid'; 390 | } 391 | 392 | if ( $options{encryption} ) { 393 | if ( -r $options{encryption} ) { 394 | 395 | # TODO add encryption verification 396 | open( IN, $options{encryption} ) or die "can't open encryption 397 | file\n"; 398 | @encryption_filters = ; 399 | close(IN); 400 | } 401 | else { 402 | $options{encryption} =~ s/\s+/,/g; 403 | @encryption_filters = split( /,/, $options{encryption} ); 404 | } 405 | chomp(@encryption_filters); 406 | $filters .= 'encryption'; 407 | } 408 | 409 | if ( $options{channel} ) { 410 | if ( -r $options{channel} ) { 411 | 412 | # TODO add channel verification 413 | open( IN, $options{channel} ) or die "can't open channel file\n"; 414 | @channel_filters = ; 415 | close(IN); 416 | } 417 | else { 418 | $options{channel} =~ s/\s+/,/g; 419 | @channel_filters = split( /,/, $options{channel} ); 420 | } 421 | chomp(@channel_filters); 422 | $filters .= 'channel'; 423 | } 424 | 425 | my $wcreate = create_wireless_table(); 426 | my $ccreate = create_clients_table(); 427 | 428 | my $sth = $dbh->selectrow_hashref("select max(id) from wireless"); 429 | $id = $sth->{'max(id)'}; 430 | if ( !defined($id) ) { 431 | $id = 1; 432 | } 433 | else { 434 | $id++; 435 | } 436 | 437 | my $sth_cid = $dbh->selectrow_hashref("select max(cid) from clients"); 438 | $cid = $sth_cid->{'max(cid)'}; 439 | if ( !defined($cid) ) { 440 | $cid = 1; 441 | } 442 | else { 443 | $cid++; 444 | } 445 | 446 | #print "id is $id\n"; 447 | if ( $options{xml} ) { 448 | ####################### 449 | # Parse the XML file 450 | ####################### 451 | $doc = $parser->parse_file($file); 452 | $xpc = XML::LibXML::XPathContext->new($doc); 453 | 454 | foreach my $wn ( $xpc->findnodes("//detection-run/wireless-network") ) { 455 | my $network_id = return_avalue( $wn, 'number' ); 456 | my $type = return_avalue( $wn, 'type' ); 457 | next if ( $type ne 'infrastructure' ); 458 | 459 | my $bssid = return_evalue( $wn, 'BSSID' ); 460 | my $manuf = return_evalue( $wn, 'manuf' ); 461 | my $first_time = return_avalue( $wn, 'first-time' ); 462 | my $last_time = return_avalue( $wn, 'first-time' ); 463 | 464 | my $ssid = ${ $wn->getElementsByTagName('SSID') }[0]; 465 | my ($ssid_first_time, $ssid_last_time, $ssid_type, 466 | $ssid_max_rate, $ssid_packets, $ssid_beaconrate, 467 | $ssid_essid, $ssid_cloaked 468 | ) = 'undefined'; 469 | my $ssid_encryption = ''; 470 | if ( defined($ssid) ) { 471 | $ssid_first_time = return_avalue( $ssid, 'first-time' ); 472 | $ssid_last_time = return_avalue( $ssid, 'last-time' ); 473 | $ssid_type = return_evalue( $ssid, 'type' ); 474 | $ssid_max_rate = return_evalue( $ssid, 'max-rate' ); 475 | $ssid_packets = return_evalue( $ssid, 'packets' ); 476 | $ssid_beaconrate = return_evalue( $ssid, 'beaconrate' ); 477 | 478 | $ssid_essid = return_evalue( $ssid, 'essid' ); 479 | my $essid = ${ $wn->getElementsByTagName('essid') }[0]; 480 | if ( defined($essid) ) { 481 | $ssid_cloaked = return_avalue( $essid, 'cloaked' ); 482 | if ( $ssid_cloaked eq 'true' ){ 483 | my $second_ssid = ${ $wn->getElementsByTagName('SSID') }[1]; 484 | if (defined($second_ssid) ) { 485 | $ssid_essid = return_evalue( $second_ssid, 'essid' ); 486 | } 487 | } 488 | 489 | } 490 | foreach my $s ( @{ $wn->getElementsByTagName('SSID') } ) { 491 | if ( !defined($ssid_encryption) 492 | or $ssid_encryption ne 493 | return_evalue_all( $s, 'encryption' ) ) 494 | { 495 | $ssid_encryption = return_evalue_all( $s, 'encryption' ); 496 | } 497 | } 498 | } 499 | else { 500 | next; 501 | } 502 | my $channel = return_evalue( $wn, 'channel' ); 503 | 504 | my $maxseenrate = return_evalue( $wn, 'maxseenrate' ); 505 | my $carrier = return_evalue( $wn, 'carrier' ); 506 | 507 | if ( $filters =~ /bssid/i ) { 508 | next if ( scalar( grep( $_ eq $bssid, @bssid_filters ) ) == 0 ); 509 | } 510 | 511 | if ( $filters =~ /channel/i ) { 512 | next 513 | if ( 514 | scalar( grep( $_ eq $channel, @channel_filters ) ) == 0 ); 515 | } 516 | if ( $filters =~ /essid/i ) { 517 | next 518 | if ( 519 | scalar( grep( $_ eq $ssid_essid, @essid_filters ) ) == 0 ); 520 | } 521 | 522 | if ( $filters =~ /encryption/i ) { 523 | next 524 | if ( 525 | scalar( grep( $_ eq $ssid_encryption, @encryption_filters ) ) 526 | == 0 ); 527 | } 528 | 529 | my $datasize = return_evalue( $wn, 'datasize' ); 530 | 531 | #print "Print Clients\n"; 532 | my %node; 533 | $node{'ClientID'} = 0; 534 | $node{'ClientMac'} = 'undefined'; 535 | $node{'NetworkID'} = $network_id; 536 | $node{'NetType'} = $type; 537 | $node{'ESSID'} = $ssid_essid; 538 | $node{'ESSID'} =~ s/\/_/g; 540 | $node{'BSSID'} = $bssid; 541 | $node{'Manuf'} = $manuf; 542 | $node{'Info'} = 'info'; 543 | $node{'Channel'} = $channel; 544 | $node{'Cloaked'} = $ssid_cloaked; 545 | $ssid_encryption = 'None' if ( $ssid_encryption eq '' ); 546 | $node{'Encryption'} = $ssid_encryption; 547 | $node{'Decrypted'} = 'decrypted'; 548 | $node{'MaxRate'} = $ssid_max_rate; 549 | $node{'MaxSeenRate'} = $maxseenrate; 550 | $node{'Beacon'} = $ssid_beaconrate; 551 | 552 | $node{'FirstTime'} = return_avalue( $wn, 'first-time' ); 553 | $node{'LastTime'} = return_avalue( $wn, 'last-time' ); 554 | 555 | my $wn_gps = ${ $wn->getElementsByTagName('gps-info') }[0]; 556 | if ( defined($wn_gps) ) { 557 | $node{'GPSMinLat'} = return_evalue( $wn_gps, 'min-lat' ); 558 | $node{'GPSMinLon'} = return_evalue( $wn_gps, 'min-lon' ); 559 | $node{'GPSMinAlt'} = return_evalue( $wn_gps, 'min-alt' ); 560 | $node{'GPSMinSpd'} = return_evalue( $wn_gps, 'min-spd' ); 561 | 562 | $node{'GPSMaxLat'} = return_evalue( $wn_gps, 'max-lat' ); 563 | $node{'GPSMaxLon'} = return_evalue( $wn_gps, 'max-lon' ); 564 | $node{'GPSMaxAlt'} = return_evalue( $wn_gps, 'max-alt' ); 565 | $node{'GPSMaxSpd'} = return_evalue( $wn_gps, 'max-spd' ); 566 | 567 | $node{'GPSBestLat'} = return_evalue( $wn_gps, 'peak-lat' ); 568 | $node{'GPSBestLon'} = return_evalue( $wn_gps, 'peak-lon' ); 569 | $node{'GPSBestAlt'} = return_evalue( $wn_gps, 'peak-alt' ); 570 | } 571 | elsif ( $options{ignoregps} ) { 572 | $node{'GPSMinLat'} = 0; 573 | $node{'GPSMinLon'} = 0; 574 | $node{'GPSMinAlt'} = 0; 575 | $node{'GPSMinSpd'} = 0; 576 | 577 | $node{'GPSMaxLat'} = 0; 578 | $node{'GPSMaxLon'} = 0; 579 | $node{'GPSMaxAlt'} = 0; 580 | $node{'GPSMaxSpd'} = 0; 581 | 582 | $node{'GPSBestLat'} = 0; 583 | $node{'GPSBestLon'} = 0; 584 | $node{'GPSBestAlt'} = 0; 585 | } 586 | else { 587 | print "Warning: no gps data found for BSSID: " . $node{'BSSID'} . " ESSID: " . $node{'ESSID'} . "\n"; 588 | next; 589 | } 590 | 591 | my $wn_pkts = ${ $wn->getElementsByTagName('packets') }[0]; 592 | if ( defined($wn_pkts) ) { 593 | 594 | $node{'LLC'} = return_evalue( $wn_pkts, 'LLC' ); 595 | $node{'Data'} = return_evalue( $wn_pkts, 'data' ); 596 | $node{'Crypt'} = return_evalue( $wn_pkts, 'crypt' ); 597 | $node{'Weak'} = 0; 598 | $node{'Total'} = return_evalue( $wn_pkts, 'total' ); 599 | } 600 | else { 601 | $node{'LLC'} = 0; 602 | $node{'Data'} = 0; 603 | $node{'Crypt'} = 0; 604 | $node{'Weak'} = 0; 605 | $node{'Total'} = 0; 606 | } 607 | 608 | my $wn_ipaddr = ${ $wn->getElementsByTagName('ip-address') }[0]; 609 | if ( defined($wn_ipaddr) ) { 610 | $node{'IPType'} = return_avalue( $wn_ipaddr, 'type' ); 611 | $node{'IP'} = return_evalue( $wn_ipaddr, 'ip-block' ); 612 | } 613 | else { 614 | $node{'IPType'} = 'undefined'; 615 | $node{'IP'} = 'undefined'; 616 | } 617 | 618 | $node{'BestSignal'} = 0; 619 | $node{'BestNoise'} = 0; 620 | $node{'BestQuality'} = 0; 621 | 622 | $node{Encoding} = 0; 623 | $node{Carrier} = $carrier; 624 | $node{DataSize} = $datasize; 625 | 626 | # ok see if the BSSID is known 627 | my $sql 628 | = qq/SELECT BSSID FROM wireless WHERE BSSID="$node{'BSSID'}"; /; 629 | 630 | if ( $node{'NetType'} ne "infrastructure" ) { 631 | next; 632 | } elsif ( ( !$options{ignoregps} ) and ( $node{'GPSBestLat'} == 0 or $node{'GPSBestLat'} == 0 ) ) 633 | { 634 | next; 635 | } 636 | if ( $options{silent} == 0 ) { 637 | print("Checking Database for BSSID: $node{'BSSID'} ... "); 638 | } 639 | 640 | my $sth = $dbh->prepare("$sql"); 641 | $sth->execute(); 642 | my $rows = 0; 643 | while ( my $row = $sth->fetchrow_arrayref ) { 644 | $rows = $rows + 1; 645 | } 646 | if ( $rows != 0 ) { 647 | if ( $options{silent} == 0 ) { 648 | print "\n"; 649 | } 650 | next; 651 | } 652 | 653 | my $insert = $dbh->prepare( 654 | 'INSERT INTO wireless VALUES 655 | (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)' 656 | ); 657 | if ( $options{debug} > 2 ) { 658 | foreach my $key ( sort keys %node ) { 659 | print "$key => " . $node{$key} . "\n"; 660 | } 661 | } 662 | my $wn_success = 1; 663 | $wn_success &&= $insert->execute( 664 | $id, $node{'NetworkID'}, 665 | $node{'NetType'}, $node{'ESSID'}, 666 | $node{'BSSID'}, $node{'Manuf'}, 667 | $node{'Info'}, $node{'Channel'}, 668 | $node{'Cloaked'}, $node{'Encryption'}, 669 | $node{'Decrypted'}, $node{'MaxRate'}, 670 | $node{'MaxSeenRate'}, $node{'Beacon'}, 671 | $node{'LLC'}, $node{'Data'}, 672 | $node{'Crypt'}, $node{'Weak'}, 673 | $node{'Total'}, $node{'Carrier'}, 674 | $node{'Encoding'}, $node{'FirstTime'}, 675 | $node{'LastTime'}, $node{'BestQuality'}, 676 | $node{'BestSignal'}, $node{'BestNoise'}, 677 | $node{'GPSMinLat'}, $node{'GPSMinLon'}, 678 | $node{'GPSMinAlt'}, $node{'GPSMinSpd'}, 679 | $node{'GPSMaxLat'}, $node{'GPSMaxLon'}, 680 | $node{'GPSMaxAlt'}, $node{'GPSMaxSpd'}, 681 | $node{'GPSBestLat'}, $node{'GPSBestLon'}, 682 | $node{'GPSBestAlt'}, $node{'DataSize'}, 683 | $node{'IPType'}, $node{'IP'} 684 | ) or die "Error inserting AP: $!\n"; 685 | 686 | $id++; 687 | if ( $options{silent} == 0 ) { 688 | print "AP added\n"; 689 | } 690 | 691 | foreach my $client ( $wn->getElementsByTagName('wireless-client') ) { 692 | 693 | $node{'FirstTime'} = return_avalue( $client, 'first-time' ); 694 | $node{'LastTime'} = return_avalue( $client, 'last-time' ); 695 | $node{'ClientMac'} = return_evalue( $client, 'client-mac' ); 696 | my $mac = return_evalue( $client, 'client-mac' ); 697 | my $manuf = return_evalue( $client, 'client-manuf' ); 698 | 699 | my $ipaddr = ${ $client->getElementsByTagName('ip-address') }[0]; 700 | if ( defined($ipaddr) ) { 701 | $node{'IPType'} = return_avalue( $ipaddr, 'type' ); 702 | $node{'IP'} = return_evalue( $ipaddr, 'ip-block' ); 703 | } 704 | else { 705 | $node{'IPType'} = 'undefined'; 706 | $node{'IP'} = 'undefined'; 707 | } 708 | my $pkts = ${ $client->getElementsByTagName('packets') }[0]; 709 | 710 | if ( defined($pkts) ) { 711 | 712 | $node{'LLC'} = return_evalue( $pkts, 'LLC' ); 713 | $node{'Data'} = return_evalue( $pkts, 'data' ); 714 | $node{'Crypt'} = return_evalue( $pkts, 'crypt' ); 715 | $node{'Weak'} = 0; 716 | $node{'Total'} = return_evalue( $pkts, 'total' ); 717 | } 718 | else { 719 | $node{'LLC'} = 0; 720 | $node{'Data'} = 0; 721 | $node{'Crypt'} = 0; 722 | $node{'Weak'} = 0; 723 | $node{'Total'} = 0; 724 | } 725 | 726 | my $gps = ${ $client->getElementsByTagName('gps-info') }[0]; 727 | if ( defined($gps) ) { 728 | $node{'GPSMinLat'} = return_evalue( $gps, 'min-lat' ); 729 | $node{'GPSMinLon'} = return_evalue( $gps, 'min-lon' ); 730 | $node{'GPSMinAlt'} = return_evalue( $gps, 'min-alt' ); 731 | $node{'GPSMinSpd'} = return_evalue( $gps, 'min-spd' ); 732 | 733 | $node{'GPSMaxLat'} = return_evalue( $gps, 'max-lat' ); 734 | $node{'GPSMaxLon'} = return_evalue( $gps, 'max-lon' ); 735 | $node{'GPSMaxAlt'} = return_evalue( $gps, 'max-alt' ); 736 | $node{'GPSMaxSpd'} = return_evalue( $gps, 'max-spd' ); 737 | 738 | $node{'GPSBestLat'} = return_evalue( $gps, 'peak-lat' ); 739 | $node{'GPSBestLon'} = return_evalue( $gps, 'peak-lon' ); 740 | $node{'GPSBestAlt'} = return_evalue( $gps, 'peak-alt' ); 741 | } 742 | elsif ( $options{ignoregps} ) { 743 | $node{'GPSMinLat'} = 0; 744 | $node{'GPSMinLon'} = 0; 745 | $node{'GPSMinAlt'} = 0; 746 | $node{'GPSMinSpd'} = 0; 747 | 748 | $node{'GPSMaxLat'} = 0; 749 | $node{'GPSMaxLon'} = 0; 750 | $node{'GPSMaxAlt'} = 0; 751 | $node{'GPSMaxSpd'} = 0; 752 | 753 | $node{'GPSBestLat'} = 0; 754 | $node{'GPSBestLon'} = 0; 755 | $node{'GPSBestAlt'} = 0; 756 | } 757 | else { 758 | next; 759 | } 760 | 761 | my $insert = $dbh->prepare( 762 | 'INSERT INTO clients VALUES 763 | (?,?,?,?,?,?)' 764 | ); 765 | my $success = 1; 766 | $success 767 | &&= $insert->execute( $cid, $node{'NetworkID'}, $mac, $manuf, 768 | $node{'IPType'}, $node{'IP'} ) 769 | or die "Error inserting client $!\n"; 770 | 771 | $cid++; 772 | } 773 | } 774 | } 775 | elsif ( $options{csv} ) { 776 | my $filename = $options{csv}; 777 | open( TMP, "<$filename" ) or die "Unable to open $filename\n"; 778 | 779 | my $counter = 0; 780 | my $id = 1; 781 | while () { 782 | if ( $counter == 0 ) { 783 | $counter = $counter + 1; 784 | next; 785 | } 786 | my @WD = split( ';', $_ ); 787 | my @mykeys = ( 788 | "NetworkID", "NetType", "ESSID", "BSSID", 789 | "Info", "Channel", "Cloaked", "Encryption", 790 | "Decrypted", "MaxRate", "MaxSeenRate", "Beacon", 791 | "LLC", "Data", "Crypt", "Weak", 792 | "Total", "Carrier", "Encoding", "FirstTime", 793 | "LastTime", "BestQuality", "BestSignal", "BestNoise", 794 | "GPSMinLat", "GPSMinLon", "GPSMinAlt", "GPSMinSpd", 795 | "GPSMaxLat", "GPSMaxLon", "GPSMaxAlt", "GPSMaxSpd", 796 | "GPSBestLat", "GPSBestLon", "GPSBestAlt", "DataSize", 797 | "IPType", "IP" 798 | ); 799 | my %node = (); 800 | my $index = 0; 801 | foreach my $thekey (@mykeys) { 802 | $node{$thekey} = $WD[$index]; 803 | $index++; 804 | } 805 | $node{'ESSID'} =~ s/\/_/g; 807 | $node{'ESSID'} =~ s/\"/_/g; 808 | 809 | # ok see if the BSSID is known 810 | my $sql 811 | = qq/SELECT BSSID FROM wireless WHERE BSSID="$node{'BSSID'}"; /; 812 | if ( $node{'NetType'} ne "infrastructure" ) 813 | { 814 | next; 815 | } elsif ( ( !$options{ignoregps} ) and ( $node{'GPSBestLat'} == 0 or $node{'GPSBestLat'} == 0 ) ) 816 | { 817 | next; 818 | } 819 | if ( $options{silent} == 0 ) { 820 | print("Checking Database for BSSID: $node{'BSSID'} ... "); 821 | } 822 | 823 | my $sth = $dbh->prepare("$sql"); 824 | $sth->execute(); 825 | my $rows = 0; 826 | while ( my $row = $sth->fetchrow_arrayref ) { 827 | $rows = $rows + 1; 828 | } 829 | if ( $rows == 0 ) { 830 | if ( $options{silent} == 0 ) { 831 | print "AP added\n"; 832 | } 833 | my $insert = $dbh->prepare( 834 | 'INSERT INTO wireless VALUES 835 | (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)' 836 | ); 837 | 838 | if ( $options{debug} > 2 ) { 839 | foreach my $key ( sort keys %node ) { 840 | print "$key => " . $node{$key} . "\n"; 841 | } 842 | } 843 | 844 | my $success = 1; 845 | $success &&= $insert->execute( 846 | $id, $node{'NetworkID'}, 847 | $node{'NetType'}, $node{'ESSID'}, 848 | $node{'BSSID'}, $node{'Manuf'}, 849 | $node{'Info'}, $node{'Channel'}, 850 | $node{'Cloaked'}, $node{'Encryption'}, 851 | $node{'Decrypted'}, $node{'MaxRate'}, 852 | $node{'MaxSeenRate'}, $node{'Beacon'}, 853 | $node{'LLC'}, $node{'Data'}, 854 | $node{'Crypt'}, $node{'Weak'}, 855 | $node{'Total'}, $node{'Carrier'}, 856 | $node{'Encoding'}, $node{'FirstTime'}, 857 | $node{'LastTime'}, $node{'BestQuality'}, 858 | $node{'BestSignal'}, $node{'BestNoise'}, 859 | $node{'GPSMinLat'}, $node{'GPSMinLon'}, 860 | $node{'GPSMinAlt'}, $node{'GPSMinSpd'}, 861 | $node{'GPSMaxLat'}, $node{'GPSMaxLon'}, 862 | $node{'GPSMaxAlt'}, $node{'GPSMaxSpd'}, 863 | $node{'GPSBestLat'}, $node{'GPSBestLon'}, 864 | $node{'GPSBestAlt'}, $node{'DataSize'}, 865 | $node{'IPType'}, $node{'IP'} 866 | ); 867 | $id++; 868 | } 869 | elsif ( $rows == 1 ) { 870 | if ( $options{silent} == 0 ) { 871 | print(" Already listed\n"); 872 | } 873 | } 874 | elsif ( $rows > 1 ) { 875 | if ( $options{silent} == 0 ) { 876 | print("Multiple entries detected\n"); 877 | } 878 | } 879 | else { 880 | if ( $options{silent} == 0 ) { 881 | print "\n"; 882 | } 883 | } 884 | $counter = $counter + 1; 885 | } 886 | } 887 | else { 888 | 889 | } 890 | 891 | if ( $options{query} ) { 892 | if ( $options{name} ) { 893 | $name = $options{name}; 894 | } 895 | else { 896 | $name = $input; 897 | } 898 | if ( $options{desc} ) { 899 | $description = $options{desc}; 900 | } 901 | else { 902 | $description = $options{query}; 903 | } 904 | my $kml = "\n"; 905 | $kml .= "\n"; 906 | $kml .= "\n"; 907 | $kml .= " $name\n"; 908 | 909 | if ( defined($description) ) { 910 | $kml .= " $description\n"; 911 | } 912 | 913 | my @data; 914 | my %node; 915 | my @mykeys = ( 916 | "Id", "NetworkID", "NetType", "ESSID", 917 | "BSSID", "Manuf", "Info", "Channel", 918 | "Cloaked", "Encryption", "Decrypted", "MaxRate", 919 | "MaxSeenRate", "Beacon", "LLC", "Data", 920 | "Crypt", "Weak", "Total", "Carrier", 921 | "Encoding", "FirstTime", "LastTime", "BestQuality", 922 | "BestSignal", "BestNoise", "GPSMinLat", "GPSMinLon", 923 | "GPSMinAlt", "GPSMinSpd", "GPSMaxLat", "GPSMaxLon", 924 | "GPSMaxAlt", "GPSMaxSpd", "GPSBestLat", "GPSBestLon", 925 | "GPSBestAlt", "DataSize", "IPType", "IP" 926 | ); 927 | 928 | if ( $options{query} ) { 929 | my @data = @{ runSql( $options{query} ) }; 930 | foreach my $i (@data) { 931 | my $num = 0; 932 | my $counter = 0; 933 | my $color; 934 | foreach my $mykey (@mykeys) { 935 | $node{$mykey} = $$i[$num]; 936 | $num++; 937 | } 938 | if ( $node{'NetType'} ne "infrastructure" ) { 939 | next; 940 | } 941 | if ( $node{'GPSBestLat'} == 0 or $node{'GPSBestLat'} == 0 ) { 942 | next; 943 | } 944 | $node{'ESSID'} =~ s/\/_/g; 946 | $node{'ESSID'} =~ s/\&/_/g; 947 | $node{'ESSID'} =~ s/\"/_/g; 948 | 949 | if ( !defined( $node{Encryption} ) ) { 950 | $node{Encryption} = 'None'; 951 | } 952 | 953 | if ( $node{Encryption} =~ /AES\-CCM/i ) { 954 | $color = $GREEN; 955 | } 956 | elsif ( $node{Encryption} =~ /TKIP/i ) { 957 | $color = $YELLOW; 958 | } 959 | elsif ( $node{Encryption} =~ /WEP/i ) { 960 | $color = $ORANGE; 961 | } 962 | else { 963 | $color = $RED; 964 | } 965 | 966 | # ok see if the BSSID is known 967 | my $sql 968 | = qq/SELECT * FROM clients WHERE nid="$node{'NetworkID'}"; /; 969 | my $sth = $dbh->prepare("$sql"); 970 | $sth->execute(); 971 | my $clients = ''; 972 | my $client_list = $sth->fetchall_hashref('cid'); 973 | foreach my $i ( sort keys %{$client_list} ) { 974 | if ( $client_list->{$i}->{mac} ne $node{BSSID} ) { 975 | $clients .= "MAC Address:\t" 976 | . $client_list->{$i}->{mac} . "
"; 977 | $clients .= "Manufacturer:\t" 978 | . $client_list->{$i}->{manuf} . '
'; 979 | $clients .= '
'; 980 | } 981 | } 982 | $clients .= '
'; 983 | my ( $net_lon, $net_lat, $net_coords, $net_alt, $net_range, 984 | $net_head, $net_tilt, $net_scale_range ) 985 | = split( 986 | /\|/, 987 | &calc_pos( 988 | $node{GPSMinLon}, $node{GPSMaxLat}, $node{GPSMaxLon}, 989 | $node{GPSMaxLat}, $node{BSSID} 990 | ) 991 | ); 992 | $net_lon = $node{GPSBestLon}; 993 | $net_lat = $node{GPSBestLat}; 994 | 995 | my $essid = $node{'ESSID'}; 996 | $kml .= " 1005 | 1014 | 1015 | 1016 | normal 1017 | #${essid}_normal 1018 | 1019 | 1020 | highlight 1021 | #${essid}_highlight 1022 | 1023 | 1024 | "; 1025 | 1026 | $kml .= "\n"; 1027 | $kml .= " $node{'ESSID'}\n"; 1028 | $kml .= "#${essid}_styleMap"; 1029 | $kml .= " '; 1031 | $kml .= 'Encryption: ' . $node{'Encryption'} . '
'; 1032 | $kml .= 'Channel: ' . $node{'Channel'} . '

'; 1033 | $kml .= 'Current Clients: ' . "
"; 1034 | $kml .= $clients . '
'; 1035 | $kml .= "]]>
\n"; 1036 | $kml .= " \n"; 1037 | $kml .= ''; 1038 | $kml .= "$net_lon"; 1039 | $kml .= "$net_lat"; 1040 | $kml .= "1"; 1041 | $kml .= "$net_scale_range"; 1042 | $kml .= "1"; 1043 | $kml .= "1"; 1044 | $kml .= ""; 1045 | $kml 1046 | .= " $node{'GPSBestLon'},$node{'GPSBestLat'},0\n"; 1047 | $kml .= " \n"; 1048 | $kml .= "
\n"; 1049 | $counter = $counter + 1; 1050 | } 1051 | } 1052 | else { 1053 | 1054 | #my $manual = $options{manual}; 1055 | #open(IN,">$manual") or die "can't open manual query file\n"; 1056 | #my @input = ; 1057 | my $counter = 0; 1058 | my @input; 1059 | foreach (@input) { 1060 | my @data = split( ';', $_ ); 1061 | my %node = (); 1062 | my $index = 0; 1063 | 1064 | foreach my $thekey (@mykeys) { 1065 | $node{$thekey} = $mykeys[$index]; 1066 | $index++; 1067 | } 1068 | 1069 | if ( $node{'NetType'} ne "infrastructure" ) { 1070 | next; 1071 | } 1072 | if ( $node{'GPSBestLat'} == 0 or $node{'GPSBestLat'} == 0 ) { 1073 | next; 1074 | } 1075 | 1076 | $kml .= "\n \n"; 1077 | $node{'ESSID'} =~ s/\/_/g; 1079 | $kml .= " $node{'ESSID'}\n"; 1080 | $kml .= " "; 1081 | $kml .= 'channel: ' . $node{'Channel'} . '
'; 1082 | $kml 1083 | .= 'encryption: ' 1084 | . $node{'Encryption'} 1085 | . '
'; 1086 | $kml .= "]]>
\n"; 1087 | $kml .= " \n"; 1088 | $kml 1089 | .= " $node{'GPSBestLon'},$node{'GPSBestLat'},0\n"; 1090 | $kml .= " \n"; 1091 | $kml .= "
\n"; 1092 | $counter = $counter + 1; 1093 | } 1094 | } 1095 | $kml .= "\n
\n"; 1096 | $kml .= "
\n"; 1097 | 1098 | if ( $options{output} ) { 1099 | 1100 | output( $options{output}, $kml ); 1101 | } 1102 | else { 1103 | print $kml; 1104 | } 1105 | } 1106 | 1107 | sub print_avalue { 1108 | my ( $node, $key ) = @_; 1109 | print "$key: " . $node->getAttribute("$key") . "\n"; 1110 | } 1111 | 1112 | sub return_avalue { 1113 | my ( $node, $key ) = @_; 1114 | return $node->getAttribute("$key"); 1115 | } 1116 | 1117 | sub print_evalue { 1118 | my ( $node, $key ) = @_; 1119 | print "$key : "; 1120 | if ( scalar( @{ $node->getElementsByTagName("$key") } ) > 0 ) { 1121 | print ${ $node->getElementsByTagName("$key") }[0]->textContent . "\n"; 1122 | } 1123 | else { 1124 | print "undefined\n"; 1125 | } 1126 | } 1127 | 1128 | sub return_evalue { 1129 | my ( $node, $key ) = @_; 1130 | 1131 | if ( scalar( @{ $node->getElementsByTagName("$key") } ) > 0 ) { 1132 | return ${ $node->getElementsByTagName("$key") }[0]->textContent; 1133 | } 1134 | else { 1135 | return "undefined"; 1136 | } 1137 | } 1138 | 1139 | sub return_evalue_all { 1140 | my ( $node, $key ) = @_; 1141 | my $value = ''; 1142 | if ( scalar( @{ $node->getElementsByTagName("$key") } ) > 0 ) { 1143 | foreach my $line ( @{ $node->getElementsByTagName("$key") } ) { 1144 | $value .= " " . $line->textContent; 1145 | } 1146 | } 1147 | $value =~ s/^\s//; 1148 | return $value; 1149 | } 1150 | 1151 | sub print_packets { 1152 | my ($node) = @_; 1153 | 1154 | print "Printing Packets\n"; 1155 | foreach my $pkts ( $node->getElementsByTagName('packets') ) { 1156 | print_evalue( $pkts, 'LLC' ); 1157 | print_evalue( $pkts, 'data' ); 1158 | 1159 | print_evalue( $pkts, 'crypt' ); 1160 | print_evalue( $pkts, 'total' ); 1161 | print_evalue( $pkts, 'framents' ); 1162 | print_evalue( $pkts, 'retries' ); 1163 | } 1164 | } 1165 | 1166 | sub print_snr_info { 1167 | my ($node) = @_; 1168 | 1169 | print "Printing snr-info\n"; 1170 | foreach my $snr ( $node->getElementsByTagName('snr-info') ) { 1171 | print_evalue( $snr, 'last_signal_dbm' ); 1172 | print_evalue( $snr, 'last_noise_dbm' ); 1173 | print_evalue( $snr, 'last_signal_rssi' ); 1174 | print_evalue( $snr, 'last_noise_rssi' ); 1175 | 1176 | print_evalue( $snr, 'min_signal_dbm' ); 1177 | print_evalue( $snr, 'min_noise_dbm' ); 1178 | print_evalue( $snr, 'min_signal_rssi' ); 1179 | print_evalue( $snr, 'min_noise_rssi' ); 1180 | 1181 | print_evalue( $snr, 'max_signal_dbm' ); 1182 | print_evalue( $snr, 'max_noise_dbm' ); 1183 | print_evalue( $snr, 'max_signal_rssi' ); 1184 | print_evalue( $snr, 'max_noise_rssi' ); 1185 | } 1186 | } 1187 | 1188 | sub print_gps_info { 1189 | my ($node) = @_; 1190 | 1191 | print "Printing gps-info\n"; 1192 | foreach my $gps ( $node->getElementsByTagName('gps-info') ) { 1193 | print_evalue( $gps, 'min-lat' ); 1194 | print_evalue( $gps, 'min-lon' ); 1195 | print_evalue( $gps, 'min-alt' ); 1196 | print_evalue( $gps, 'min-spd' ); 1197 | 1198 | print_evalue( $gps, 'max-lat' ); 1199 | print_evalue( $gps, 'max-mon' ); 1200 | print_evalue( $gps, 'max-alt' ); 1201 | print_evalue( $gps, 'max-spd' ); 1202 | 1203 | print_evalue( $gps, 'peak-lat' ); 1204 | print_evalue( $gps, 'peak-lon' ); 1205 | print_evalue( $gps, 'peak-alt' ); 1206 | 1207 | print_evalue( $gps, 'avg-lat' ); 1208 | print_evalue( $gps, 'avg-lon' ); 1209 | print_evalue( $gps, 'avg-alt' ); 1210 | 1211 | print_evalue( $gps, 'agg-points' ); 1212 | } 1213 | } 1214 | -------------------------------------------------------------------------------- /giskismet.man.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # pod2man giskismet.man.1 | gzip -c > giskismet.1p.gz && gunzip giskismet.1p.gz 4 | # 5 | # Copyright (C) 2009 Joshua D. Abraham (jabra@spl0it.org) 6 | # 7 | # This manpage is released under the terms of the GNU General Public 8 | # License (GPL), which is distributed with this software in the file 9 | # "COPYING". The GPL specifies the terms under which users may copy 10 | # and use this software. 11 | # 12 | 13 | =pod 14 | 15 | =begin man 16 | 17 | =head1 NAME 18 | 19 | GISKismet - a program to visually represent the Kismet data in 20 | a flexible manner. 21 | 22 | =head1 SYNOPSIS 23 | 24 | giskismet [Options] 25 | 26 | =cut 27 | 28 | =begin man 29 | 30 | =head1 DESCRIPTION 31 | 32 | GISKismet is a wireless recon visualization tool to represent data 33 | gathered using Kismet in a flexible manner. GISKismet stores the 34 | information in a database so that the user can generate graphs using 35 | SQL. GISKismet currently uses SQLite for the database and GoogleEarth 36 | / KML files for graphing. 37 | 38 | =head1 OPTIONS 39 | 40 | Usage: giskismet.pl [Options] 41 | 42 | Input File: 43 | --csv Parse the input from Kismet-devel CSV 44 | -x --xml Parse the input from Kismet-newcore NETXML 45 | 46 | Input Filters: 47 | --bssid file | list Filter based on BSSID 48 | --essid file | list Filter based on ESSID 49 | --encryption file | list Filter based on Encryption 50 | --channel file | list Filter based on Channel 51 | 52 | file | list (list = comma separted lists(needs quotes) 53 | 54 | Kismet-newcore Options: 55 | -a --ap Insert only the APs 56 | 57 | Query 58 | -q --query [sql] SQL query 59 | -m --manual [csv] CSV output of manual SQL query 60 | 61 | -o --output [file] Output filename 62 | -n --name [str] Name of the KML layer 63 | --desc [str] Description of the KML layer 64 | 65 | General Options: 66 | -d --debug [num] Display debug information 67 | -s --silent No output when adding APs 68 | -v --version Display version 69 | -h --help Display this information 70 | 71 | Send Comments to Joshua D. Abraham ( jabra@spl0it.org ) 72 | 73 | =end man 74 | 75 | =cut 76 | 77 | 78 | __END__ 79 | 80 | =begin man 81 | 82 | =head1 EXAMPLE SINGLE SCAN 83 | 84 | 1) Insert all data from a Kismet-newcore netxml file into the 85 | GISKismet database 86 | 87 | perl giskismet -x examples/Kismet-Feb-05-2009-1.netxml 88 | 89 | 2) Insert only the APs on channel 2 90 | 91 | perl giskismet -x examples/Kismet-Feb-05-2009-1.netxml --channel 2 92 | 93 | 3) Generate a graph based on the GISKismet database 94 | 95 | perl giskismet -q "select * from wireless" -o ex1.kml 96 | 97 | 4) Insert all the information from a Kismet-newcore netxml file and 98 | generate a graph of all the APs named linksys without encryption 99 | 100 | perl giskismet -x examples/Kismet-Feb-05-2009-1.netxml 101 | -q "select * from wireless where ESSID='linksys' and Encryption='None'" -o ex2.kml 102 | 103 | =head1 FEATURE REQUESTS 104 | 105 | Any feature requests should be reported to the online 106 | feature-request-tracking system available on the web at : 107 | 108 | http://my-trac.assembla.com/giskismet/newticket 109 | 110 | Before requesting a feature, please check to see if the features has 111 | already been requested. 112 | 113 | =head1 BUG REPORTS 114 | 115 | Any bugs found should be reported to the online bug-tracking system 116 | available on the web at : 117 | 118 | http://my-trac.assembla.com/giskismet/newticket 119 | 120 | Before reporting a bug, please check to see if the bug has already 121 | been reported. 122 | 123 | =head1 SUPPORTED DATABASES 124 | 125 | The following databases are supported: 126 | 127 | * SQLite 128 | 129 | =head1 DATABASE SCHEMA 130 | 131 | The following is the SQLite version of the database schema: 132 | 133 | CREATE TABLE clients ( 134 | cid INTEGER PRIMARY KEY AUTOINCREMENT, 135 | nid INTEGER NULL, 136 | mac text default NULL, 137 | manuf text default NULL, 138 | iptype text default NULL, 139 | ip text default NULL); 140 | CREATE TABLE wireless ( 141 | Id INTEGER PRIMARY KEY AUTOINCREMENT, 142 | NetworkID INTEGER NULL, 143 | NetType text default NULL, 144 | ESSID text default NULL, 145 | BSSID text default NULL, 146 | Manuf text default NULL, 147 | Info text default NULL, 148 | Channel INTEGER NULL, 149 | Cloaked text default NULL, 150 | Encryption text default NULL, 151 | Decrypted text default NULL, 152 | MaxRate INTEGER NULL, 153 | MaxSeenRate INTEGER NULL, 154 | Beacon INTEGER NULL, 155 | LLC INTEGER NULL, 156 | Data INTEGER NULL, 157 | Crypt INTEGER NULL, 158 | Weak INTEGER NULL, 159 | Total INTEGER NULL, 160 | Carrier text default NULL, 161 | Encoding text default NULL, 162 | FirstTime text default NULL, 163 | LastTime text default NULL, 164 | BestQuality INTEGER NULL, 165 | BestSignal INTEGER NULL, 166 | BestNoise INTEGER NULL, 167 | GPSMinLat float NULL, 168 | GPSMinLon float NULL, 169 | GPSMinAlt float NULL, 170 | GPSMinSpd float NULL, 171 | GPSMaxLat float NULL, 172 | GPSMaxLon float NULL, 173 | GPSMaxAlt float NULL, 174 | GPSMaxSpd float NULL, 175 | GPSBestLat float NULL, 176 | GPSBestLon float NULL, 177 | GPSBestAlt float NULL, 178 | DataSize INTEGER NULL, 179 | IPType text default NULL, 180 | IP text default NULL); 181 | 182 | =head1 AUTHORS 183 | 184 | Joshua D. Abraham ( jabra@spl0it.org ) 185 | 186 | =end man 187 | -------------------------------------------------------------------------------- /pm_to_blib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtr4nge/giskismet/9ebe9d026f0112096ace24fe14c2f22dbffe67bb/pm_to_blib --------------------------------------------------------------------------------