├── .gitignore ├── .travis.yml ├── INSTALL.md ├── README.md ├── docs ├── CREDITS.txt ├── LICENSE.txt ├── anwi.html ├── assets │ ├── css │ │ ├── font-awesome.min.css │ │ └── main.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ └── js │ │ ├── jquery.min.js │ │ ├── main.js │ │ ├── skel.min.js │ │ └── util.js ├── elements.html ├── images │ ├── ANWI_BHUSA_2018.pdf │ ├── banner.jpg │ ├── pic01.jpg │ ├── pic02.jpg │ ├── rishikesh_bhide.jpeg │ └── sanket_karpe.jpeg └── index.html ├── lib ├── alerts │ ├── alerts.cpp │ └── alerts.h ├── config │ ├── config.cpp │ └── config.h ├── debug_print │ ├── debug_print.cpp │ └── debug_print.h ├── global_vars.h ├── ieee80211_packet.h ├── packet_capture │ ├── packet_capture.cpp │ └── packet_capture.h ├── protection │ ├── geofence.cpp │ └── geofence.h └── readme.txt ├── platformio.ini ├── server_nodered.json └── src └── main.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | .pioenvs 2 | .piolibdeps 3 | .vscode/c_cpp_properties.json 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Continuous Integration (CI) is the practice, in software 2 | # engineering, of merging all developer working copies with a shared mainline 3 | # several times a day < http://docs.platformio.org/page/ci/index.html > 4 | # 5 | # Documentation: 6 | # 7 | # * Travis CI Embedded Builds with PlatformIO 8 | # < https://docs.travis-ci.com/user/integration/platformio/ > 9 | # 10 | # * PlatformIO integration with Travis CI 11 | # < http://docs.platformio.org/page/ci/travis.html > 12 | # 13 | # * User Guide for `platformio ci` command 14 | # < http://docs.platformio.org/page/userguide/cmd_ci.html > 15 | # 16 | # 17 | # Please choice one of the following templates (proposed below) and uncomment 18 | # it (remove "# " before each line) or use own configuration according to the 19 | # Travis CI documentation (see above). 20 | # 21 | 22 | 23 | # 24 | # Template #1: General project. Test it using existing `platformio.ini`. 25 | # 26 | 27 | # language: python 28 | # python: 29 | # - "2.7" 30 | # 31 | # sudo: false 32 | # cache: 33 | # directories: 34 | # - "~/.platformio" 35 | # 36 | # install: 37 | # - pip install -U platformio 38 | # 39 | # script: 40 | # - platformio run 41 | 42 | 43 | # 44 | # Template #2: The project is intended to by used as a library with examples 45 | # 46 | 47 | # language: python 48 | # python: 49 | # - "2.7" 50 | # 51 | # sudo: false 52 | # cache: 53 | # directories: 54 | # - "~/.platformio" 55 | # 56 | # env: 57 | # - PLATFORMIO_CI_SRC=path/to/test/file.c 58 | # - PLATFORMIO_CI_SRC=examples/file.ino 59 | # - PLATFORMIO_CI_SRC=path/to/test/directory 60 | # 61 | # install: 62 | # - pip install -U platformio 63 | # 64 | # script: 65 | # - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N 66 | -------------------------------------------------------------------------------- /INSTALL.md: -------------------------------------------------------------------------------- 1 | # INSTALLATION GUIDE 2 | 3 | ### Code Upload Steps 4 | 5 | 1) Install Visual Studio Code 6 | 2) Install PlatformIO by following instructions at http://docs.platformio.org/en/latest/ide/vscode.html 7 | 3) Import the anwi code into Visual Studio Code using PlatformIO ( PIO Home) 8 | 4) Connect the Wesmos D1 sensor to the computer using USB cable 9 | 5) Build and upload the code to the D1 sensor using the build option in PlatformIO 10 | 11 | ### Sensor Configuration Steps - Serial PORT 12 | 13 | 1) Open Arduino IDE's serial monitor and select Sensor serial PORT 14 | 2) Enter 'c' to configure the sensor 15 | 3) Enter the configuration data asked by sensor 16 | 4) Sensor will restart once data is confirmed by user 17 | 5) The sensor will enter "Protection Mode" on reboot 18 | 19 | ### Sensor Configuration Steps - Web Configuration 20 | 21 | 1) Provide power to the sensor 22 | 2) The sensor will become an Access Point with name ANWI_Sensor after 20 seconds delay 23 | 3) Connect to the sensor using computer 24 | 4) Use browser to connect to 192.168.4.1 25 | 5) Fill in the required data on the form displayed 26 | 6) Click on "Save Settings" button once the data is filled 27 | 7) The sensor will reboot and enter "Protection Mode" 28 | 29 | ### Standalone Alert aka IFTTT Alert Configuration Steps 30 | 31 | 1) Create an account on https://ifttt.com 32 | 2) Follow the steps mentioned on https://ifttt.com/maker_webhooks 33 | 3) Provide the unique IFTTT key to sensor during configuration phase 34 | 35 | ### Server Configuration Steps 36 | 37 | 1) Install node-red by following steps mentioned on https://nodered.org/docs/getting-started/installation 38 | 2) Copy the contents of server_nodered.json and import to node-red dashboard 39 | 3) Execute the Flow 40 | 4) Provide the Server IP to the sensor during configuration phase 41 | 42 | 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ANWI - All New Wireless IDS 2 | Black Hat Arsenal Europe 2017 Black Hat Arsenal USA 2018 3 | 4 | 5 | ANWI is a new type of Wireless Intrusion Detection System which is based on a low cost Wi-Fi module (ESP8266) and can be deployed at the physical perimeter of the coverage area. It allows organizations that cannot afford expensive WIDS solutions to protect their networks at a fraction of the cost. 6 | 7 | 8 | # LICENSE: [![License: CC BY-NC-SA 4.0](https://licensebuttons.net/l/by-nc-sa/4.0/80x15.png)](https://creativecommons.org/licenses/by-nc-sa/4.0/) 9 | 10 | 11 | This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. 12 | -------------------------------------------------------------------------------- /docs/CREDITS.txt: -------------------------------------------------------------------------------- 1 | # Image Credits 2 | 3 | All images courtesy of Unsplash (https://unsplash.com). 4 | 5 | - Redd Angelo (https://unsplash.com/photos/h34WJ4T9uhw) 6 | - Nirzar Pangarkar (https://unsplash.com/photos/EKjJSbVI7rk) 7 | - Maxim Polishtchouk (https://unsplash.com/photos/N6q6wtJ_mkA) -------------------------------------------------------------------------------- /docs/LICENSE.txt: -------------------------------------------------------------------------------- 1 | # Creative Commons Attribution 3.0 Unported (http://creativecommons.org/licenses/by/3.0) 2 | 3 | License 4 | 5 | THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. 6 | 7 | BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. 8 | 9 | 1. Definitions 10 | 11 | 1. "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. 12 | 2. "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License. 13 | 3. "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership. 14 | 4. "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License. 15 | 5. "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast. 16 | 6. "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work. 17 | 7. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. 18 | 8. "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images. 19 | 9. "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium. 20 | 21 | 2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws. 22 | 23 | 3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: 24 | 25 | 1. to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; 26 | 2. to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified."; 27 | 3. to Distribute and Publicly Perform the Work including as incorporated in Collections; and, 28 | 4. to Distribute and Publicly Perform Adaptations. 29 | 5. 30 | 31 | For the avoidance of doubt: 32 | 1. Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; 33 | 2. Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and, 34 | 3. Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License. 35 | 36 | The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved. 37 | 38 | 4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: 39 | 40 | 1. You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(b), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(b), as requested. 41 | 2. If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4 (b) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties. 42 | 3. Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise. 43 | 44 | 5. Representations, Warranties and Disclaimer 45 | 46 | UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. 47 | 48 | 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 49 | 50 | 7. Termination 51 | 52 | 1. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. 53 | 2. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. 54 | 55 | 8. Miscellaneous 56 | 57 | 1. Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. 58 | 2. Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. 59 | 3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. 60 | 4. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. 61 | 5. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. 62 | 6. The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. 63 | -------------------------------------------------------------------------------- /docs/anwi.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | ANWI 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 27 | 28 | 29 |
30 |
31 |
32 |

ANWI (All New Wireless IDS)

33 |

The $5 Wireless IDS

34 |
35 | 36 |

37 | ANWI is a new type of Wireless Intrusion Detection System which is based on a low cost WiFi module (ESP8266) and can be deployed at physical perimeter of the coverage area. It allows organizations which can't afford expensive WIDS solutions to protect their networks at fraction of the cost involved. 38 |

39 |

40 | ANWI provides three layers of protection: 41 |

46 |

47 |

48 | ANWI supports standalone as well as managed mode for sending alerts. It also has ability to use separate radio for sending alerts as added resiliency.ANWI aims to fulfill the need of WIDS which is inexpensive yet can protect against most of the possible attacks. It is easy to setup and deploy and works on "fire and forget principle". Once the sensors have been configured they can be deployed across the perimeter. The sensors send heartbeat signal and in case any of the sensors goes offline an alert is generated by server. The current production version includes all the above features. 49 |

50 | 51 | 52 |
53 |
54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /docs/assets/css/font-awesome.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.6.3 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.6.3');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.6.3') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.6.3') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.6.3') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} 5 | -------------------------------------------------------------------------------- /docs/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anwi-wips/anwi/94a184edd00081d9c9a23d8f8e3a29f7ad45cfb1/docs/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /docs/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anwi-wips/anwi/94a184edd00081d9c9a23d8f8e3a29f7ad45cfb1/docs/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anwi-wips/anwi/94a184edd00081d9c9a23d8f8e3a29f7ad45cfb1/docs/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anwi-wips/anwi/94a184edd00081d9c9a23d8f8e3a29f7ad45cfb1/docs/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/assets/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anwi-wips/anwi/94a184edd00081d9c9a23d8f8e3a29f7ad45cfb1/docs/assets/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/assets/js/main.js: -------------------------------------------------------------------------------- 1 | /* 2 | Projection by TEMPLATED 3 | templated.co @templatedco 4 | Released for free under the Creative Commons Attribution 3.0 license (templated.co/license) 5 | */ 6 | 7 | (function($) { 8 | 9 | // Breakpoints. 10 | skel.breakpoints({ 11 | xlarge: '(max-width: 1680px)', 12 | large: '(max-width: 1280px)', 13 | medium: '(max-width: 980px)', 14 | small: '(max-width: 736px)', 15 | xsmall: '(max-width: 480px)' 16 | }); 17 | 18 | $(function() { 19 | 20 | var $window = $(window), 21 | $body = $('body'); 22 | 23 | // Disable animations/transitions until the page has loaded. 24 | $body.addClass('is-loading'); 25 | 26 | $window.on('load', function() { 27 | window.setTimeout(function() { 28 | $body.removeClass('is-loading'); 29 | }, 100); 30 | }); 31 | 32 | // Prioritize "important" elements on medium. 33 | skel.on('+medium -medium', function() { 34 | $.prioritize( 35 | '.important\\28 medium\\29', 36 | skel.breakpoint('medium').active 37 | ); 38 | }); 39 | 40 | // Off-Canvas Navigation. 41 | 42 | // Navigation Panel. 43 | $( 44 | '' 48 | ) 49 | .appendTo($body) 50 | .panel({ 51 | delay: 500, 52 | hideOnClick: true, 53 | hideOnSwipe: true, 54 | resetScroll: true, 55 | resetForms: true, 56 | side: 'left' 57 | }); 58 | 59 | // Fix: Remove transitions on WP<10 (poor/buggy performance). 60 | if (skel.vars.os == 'wp' && skel.vars.osVersion < 10) 61 | $('#navPanel') 62 | .css('transition', 'none'); 63 | 64 | }); 65 | 66 | })(jQuery); 67 | -------------------------------------------------------------------------------- /docs/assets/js/skel.min.js: -------------------------------------------------------------------------------- 1 | /* skel.js v3.0.1 | (c) skel.io | MIT licensed */ 2 | var skel=function(){"use strict";var t={breakpointIds:null,events:{},isInit:!1,obj:{attachments:{},breakpoints:{},head:null,states:{}},sd:"/",state:null,stateHandlers:{},stateId:"",vars:{},DOMReady:null,indexOf:null,isArray:null,iterate:null,matchesMedia:null,extend:function(e,n){t.iterate(n,function(i){t.isArray(n[i])?(t.isArray(e[i])||(e[i]=[]),t.extend(e[i],n[i])):"object"==typeof n[i]?("object"!=typeof e[i]&&(e[i]={}),t.extend(e[i],n[i])):e[i]=n[i]})},newStyle:function(t){var e=document.createElement("style");return e.type="text/css",e.innerHTML=t,e},_canUse:null,canUse:function(e){t._canUse||(t._canUse=document.createElement("div"));var n=t._canUse.style,i=e.charAt(0).toUpperCase()+e.slice(1);return e in n||"Moz"+i in n||"Webkit"+i in n||"O"+i in n||"ms"+i in n},on:function(e,n){var i=e.split(/[\s]+/);return t.iterate(i,function(e){var a=i[e];if(t.isInit){if("init"==a)return void n();if("change"==a)n();else{var r=a.charAt(0);if("+"==r||"!"==r){var o=a.substring(1);if(o in t.obj.breakpoints)if("+"==r&&t.obj.breakpoints[o].active)n();else if("!"==r&&!t.obj.breakpoints[o].active)return void n()}}}t.events[a]||(t.events[a]=[]),t.events[a].push(n)}),t},trigger:function(e){return t.events[e]&&0!=t.events[e].length?(t.iterate(t.events[e],function(n){t.events[e][n]()}),t):void 0},breakpoint:function(e){return t.obj.breakpoints[e]},breakpoints:function(e){function n(t,e){this.name=this.id=t,this.media=e,this.active=!1,this.wasActive=!1}return n.prototype.matches=function(){return t.matchesMedia(this.media)},n.prototype.sync=function(){this.wasActive=this.active,this.active=this.matches()},t.iterate(e,function(i){t.obj.breakpoints[i]=new n(i,e[i])}),window.setTimeout(function(){t.poll()},0),t},addStateHandler:function(e,n){t.stateHandlers[e]=n},callStateHandler:function(e){var n=t.stateHandlers[e]();t.iterate(n,function(e){t.state.attachments.push(n[e])})},changeState:function(e){t.iterate(t.obj.breakpoints,function(e){t.obj.breakpoints[e].sync()}),t.vars.lastStateId=t.stateId,t.stateId=e,t.breakpointIds=t.stateId===t.sd?[]:t.stateId.substring(1).split(t.sd),t.obj.states[t.stateId]?t.state=t.obj.states[t.stateId]:(t.obj.states[t.stateId]={attachments:[]},t.state=t.obj.states[t.stateId],t.iterate(t.stateHandlers,t.callStateHandler)),t.detachAll(t.state.attachments),t.attachAll(t.state.attachments),t.vars.stateId=t.stateId,t.vars.state=t.state,t.trigger("change"),t.iterate(t.obj.breakpoints,function(e){t.obj.breakpoints[e].active?t.obj.breakpoints[e].wasActive||t.trigger("+"+e):t.obj.breakpoints[e].wasActive&&t.trigger("-"+e)})},generateStateConfig:function(e,n){var i={};return t.extend(i,e),t.iterate(t.breakpointIds,function(e){t.extend(i,n[t.breakpointIds[e]])}),i},getStateId:function(){var e="";return t.iterate(t.obj.breakpoints,function(n){var i=t.obj.breakpoints[n];i.matches()&&(e+=t.sd+i.id)}),e},poll:function(){var e="";e=t.getStateId(),""===e&&(e=t.sd),e!==t.stateId&&t.changeState(e)},_attach:null,attach:function(e){var n=t.obj.head,i=e.element;return i.parentNode&&i.parentNode.tagName?!1:(t._attach||(t._attach=n.firstChild),n.insertBefore(i,t._attach.nextSibling),e.permanent&&(t._attach=i),!0)},attachAll:function(e){var n=[];t.iterate(e,function(t){n[e[t].priority]||(n[e[t].priority]=[]),n[e[t].priority].push(e[t])}),n.reverse(),t.iterate(n,function(e){t.iterate(n[e],function(i){t.attach(n[e][i])})})},detach:function(t){var e=t.element;return t.permanent||!e.parentNode||e.parentNode&&!e.parentNode.tagName?!1:(e.parentNode.removeChild(e),!0)},detachAll:function(e){var n={};t.iterate(e,function(t){n[e[t].id]=!0}),t.iterate(t.obj.attachments,function(e){e in n||t.detach(t.obj.attachments[e])})},attachment:function(e){return e in t.obj.attachments?t.obj.attachments[e]:null},newAttachment:function(e,n,i,a){return t.obj.attachments[e]={id:e,element:n,priority:i,permanent:a}},init:function(){t.initMethods(),t.initVars(),t.initEvents(),t.obj.head=document.getElementsByTagName("head")[0],t.isInit=!0,t.trigger("init")},initEvents:function(){t.on("resize",function(){t.poll()}),t.on("orientationChange",function(){t.poll()}),t.DOMReady(function(){t.trigger("ready")}),window.onload&&t.on("load",window.onload),window.onload=function(){t.trigger("load")},window.onresize&&t.on("resize",window.onresize),window.onresize=function(){t.trigger("resize")},window.onorientationchange&&t.on("orientationChange",window.onorientationchange),window.onorientationchange=function(){t.trigger("orientationChange")}},initMethods:function(){document.addEventListener?!function(e,n){t.DOMReady=n()}("domready",function(){function t(t){for(r=1;t=n.shift();)t()}var e,n=[],i=document,a="DOMContentLoaded",r=/^loaded|^c/.test(i.readyState);return i.addEventListener(a,e=function(){i.removeEventListener(a,e),t()}),function(t){r?t():n.push(t)}}):!function(e,n){t.DOMReady=n()}("domready",function(t){function e(t){for(h=1;t=i.shift();)t()}var n,i=[],a=!1,r=document,o=r.documentElement,s=o.doScroll,c="DOMContentLoaded",d="addEventListener",u="onreadystatechange",l="readyState",f=s?/^loaded|^c/:/^loaded|c/,h=f.test(r[l]);return r[d]&&r[d](c,n=function(){r.removeEventListener(c,n,a),e()},a),s&&r.attachEvent(u,n=function(){/^c/.test(r[l])&&(r.detachEvent(u,n),e())}),t=s?function(e){self!=top?h?e():i.push(e):function(){try{o.doScroll("left")}catch(n){return setTimeout(function(){t(e)},50)}e()}()}:function(t){h?t():i.push(t)}}),Array.prototype.indexOf?t.indexOf=function(t,e){return t.indexOf(e)}:t.indexOf=function(t,e){if("string"==typeof t)return t.indexOf(e);var n,i,a=e?e:0;if(!this)throw new TypeError;if(i=this.length,0===i||a>=i)return-1;for(0>a&&(a=i-Math.abs(a)),n=a;i>n;n++)if(this[n]===t)return n;return-1},Array.isArray?t.isArray=function(t){return Array.isArray(t)}:t.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},Object.keys?t.iterate=function(t,e){if(!t)return[];var n,i=Object.keys(t);for(n=0;i[n]&&e(i[n],t[i[n]])!==!1;n++);}:t.iterate=function(t,e){if(!t)return[];var n;for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])===!1)break},window.matchMedia?t.matchesMedia=function(t){return""==t?!0:window.matchMedia(t).matches}:window.styleMedia||window.media?t.matchesMedia=function(t){if(""==t)return!0;var e=window.styleMedia||window.media;return e.matchMedium(t||"all")}:window.getComputedStyle?t.matchesMedia=function(t){if(""==t)return!0;var e=document.createElement("style"),n=document.getElementsByTagName("script")[0],i=null;e.type="text/css",e.id="matchmediajs-test",n.parentNode.insertBefore(e,n),i="getComputedStyle"in window&&window.getComputedStyle(e,null)||e.currentStyle;var a="@media "+t+"{ #matchmediajs-test { width: 1px; } }";return e.styleSheet?e.styleSheet.cssText=a:e.textContent=a,"1px"===i.width}:t.matchesMedia=function(t){if(""==t)return!0;var e,n,i,a,r={"min-width":null,"max-width":null},o=!1;for(i=t.split(/\s+and\s+/),e=0;er["max-width"]||null!==r["min-height"]&&cr["max-height"]?!1:!0},navigator.userAgent.match(/MSIE ([0-9]+)/)&&RegExp.$1<9&&(t.newStyle=function(t){var e=document.createElement("span");return e.innerHTML=' ",e})},initVars:function(){var e,n,i,a=navigator.userAgent;e="other",n=0,i=[["firefox",/Firefox\/([0-9\.]+)/],["bb",/BlackBerry.+Version\/([0-9\.]+)/],["bb",/BB[0-9]+.+Version\/([0-9\.]+)/],["opera",/OPR\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)/],["edge",/Edge\/([0-9\.]+)/],["safari",/Version\/([0-9\.]+).+Safari/],["chrome",/Chrome\/([0-9\.]+)/],["ie",/MSIE ([0-9]+)/],["ie",/Trident\/.+rv:([0-9]+)/]],t.iterate(i,function(t,i){return a.match(i[1])?(e=i[0],n=parseFloat(RegExp.$1),!1):void 0}),t.vars.browser=e,t.vars.browserVersion=n,e="other",n=0,i=[["ios",/([0-9_]+) like Mac OS X/,function(t){return t.replace("_",".").replace("_","")}],["ios",/CPU like Mac OS X/,function(t){return 0}],["wp",/Windows Phone ([0-9\.]+)/,null],["android",/Android ([0-9\.]+)/,null],["mac",/Macintosh.+Mac OS X ([0-9_]+)/,function(t){return t.replace("_",".").replace("_","")}],["windows",/Windows NT ([0-9\.]+)/,null],["bb",/BlackBerry.+Version\/([0-9\.]+)/,null],["bb",/BB[0-9]+.+Version\/([0-9\.]+)/,null]],t.iterate(i,function(t,i){return a.match(i[1])?(e=i[0],n=parseFloat(i[2]?i[2](RegExp.$1):RegExp.$1),!1):void 0}),t.vars.os=e,t.vars.osVersion=n,t.vars.IEVersion="ie"==t.vars.browser?t.vars.browserVersion:99,t.vars.touch="wp"==t.vars.os?navigator.msMaxTouchPoints>0:!!("ontouchstart"in window),t.vars.mobile="wp"==t.vars.os||"android"==t.vars.os||"ios"==t.vars.os||"bb"==t.vars.os}};return t.init(),t}();!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.skel=e()}(this,function(){return skel}); 3 | -------------------------------------------------------------------------------- /docs/assets/js/util.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | 3 | /** 4 | * Generate an indented list of links from a nav. Meant for use with panel(). 5 | * @return {jQuery} jQuery object. 6 | */ 7 | $.fn.navList = function() { 8 | 9 | var $this = $(this); 10 | $a = $this.find('a'), 11 | b = []; 12 | 13 | $a.each(function() { 14 | 15 | var $this = $(this), 16 | indent = Math.max(0, $this.parents('li').length - 1), 17 | href = $this.attr('href'), 18 | target = $this.attr('target'); 19 | 20 | b.push( 21 | '' + 26 | '' + 27 | $this.text() + 28 | '' 29 | ); 30 | 31 | }); 32 | 33 | return b.join(''); 34 | 35 | }; 36 | 37 | /** 38 | * Panel-ify an element. 39 | * @param {object} userConfig User config. 40 | * @return {jQuery} jQuery object. 41 | */ 42 | $.fn.panel = function(userConfig) { 43 | 44 | // No elements? 45 | if (this.length == 0) 46 | return $this; 47 | 48 | // Multiple elements? 49 | if (this.length > 1) { 50 | 51 | for (var i=0; i < this.length; i++) 52 | $(this[i]).panel(userConfig); 53 | 54 | return $this; 55 | 56 | } 57 | 58 | // Vars. 59 | var $this = $(this), 60 | $body = $('body'), 61 | $window = $(window), 62 | id = $this.attr('id'), 63 | config; 64 | 65 | // Config. 66 | config = $.extend({ 67 | 68 | // Delay. 69 | delay: 0, 70 | 71 | // Hide panel on link click. 72 | hideOnClick: false, 73 | 74 | // Hide panel on escape keypress. 75 | hideOnEscape: false, 76 | 77 | // Hide panel on swipe. 78 | hideOnSwipe: false, 79 | 80 | // Reset scroll position on hide. 81 | resetScroll: false, 82 | 83 | // Reset forms on hide. 84 | resetForms: false, 85 | 86 | // Side of viewport the panel will appear. 87 | side: null, 88 | 89 | // Target element for "class". 90 | target: $this, 91 | 92 | // Class to toggle. 93 | visibleClass: 'visible' 94 | 95 | }, userConfig); 96 | 97 | // Expand "target" if it's not a jQuery object already. 98 | if (typeof config.target != 'jQuery') 99 | config.target = $(config.target); 100 | 101 | // Panel. 102 | 103 | // Methods. 104 | $this._hide = function(event) { 105 | 106 | // Already hidden? Bail. 107 | if (!config.target.hasClass(config.visibleClass)) 108 | return; 109 | 110 | // If an event was provided, cancel it. 111 | if (event) { 112 | 113 | event.preventDefault(); 114 | event.stopPropagation(); 115 | 116 | } 117 | 118 | // Hide. 119 | config.target.removeClass(config.visibleClass); 120 | 121 | // Post-hide stuff. 122 | window.setTimeout(function() { 123 | 124 | // Reset scroll position. 125 | if (config.resetScroll) 126 | $this.scrollTop(0); 127 | 128 | // Reset forms. 129 | if (config.resetForms) 130 | $this.find('form').each(function() { 131 | this.reset(); 132 | }); 133 | 134 | }, config.delay); 135 | 136 | }; 137 | 138 | // Vendor fixes. 139 | $this 140 | .css('-ms-overflow-style', '-ms-autohiding-scrollbar') 141 | .css('-webkit-overflow-scrolling', 'touch'); 142 | 143 | // Hide on click. 144 | if (config.hideOnClick) { 145 | 146 | $this.find('a') 147 | .css('-webkit-tap-highlight-color', 'rgba(0,0,0,0)'); 148 | 149 | $this 150 | .on('click', 'a', function(event) { 151 | 152 | var $a = $(this), 153 | href = $a.attr('href'), 154 | target = $a.attr('target'); 155 | 156 | if (!href || href == '#' || href == '' || href == '#' + id) 157 | return; 158 | 159 | // Cancel original event. 160 | event.preventDefault(); 161 | event.stopPropagation(); 162 | 163 | // Hide panel. 164 | $this._hide(); 165 | 166 | // Redirect to href. 167 | window.setTimeout(function() { 168 | 169 | if (target == '_blank') 170 | window.open(href); 171 | else 172 | window.location.href = href; 173 | 174 | }, config.delay + 10); 175 | 176 | }); 177 | 178 | } 179 | 180 | // Event: Touch stuff. 181 | $this.on('touchstart', function(event) { 182 | 183 | $this.touchPosX = event.originalEvent.touches[0].pageX; 184 | $this.touchPosY = event.originalEvent.touches[0].pageY; 185 | 186 | }) 187 | 188 | $this.on('touchmove', function(event) { 189 | 190 | if ($this.touchPosX === null 191 | || $this.touchPosY === null) 192 | return; 193 | 194 | var diffX = $this.touchPosX - event.originalEvent.touches[0].pageX, 195 | diffY = $this.touchPosY - event.originalEvent.touches[0].pageY, 196 | th = $this.outerHeight(), 197 | ts = ($this.get(0).scrollHeight - $this.scrollTop()); 198 | 199 | // Hide on swipe? 200 | if (config.hideOnSwipe) { 201 | 202 | var result = false, 203 | boundary = 20, 204 | delta = 50; 205 | 206 | switch (config.side) { 207 | 208 | case 'left': 209 | result = (diffY < boundary && diffY > (-1 * boundary)) && (diffX > delta); 210 | break; 211 | 212 | case 'right': 213 | result = (diffY < boundary && diffY > (-1 * boundary)) && (diffX < (-1 * delta)); 214 | break; 215 | 216 | case 'top': 217 | result = (diffX < boundary && diffX > (-1 * boundary)) && (diffY > delta); 218 | break; 219 | 220 | case 'bottom': 221 | result = (diffX < boundary && diffX > (-1 * boundary)) && (diffY < (-1 * delta)); 222 | break; 223 | 224 | default: 225 | break; 226 | 227 | } 228 | 229 | if (result) { 230 | 231 | $this.touchPosX = null; 232 | $this.touchPosY = null; 233 | $this._hide(); 234 | 235 | return false; 236 | 237 | } 238 | 239 | } 240 | 241 | // Prevent vertical scrolling past the top or bottom. 242 | if (($this.scrollTop() < 0 && diffY < 0) 243 | || (ts > (th - 2) && ts < (th + 2) && diffY > 0)) { 244 | 245 | event.preventDefault(); 246 | event.stopPropagation(); 247 | 248 | } 249 | 250 | }); 251 | 252 | // Event: Prevent certain events inside the panel from bubbling. 253 | $this.on('click touchend touchstart touchmove', function(event) { 254 | event.stopPropagation(); 255 | }); 256 | 257 | // Event: Hide panel if a child anchor tag pointing to its ID is clicked. 258 | $this.on('click', 'a[href="#' + id + '"]', function(event) { 259 | 260 | event.preventDefault(); 261 | event.stopPropagation(); 262 | 263 | config.target.removeClass(config.visibleClass); 264 | 265 | }); 266 | 267 | // Body. 268 | 269 | // Event: Hide panel on body click/tap. 270 | $body.on('click touchend', function(event) { 271 | $this._hide(event); 272 | }); 273 | 274 | // Event: Toggle. 275 | $body.on('click', 'a[href="#' + id + '"]', function(event) { 276 | 277 | event.preventDefault(); 278 | event.stopPropagation(); 279 | 280 | config.target.toggleClass(config.visibleClass); 281 | 282 | }); 283 | 284 | // Window. 285 | 286 | // Event: Hide on ESC. 287 | if (config.hideOnEscape) 288 | $window.on('keydown', function(event) { 289 | 290 | if (event.keyCode == 27) 291 | $this._hide(event); 292 | 293 | }); 294 | 295 | return $this; 296 | 297 | }; 298 | 299 | /** 300 | * Apply "placeholder" attribute polyfill to one or more forms. 301 | * @return {jQuery} jQuery object. 302 | */ 303 | $.fn.placeholder = function() { 304 | 305 | // Browser natively supports placeholders? Bail. 306 | if (typeof (document.createElement('input')).placeholder != 'undefined') 307 | return $(this); 308 | 309 | // No elements? 310 | if (this.length == 0) 311 | return $this; 312 | 313 | // Multiple elements? 314 | if (this.length > 1) { 315 | 316 | for (var i=0; i < this.length; i++) 317 | $(this[i]).placeholder(); 318 | 319 | return $this; 320 | 321 | } 322 | 323 | // Vars. 324 | var $this = $(this); 325 | 326 | // Text, TextArea. 327 | $this.find('input[type=text],textarea') 328 | .each(function() { 329 | 330 | var i = $(this); 331 | 332 | if (i.val() == '' 333 | || i.val() == i.attr('placeholder')) 334 | i 335 | .addClass('polyfill-placeholder') 336 | .val(i.attr('placeholder')); 337 | 338 | }) 339 | .on('blur', function() { 340 | 341 | var i = $(this); 342 | 343 | if (i.attr('name').match(/-polyfill-field$/)) 344 | return; 345 | 346 | if (i.val() == '') 347 | i 348 | .addClass('polyfill-placeholder') 349 | .val(i.attr('placeholder')); 350 | 351 | }) 352 | .on('focus', function() { 353 | 354 | var i = $(this); 355 | 356 | if (i.attr('name').match(/-polyfill-field$/)) 357 | return; 358 | 359 | if (i.val() == i.attr('placeholder')) 360 | i 361 | .removeClass('polyfill-placeholder') 362 | .val(''); 363 | 364 | }); 365 | 366 | // Password. 367 | $this.find('input[type=password]') 368 | .each(function() { 369 | 370 | var i = $(this); 371 | var x = $( 372 | $('
') 373 | .append(i.clone()) 374 | .remove() 375 | .html() 376 | .replace(/type="password"/i, 'type="text"') 377 | .replace(/type=password/i, 'type=text') 378 | ); 379 | 380 | if (i.attr('id') != '') 381 | x.attr('id', i.attr('id') + '-polyfill-field'); 382 | 383 | if (i.attr('name') != '') 384 | x.attr('name', i.attr('name') + '-polyfill-field'); 385 | 386 | x.addClass('polyfill-placeholder') 387 | .val(x.attr('placeholder')).insertAfter(i); 388 | 389 | if (i.val() == '') 390 | i.hide(); 391 | else 392 | x.hide(); 393 | 394 | i 395 | .on('blur', function(event) { 396 | 397 | event.preventDefault(); 398 | 399 | var x = i.parent().find('input[name=' + i.attr('name') + '-polyfill-field]'); 400 | 401 | if (i.val() == '') { 402 | 403 | i.hide(); 404 | x.show(); 405 | 406 | } 407 | 408 | }); 409 | 410 | x 411 | .on('focus', function(event) { 412 | 413 | event.preventDefault(); 414 | 415 | var i = x.parent().find('input[name=' + x.attr('name').replace('-polyfill-field', '') + ']'); 416 | 417 | x.hide(); 418 | 419 | i 420 | .show() 421 | .focus(); 422 | 423 | }) 424 | .on('keypress', function(event) { 425 | 426 | event.preventDefault(); 427 | x.val(''); 428 | 429 | }); 430 | 431 | }); 432 | 433 | // Events. 434 | $this 435 | .on('submit', function() { 436 | 437 | $this.find('input[type=text],input[type=password],textarea') 438 | .each(function(event) { 439 | 440 | var i = $(this); 441 | 442 | if (i.attr('name').match(/-polyfill-field$/)) 443 | i.attr('name', ''); 444 | 445 | if (i.val() == i.attr('placeholder')) { 446 | 447 | i.removeClass('polyfill-placeholder'); 448 | i.val(''); 449 | 450 | } 451 | 452 | }); 453 | 454 | }) 455 | .on('reset', function(event) { 456 | 457 | event.preventDefault(); 458 | 459 | $this.find('select') 460 | .val($('option:first').val()); 461 | 462 | $this.find('input,textarea') 463 | .each(function() { 464 | 465 | var i = $(this), 466 | x; 467 | 468 | i.removeClass('polyfill-placeholder'); 469 | 470 | switch (this.type) { 471 | 472 | case 'submit': 473 | case 'reset': 474 | break; 475 | 476 | case 'password': 477 | i.val(i.attr('defaultValue')); 478 | 479 | x = i.parent().find('input[name=' + i.attr('name') + '-polyfill-field]'); 480 | 481 | if (i.val() == '') { 482 | i.hide(); 483 | x.show(); 484 | } 485 | else { 486 | i.show(); 487 | x.hide(); 488 | } 489 | 490 | break; 491 | 492 | case 'checkbox': 493 | case 'radio': 494 | i.attr('checked', i.attr('defaultValue')); 495 | break; 496 | 497 | case 'text': 498 | case 'textarea': 499 | i.val(i.attr('defaultValue')); 500 | 501 | if (i.val() == '') { 502 | i.addClass('polyfill-placeholder'); 503 | i.val(i.attr('placeholder')); 504 | } 505 | 506 | break; 507 | 508 | default: 509 | i.val(i.attr('defaultValue')); 510 | break; 511 | 512 | } 513 | }); 514 | 515 | }); 516 | 517 | return $this; 518 | 519 | }; 520 | 521 | /** 522 | * Moves elements to/from the first positions of their respective parents. 523 | * @param {jQuery} $elements Elements (or selector) to move. 524 | * @param {bool} condition If true, moves elements to the top. Otherwise, moves elements back to their original locations. 525 | */ 526 | $.prioritize = function($elements, condition) { 527 | 528 | var key = '__prioritize'; 529 | 530 | // Expand $elements if it's not already a jQuery object. 531 | if (typeof $elements != 'jQuery') 532 | $elements = $($elements); 533 | 534 | // Step through elements. 535 | $elements.each(function() { 536 | 537 | var $e = $(this), $p, 538 | $parent = $e.parent(); 539 | 540 | // No parent? Bail. 541 | if ($parent.length == 0) 542 | return; 543 | 544 | // Not moved? Move it. 545 | if (!$e.data(key)) { 546 | 547 | // Condition is false? Bail. 548 | if (!condition) 549 | return; 550 | 551 | // Get placeholder (which will serve as our point of reference for when this element needs to move back). 552 | $p = $e.prev(); 553 | 554 | // Couldn't find anything? Means this element's already at the top, so bail. 555 | if ($p.length == 0) 556 | return; 557 | 558 | // Move element to top of parent. 559 | $e.prependTo($parent); 560 | 561 | // Mark element as moved. 562 | $e.data(key, $p); 563 | 564 | } 565 | 566 | // Moved already? 567 | else { 568 | 569 | // Condition is true? Bail. 570 | if (condition) 571 | return; 572 | 573 | $p = $e.data(key); 574 | 575 | // Move element back to its original location (using our placeholder). 576 | $e.insertAfter($p); 577 | 578 | // Unmark element as moved. 579 | $e.removeData(key); 580 | 581 | } 582 | 583 | }); 584 | 585 | }; 586 | 587 | })(jQuery); -------------------------------------------------------------------------------- /docs/elements.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | Elements - Projection by TEMPLATED 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 28 | 29 | 30 |
31 |
32 |
33 |

Elements

34 |

Aliquam erat volutpat nam dui

35 |
36 | 37 | 38 |
39 |
40 |

What is Baseline?

41 |

Baseline is a simple boilerplate for creating new projects with Skel. It features clear, concise HTML5 and CSS3 code (built on Sass), responsiveness right out of the box, off-canvas navigation, an assortment of pre-styled elements, Font Awesome icons, and everything offered by Skel + Skel.scss. Baseline is MIT licensed.

42 |
43 |
44 |

Sed Feugiat

45 |

Erat ac non lorem justo amet primis dolor adipiscing lacinia accumsan felis sed dolor interdum ut. Amet accumsan magna etiam orci faucibus interdum et lorem ipsum et nullam.

46 |
47 |
48 |

Lorem Ipsum

49 |

Erat ac non lorem justo amet primis dolor adipiscing lacinia accumsan felis sed dolor interdum ut. Amet accumsan magna etiam orci faucibus interdum et lorem ipsum et nullam.

50 |
51 |
52 | 53 |
54 | 55 | 56 |

Sample Content

57 |

Praesent ac adipiscing ullamcorper semper ut amet ac risus. Lorem sapien ut odio odio nunc. Ac adipiscing nibh porttitor erat risus justo adipiscing adipiscing amet placerat accumsan. Vis. Faucibus odio magna tempus adipiscing a non. In mi primis arcu ut non accumsan vivamus ac blandit adipiscing adipiscing arcu metus praesent turpis eu ac lacinia nunc ac commodo gravida adipiscing eget accumsan ac nunc adipiscing adipiscing.

58 |
59 |
60 |

Sem turpis amet semper

61 |

Nunc lacinia ante nunc ac lobortis. Interdum adipiscing gravida odio porttitor sem non mi integer non faucibus ornare mi ut ante amet placerat aliquet. Volutpat commodo eu sed ante lacinia. Sapien a lorem in integer ornare praesent commodo adipiscing arcu in massa commodo lorem accumsan at odio massa ac ac. Semper adipiscing varius montes viverra nibh in adipiscing blandit tempus accumsan.

62 |
63 |
64 |

Magna odio tempus commodo

65 |

In arcu accumsan arcu adipiscing accumsan orci ac. Felis id enim aliquet. Accumsan ac integer lobortis commodo ornare aliquet accumsan erat tempus amet porttitor. Ante commodo blandit adipiscing integer semper orci eget. Faucibus commodo adipiscing mi eu nullam accumsan morbi arcu ornare odio mi adipiscing nascetur lacus ac interdum morbi accumsan vis mi accumsan ac praesent.

66 |
67 | 68 |
69 |

Interdum sapien gravida

70 |

Nunc lacinia ante nunc ac lobortis. Interdum adipiscing gravida odio porttitor sem non mi integer non faucibus ornare mi ut ante amet placerat aliquet. Volutpat eu sed ante lacinia sapien lorem accumsan varius montes viverra nibh in adipiscing blandit tempus accumsan.

71 |
72 |
73 |

Faucibus consequat lorem

74 |

Nunc lacinia ante nunc ac lobortis. Interdum adipiscing gravida odio porttitor sem non mi integer non faucibus ornare mi ut ante amet placerat aliquet. Volutpat eu sed ante lacinia sapien lorem accumsan varius montes viverra nibh in adipiscing blandit tempus accumsan.

75 |
76 |
77 |

Accumsan montes viverra

78 |

Nunc lacinia ante nunc ac lobortis. Interdum adipiscing gravida odio porttitor sem non mi integer non faucibus ornare mi ut ante amet placerat aliquet. Volutpat eu sed ante lacinia sapien lorem accumsan varius montes viverra nibh in adipiscing blandit tempus accumsan.

79 |
80 |
81 | 82 |
83 | 84 | 85 |

Elements

86 |
87 |
88 | 89 | 90 |

Text

91 |

This is bold and this is strong. This is italic and this is emphasized. 92 | This is superscript text and this is subscript text. 93 | This is underlined and this is code: for (;;) { ... }.

94 |
95 |

Heading Level 2

96 |

Heading Level 3

97 |

Heading Level 4

98 |
Heading Level 5
99 |
Heading Level 6
100 |
101 |
102 |

Heading with a Subtitle

103 |

Lorem ipsum dolor sit amet nullam id egestas urna aliquam

104 |
105 |

Nunc lacinia ante nunc ac lobortis. Interdum adipiscing gravida odio porttitor sem non mi integer non faucibus ornare mi ut ante amet placerat aliquet. Volutpat eu sed ante lacinia sapien lorem accumsan varius montes viverra nibh in adipiscing blandit tempus accumsan.

106 |
107 |

Heading with a Subtitle

108 |

Lorem ipsum dolor sit amet nullam id egestas urna aliquam

109 |
110 |

Nunc lacinia ante nunc ac lobortis. Interdum adipiscing gravida odio porttitor sem non mi integer non faucibus ornare mi ut ante amet placerat aliquet. Volutpat eu sed ante lacinia sapien lorem accumsan varius montes viverra nibh in adipiscing blandit tempus accumsan.

111 |
112 |

Heading with a Subtitle

113 |

Lorem ipsum dolor sit amet nullam id egestas urna aliquam

114 |
115 |

Nunc lacinia ante nunc ac lobortis. Interdum adipiscing gravida odio porttitor sem non mi integer non faucibus ornare mi ut ante amet placerat aliquet. Volutpat eu sed ante lacinia sapien lorem accumsan varius montes viverra nibh in adipiscing blandit tempus accumsan.

116 | 117 | 118 |

Lists

119 |
120 |
121 | 122 |

Unordered

123 |
    124 |
  • Dolor pulvinar etiam magna etiam.
  • 125 |
  • Sagittis adipiscing lorem eleifend.
  • 126 |
  • Felis enim feugiat dolore viverra.
  • 127 |
128 | 129 |

Alternate

130 |
    131 |
  • Dolor pulvinar etiam magna etiam.
  • 132 |
  • Sagittis adipiscing lorem eleifend.
  • 133 |
  • Felis enim feugiat dolore viverra.
  • 134 |
135 | 136 |
137 |
138 | 139 |

Ordered

140 |
    141 |
  1. Dolor pulvinar etiam magna etiam.
  2. 142 |
  3. Etiam vel felis at lorem sed viverra.
  4. 143 |
  5. Felis enim feugiat dolore viverra.
  6. 144 |
  7. Dolor pulvinar etiam magna etiam.
  8. 145 |
  9. Etiam vel felis at lorem sed viverra.
  10. 146 |
  11. Felis enim feugiat dolore viverra.
  12. 147 |
148 | 149 |

Icons

150 | 158 | 159 |
160 |
161 |

Definition

162 |
163 |
Item 1
164 |
165 |

Lorem ipsum dolor vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.

166 |
167 |
Item 2
168 |
169 |

Lorem ipsum dolor vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.

170 |
171 |
Item 3
172 |
173 |

Lorem ipsum dolor vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.

174 |
175 |
176 | 177 |

Actions

178 | 183 | 188 |
189 |
190 | 195 |
196 |
197 | 202 |
203 |
204 | 209 |
210 |
211 | 216 |
217 |
218 | 219 | 220 |

Blockquote

221 |
Fringilla nisl. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan faucibus. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis.
222 | 223 | 224 |

Table

225 | 226 |

Default

227 |
228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 |
NameDescriptionPrice
Item 1Ante turpis integer aliquet porttitor.29.99
Item 2Vis ac commodo adipiscing arcu aliquet.19.99
Item 3 Morbi faucibus arcu accumsan lorem.29.99
Item 4Vitae integer tempus condimentum.19.99
Item 5Ante turpis integer aliquet porttitor.29.99
100.00
270 |
271 | 272 |

Alternate

273 |
274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 |
NameDescriptionPrice
Item 1Ante turpis integer aliquet porttitor.29.99
Item 2Vis ac commodo adipiscing arcu aliquet.19.99
Item 3 Morbi faucibus arcu accumsan lorem.29.99
Item 4Vitae integer tempus condimentum.19.99
Item 5Ante turpis integer aliquet porttitor.29.99
100.00
316 |
317 | 318 |
319 |
320 | 321 | 322 |

Buttons

323 | 328 | 333 | 338 | 343 | 348 |
    349 |
  • Special
  • 350 |
  • Default
  • 351 |
  • Alternate
  • 352 |
353 | 354 | 355 |

Form

356 | 357 |
358 |
359 |
360 | 361 |
362 |
363 | 364 |
365 | 366 |
367 |
368 | 375 |
376 |
377 | 378 |
379 | 380 | 381 |
382 |
383 | 384 | 385 |
386 |
387 | 388 | 389 |
390 | 391 |
392 | 393 | 394 |
395 |
396 | 397 | 398 |
399 | 400 |
401 | 402 |
403 | 404 |
405 |
    406 |
  • 407 |
  • 408 |
409 |
410 |
411 |
412 | 413 |
414 | 415 |
416 |
417 |
418 | 419 |
420 |
421 | 422 |
423 |
424 |
425 | 426 | 427 |

Image

428 | 429 |

Fit

430 | 431 |
432 |
433 |
434 |
435 |
436 | 437 |
438 |
439 |
440 | 441 |
442 |
443 |
444 |
445 |
446 | 447 |

Left & Right

448 |

Lorem ipsum dolor sit accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Vestibulum ante ipsum primis in faucibus magna blandit adipiscing eu felis iaculis volutpat lorem ipsum dolor sit amet dolor consequat.

449 |

Lorem ipsum dolor sit accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Vestibulum ante ipsum primis in faucibus magna blandit adipiscing eu felis iaculis volutpat lorem ipsum dolor sit amet dolor consequat.

450 | 451 | 452 |

Box

453 |
454 |

Felis sagittis eget tempus primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Magna sed etiam ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus lorem ipsum dolor sit amet nullam.

455 |
456 | 457 | 458 |

Preformatted

459 |
i = 0;
460 | 
461 | while (!deck.isInOrder()) {
462 |     print 'Iteration ' + i;
463 |     deck.shuffle();
464 |     i++;
465 | }
466 | 
467 | print 'It took ' + i + ' iterations to sort the deck.';
468 | 
469 | 470 |
471 |
472 | 473 |
474 | 475 |
476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | -------------------------------------------------------------------------------- /docs/images/ANWI_BHUSA_2018.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anwi-wips/anwi/94a184edd00081d9c9a23d8f8e3a29f7ad45cfb1/docs/images/ANWI_BHUSA_2018.pdf -------------------------------------------------------------------------------- /docs/images/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anwi-wips/anwi/94a184edd00081d9c9a23d8f8e3a29f7ad45cfb1/docs/images/banner.jpg -------------------------------------------------------------------------------- /docs/images/pic01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anwi-wips/anwi/94a184edd00081d9c9a23d8f8e3a29f7ad45cfb1/docs/images/pic01.jpg -------------------------------------------------------------------------------- /docs/images/pic02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anwi-wips/anwi/94a184edd00081d9c9a23d8f8e3a29f7ad45cfb1/docs/images/pic02.jpg -------------------------------------------------------------------------------- /docs/images/rishikesh_bhide.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anwi-wips/anwi/94a184edd00081d9c9a23d8f8e3a29f7ad45cfb1/docs/images/rishikesh_bhide.jpeg -------------------------------------------------------------------------------- /docs/images/sanket_karpe.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anwi-wips/anwi/94a184edd00081d9c9a23d8f8e3a29f7ad45cfb1/docs/images/sanket_karpe.jpeg -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | ANWI 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 24 | 25 | 26 | 27 | 37 | 38 | 39 | 73 | 74 | 75 | 76 |
77 |
78 |
79 |
80 |
81 | Pic 01 82 |
83 |
84 |

Sanket Karpe
Lead Malware Researcher

85 |
86 |

Sanket Karpe is a security researcher with experience on 87 |
malware analysis and incident response. He is currently 88 |
working as a Lead Malware Research Engineer at Qualys Inc 89 |
where his primary responsibilities include malware analysis, 90 |
creating new malware detection techniques and tools development. 91 |
In his free time he likes to create Home Automations 92 |
using Arduino and Raspberry Pi.

93 | 96 |
97 |
98 |
99 | Pic 02 100 |
101 |
102 |

Rishikesh Bhide
Senior Software Engineer

103 |
104 |

Rishikesh Bhide is Senior Developer at Qualys with experience 105 |
in developing Firewall and Anti-Malware technologies. His current 106 |
responsibility at Qualys includes designing and developing frameworks 107 |
for behavior based malware detection. He is a part time ethical hacker 108 |
and has done several responsible disclosures. He also works on IoT 109 |
hobby projects using ESP & Raspberry Pi.

110 | 113 |
114 |
115 |
116 |
117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /lib/alerts/alerts.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "alerts.h" 6 | #include <..\global_vars.h> 7 | #include "config.h" 8 | #include "packet_capture.h" 9 | 10 | #define NRF_CHANNEL 8 11 | 12 | #define NRF24_HEARTBEAT 1 13 | #define WIFI_HEARTBEAT 2 14 | 15 | bool is_first_alert_sent = false; 16 | 17 | // 4,15 for NodeMCU 18 | // 7,8 for Arduino 19 | RF24 radio(4,15); 20 | RF24Network network(radio); 21 | 22 | const uint16_t this_node_address = 01; // Address of this node 23 | const uint16_t server_node_address = 00; // Address of the server node 24 | 25 | const unsigned long interval = 20; 26 | 27 | unsigned long last_sent; 28 | unsigned long packets_sent; 29 | 30 | uint16_t heartbeat_type = 1; 31 | 32 | void radio_update() 33 | { 34 | network.update(); 35 | } 36 | 37 | void init_radio() 38 | { 39 | SPI.begin(); 40 | radio.begin(); 41 | radio.setPALevel(RF24_PA_LOW); 42 | network.begin(NRF_CHANNEL, this_node_address); 43 | } 44 | 45 | void alert_nrf() 46 | { 47 | Serial.println("Sending RADIO Alert "); 48 | char data[256]; 49 | char bssid_mac[18],dest_address[18],src_address[18]; 50 | StaticJsonBuffer<256> jsonBuffer; 51 | JsonObject& root = jsonBuffer.createObject(); 52 | if(DEBUG_PRINT) 53 | { 54 | Serial.println("Sending RADIO Alert "); 55 | } 56 | 57 | root["id"] = sensor_config.id; 58 | 59 | //root["sensor_location"] = sensor_config.sensor_location; 60 | 61 | sprintf(bssid_mac,MACSTR , MAC2STR(pkt_info.frame_hdr.bssid_address)); 62 | 63 | // root["bssid_mac"] = bssid_mac; 64 | root["rssi"] = pkt_info.rssi; 65 | root["attack_type"] = pkt_info.attack_type; 66 | root["channel"] =pkt_info.channel; 67 | sprintf(dest_address,MACSTR , MAC2STR(pkt_info.frame_hdr.destination_address)); 68 | //root["destination_address"] = dest_address; 69 | sprintf(src_address,MACSTR , MAC2STR(pkt_info.frame_hdr.source_address)); 70 | //root["source_address"] = src_address; 71 | root["sensor_location"] = "CORE"; 72 | 73 | if(pkt_info.attack_type == IS_EVILTWIN_ATTACK) 74 | { 75 | root["bssid_mac"] = bssid_mac; 76 | root["attackers_mac"] = src_address; 77 | root["victims_mac"] = bssid_mac; 78 | root["deauth_reason"] = 4; 79 | } 80 | 81 | if(pkt_info.attack_type == IS_DEAUTH_ATTACK) 82 | { 83 | root["bssid_mac"] = bssid_mac; 84 | root["attackers_mac"] = "NA"; 85 | root["victims_mac"] = bssid_mac; 86 | root["deauth_reason"] = pkt_info.frame_hdr.deauth.reason_code; 87 | } 88 | 89 | if(pkt_info.attack_type == IS_GEOFENCE_ATTACK) 90 | { 91 | root["bssid_mac"] = bssid_mac; 92 | root["attackers_mac"] = src_address; 93 | root["victims_mac"] = dest_address; 94 | root["deauth_reason"] = 4; 95 | } 96 | 97 | 98 | size_t n = root.printTo(data, sizeof(data)); 99 | RF24NetworkHeader header(server_node_address); 100 | bool msg_status = network.write(header,data,n); 101 | Serial.println(data); 102 | if(DEBUG_PRINT) 103 | { 104 | if (msg_status) 105 | { 106 | Serial.println("Alert Sent using nRF24 successfully"); 107 | } 108 | else 109 | { 110 | Serial.println("Alert sending nRF24 failed"); 111 | } 112 | Serial.println("Alert Sent"); 113 | } 114 | } 115 | 116 | void connect_Wifi() 117 | { 118 | delay(10); 119 | yield(); 120 | WiFi.mode(WIFI_STA); 121 | if(DEBUG_PRINT) 122 | { 123 | Serial.print("Connecting to : "); 124 | Serial.println(sensor_config.connect_ap_info.SSID); 125 | } 126 | WiFi.begin(sensor_config.connect_ap_info.SSID, sensor_config.connect_ap_info.PASSWORD); 127 | while (WiFi.status() != WL_CONNECTED) 128 | { 129 | delay(1000); 130 | Serial.print("."); 131 | } 132 | if(DEBUG_PRINT) 133 | { 134 | Serial.println("WiFi connected"); 135 | Serial.print("IP address: "); 136 | Serial.println(WiFi.localIP()); 137 | } 138 | } 139 | 140 | void alert_ifttt() 141 | { 142 | connect_Wifi(); 143 | HTTPClient http; 144 | if(DEBUG_PRINT) Serial.println("Sending alert to IFTTT"); 145 | //https://bblanchon.github.io/ArduinoJson/example/generator/ 146 | 147 | StaticJsonBuffer<200> jsonBuffer; 148 | JsonObject& root = jsonBuffer.createObject(); 149 | root["value1"] = pkt_info.frame_hdr.bssid_address; 150 | root["value2"] = pkt_info.rssi; 151 | 152 | char data[256]; 153 | size_t n = root.printTo(data, sizeof(data)); 154 | String ifttt_triggerName=""; 155 | String alert_url = ""; 156 | switch(pkt_info.attack_type) 157 | { 158 | case IS_EVILTWIN_ATTACK: 159 | ifttt_triggerName=sensor_config.ifttt_info.ifttt_eventName_eviltwin; 160 | break; 161 | case IS_DEAUTH_ATTACK: 162 | ifttt_triggerName=sensor_config.ifttt_info.ifttt_eventName_deauth; 163 | break; 164 | case IS_GEOFENCE_ATTACK: 165 | ifttt_triggerName=sensor_config.ifttt_info.ifttt_eventName_geofence; 166 | break; 167 | } 168 | alert_url = IFTTT_ALERT_URL+ ifttt_triggerName+"/with/key/"+sensor_config.ifttt_info.ifttt_key; 169 | if(DEBUG_PRINT) 170 | { 171 | Serial.println(alert_url); 172 | } 173 | http.begin(alert_url); 174 | http.addHeader("Content-Type", "application/json"); 175 | http.POST(data); 176 | http.end(); 177 | } 178 | 179 | void alert_server() 180 | { 181 | connect_Wifi(); 182 | HTTPClient http; 183 | //https://bblanchon.github.io/ArduinoJson/example/generator/ 184 | StaticJsonBuffer<200> jsonBuffer; 185 | JsonObject& root = jsonBuffer.createObject(); 186 | if(DEBUG_PRINT) 187 | { 188 | Serial.println("Sending Alert to server"); 189 | } 190 | 191 | char bssid_mac[18],dest_address[18],src_address[18]; 192 | root["id"] = sensor_config.id; 193 | root["sensor_location"] = sensor_config.sensor_location; 194 | 195 | sprintf(bssid_mac,MACSTR , MAC2STR(pkt_info.frame_hdr.bssid_address)); 196 | root["bssid_mac"] = bssid_mac; 197 | root["rssi"] = pkt_info.rssi; 198 | root["attack_type"] = pkt_info.attack_type; 199 | root["channel"] =pkt_info.channel; 200 | sprintf(dest_address,MACSTR , MAC2STR(pkt_info.frame_hdr.destination_address)); 201 | root["destination_address"] = dest_address; 202 | sprintf(src_address,MACSTR , MAC2STR(pkt_info.frame_hdr.source_address)); 203 | root["source_address"] = src_address; 204 | 205 | if(pkt_info.attack_type == IS_EVILTWIN_ATTACK){ 206 | root["sensor_location"] = "CORE"; 207 | root["attackers_mac"] = src_address; 208 | root["victims_mac"] = bssid_mac; 209 | } 210 | 211 | if(pkt_info.attack_type == IS_DEAUTH_ATTACK) 212 | { 213 | root["sensor_location"] = "CORE"; 214 | root["attackers_mac"] = "NA"; 215 | root["victims_mac"] = bssid_mac; 216 | root["deauth_reason"] = pkt_info.frame_hdr.deauth.reason_code; 217 | } 218 | 219 | if(pkt_info.attack_type == IS_GEOFENCE_ATTACK){ 220 | root["sensor_location"] = "NORTH"; 221 | root["attackers_mac"] = src_address; 222 | root["victims_mac"] = bssid_mac; 223 | } 224 | 225 | char data[256]; 226 | size_t n = root.printTo(data, sizeof(data)); 227 | String server_ip(sensor_config.alert_server_info.server_ip); 228 | 229 | 230 | String alert_url = ""; 231 | alert_url = "http://"+server_ip + ":1880/AttackDetected"; 232 | if(DEBUG_PRINT) 233 | { 234 | Serial.println(alert_url); 235 | } 236 | http.begin(alert_url); 237 | http.addHeader("Content-Type", "application/json"); 238 | http.POST(data); 239 | http.end(); 240 | } 241 | 242 | void heartbeat() 243 | { 244 | 245 | heartbeatTimecurr = millis(); 246 | if(heartbeatTimecurr - heartbeatTimeprev >= HEARTBEAT_FREQ) 247 | { 248 | if(DEBUG_PRINT) 249 | { 250 | Serial.println("Sending Heartbeat"); 251 | } 252 | 253 | if(heartbeat_type == WIFI_HEARTBEAT) // 2 254 | { 255 | wifi_promiscuous_enable(DISABLE); 256 | connect_Wifi(); 257 | HTTPClient http; 258 | StaticJsonBuffer<32> jsonBuffer; 259 | JsonObject& root = jsonBuffer.createObject(); 260 | root["id"] = sensor_config.id; 261 | char data[32]; 262 | size_t n = root.printTo(data, sizeof(data)); 263 | String server_ip(sensor_config.alert_server_info.server_ip); 264 | String heartbeat_url = ""; 265 | heartbeat_url = "http://"+server_ip + ":1880/HeartBeatDetected"; 266 | if(DEBUG_PRINT) 267 | { 268 | Serial.println(heartbeat_url); 269 | } 270 | http.begin(heartbeat_url); 271 | http.addHeader("Content-Type", "application/json"); 272 | http.POST(data); 273 | http.end(); 274 | heartbeatTimeprev = heartbeatTimecurr; 275 | if(DEBUG_PRINT) 276 | { 277 | Serial.println("HeartBeatSent"); 278 | Serial.println("Re-enabling protection mode"); 279 | } 280 | init_sniffing(); 281 | } 282 | else // 1 283 | { 284 | StaticJsonBuffer<32> jsonBuffer; 285 | JsonObject& root = jsonBuffer.createObject(); 286 | root["id"] = sensor_config.id; 287 | char data[32]; 288 | size_t n = root.printTo(data, sizeof(data)); 289 | RF24NetworkHeader header(server_node_address); 290 | bool msg_status = network.write(header,data,n); 291 | if (DEBUG_PRINT) 292 | { 293 | if (msg_status) 294 | { 295 | Serial.println("HeartBeat Sent successfully"); 296 | } 297 | else 298 | { 299 | Serial.println("HeartBeat sending failed"); 300 | } 301 | } 302 | heartbeatTimeprev = heartbeatTimecurr; 303 | } 304 | } 305 | } 306 | 307 | void send_alert() 308 | { 309 | alertTimecurr = millis(); 310 | if ( alertTimecurr - alertTimeprev >= ALERT_FREQ) // || !is_first_alert_sent) 311 | { 312 | wifi_promiscuous_enable(DISABLE); 313 | if(DEBUG_PRINT) 314 | { 315 | Serial.println("Sending Alert"); 316 | } 317 | 318 | switch(sensor_config.alert_mode) 319 | { 320 | case ALERT_STANDALONE: 321 | // wifi_promiscuous_enable(DISABLE); 322 | alert_ifttt(); 323 | 324 | break; 325 | case ALERT_WIFI_SERVER: 326 | //wifi_promiscuous_enable(DISABLE); 327 | alert_server(); 328 | break; 329 | case ALERT_NRF: 330 | alert_nrf(); 331 | break; 332 | } 333 | if(DEBUG_PRINT) 334 | { 335 | if (sensor_config.operation_mode == OPERATION_DETECTION_MODE ) 336 | { 337 | Serial.println("Re-enabling detection mode"); 338 | } 339 | else 340 | { 341 | Serial.println("Re-enabling protection mode"); 342 | } 343 | } 344 | is_first_alert_sent = true; 345 | alertTimeprev = alertTimecurr; 346 | if (sensor_config.operation_mode == OPERATION_DETECTION_MODE ) 347 | { 348 | init_sniffing(); 349 | 350 | } 351 | } 352 | } 353 | -------------------------------------------------------------------------------- /lib/alerts/alerts.h: -------------------------------------------------------------------------------- 1 | #ifndef _ALERTS_H_ 2 | #define _ALERTS_H_ 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | void init_radio(); 9 | void radio_update(); 10 | void send_alert(); 11 | void heartbeat(); 12 | void alert_nrf(); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /lib/config/config.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "config.h" 6 | #include <..\global_vars.h> 7 | 8 | struct sensor_config_info sensor_config; 9 | 10 | ESP8266WebServer server(80); 11 | 12 | 13 | uint8_t curr_channel = 0; 14 | uint8_t set_channel = INIT_CHANNEL; 15 | uint16_t deauth_pkt_counter = 0; 16 | uint8_t cntr = 0; 17 | 18 | unsigned long prevTime = 0; 19 | unsigned long curTime = 0; 20 | 21 | bool isWebConfig = false; 22 | String tmp_str = ""; 23 | unsigned long alertTimecurr = 0; 24 | unsigned long alertTimeprev = 0; 25 | 26 | 27 | unsigned long heartbeatTimecurr = 0; 28 | unsigned long heartbeatTimeprev = 0; 29 | 30 | int curChannel = INIT_CHANNEL; 31 | 32 | bool is_deauth_or_disassoc_attack = false; 33 | bool is_evil_twin_attack = false; 34 | bool manual_config = false; 35 | bool isConfigured = false; 36 | 37 | 38 | int config_ROM_Address = 0; //ROM address where Config will be stored from 39 | 40 | void clear_configuration() 41 | { 42 | EEPROM.begin(1024); 43 | 44 | for(int i = 0; i < 1024;i++) 45 | { 46 | EEPROM.put(i, 0); 47 | } 48 | EEPROM.commit(); 49 | EEPROM.end(); 50 | 51 | } 52 | 53 | void save_config_settings() 54 | { 55 | EEPROM.begin(1024); 56 | EEPROM.put(config_ROM_Address, sensor_config); 57 | EEPROM.commit(); 58 | EEPROM.end(); 59 | } 60 | 61 | void get_config_settings() 62 | { 63 | EEPROM.begin(1024); 64 | EEPROM.get(config_ROM_Address,sensor_config); 65 | EEPROM.end(); 66 | } 67 | 68 | uint8_t get_configuration_status() 69 | { 70 | get_config_settings(); 71 | return sensor_config.isConfigured; 72 | } 73 | 74 | 75 | void print_config() 76 | { 77 | Serial.print("Sensor ID : "); 78 | Serial.println(sensor_config.id); 79 | 80 | Serial.print("Sensor Location : "); 81 | switch(sensor_config.sensor_location) 82 | { 83 | case NORTH: 84 | Serial.println("NORTH"); 85 | break; 86 | case SOUTH: 87 | Serial.println("SOUTH"); 88 | break; 89 | case WEST: 90 | Serial.println("WEST"); 91 | break; 92 | case EAST: 93 | Serial.println("EAST"); 94 | break; 95 | } 96 | 97 | Serial.print("SSID To Protect : "); 98 | Serial.println(sensor_config.protect_ap_info.SSID); 99 | Serial.print("BSSID To Protect : "); 100 | Serial.println(sensor_config.protect_ap_info.BSSID_lower); 101 | 102 | Serial.print("Connection SSID : "); 103 | Serial.println(sensor_config.connect_ap_info.SSID); 104 | Serial.print("Operation Mode : "); 105 | if(sensor_config.operation_mode == OPERATION_DETECTION_MODE) 106 | { 107 | Serial.println("Detection Mode"); 108 | } 109 | else if(sensor_config.operation_mode == OPERATION_PROTECTION_MODE) 110 | { 111 | Serial.println("Protection Mode"); 112 | } 113 | 114 | Serial.print("Alert Mode : "); 115 | switch(sensor_config.alert_mode) 116 | { 117 | case ALERT_STANDALONE : 118 | Serial.println("StandAlone Mode"); 119 | Serial.print("IFTTT KEY : "); 120 | Serial.println(sensor_config.ifttt_info.ifttt_key); 121 | if(sensor_config.operation_mode == OPERATION_DETECTION_MODE) 122 | { 123 | Serial.print("IFTTT Deauthentication Event Name : "); 124 | Serial.println(sensor_config.ifttt_info.ifttt_eventName_deauth); 125 | Serial.print("IFTTT Evil Twin Event Name : "); 126 | Serial.println(sensor_config.ifttt_info.ifttt_eventName_eviltwin); 127 | } 128 | else if(sensor_config.operation_mode == OPERATION_PROTECTION_MODE) 129 | { 130 | Serial.print("IFTTT GeoFencing Event Name : "); 131 | Serial.println(sensor_config.ifttt_info.ifttt_eventName_geofence); 132 | } 133 | 134 | break; 135 | 136 | case ALERT_WIFI_SERVER: 137 | Serial.println("Wifi Server Alert Mode"); 138 | Serial.print("Server IP : "); 139 | Serial.println(sensor_config.alert_server_info.server_ip); 140 | break; 141 | 142 | case ALERT_NRF: 143 | Serial.println("Standalone Radio Mode"); 144 | break; 145 | } 146 | } 147 | 148 | String get_string_input(String msg,uint8_t min_len,uint8_t max_len) 149 | { 150 | bool input_provided = false; 151 | String reply = ""; 152 | Serial.print(msg); 153 | while(!input_provided) 154 | { 155 | reply = Serial.readStringUntil('\0'); 156 | if ( min_len == max_len && reply.length() == min_len) 157 | { 158 | input_provided = true; 159 | } 160 | if(reply.length() >= min_len && reply.length() <= max_len ) 161 | input_provided = true; 162 | } 163 | Serial.println(reply); 164 | return reply; 165 | } 166 | 167 | uint8_t get_int_input(String msg,uint8_t min_val,uint8_t max_val) 168 | { 169 | bool input_provided = false; 170 | String reply = ""; 171 | uint8_t reply_int = 0; 172 | Serial.print(msg); 173 | while(!input_provided) 174 | { 175 | reply = Serial.readStringUntil('\0'); 176 | reply_int = reply.toInt(); 177 | if(reply_int > min_val && reply_int < max_val ) 178 | input_provided = true; 179 | } 180 | Serial.println(reply_int); 181 | return reply_int; 182 | } 183 | 184 | 185 | void config_sensor_json() 186 | { 187 | //const char * tmpchar; 188 | DynamicJsonBuffer jsonBuffer(1024); 189 | 190 | if (Serial.available()) 191 | { 192 | JsonObject& root = jsonBuffer.parseObject(Serial); 193 | 194 | tmp_str = root.get("id"); 195 | sensor_config.id = tmp_str.toInt(); 196 | 197 | tmp_str = root.get("sensor_location"); 198 | sensor_config.sensor_location = tmp_str.toInt(); 199 | 200 | tmp_str = root.get("protect_SSID"); 201 | tmp_str.toCharArray(sensor_config.protect_ap_info.SSID,tmp_str.length() + 1); 202 | 203 | tmp_str = root.get("protect_BSSID"); 204 | tmp_str.toLowerCase(); 205 | tmp_str.toCharArray(sensor_config.protect_ap_info.BSSID_lower,tmp_str.length() + 1); 206 | tmp_str.toUpperCase(); 207 | tmp_str.toCharArray(sensor_config.protect_ap_info.BSSID_upper,tmp_str.length() + 1); 208 | 209 | 210 | tmp_str = root.get("connect_SSID"); 211 | tmp_str.toCharArray(sensor_config.connect_ap_info.SSID,tmp_str.length() + 1); 212 | 213 | tmp_str = root.get("connect_PASSWORD"); 214 | tmp_str.toCharArray(sensor_config.connect_ap_info.PASSWORD,tmp_str.length() + 1); 215 | 216 | tmp_str = root.get("op_mode"); 217 | sensor_config.operation_mode = tmp_str.toInt(); 218 | tmp_str = root.get("Alert_Mode"); 219 | 220 | switch (tmp_str.toInt()) 221 | { 222 | case 1: // Alert_Mode-IFTTT 223 | tmp_str = root.get("ifttt_key"); 224 | tmp_str.toCharArray(sensor_config.ifttt_info.ifttt_key,tmp_str.length() + 1); 225 | if(sensor_config.operation_mode == OPERATION_DETECTION_MODE) 226 | { 227 | tmp_str = root.get("ifttt_eventName_eviltwin"); 228 | tmp_str.toCharArray(sensor_config.ifttt_info.ifttt_eventName_eviltwin,tmp_str.length() + 1); 229 | 230 | tmp_str = root.get("ifttt_eventName_deauth"); 231 | tmp_str.toCharArray(sensor_config.ifttt_info.ifttt_eventName_deauth,tmp_str.length() + 1); 232 | } 233 | else if(sensor_config.operation_mode == OPERATION_PROTECTION_MODE) 234 | { 235 | tmp_str = root.get("ifttt_eventName_geofence"); 236 | tmp_str.toCharArray(sensor_config.ifttt_info.ifttt_eventName_geofence,tmp_str.length() + 1); 237 | } 238 | sensor_config.alert_mode = ALERT_STANDALONE; 239 | break; 240 | case 2: //Alert_Mode-SERVER 241 | tmp_str = root.get("server_ip"); 242 | tmp_str.toCharArray(sensor_config.alert_server_info.server_ip,tmp_str.length() + 1); 243 | sensor_config.alert_mode = ALERT_WIFI_SERVER; 244 | break; 245 | case 3: 246 | sensor_config.alert_mode = ALERT_NRF; 247 | break; 248 | 249 | } 250 | sensor_config.isConfigured = 1; 251 | save_config_settings(); 252 | print_config(); 253 | 254 | } 255 | 256 | } 257 | 258 | void config_sensor_manually() 259 | { 260 | String reply = ""; 261 | bool ssid_len_in_limit = false; 262 | bool bssid_len_in_limit = false; 263 | bool confirm_setting = false; 264 | uint8_t cho = -1; 265 | uint8_t alert_mode = 0, operation_mode = 0; 266 | bool id_set = false; 267 | bool alert_mode_set = false; 268 | bool alert_nrf_mode_selected = false; 269 | bool alert_standalone_mode_set = false; 270 | bool alert_server_mode_set = false; 271 | bool ifttt_key_set = false; 272 | bool ifttt_event_set = false; 273 | bool server_ip_set = false; 274 | bool operation_mode_detection_set = false; 275 | bool operation_mode_protection_set = false; 276 | 277 | while(!confirm_setting) 278 | { 279 | String msg = "Enter ID for Sensor [XX] : "; 280 | sensor_config.id = get_int_input(msg,0,100); 281 | msg = "Enter SSID of Access Point to Protect (MAX 32 Len ): "; 282 | 283 | tmp_str = get_string_input(msg,1,MAX_SSID_LEN); 284 | tmp_str.toCharArray(sensor_config.protect_ap_info.SSID,tmp_str.length()-1); 285 | 286 | msg = "Enter BSSID ( MAC ) of Access Point to protect ( eg 00:11:22:33:44:55) : "; 287 | tmp_str = get_string_input(msg,MAC_LEN_FMT+1,MAC_LEN_FMT+1); 288 | 289 | // Temp 290 | tmp_str.toLowerCase(); 291 | tmp_str.toCharArray(sensor_config.protect_ap_info.BSSID_lower,tmp_str.length() -1 ); 292 | tmp_str.toUpperCase(); 293 | tmp_str.toCharArray(sensor_config.protect_ap_info.BSSID_upper,tmp_str.length() -1 ); 294 | 295 | // Type of WiFi network to protect 296 | msg = "Enter Type Of Wifi Network To Protect OPEN/ENCRYPTED : "; 297 | tmp_str = get_string_input(msg,4,MAX_NETWORK_TYPE_LEN); 298 | tmp_str.toCharArray(sensor_config.protect_ap_info.NETWORK_type,tmp_str.length()-1); 299 | 300 | msg = "Enter WIFI SSID : "; 301 | tmp_str = get_string_input(msg,1,MAX_SSID_LEN); 302 | tmp_str.toCharArray(sensor_config.connect_ap_info.SSID,tmp_str.length()-1); 303 | 304 | msg = "Enter WIFI PASSWD : "; 305 | tmp_str = get_string_input(msg,1,MAX_SSID_LEN); 306 | tmp_str.toCharArray(sensor_config.connect_ap_info.PASSWORD,tmp_str.length()-1); 307 | 308 | 309 | while(!alert_mode_set) 310 | { 311 | msg = "Select ANWI operation mode \n 1) Detection Mode \n 2) Protection Mode"; 312 | operation_mode = get_int_input(msg,0,3); 313 | sensor_config.operation_mode = operation_mode; 314 | 315 | msg = "Select sensor alert mode \n 1) Standalone Mode (IFTTT) \n 2) Wifi Server Mode \n 3) Standalone Radio Mode"; 316 | alert_mode = get_int_input(msg,0,4); 317 | 318 | switch (alert_mode) 319 | { 320 | case 1: 321 | msg= "Enter IFTTT key : "; 322 | tmp_str = get_string_input(msg,1,100); 323 | tmp_str.toCharArray(sensor_config.ifttt_info.ifttt_key,tmp_str.length()-1); 324 | 325 | if(operation_mode == OPERATION_DETECTION_MODE) //DETECTION_MODE 326 | { 327 | msg = "Enter IFTTT event name for Evil Twin: "; 328 | tmp_str = get_string_input(msg,1,100); 329 | tmp_str.toCharArray(sensor_config.ifttt_info.ifttt_eventName_eviltwin,tmp_str.length()-1); 330 | 331 | msg = "Enter IFTTT event name for Deauthentication : "; 332 | tmp_str = get_string_input(msg,1,100); 333 | tmp_str.toCharArray(sensor_config.ifttt_info.ifttt_eventName_deauth,tmp_str.length()-1); 334 | } 335 | else if(operation_mode == OPERATION_PROTECTION_MODE) //PROTECTION_MODE 336 | { 337 | msg = "Enter IFTTT event name for GeoFencing : "; 338 | tmp_str = get_string_input(msg,1,100); 339 | tmp_str.toCharArray(sensor_config.ifttt_info.ifttt_eventName_geofence,tmp_str.length()-1); 340 | } 341 | 342 | sensor_config.alert_mode = ALERT_STANDALONE; 343 | alert_mode_set = true; 344 | break; 345 | 346 | case 2: 347 | msg = "Enter Alert Server IP : "; 348 | tmp_str = get_string_input(msg,7,17); 349 | tmp_str.toCharArray(sensor_config.alert_server_info.server_ip,tmp_str.length()-1); 350 | sensor_config.alert_mode = ALERT_WIFI_SERVER; 351 | alert_mode_set = true; 352 | break; 353 | 354 | case 3: 355 | msg = "Separate Radio mode selected"; 356 | sensor_config.alert_mode = ALERT_NRF; 357 | alert_mode_set = true; 358 | break; 359 | } 360 | } 361 | 362 | print_config(); 363 | msg = " Do you want to save Yes[1], No[0] : "; 364 | cho = get_int_input(msg,0,3); 365 | if( cho == 1) 366 | { 367 | sensor_config.isConfigured = 1; 368 | save_config_settings(); 369 | if(DEBUG_PRINT) 370 | { 371 | Serial.println("Settings Saved"); 372 | get_config_settings(); 373 | Serial.println("Saved setttings from ROM :"); 374 | print_config(); 375 | } 376 | confirm_setting = true; 377 | ESP.restart(); 378 | break; 379 | } 380 | } 381 | } 382 | 383 | void save_settings() 384 | { 385 | 386 | uint8_t alert_mode = 1, operation_mode = 1; 387 | 388 | tmp_str = server.arg("id"); 389 | sensor_config.id = tmp_str.toInt(); 390 | 391 | //tmp_str = server.arg("sensor_location"); 392 | //sensor_config.sensor_location = tmp_str.toInt(); 393 | 394 | tmp_str = server.arg("protect_SSID"); 395 | tmp_str.toCharArray(sensor_config.protect_ap_info.SSID,tmp_str.length() + 1); 396 | 397 | tmp_str = server.arg("protect_BSSID"); 398 | 399 | tmp_str.toLowerCase(); 400 | tmp_str.toCharArray(sensor_config.protect_ap_info.BSSID_lower,tmp_str.length() + 1); 401 | 402 | tmp_str.toUpperCase(); 403 | tmp_str.toCharArray(sensor_config.protect_ap_info.BSSID_upper,tmp_str.length() + 1); 404 | 405 | 406 | tmp_str = server.arg("connect_SSID"); 407 | tmp_str.toCharArray(sensor_config.connect_ap_info.SSID,tmp_str.length() + 1); 408 | 409 | tmp_str = server.arg("connect_PASSWORD"); 410 | tmp_str.toCharArray(sensor_config.connect_ap_info.PASSWORD,tmp_str.length() + 1); 411 | 412 | tmp_str = server.arg("Alert_Mode"); 413 | alert_mode = tmp_str.toInt(); 414 | 415 | tmp_str = server.arg("Operation_Mode"); 416 | operation_mode = tmp_str.toInt(); 417 | sensor_config.operation_mode = operation_mode; 418 | 419 | switch (alert_mode) 420 | { 421 | case 1: // Alert_Mode-IFTTT 422 | tmp_str = server.arg("ifttt_key"); 423 | tmp_str.toCharArray(sensor_config.ifttt_info.ifttt_key,tmp_str.length() + 1); 424 | 425 | tmp_str = server.arg("ifttt_eventName_eviltwin"); 426 | tmp_str.toCharArray(sensor_config.ifttt_info.ifttt_eventName_eviltwin,tmp_str.length() + 1); 427 | 428 | tmp_str = server.arg("ifttt_eventName_deauth"); 429 | tmp_str.toCharArray(sensor_config.ifttt_info.ifttt_eventName_deauth,tmp_str.length() + 1); 430 | sensor_config.alert_mode = ALERT_STANDALONE; 431 | 432 | if(operation_mode == OPERATION_DETECTION_MODE) 433 | { 434 | tmp_str = server.arg("ifttt_eventName_eviltwin"); 435 | tmp_str.toCharArray(sensor_config.ifttt_info.ifttt_eventName_eviltwin,tmp_str.length() + 1); 436 | 437 | tmp_str = server.arg("ifttt_eventName_deauth"); 438 | tmp_str.toCharArray(sensor_config.ifttt_info.ifttt_eventName_deauth,tmp_str.length() + 1); 439 | } 440 | else if(operation_mode == OPERATION_PROTECTION_MODE) 441 | { 442 | tmp_str = server.arg("ifttt_eventName_geofence"); 443 | tmp_str.toCharArray(sensor_config.ifttt_info.ifttt_eventName_geofence,tmp_str.length() + 1); 444 | } 445 | 446 | break; 447 | case 2: //Alert_Mode-SERVER 448 | tmp_str = server.arg("server_ip"); 449 | tmp_str.toCharArray(sensor_config.alert_server_info.server_ip,tmp_str.length() + 1); 450 | 451 | sensor_config.alert_mode = ALERT_WIFI_SERVER; 452 | break; 453 | case 3: 454 | sensor_config.alert_mode = ALERT_NRF; 455 | break; 456 | } 457 | sensor_config.isConfigured = 1; 458 | save_config_settings(); 459 | // save_configuration_status(); 460 | 461 | server.send ( 200, "text/html", "Saved"); 462 | 463 | print_config(); 464 | ESP.restart(); 465 | 466 | } 467 | 468 | void create_AP() 469 | { 470 | 471 | WiFi.mode(WIFI_AP); 472 | WiFi.softAP("Anwi_Sensor");//,"anwi"); 473 | IPAddress myIP = WiFi.softAPIP(); //Get IP address 474 | Serial.print("HotSpt IP:"); 475 | Serial.println(myIP); 476 | Serial.println("WiFi AP Created"); 477 | isWebConfig = true; 478 | 479 | } 480 | 481 | void config_sensor_web() 482 | { 483 | Serial.println("Starting Access Point"); 484 | create_AP(); 485 | //listen to port 80 486 | 487 | server.on ( "/", [&](){ 488 | server.send ( 200, "text/html", Sensor_config_web); 489 | }); 490 | 491 | server.on ("/save_settings",save_settings); 492 | server.begin(); //start the webserver 493 | Serial.println("Webserver started"); 494 | } 495 | 496 | 497 | void serve_clients() 498 | { 499 | server.handleClient(); //process all the requests for the Webserver 500 | } 501 | -------------------------------------------------------------------------------- /lib/config/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _CONFIG_H_ 2 | #define _CONFIG_H_ 3 | 4 | void config_sensor_manually(); 5 | void config_sensor_json(); 6 | void get_config_settings(); 7 | void print_config(); 8 | void save_config_settings(); 9 | void config_sensor_web(); 10 | void serve_clients(); 11 | uint8_t get_configuration_status(); 12 | void clear_configuration(); 13 | #endif 14 | -------------------------------------------------------------------------------- /lib/debug_print/debug_print.cpp: -------------------------------------------------------------------------------- 1 | #include "debug.h" 2 | #include "..\ieee80211_packet.h" 3 | #include 4 | #include "..\global_vars.h" 5 | 6 | extern "C" 7 | { 8 | #include 9 | } 10 | 11 | void debug_print_beacon() 12 | { 13 | if(is_evil_twin_attack) 14 | { 15 | Serial.print("Evil Twin Detected "); 16 | is_evil_twin_attack = false; 17 | } 18 | 19 | } 20 | 21 | void debug_print_deauth() 22 | { 23 | char mac[MAC_LEN_FMT]; 24 | 25 | Serial.println("DEAUTH ATTACK"); 26 | Serial.println("Channel "); 27 | Serial.println(pkt_info.channel); 28 | 29 | Serial.print("SRC MAC "); 30 | sprintf(mac, MACSTR, MAC2STR(pkt_info.frame_hdr.source_address)); 31 | Serial.println(mac); 32 | 33 | Serial.print("DST MAC "); 34 | sprintf(mac,MACSTR , MAC2STR(pkt_info.frame_hdr.destination_address)); 35 | Serial.println(mac); 36 | 37 | Serial.print("BSSID MAC "); 38 | sprintf(mac, MACSTR, MAC2STR(pkt_info.frame_hdr.bssid_address)); 39 | Serial.println(mac); 40 | 41 | if(pkt_info.is_disassoc_detected) 42 | { 43 | Serial.print("Disassoc Reason "); 44 | } 45 | 46 | else 47 | { 48 | Serial.print("Deauth Reason "); 49 | } 50 | Serial.println(pkt_info.frame_hdr.deauth.reason_code); 51 | 52 | } -------------------------------------------------------------------------------- /lib/debug_print/debug_print.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEBUG_PRINT_H_ 2 | #define _DEBUG_PRINT_H_ 3 | 4 | 5 | void debug_print_beacon(); 6 | 7 | #endif -------------------------------------------------------------------------------- /lib/global_vars.h: -------------------------------------------------------------------------------- 1 | #ifndef _GLOBAL_VARS_H_ 2 | #define _GLOBAL_VARS_H_ 3 | 4 | #include 5 | 6 | #include ".\config\config.h" 7 | #include "ieee80211_packet.h" 8 | 9 | 10 | extern "C" 11 | { 12 | #include 13 | } 14 | 15 | #define DEBUG_PRINT 0 16 | 17 | #define DISABLE 0 18 | #define ENABLE 1 19 | #define MAX_IP_LEN 16 20 | #define MAX_STRING_INPUT 100 21 | #define MAX_NETWORK_TYPE_LEN 10 22 | 23 | #define IFTTT_ALERT_URL "http://maker.ifttt.com/trigger/" 24 | 25 | 26 | #define INIT_CHANNEL 6 27 | #define MAX_CHANNEL 11 28 | #define SCAN_FREQ 1000 29 | #define MAX_DEAUTH_PKT 20 30 | #define ALERT_FREQ 60000 31 | 32 | #define HEARTBEAT_FREQ 30000 33 | 34 | #define IS_EVILTWIN_ATTACK 1 35 | #define IS_DEAUTH_ATTACK 2 36 | #define IS_GEOFENCE_ATTACK 3 37 | 38 | #define ALERT_STANDALONE 1 39 | #define ALERT_WIFI_SERVER 2 40 | #define ALERT_NRF 3 41 | 42 | #define OPERATION_DETECTION_MODE 1 43 | #define OPERATION_PROTECTION_MODE 2 44 | 45 | #define NORTH 1 46 | #define SOUTH 2 47 | #define WEST 3 48 | #define EAST 4 49 | 50 | 51 | 52 | extern uint8_t set_channel; 53 | extern uint16_t deauth_pkt_counter; 54 | 55 | extern uint8_t cntr; 56 | extern uint8_t sensor_id; 57 | 58 | extern int config_ROM_Address; //ROM Address where the config is saved 59 | 60 | extern unsigned long prevTime; 61 | extern unsigned long curTime; 62 | 63 | extern unsigned long alertTimecurr; 64 | extern unsigned long alertTimeprev; 65 | extern bool is_first_alert_sent; 66 | 67 | extern unsigned long heartbeatTimecurr; 68 | extern unsigned long heartbeatTimeprev; 69 | 70 | extern int curChannel; 71 | extern bool is_deauth_or_disassoc_attack; 72 | extern bool is_evil_twin_attack; 73 | extern bool isConfigured; 74 | extern bool manual_config; 75 | 76 | extern uint8_t alert_mode; 77 | 78 | extern uint8_t curr_channel; 79 | extern bool isWebConfig; 80 | 81 | 82 | struct protection_config 83 | { 84 | bool is_hop_channel_enabled = false; 85 | bool is_evil_twin_detect_enabled = true; 86 | bool is_deauth_or_disassoc_detect_enabled = true; 87 | }; 88 | 89 | struct protect_ap_info 90 | { 91 | char SSID[MAX_SSID_LEN]; 92 | char BSSID_lower[MAC_LEN_FMT]; 93 | char BSSID_upper[MAC_LEN_FMT]; 94 | char NETWORK_type[MAX_NETWORK_TYPE_LEN]; 95 | }; 96 | 97 | extern struct captured_packet_info 98 | { 99 | int8_t rssi; 100 | uint8_t channel; 101 | uint8_t type; 102 | uint8_t attack_type = -1; 103 | bool is_beacon_detected = false; 104 | bool is_deauth_detected = false; 105 | bool is_disassoc_detected = false; 106 | bool has_ie_vendor_specific = false; 107 | bool has_ie_rsn = false; 108 | bool is_ssid_hidden; 109 | bool is_encrypted; 110 | struct ieee80211_frame_header frame_hdr; 111 | }pkt_info; 112 | 113 | 114 | struct ifttt_info 115 | { 116 | char ifttt_key[MAX_STRING_INPUT] = ""; 117 | char ifttt_eventName_eviltwin[MAX_STRING_INPUT] = ""; 118 | char ifttt_eventName_deauth[MAX_STRING_INPUT] = ""; 119 | char ifttt_eventName_geofence[MAX_STRING_INPUT] = ""; 120 | }; 121 | 122 | struct alert_server_info 123 | { 124 | char server_ip[MAX_IP_LEN] = ""; 125 | }; 126 | 127 | struct nrf_info 128 | { 129 | uint8_t nrf_channel = 1; 130 | }; 131 | 132 | struct connect_ap_info 133 | { 134 | char SSID[MAX_SSID_LEN]; 135 | char PASSWORD[MAX_SSID_LEN]; 136 | }; 137 | 138 | extern struct sensor_config_info 139 | { 140 | uint8_t isConfigured = -1; 141 | uint8_t id = 0; 142 | uint8_t sensor_location = -1; 143 | struct protect_ap_info protect_ap_info; 144 | uint8_t alert_mode = -1; 145 | uint8_t operation_mode = -1; 146 | struct connect_ap_info connect_ap_info; 147 | struct ifttt_info ifttt_info; 148 | struct alert_server_info alert_server_info; 149 | struct nrf_info nrf_info; 150 | struct protection_config protection_config; 151 | 152 | }sensor_config; 153 | 154 | const char Sensor_config_web[] PROGMEM = R"=====( 155 | 156 | 157 | 158 | 238 | 239 | 282 | 283 | 284 |

ANWI ( All New Wireless IDS) - Sensor Configuration

285 |
286 | 287 |
288 | 289 | 290 |
291 | 292 |
293 | 294 | 295 |
296 | 297 |
298 | 299 | 300 |
301 | 302 |
303 | 304 | 308 |
309 | 310 |
311 | 312 | 313 |
314 | 315 |
316 | 317 | 318 |
319 | 320 |
321 | 322 |
323 | 327 |
328 |
329 | 333 |
334 |
335 | 336 |
337 | 338 |
339 | 343 |
344 |
345 | 349 |
350 |
351 | 352 |
353 | 354 | 355 |
356 | 357 |
358 | 359 | 360 |
361 | 362 |
363 | 364 | 365 |
366 | 367 |
368 | 369 | 370 |
371 | 372 |
373 | 374 | 375 |
376 | 377 |
378 | 379 |
380 |
381 | 382 | 383 | 384 | )====="; 385 | 386 | 387 | 388 | #endif 389 | -------------------------------------------------------------------------------- /lib/ieee80211_packet.h: -------------------------------------------------------------------------------- 1 | #ifndef _PACKET_H_ 2 | #define _PACKET_H_ 3 | 4 | //#include 5 | 6 | #define SNIFF_BUF2_MAX_SIZE 112 7 | #define SNIFF_BUF_MAX_SIZE 36 8 | #define MAX_SSID_LEN 32 9 | #define MAC_LEN 6 10 | #define MAC_LEN_FMT 18 11 | 12 | 13 | #define IEEE80211_FTYPE_MGMT 0x0000 14 | 15 | /* management packet subtype flags converted to little endian */ 16 | 17 | #define IEEE80211_STYPE_ASSOC_REQ 0x0000 18 | #define IEEE80211_STYPE_ASSOC_RESP 0x0001 19 | #define IEEE80211_STYPE_REASSOC_REQ 0x0002 20 | #define IEEE80211_STYPE_REASSOC_RESP 0x0003 21 | #define IEEE80211_STYPE_PROBE_REQ 0x0004 22 | #define IEEE80211_STYPE_PROBE_RESP 0x0005 23 | #define IEEE80211_STYPE_BEACON 0x0008 24 | #define IEEE80211_STYPE_ATIM 0x0009 25 | #define IEEE80211_STYPE_DISASSOC 0x000A 26 | #define IEEE80211_STYPE_AUTH 0x000B 27 | #define IEEE80211_STYPE_DEAUTH 0x000C 28 | #define IEEE80211_STYPE_ACTION 0x000D 29 | 30 | 31 | //http://docs.ros.org/diamondback/api/wpa_supplicant/html/ieee802__11__defs_8h_source.html 32 | 33 | #define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00 34 | #define WLAN_CIPHER_SUITE_WEP40 0x000FAC01 35 | #define WLAN_CIPHER_SUITE_TKIP 0x000FAC02 36 | #define WLAN_CIPHER_SUITE_CCMP 0x000FAC04 37 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 38 | #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 39 | #define WLAN_AKM_SUITE_8021X 0x000FAC01 40 | #define WLAN_AKM_SUITE_PSK 0x000FAC02 41 | 42 | 43 | struct RxControl 44 | { 45 | signed rssi : 8; 46 | unsigned rate : 4; 47 | unsigned is_group : 1; 48 | unsigned : 1; 49 | unsigned sig_mode : 2; 50 | unsigned legacy_length : 12; 51 | unsigned damatch0 : 1; 52 | unsigned damatch1 : 1; 53 | unsigned bssidmatch0 : 1; 54 | unsigned bssidmatch1 : 1; 55 | unsigned MCS : 7; 56 | unsigned CWB : 1; 57 | unsigned HT_length : 16; 58 | unsigned Smoothing : 1; 59 | unsigned Not_Sounding : 1; 60 | unsigned : 1; 61 | unsigned Aggregation : 1; 62 | unsigned STBC : 2; 63 | unsigned FEC_CODING : 1; 64 | unsigned SGI : 1; 65 | unsigned rxend_state : 8; 66 | unsigned ampdu_cnt : 8; 67 | unsigned channel : 4; 68 | unsigned : 12; 69 | }; 70 | 71 | struct Ampdu_Info 72 | { 73 | uint16_t length; 74 | uint16_t seq; 75 | uint8_t address3[6]; 76 | }__attribute__ ((packed)); 77 | 78 | struct sniffer_buf 79 | { 80 | struct RxControl rx_ctrl; 81 | uint8_t buf[SNIFF_BUF_MAX_SIZE]; 82 | uint16_t cnt; 83 | struct Ampdu_Info ampdu_info[1]; 84 | }; 85 | 86 | // MGMT PACKET esp8266-technical_reference_en.pdf, #108 87 | 88 | struct sniffer_buf2 89 | { 90 | struct RxControl rx_ctrl; 91 | uint8_t buf[SNIFF_BUF2_MAX_SIZE]; 92 | uint16_t cnt; 93 | uint16_t len; //length of packet 94 | }__attribute__ ((packed)); 95 | 96 | 97 | struct ieee80211_frame_control_flags 98 | { 99 | unsigned to_ds : 1; 100 | unsigned from_ds : 1; 101 | unsigned more_frag : 1; 102 | unsigned retry : 1; 103 | unsigned power_mng : 1; 104 | unsigned more_data : 1; 105 | unsigned protected_frame : 1; 106 | unsigned order : 1; 107 | }__attribute__ ((packed)); 108 | 109 | 110 | //802.11-2016.pdf, #670 111 | struct ieee80211__frame_control 112 | { 113 | unsigned protocol_version : 2; 114 | unsigned type : 2; 115 | unsigned sub_type : 4; 116 | struct ieee80211_frame_control_flags frame_control_flags; 117 | }__attribute__ ((packed)); 118 | 119 | 120 | struct ieee80211_sequence_control 121 | { 122 | unsigned fragment_number : 4; 123 | unsigned sequence_number : 12; 124 | }__attribute__ ((packed)); 125 | 126 | 127 | struct ieee80211_deauth_or_disassoc 128 | { 129 | uint16_t reason_code; // __le16 130 | }__attribute__ ((packed)); 131 | 132 | 133 | 134 | /** 802.11 Robust Security Network ("WPA") information element 135 | * Many fields reference a cipher or authentication-type ID; this is a 136 | * three-byte OUI followed by one byte identifying the cipher with 137 | * respect to that OUI. For all standard ciphers the OUI is 00:0F:AC, 138 | * except in old-style WPA IEs encapsulated in vendor-specific IEs, 139 | * where it's 00:50:F2. 140 | */ 141 | 142 | struct ieee80211_ie_rsn_pairwise_cipher 143 | { 144 | uint8_t pairwise_cipher[4]; 145 | }__attribute__ ((packed)); 146 | 147 | 148 | struct ieee80211_ie_vendor_specific 149 | { 150 | uint8_t oui[4]; /**< OUI and vendor-specific type byte */ 151 | uint8_t data[0]; 152 | }__attribute__ ((packed)); 153 | 154 | struct ieee80211_ie_rsn 155 | { 156 | uint16_t version; 157 | uint8_t group_cipher[4]; 158 | uint16_t pairwise_count; 159 | struct ieee80211_ie_rsn_pairwise_cipher pairwise_cipher[2]; 160 | uint16_t akm_count; 161 | uint32_t akm_list[1]; 162 | uint16_t rsn_capab; 163 | uint16_t pmkid_count; 164 | uint8_t pmkid_list[0]; 165 | }__attribute__((packed)); 166 | 167 | /** Information element ID for Robust Security Network information element */ 168 | #define IEEE80211_IE_RSN 48 169 | 170 | #define IEEE80211_IE_VENDOR_SPECIFIC 221 171 | 172 | /** 802.11 SSID information element */ 173 | struct ieee80211_ie_ssid 174 | { 175 | char ssid[0]; /**< SSID data, not NUL-terminated */ 176 | }__attribute__ ((packed)); 177 | 178 | /** Information element ID for SSID information element */ 179 | #define IEEE80211_IE_SSID 0 180 | 181 | struct ieee80211_ie_type 182 | { 183 | uint8_t id; 184 | uint8_t len; 185 | }__attribute__ ((packed)); 186 | 187 | struct ieee80211_beacon //https://mrncciew.com/2014/10/08/802-11-mgmt-beacon-frame/ 188 | { 189 | uint64_t timestamp; // __le64 190 | uint16_t beacon_interval; // __le16 191 | uint16_t capab_info; // __le16 //today 192 | //struct ieee80211_capab_info capab_info; 193 | struct ieee80211_ie_type ie_type; 194 | //union 195 | //{ 196 | struct ieee80211_ie_ssid ssid_ie; 197 | struct ieee80211_ie_rsn rsn_ie; 198 | struct ieee80211_ie_vendor_specific ie_vendor_specific; 199 | 200 | //}__attribute__ ((packed)); 201 | 202 | }__attribute__ ((packed)); 203 | 204 | //ieee80211 Managment Packet 802.11-2016.pdf, #692 205 | struct ieee80211_frame_header 206 | { 207 | 208 | struct ieee80211__frame_control frame_control; 209 | uint16_t duration_id; 210 | uint8_t destination_address[MAC_LEN]; 211 | uint8_t source_address[MAC_LEN]; 212 | uint8_t bssid_address[MAC_LEN]; 213 | 214 | //Sequence Control,802.11-2016.pdf # 215 | // Instead of using struct, using uint8_t to bypass extra byte bug causing issues with ssid_len 216 | //struct ieee80211_sequence_control sequence_control; //// making it 4 instead of 12 to bypass bug of extra one 8 causing issue with beacon 217 | uint16_t seq_ctrl; 218 | union 219 | { 220 | struct ieee80211_deauth_or_disassoc deauth; 221 | struct ieee80211_beacon beacon; 222 | }__attribute__ ((packed)); 223 | }__attribute__((__packed__)); 224 | 225 | #endif -------------------------------------------------------------------------------- /lib/packet_capture/packet_capture.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "packet_capture.h" 3 | #include 4 | 5 | struct captured_packet_info pkt_info; 6 | 7 | char bssid_mac[MAC_LEN_FMT]; 8 | 9 | void init_sniffing() 10 | { 11 | wifi_set_opmode(STATION_MODE); 12 | wifi_set_channel(set_channel); 13 | wifi_promiscuous_enable(DISABLE); 14 | delay(10); 15 | wifi_set_promiscuous_rx_cb(sniffer_wifi_promiscuous_rx); 16 | delay(10); 17 | wifi_promiscuous_enable(ENABLE); 18 | 19 | } 20 | 21 | 22 | 23 | void sniffer_wifi_promiscuous_rx(uint8 *buf, uint16 buf_len) 24 | { 25 | uint8_t *data; 26 | uint16_t i; 27 | uint16_t len; 28 | uint16_t cnt = 0; 29 | 30 | // MGMT Packet == buf2 31 | if (buf_len == sizeof(struct sniffer_buf2)) 32 | { 33 | struct sniffer_buf2 * ptr_buf2 = (struct sniffer_buf2 * ) buf; 34 | struct ieee80211_frame_header * ptr_frame = (struct ieee80211_frame_header * ) ptr_buf2->buf; 35 | if (ptr_frame->frame_control.type == IEEE80211_FTYPE_MGMT ) 36 | { 37 | pkt_info.type = IEEE80211_FTYPE_MGMT; 38 | pkt_info.rssi = ptr_buf2->rx_ctrl.rssi; 39 | pkt_info.channel = wifi_get_channel(); 40 | pkt_info.attack_type = -1; 41 | 42 | if ( ptr_frame->frame_control.frame_control_flags.to_ds == 0 && ptr_frame->frame_control.frame_control_flags.from_ds == 0 ) 43 | { 44 | memcpy(pkt_info.frame_hdr.destination_address,ptr_frame->destination_address,MAC_LEN); 45 | memcpy(pkt_info.frame_hdr.source_address,ptr_frame->source_address,MAC_LEN); 46 | memcpy(pkt_info.frame_hdr.bssid_address,ptr_frame->bssid_address,MAC_LEN); 47 | } 48 | if ( ptr_frame->frame_control.frame_control_flags.to_ds == 0 && ptr_frame->frame_control.frame_control_flags.from_ds == 1 ) 49 | { 50 | memcpy(pkt_info.frame_hdr.destination_address,ptr_frame->destination_address,MAC_LEN); 51 | memcpy(pkt_info.frame_hdr.bssid_address,ptr_frame->source_address,MAC_LEN); 52 | memcpy(pkt_info.frame_hdr.source_address,ptr_frame->bssid_address,MAC_LEN); 53 | } 54 | if ( ptr_frame->frame_control.frame_control_flags.to_ds == 1 && ptr_frame->frame_control.frame_control_flags.from_ds == 0 ) 55 | { 56 | memcpy(pkt_info.frame_hdr.bssid_address,ptr_frame->destination_address,MAC_LEN); 57 | memcpy(pkt_info.frame_hdr.source_address,ptr_frame->source_address,MAC_LEN); 58 | memcpy(pkt_info.frame_hdr.destination_address,ptr_frame->bssid_address,MAC_LEN); 59 | } 60 | //if ( to_ds == 1 && from_ds ==1 ) // No support for WDS presently 61 | 62 | switch(ptr_frame->frame_control.sub_type) 63 | { 64 | case IEEE80211_STYPE_DISASSOC: // Both disassociation and deauthentication have same struct 65 | //pkt_info.is_disassoc_detected = true; 66 | case IEEE80211_STYPE_DEAUTH: 67 | 68 | 69 | sprintf(bssid_mac,MACSTR , MAC2STR(pkt_info.frame_hdr.bssid_address)); 70 | 71 | if ( ( strcmp(sensor_config.protect_ap_info.BSSID_lower,bssid_mac) == 0 ) || ( strcmp(sensor_config.protect_ap_info.BSSID_upper,bssid_mac) == 0 ) ) 72 | { 73 | if(pkt_info.frame_hdr.deauth.reason_code != 4 ) 74 | { 75 | pkt_info.is_deauth_detected = true; 76 | deauth_pkt_counter++; 77 | pkt_info.frame_hdr.deauth.reason_code = ptr_frame->deauth.reason_code; 78 | } 79 | } 80 | 81 | 82 | break; 83 | 84 | case IEEE80211_STYPE_BEACON: 85 | // reset all flags here 86 | pkt_info.has_ie_vendor_specific = false; 87 | pkt_info.has_ie_rsn = false; 88 | pkt_info.is_beacon_detected = false; 89 | 90 | struct ieee80211_beacon * curr_ptr = ( struct ieee80211_beacon *) &ptr_frame->beacon; 91 | uint8_t * next_ptr; 92 | uint8_t * tmp_ptr; 93 | uint8_t offset_of_next_ie =0; 94 | 95 | for(offset_of_next_ie = 0; offset_of_next_ie < SNIFF_BUF2_MAX_SIZE ;offset_of_next_ie = curr_ptr->ie_type.len + 2 ) 96 | { 97 | switch(curr_ptr->ie_type.id) 98 | { 99 | case IEEE80211_IE_SSID: 100 | 101 | pkt_info.is_ssid_hidden == false; 102 | //Check if AP is OPEN or using encryption using Privacy Bit 103 | pkt_info.is_encrypted = ( ptr_frame->beacon.capab_info >> 4 ) & 0X0001; 104 | if(ptr_frame->beacon.ie_type.len > 32) 105 | { 106 | break; // Do not proces SSID > 32 107 | } 108 | if(ptr_frame->beacon.ie_type.len == 0) 109 | { 110 | pkt_info.is_ssid_hidden == true; 111 | break; 112 | } 113 | memset((&pkt_info.frame_hdr.beacon.ssid_ie.ssid),0,MAX_SSID_LEN); // Clear det_ssid 114 | memcpy(pkt_info.frame_hdr.beacon.ssid_ie.ssid,ptr_frame->beacon.ssid_ie.ssid,ptr_frame->beacon.ie_type.len); 115 | if(!pkt_info.is_encrypted) 116 | { 117 | //Serial.println(sensor_config.protect_ap_info.SSID); 118 | 119 | if (strcmp(sensor_config.protect_ap_info.SSID,pkt_info.frame_hdr.beacon.ssid_ie.ssid) == 0) 120 | { 121 | pkt_info.attack_type = IS_EVILTWIN_ATTACK; 122 | } 123 | } 124 | break; 125 | 126 | // http://lists.shmoo.com/pipermail/hostap/2008-July/018074.html 127 | // WPA OUI = 00:50:F2 128 | // https://msdn.microsoft.com/en-us/library/windows/hardware/ff565906(v=vs.85).aspx 129 | 130 | case IEEE80211_IE_VENDOR_SPECIFIC: 131 | pkt_info.has_ie_vendor_specific = true; 132 | memcpy(pkt_info.frame_hdr.beacon.ie_vendor_specific.oui,curr_ptr->ie_vendor_specific.oui,sizeof(curr_ptr->ie_vendor_specific.oui)); 133 | break; 134 | 135 | case IEEE80211_IE_RSN: 136 | 137 | pkt_info.has_ie_rsn = true; 138 | memcpy(pkt_info.frame_hdr.beacon.rsn_ie.group_cipher,curr_ptr->rsn_ie.group_cipher,sizeof(curr_ptr->rsn_ie.group_cipher)); 139 | pkt_info.frame_hdr.beacon.rsn_ie.pairwise_count = curr_ptr->rsn_ie.pairwise_count; 140 | 141 | uint8_t cntr2 = 0; 142 | cntr2 = curr_ptr->rsn_ie.pairwise_count; 143 | for( cntr = 0; cntr < cntr2;cntr++) 144 | { 145 | memcpy(pkt_info.frame_hdr.beacon.rsn_ie.pairwise_cipher[cntr].pairwise_cipher,curr_ptr->rsn_ie.pairwise_cipher,sizeof(curr_ptr->rsn_ie.pairwise_cipher)); 146 | tmp_ptr = (uint8_t *)curr_ptr + sizeof(ieee80211_ie_rsn_pairwise_cipher); 147 | curr_ptr = (struct ieee80211_beacon *) tmp_ptr; 148 | } 149 | break; 150 | } 151 | next_ptr = (uint8_t *) curr_ptr + offset_of_next_ie; 152 | curr_ptr = (struct ieee80211_beacon *) next_ptr; 153 | } 154 | break; 155 | } 156 | } 157 | return; 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /lib/packet_capture/packet_capture.h: -------------------------------------------------------------------------------- 1 | #ifndef _PACKET_CAPTURE_H_ 2 | #define _PACKET_CAPTURE_H_ 3 | 4 | #include "..\global_vars.h" 5 | 6 | 7 | void sniffer_wifi_promiscuous_rx(uint8*, uint16 ); 8 | void init_sniffing(); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /lib/protection/geofence.cpp: -------------------------------------------------------------------------------- 1 | #include "geofence.h" 2 | 3 | //geofence Settings 4 | String MAC_TO_PROTECT = ""; 5 | const char* WEAK_PASSWORD = "123456789"; 6 | float Anwi_Power = 20.5; 7 | float Strength_Baseline = 40; 8 | 9 | //get RSSI value for given ssid 10 | int32_t get_RSSI(const char* target_ssid) 11 | { 12 | byte available_networks = WiFi.scanNetworks(); 13 | for (int network = 0; network < available_networks; network++) 14 | { 15 | if (strcmp(WiFi.SSID(network).c_str(), target_ssid) == 0) 16 | { 17 | return WiFi.RSSI(network); 18 | } 19 | } 20 | return 0; 21 | } 22 | 23 | // Get mac address of given ssid 24 | String get_mac(const char* target_ssid) 25 | { 26 | byte available_networks = WiFi.scanNetworks(); 27 | for (int network = 0; network < available_networks; network++) 28 | { 29 | if (strcmp(WiFi.SSID(network).c_str(), target_ssid) == 0) 30 | { 31 | return WiFi.BSSIDstr(network); 32 | } 33 | } 34 | return String(""); 35 | } 36 | 37 | //Return RSSI if MAC is provided 38 | int32_t getRSSI_mac(const char* target_mac) 39 | { 40 | byte available_networks = WiFi.scanNetworks(); 41 | for (int network = 0; network < available_networks; network++) 42 | { 43 | if (strcmp(WiFi.BSSIDstr(network).c_str(), target_mac) == 0) 44 | { 45 | return WiFi.RSSI(network); 46 | } 47 | } 48 | return 0; 49 | } 50 | 51 | //set transmission power for geofence 52 | void set_transmission_power(int32_t strength) 53 | { 54 | strength = strength *(-1); 55 | Anwi_Power = 20.5 - (strength-Strength_Baseline)/2; // mapping 40 to 80 with 0 20.5. 56 | WiFi.setOutputPower(Anwi_Power); 57 | Serial.printf("Input signal strength = -%ddbm. Anwi power set to %f dBm\n",strength,Anwi_Power); 58 | } 59 | 60 | // recalibrate geofence transmission power 61 | void recalibrate_transmission_power() 62 | { 63 | if(strcmp(MAC_TO_PROTECT.c_str(),"")!= 0) 64 | { 65 | int32_t target_ap_strength = 0; 66 | target_ap_strength = getRSSI_mac(MAC_TO_PROTECT.c_str()); 67 | set_transmission_power(target_ap_strength); 68 | } 69 | } 70 | 71 | // print signal strength value in dBm 72 | void print_signal_strength(int32_t rssi) 73 | { 74 | Serial.print("Target Signal strength: "); 75 | Serial.print(rssi); 76 | Serial.println("dBm"); 77 | } 78 | 79 | //setup anwi geofencing 80 | void setup_hotspot(const char * SSID) 81 | { 82 | boolean result = WiFi.softAP(SSID, WEAK_PASSWORD); 83 | if(result == true) 84 | { 85 | Serial.println("ANWI GeoFencing Ready"); 86 | } 87 | else 88 | { 89 | Serial.println("ANWI GeoFencing Failed!"); 90 | } 91 | } 92 | 93 | void setup_geofence(const char * SSID) 94 | { 95 | int32_t target_ap_strength = 0; 96 | Serial.println("Starting ANWI GeoFence"); 97 | 98 | MAC_TO_PROTECT = get_mac(SSID).c_str(); 99 | Serial.printf("Protecting SSID = %s MAC = %s",SSID,MAC_TO_PROTECT.c_str()); 100 | 101 | target_ap_strength = getRSSI_mac(MAC_TO_PROTECT.c_str()); 102 | Serial.print("\nTarget Signal Strength is"); 103 | print_signal_strength(target_ap_strength); 104 | delay(3000); 105 | 106 | Serial.printf("\nCalibrating signal strength for SSID %s\n",SSID); 107 | set_transmission_power(target_ap_strength); 108 | 109 | Serial.println("\nActivating Geo-Fencing"); 110 | setup_hotspot(SSID); 111 | set_transmission_power(target_ap_strength); 112 | } -------------------------------------------------------------------------------- /lib/protection/geofence.h: -------------------------------------------------------------------------------- 1 | #ifndef _GEOFENCE_H_ 2 | #define _GEOFENCE_H_ 3 | 4 | #include 5 | #include 6 | 7 | //get RSSI value for given ssid 8 | int32_t get_RSSI(const char* target_ssid); 9 | 10 | // Get mac address of given ssid 11 | String get_mac(const char* target_ssid); 12 | 13 | //Return RSSI if MAC is provided 14 | int32_t getRSSI_mac(const char* target_mac); 15 | 16 | //set transmission power for geofence 17 | void set_transmission_power(int32_t strength); 18 | 19 | // recalibrate geofence transmission power 20 | void recalibrate_transmission_power(); 21 | // print signal strength value in dBm 22 | void print_signal_strength(int32_t rssi); 23 | 24 | //setup hotspot 25 | void setup_hotspot(const char * SSID); 26 | 27 | //setup anwi geofencing 28 | void setup_geofence(const char * SSID); 29 | 30 | #endif -------------------------------------------------------------------------------- /lib/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for the project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link to executable file. 4 | 5 | The source code of each library should be placed in separate directory, like 6 | "lib/private_lib/[here are source files]". 7 | 8 | For example, see how can be organized `Foo` and `Bar` libraries: 9 | 10 | |--lib 11 | | |--Bar 12 | | | |--docs 13 | | | |--examples 14 | | | |--src 15 | | | |- Bar.c 16 | | | |- Bar.h 17 | | |--Foo 18 | | | |- Foo.c 19 | | | |- Foo.h 20 | | |- readme.txt --> THIS FILE 21 | |- platformio.ini 22 | |--src 23 | |- main.c 24 | 25 | Then in `src/main.c` you should use: 26 | 27 | #include 28 | #include 29 | 30 | // rest H/C/CPP code 31 | 32 | PlatformIO will find your libraries automatically, configure preprocessor's 33 | include paths and build them. 34 | 35 | More information about PlatformIO Library Dependency Finder 36 | - http://docs.platformio.org/page/librarymanager/ldf.html 37 | -------------------------------------------------------------------------------- /platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; http://docs.platformio.org/page/projectconf.html 10 | 11 | [env:d1_mini] 12 | platform = espressif8266 13 | board = d1_mini 14 | framework = arduino 15 | upload_port = COM4 16 | monitor_speed = 115200 17 | 18 | lib_deps = 19 | # Using a library name 20 | ESP8266WiFi, 21 | ArduinoJson, 22 | ESP8266WebServer -------------------------------------------------------------------------------- /server_nodered.json: -------------------------------------------------------------------------------- 1 | [{"id":"2a5e4420.d9119c","type":"http in","z":"a2b187fe.572708","name":"ANWI-Server","url":"postdata","method":"post","upload":true,"swaggerDoc":"","x":118.78689575195312,"y":471.3550615310669,"wires":[["1356b455.9c3b4c","3b5fc34e.7f236c","3eceea50.40a526","c55f9a49.f222a8"]]},{"id":"a4073f8d.d5641","type":"inject","z":"a2b187fe.572708","name":"TestData","topic":"","payload":"{\"id\":1,\"sensor_location\":\"SOUTH\",\"bssid_mac\":\"24:0A:C4:DD:DD:D4\",\"rssi\":12,\"estimated_distance\":3,\"attack_type\":3,\"channel\":12,\"attackers_mac\":\"00:0B:79:07:A6:A5\",\"victims_mac\":\"24:0A:C4:DD:DD:D4\",\"deauth_reason\":4}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":111.78121948242188,"y":365.8805503845215,"wires":[["3b5fc34e.7f236c","3eceea50.40a526","c55f9a49.f222a8"]]},{"id":"66d5f4c4.9f982c","type":"http request","z":"a2b187fe.572708","name":"DocPutAPI","method":"POST","ret":"obj","url":"https://c0bbe27fc47a4db797424203d5505f19.us-east-1.aws.found.io:9243/test1/_doc","tls":"","x":915.8750152587891,"y":213.93176651000977,"wires":[[]]},{"id":"1356b455.9c3b4c","type":"http response","z":"a2b187fe.572708","name":"Return200","statusCode":"200","headers":{},"x":336.96305084228516,"y":472.04826307296753,"wires":[]},{"id":"1e333a36.eeb6e6","type":"inject","z":"a2b187fe.572708","name":"CreateIndexMapping","topic":"","payload":"{\"mappings\":{\"_doc\":{\"properties\":{\"attack_type\":{\"type\":\"long\"},\"attackers_address\":{\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}},\"bssid_mac\":{\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}},\"channel\":{\"type\":\"long\"},\"timestamp\":{\"type\":\"date\",\"format\":\"epoch_millis\"},\"deauth_reason\":{\"type\":\"long\"},\"estimated_distance\":{\"type\":\"long\"},\"id\":{\"type\":\"long\"},\"rssi\":{\"type\":\"long\"},\"attackers_mac_vendor\":{\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}},\"victims_mac_vendor\":{\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}},\"sensor_location\":{\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}},\"victims_address\":{\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}}}}}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":138.78408813476562,"y":560.8863296508789,"wires":[["e51c3448.97fbb8"]]},{"id":"e51c3448.97fbb8","type":"http request","z":"a2b187fe.572708","name":"CreateIndexAPI","method":"PUT","ret":"obj","url":"https://c0bbe27fc47a4db797424203d5505f19.us-east-1.aws.found.io:9243/test1","tls":"","x":412.78977966308594,"y":563.0596389770508,"wires":[["d169eae8.933858"]]},{"id":"d169eae8.933858","type":"debug","z":"a2b187fe.572708","name":"Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650.9659061431885,"y":560.6278877258301,"wires":[]},{"id":"3b5fc34e.7f236c","type":"function","z":"a2b187fe.572708","name":"timestamp","func":"var timestamp = new Date();\nmsg.payload[\"timestamp\"] = timestamp.getTime() - 76400000;//1 day\nreturn msg;","outputs":1,"noerr":0,"x":337.1768569946289,"y":367.9368152618408,"wires":[["c32b6.3096fd4b"]]},{"id":"c55f9a49.f222a8","type":"function","z":"a2b187fe.572708","name":"GetVictimsMacVendor","func":"var amac = msg.payload.victims_mac.replace(/:/g, \"-\");\nmsg.mac = amac;\nreturn msg;","outputs":1,"noerr":0,"x":129.18038940429688,"y":156.2130889892578,"wires":[["589c78f5.a5c608"]]},{"id":"c32b6.3096fd4b","type":"join","z":"a2b187fe.572708","name":"MergeData","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"2","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":708.0753326416016,"y":335.0141792297363,"wires":[["66d5f4c4.9f982c","7b8c79aa.806138"]]},{"id":"3eceea50.40a526","type":"function","z":"a2b187fe.572708","name":"GetAttackersMacVendor","func":"var vmac = msg.payload.attackers_mac.replace(/:/g, \"-\");\nmsg.mac = vmac;\nreturn msg;","outputs":1,"noerr":0,"x":138.5333709716797,"y":277.3075256347656,"wires":[["ca232266.fcd57"]]},{"id":"1e455bc0.8e7454","type":"function","z":"a2b187fe.572708","name":"ExtractVendorInfo","func":"victims_mac_vendor = msg.payload;\nvar newMsg = {payload:{\"victims_mac_vendor\":victims_mac_vendor}};\nreturn newMsg;","outputs":1,"noerr":0,"x":435.35877227783203,"y":160.66406154632568,"wires":[["c32b6.3096fd4b"]]},{"id":"589c78f5.a5c608","type":"http request","z":"a2b187fe.572708","name":"GetVendor","method":"GET","ret":"txt","url":"https://macvendors.co/api/vendorname/{{{mac}}}","tls":"","x":343.72230529785156,"y":93.8515625,"wires":[["1e455bc0.8e7454"]]},{"id":"ca232266.fcd57","type":"http request","z":"a2b187fe.572708","name":"GetVendor","method":"GET","ret":"txt","url":"https://macvendors.co/api/vendorname/{{{mac}}}","tls":"","x":329.38140869140625,"y":212.82174682617188,"wires":[["4b12b73d.fa6fa8"]]},{"id":"4b12b73d.fa6fa8","type":"function","z":"a2b187fe.572708","name":"ExtractVendorInfo","func":"attackers_mac_vendor = msg.payload;\nvar newMsg = {payload:{\"attackers_mac_vendor\":attackers_mac_vendor}};\nreturn newMsg;","outputs":1,"noerr":0,"x":434.56321716308594,"y":284.0944495201111,"wires":[["c32b6.3096fd4b"]]},{"id":"7b8c79aa.806138","type":"debug","z":"a2b187fe.572708","name":"Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":691.7223434448242,"y":140.6356544494629,"wires":[]}] -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include <..\lib\global_vars.h> 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "packet_capture.h" 8 | #include "debug_print.h" 9 | #include "config.h" 10 | #include "alerts.h" 11 | #include "geofence.h" 12 | 13 | uint8_t isConfiguredflag = -1; 14 | 15 | void hop_channel() 16 | { 17 | if (sensor_config.protection_config.is_hop_channel_enabled) 18 | { 19 | if (set_channel == MAX_CHANNEL) 20 | { 21 | set_channel = INIT_CHANNEL; 22 | } 23 | else 24 | { 25 | set_channel++; 26 | } 27 | if(DEBUG_PRINT) 28 | { 29 | Serial.print(" CHAN SET TO : "); 30 | Serial.println(set_channel); 31 | } 32 | wifi_set_channel(set_channel); 33 | } 34 | } 35 | 36 | void loop() 37 | { 38 | if ( sensor_config.alert_mode == ALERT_NRF ) 39 | { 40 | radio_update(); 41 | } 42 | 43 | heartbeat(); 44 | 45 | if(sensor_config.operation_mode == OPERATION_DETECTION_MODE) 46 | { 47 | curTime = millis(); 48 | if(curTime - prevTime >= SCAN_FREQ) 49 | { 50 | if(pkt_info.is_deauth_detected) 51 | { 52 | if(deauth_pkt_counter >= MAX_DEAUTH_PKT) 53 | { 54 | pkt_info.attack_type = IS_DEAUTH_ATTACK; 55 | } 56 | pkt_info.is_deauth_detected = false; 57 | } 58 | hop_channel(); 59 | } 60 | else 61 | { 62 | prevTime = curTime; 63 | deauth_pkt_counter = 0; 64 | } 65 | 66 | if (pkt_info.attack_type == IS_EVILTWIN_ATTACK || pkt_info.attack_type == IS_DEAUTH_ATTACK ) 67 | { 68 | send_alert(); 69 | pkt_info.attack_type = -1; 70 | } 71 | } 72 | 73 | else if(sensor_config.operation_mode == OPERATION_PROTECTION_MODE) 74 | { 75 | delay(5000); 76 | //recalibrate geofence after regular interval 77 | recalibrate_transmission_power(); 78 | 79 | //set values for pkt_info variable 80 | unsigned char number_client; 81 | struct station_info *stat_info; 82 | int i=1; 83 | 84 | number_client= wifi_softap_get_station_num(); // Count of stations which are connected to ESP8266 soft-AP 85 | stat_info = wifi_softap_get_station_info(); 86 | if(DEBUG_PRINT) 87 | { 88 | Serial.print(" Total connected_client are = "); 89 | Serial.println(number_client); 90 | 91 | if(stat_info == NULL) 92 | { 93 | Serial.print("ERROR: Stat_info is null"); 94 | } 95 | } 96 | //send alert for each connected client.. Currently no duplicate checked 97 | char bssid_mac[18]; 98 | while (stat_info != NULL) 99 | { 100 | pkt_info.attack_type = IS_GEOFENCE_ATTACK; 101 | WiFi.macAddress(pkt_info.frame_hdr.bssid_address); 102 | pkt_info.channel = 1; 103 | pkt_info.rssi = WiFi.RSSI(); 104 | WiFi.macAddress(pkt_info.frame_hdr.destination_address); 105 | MEMCPY(pkt_info.frame_hdr.source_address,stat_info->bssid,6); 106 | pkt_info.frame_hdr.deauth.reason_code = 0; 107 | sprintf(bssid_mac,MACSTR , MAC2STR(pkt_info.frame_hdr.bssid_address)); 108 | Serial.print("Attacker MAC : "); 109 | Serial.println(bssid_mac); 110 | send_alert(); 111 | pkt_info.attack_type = -1; 112 | stat_info = STAILQ_NEXT(stat_info, next); 113 | i++; 114 | } 115 | pkt_info.attack_type = -1; 116 | } 117 | } 118 | 119 | void setup() 120 | { 121 | delay(5000); 122 | isConfiguredflag = get_configuration_status(); 123 | Serial.begin(115200); 124 | Serial.println("\nANWI - All New Wireless IDS\n "); 125 | if ( isConfiguredflag == 0) 126 | { 127 | Serial.println("NOT_CONFIGURED"); 128 | while (get_configuration_status() == 0) 129 | { 130 | if(Serial) 131 | { 132 | config_sensor_json(); 133 | } 134 | } 135 | Serial.println("JUST_CONFIGURED"); 136 | delay(2000); 137 | ESP.restart(); 138 | } 139 | else 140 | { 141 | Serial.println("ALREADY_CONFIGURED"); 142 | get_config_settings(); 143 | print_config(); 144 | delay(5000); 145 | if(Serial.read() == 'd') 146 | { 147 | clear_configuration(); 148 | Serial.println("CONFIGURATION_CLEARED"); 149 | Serial.println("Rebooting Sensor"); 150 | delay(1000); 151 | ESP.restart(); 152 | } 153 | Serial.println("Using existing configuration"); 154 | } 155 | 156 | if ( sensor_config.alert_mode == ALERT_NRF ) 157 | { 158 | init_radio(); 159 | radio_update(); 160 | } 161 | 162 | curr_channel = 1; 163 | //get_config_settings(); 164 | if(sensor_config.operation_mode == OPERATION_DETECTION_MODE) 165 | { 166 | Serial.println("ANWI Attack Detection Mode Activated.."); 167 | init_sniffing(); 168 | } 169 | else if (sensor_config.operation_mode == OPERATION_PROTECTION_MODE) 170 | { 171 | Serial.println("ANWI Protection Mode Activated.."); 172 | setup_geofence(sensor_config.protect_ap_info.SSID); 173 | } 174 | } 175 | --------------------------------------------------------------------------------