completed

This commit is contained in:
CarterPerez-dev 2026-07-04 10:40:11 -04:00
parent 71f6acd972
commit ab42857882
18 changed files with 2168 additions and 98 deletions

View File

@ -0,0 +1,4 @@
# ©AngelaMos | 2026
# .npmrc
strict-dep-builds=false
auto-install-peers=true

View File

@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

View File

@ -1,43 +1,176 @@
<!-- ©AngelaMos | 2026 -->
<!-- README.md -->
# zingela
A stateless, line-rate mass TCP port scanner written in Zig 0.16, in the lineage of masscan and zmap. The name is Zulu for "to hunt."
## Honest positioning
On stock Linux, masscan, zmap, and zingela all hit the same kernel `AF_PACKET` transmit ceiling, roughly 1.5 to 2.5 million packets per second on a single core. There is no raw-throughput win to be had there, and zingela does not claim one.
The difference is the road past that ceiling. masscan reaches higher rates only with proprietary PF_RING ZC: a paid license, an out-of-tree kernel module, and specific NICs. zingela's planned road is `AF_XDP`, which has been in the mainline Linux kernel since 4.18 and needs no proprietary dependency. Once that backend lands (a later milestone), zingela is designed to match masscan on bare Linux and pull ahead on XDP-capable hardware precisely where masscan needs a paywall, while shipping as a single static binary with no libpcap or libgmp dependency, proving its packet logic against known-answer tests, and being memory-safe.
## Status
Early development. The current milestone (M0) establishes the project scaffold, the Zig 0.16 module graph, the wire-format headers with a verified RFC 1071 checksum, and a ground-truth smoke that sends one hand-built SYN through a raw `AF_PACKET` socket.
## Build
Requires Zig 0.16.0.
```
zig build # debug build at zig-out/bin/zingela
zig build test # unit tests
zig build run # run (prints help)
zig build run -- --version
________ _ _ ____ _____ _ _
|__ /_ _| \ | |/ ___| ____| | / \
/ / | || \| | | _| _| | | / _ \
/ /_ | || |\ | |_| | |___| |___ / ___ \
/____|___|_| \_|\____|_____|_____/_/ \_\
```
## Smoke test (proves the raw-socket path)
[![Cybersecurity Projects](https://img.shields.io/badge/Cybersecurity--Projects-Project%20%2336-red?style=flat&logo=github)](https://github.com/CarterPerez-dev/Cybersecurity-Projects/tree/main/PROJECTS/advanced/zig-stateless-scanner)
[![Zig](https://img.shields.io/badge/Zig-0.16.0-F7A41D?style=flat&logo=zig&logoColor=white)](https://ziglang.org)
[![Backend](https://img.shields.io/badge/backend-AF__PACKET%20%2B%20AF__XDP-4B7BEC?style=flat)](https://www.kernel.org/doc/html/latest/networking/af_xdp.html)
[![Binary](https://img.shields.io/badge/binary-static%20musl-6d4aff?style=flat)](https://musl.libc.org)
[![License: AGPLv3](https://img.shields.io/badge/License-AGPL_v3-purple.svg)](https://www.gnu.org/licenses/agpl-3.0)
Sending raw packets needs `CAP_NET_RAW` and `CAP_NET_ADMIN`. Grant the capabilities once, then run without sudo (running under sudo drops the environment that the colored output relies on):
> A stateless, line-rate mass TCP/UDP port scanner in the lineage of masscan and zmap. The name is Zulu for "to hunt." It holds no per-connection state, encodes probe identity in a SipHash cookie, walks the address space with a cyclic-group permutation, and ships as a single static binary with no libpcap, no libgmp, and no PCRE. It proves its packet logic against known-answer tests and stays memory-safe under Zig's ReleaseSafe.
```
zig build
sudo setcap cap_net_raw,cap_net_admin=eip ./zig-out/bin/zingela
./zig-out/bin/zingela smoke
## Why a stateless scanner in Zig
A normal TCP client tracks every connection: a socket, a state machine, a retransmit timer. That is fine for thousands of connections and impossible for billions. To sweep the routable IPv4 space you cannot keep a table, so the state moves into the packet itself. zingela encodes each probe's identity in the TCP sequence number with a keyed hash, and validates a reply with one hash recompute. No table, no timers, constant memory, and the transmit and receive engines share nothing and run flat out.
That makes it a sharp showcase for Zig: `extern struct` wire formats with compile-time size assertions, an RFC 1071 checksum in both scalar and `@Vector` form checked against the published vector, raw `AF_PACKET` and `AF_XDP` reached straight through `std.os.linux`, and every checksum and cookie pinned to a known-answer test. The result is a scanner that is fast where it can be, honest where it cannot, and safe by construction.
## The honest positioning
Read this before you believe any speed claim, from us or anyone else.
On stock Linux, masscan, zmap, and zingela all hit the same wall: the kernel `AF_PACKET` transmit path tops out around 1.5 to 2.5 million packets per second on a single core. Every one of these tools meets that ceiling. There is no raw-throughput number to win on identical hardware, and zingela does not claim one.
The only road past that ceiling in masscan is proprietary PF_RING ZC: a paid license, an out-of-tree kernel module, and specific NICs. Its headline figures, roughly 10 Mpps on a single 10GbE NIC and higher in dual-NIC demonstrations, are all PF_RING, never a stock kernel. zingela's road is `AF_XDP`, mainline in Linux since kernel 4.18, with no license and no proprietary module. That backend ships today behind the `-Dxdp` flag (pure syscalls, no libxdp). The head-to-head 10GbE benchmark against masscan is future work, and this README will not quote a line rate that has not been measured on real hardware.
The defensible win is the combination: `AF_XDP` acceleration with no PF_RING paywall, memory-safe Zig, a single static binary, correctness masscan never cleanly solved (RST suppression, validated-ICMP classification, accurate dedup), and a modern colorful interface.
## What Works Today
Every capability below is exercised by unit tests, an in-namespace end-to-end scan, and read-only audit passes.
**Scanning**
- Stateless TCP SYN scan over IPv4 and IPv6 via a raw `AF_PACKET` + `PACKET_TX_RING` + `PACKET_QDISC_BYPASS` datapath
- UDP scan with per-protocol payloads, ICMP type-3 code-3 classified as closed, silence reported honestly as `open|filtered`
- TCP connect() scan (`--connect`) for unprivileged or raw-blocked environments, IPv4 and IPv6
- Cloud and VM raw-send auto-detection (`--backend auto`): a two-socket self-probe detects hypervisors that silently drop raw sends and falls back to connect mode with a clear notice
**Statelessness and coverage**
- SipHash SYN-cookie identity in the TCP sequence number, validated by `ack == cookie +% 1`
- zmap-style multiplicative cyclic-group address permutation, seeded per scan from the OS CSPRNG, with the prime computed at runtime for the exact target space
- Token-bucket rate control, default 10,000 pps, responsible by default
- An RFC 6890 reserved-range exclusion floor that cannot be overridden
**Detection and evasion**
- Service and banner detection (`--banners`): a two-phase NULL-probe plus HTTP grab on open ports; TLS is detected, not decrypted; there is no JA4 (a dedicated Rust tool covers that)
- A stealth suite gated behind `--authorized-scan`: OS-realistic SYN templates, `fin|null|xmas|maimon|ack|window` scan types, Poisson jitter, source-port rotation, decoys, and scoped RST suppression
**Acceleration and output**
- An `AF_XDP` TX backend behind `-Dxdp` (pure-syscall UMEM and rings, with a zero-copy then `XDP_SKB` then `AF_PACKET` selection ladder)
- A truecolor live dashboard and a clean results table on stderr, with NDJSON on stdout (`--json`) so results stay greppable
## Quick Start
```bash
curl -fsSL https://angelamos.com/zingela/install.sh | bash
zingela scan --target 192.0.2.0/24 --ports 80,443 --rate 20000
```
Expected output: one SYN sent to 127.0.0.1:80 on the loopback interface. `zig build smoke` runs the same installed binary, so it works too once the capability is set. Without the capability the smoke prints the setcap instruction and exits cleanly. The capability must be reapplied after every rebuild, since rebuilding replaces the binary.
One command takes a fresh Linux box to `zingela` on your PATH. The installer downloads a prebuilt static musl binary when a release is available and otherwise builds from source (fetching Zig 0.16 if it is missing), then grants `cap_net_raw,cap_net_admin` so raw scans run without sudo.
## Authorized use only
The target shown, `192.0.2.0/24`, is a reserved documentation range (RFC 5737) that zingela skips by design, so it reports zero targets. Substitute a range you own or are authorized to scan. For an unprivileged scan that needs no capabilities, add `--connect`.
zingela sends unsolicited packets to hosts. Scan only systems you own or have explicit written permission to test. Unauthorized scanning may violate the Computer Fraud and Abuse Act and equivalent laws in other jurisdictions. The defaults are deliberately conservative and reserved address ranges are excluded by construction.
> [!TIP]
> This project uses [`just`](https://github.com/casey/just) as a command runner. Type `just` to see every recipe grouped by area: `just safe` for a ReleaseSafe build, `just test-all` for the full matrix, `just bench` for the hot-path numbers, `just dist` for the musl release binaries, `just setcap` to grant capabilities.
>
> Install: `curl -sSf https://just.systems/install.sh | bash -s -- --to ~/.local/bin`
## Learn
This project ships a full teaching track. Read it in order, or jump to what you need.
| Doc | What it covers |
|-----|----------------|
| [`learn/00-OVERVIEW.md`](learn/00-OVERVIEW.md) | What a mass scanner is, why stateless scanning exists, and a quick tour |
| [`learn/01-CONCEPTS.md`](learn/01-CONCEPTS.md) | The handshake, SYN cookies, the permutation, responsible scanning, with real breaches |
| [`learn/02-ARCHITECTURE.md`](learn/02-ARCHITECTURE.md) | The two-engine model, the module map, and the backend ladder, with diagrams |
| [`learn/03-IMPLEMENTATION.md`](learn/03-IMPLEMENTATION.md) | A code walkthrough, module by module |
| [`learn/MECHANICS.md`](learn/MECHANICS.md) | The cookie, checksum, cyclic group, dedup, and token bucket, byte by byte, with the measured numbers |
| [`learn/04-CHALLENGES.md`](learn/04-CHALLENGES.md) | Extension ideas, from a real AF_XDP benchmark to new probe modules |
## Architecture
Two cooperating machines: a stateless line-rate transmit and receive core that owns the packet hot path, and a memory-safe control plane that parses intent, paces the sending, and presents results.
```
you --> cli / scancmd control plane: parse, validate, select backend
|
+---------+---------+
v v
tx (transmit) rx (receive) data plane: no heap alloc after startup
targets.next() read frame
cookie.seq classify open / closed / filtered
template.stamp cookie.validateSynAck (ack == cookie + 1 ?)
ratelimit gate |
packet_io v
| dedup.insert --> output (dashboard / table / NDJSON)
v
AF_XDP --> AF_PACKET TX_RING --> the wire --> AF_PACKET RX
```
Nothing links the transmit column to the receive column except arithmetic: the cookie written into the sequence number is the same cookie recomputed on receipt. A reply without a valid cookie is dropped before it can pollute the results.
**Design decisions:** the address permutation is a multiplicative cyclic group (zmap's approach, uniform coverage), not masscan's BlackRock Feistel cipher, which the 2024 "Ten Years of ZMap" retrospective found finds fewer hosts due to randomization bias. The prime is computed at runtime for the exact scan size rather than drawn from a fixed table. Raw packet I/O goes straight through `std.os.linux`, never `std.posix`, which dropped its socket wrappers. The `AF_XDP` path is asymmetric: it accelerates transmit and pairs with an `AF_PACKET` receive, because replies are sparse and this avoids receive-side steering.
## Build and Test
```bash
zig build # debug build at zig-out/bin/zingela
zig build -Doptimize=ReleaseSafe # the shipped artifact
zig build -Dxdp=true # include the AF_XDP TX backend
zig build test # unit tests (240)
zig build bench # hot-path microbenchmarks
zig build release # static musl binaries for x86_64 + aarch64
just ci # build + test
```
> [!NOTE]
> Plain `zig build` produces a **Debug** binary; the shipped artifact is `--release=safe` (ReleaseSafe), which keeps every undefined-behavior check live as a fail-closed trap rather than silent corruption. Sending raw packets needs `CAP_NET_RAW` and `CAP_NET_ADMIN`: run `just setcap` (or `sudo setcap cap_net_raw,cap_net_admin=eip ./zig-out/bin/zingela`) once, then run without sudo. The capability is cleared whenever the binary is rebuilt, so reapply it after every build.
## Performance
The hot path is CPU-cheap by design, which is the whole basis of the honest positioning above: the bottleneck is the kernel transmit path, never packet construction. These are measured with `zig build bench` on an Intel Core i7-14700KF, single core, ReleaseFast, with inputs varied per iteration and results folded into a printed sink so nothing is optimized away. Reproduce them with `just bench`.
| Operation | ns/op | Throughput |
|---|---|---|
| RFC 1071 checksum, scalar, 40 B header | 6.0 | 6.7 GB/s |
| RFC 1071 checksum, SIMD, 1500 B frame | 30.4 | 49 GB/s |
| SipHash SYN-cookie generate | 14.0 | 71 M/s |
| SipHash SYN-cookie validate | 14.8 | 68 M/s |
| SYN frame stamp (full Ethernet+IP+TCP) | 22.9 | 44 M/s |
| Cyclic-group address permutation step | 4.6 | 216 M/s |
| RX dedup insert | 15.4 | 65 M/s |
A single core builds about 44 million complete SYN frames per second, roughly twenty times faster than the `AF_PACKET` kernel can drain them at 1.5 to 2.5 Mpps. The CPU is never the wall. That is exactly why the only real path to higher throughput is bypassing the kernel with `AF_XDP`, and why there is no honest raw-pps advantage to claim on stock hardware.
## Project Structure
```
zig-stateless-scanner/
├── build.zig # module graph, `release` (musl x2) + `bench` steps, version
├── build.zig.zon # package manifest
├── install.sh # one-shot curl|bash: prebuilt-first, source fallback, setcap
├── src/
│ ├── main.zig # entry: parse args, dispatch smoke / tx / scan
│ ├── cli.zig # argument parsing, help, the violet banner, --version
│ ├── scancmd.zig # the scan command: validate, select backend, launch engines
│ ├── targets.zig # cyclic-group permutation, primitive-root finder, exclusion floor
│ ├── numtheory.zig # modexp, primality, primitive-root test for the permutation
│ ├── packet.zig # wire headers, RFC 1071 checksum (scalar + @Vector), SYN presets
│ ├── cookie.zig # SipHash SYN-cookie generate + validate, v4 and v6
│ ├── template.zig # the SYN frame template stamped per target
│ ├── ratelimit.zig # the token-bucket pacer
│ ├── tx.zig rx.zig # the transmit and receive engines
│ ├── classify.zig # reply classification open / closed / filtered
│ ├── dedup.zig # the lockless open-addressed dedup table
│ ├── packet_io.zig # backend interface: afpacket.zig, afxdp.zig, connect.zig
│ ├── udp.zig # UDP payloads and UDP classification
│ ├── service.zig # opt-in banner and service detection (no JA4)
│ ├── stealth.zig # the --authorized-scan gated evasion features
│ ├── output.zig # live dashboard, results table, NDJSON
│ ├── netutil.zig ndp.zig rawprobe.zig # iface + gateway resolution, NDP, cloud probe
│ └── bench.zig # the hot-path microbenchmark harness
└── learn/ # the teaching track (this is public)
```
## License
[AGPL 3.0](LICENSE).

View File

@ -3,14 +3,94 @@
const std = @import("std");
const zingela_version = "0.0.0-m11";
const ReleaseTarget = struct {
query: std.Target.Query,
asset: []const u8,
};
const release_targets = [_]ReleaseTarget{
.{ .query = .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .musl }, .asset = "zingela-x86_64-linux-musl" },
.{ .query = .{ .cpu_arch = .aarch64, .os_tag = .linux, .abi = .musl }, .asset = "zingela-aarch64-linux-musl" },
};
const Built = struct {
exe: *std.Build.Step.Compile,
test_mods: []const *std.Build.Module,
packet: *std.Build.Module,
cookie: *std.Build.Module,
targets: *std.Build.Module,
template: *std.Build.Module,
dedup: *std.Build.Module,
};
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const xdp_enabled = b.option(bool, "xdp", "Enable the AF_XDP TX backend (pure-syscall, no libxdp; needs CAP_NET_ADMIN at runtime)") orelse false;
const host = buildZingela(b, target, optimize, xdp_enabled);
b.installArtifact(host.exe);
const run_cmd = b.addRunArtifact(host.exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| run_cmd.addArgs(args);
const run_step = b.step("run", "Run zingela");
run_step.dependOn(&run_cmd.step);
const smoke_cmd = b.addSystemCommand(&.{b.getInstallPath(.bin, "zingela")});
smoke_cmd.addArg("smoke");
if (b.args) |args| smoke_cmd.addArgs(args);
smoke_cmd.step.dependOn(b.getInstallStep());
const smoke_step = b.step("smoke", "AF_PACKET ground-truth smoke on the installed binary (setcap it first)");
smoke_step.dependOn(&smoke_cmd.step);
const test_step = b.step("test", "Run unit tests");
for (host.test_mods) |mod| {
const t = b.addTest(.{ .root_module = mod });
const rt = b.addRunArtifact(t);
test_step.dependOn(&rt.step);
}
const bench_src = buildZingela(b, target, .ReleaseFast, xdp_enabled);
const bench_mod = b.createModule(.{
.root_source_file = b.path("src/bench.zig"),
.target = target,
.optimize = .ReleaseFast,
});
bench_mod.addImport("packet", bench_src.packet);
bench_mod.addImport("cookie", bench_src.cookie);
bench_mod.addImport("targets", bench_src.targets);
bench_mod.addImport("template", bench_src.template);
bench_mod.addImport("dedup", bench_src.dedup);
const bench_exe = b.addExecutable(.{ .name = "zingela-bench", .root_module = bench_mod });
const bench_run = b.addRunArtifact(bench_exe);
if (b.args) |args| bench_run.addArgs(args);
const bench_step = b.step("bench", "Run the hot-path microbenchmarks (ReleaseFast, measured on this host)");
bench_step.dependOn(&bench_run.step);
const release_step = b.step("release", "Build static musl release binaries for every distribution target");
for (release_targets) |rt| {
const resolved = b.resolveTargetQuery(rt.query);
const built = buildZingela(b, resolved, .ReleaseSafe, xdp_enabled);
const inst = b.addInstallArtifact(built.exe, .{
.dest_dir = .{ .override = .{ .custom = "release" } },
.dest_sub_path = rt.asset,
});
release_step.dependOn(&inst.step);
}
}
fn buildZingela(
b: *std.Build,
target: std.Build.ResolvedTarget,
optimize: std.builtin.OptimizeMode,
xdp_enabled: bool,
) Built {
const opts = b.addOptions();
opts.addOption([]const u8, "version", "0.0.0-m10");
opts.addOption([]const u8, "version", zingela_version);
opts.addOption(bool, "xdp", xdp_enabled);
const build_config_mod = opts.createModule();
@ -274,26 +354,23 @@ pub fn build(b: *std.Build) void {
exe.root_module.addImport("smoke", smoke_mod);
exe.root_module.addImport("txcmd", txcmd_mod);
exe.root_module.addImport("scancmd", scancmd_mod);
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| run_cmd.addArgs(args);
const run_step = b.step("run", "Run zingela");
run_step.dependOn(&run_cmd.step);
const test_mods = b.allocator.dupe(*std.Build.Module, &.{
packet_mod, cli_mod, smoke_mod, cookie_mod, numtheory_mod,
targets_mod, ratelimit_mod, template_mod, segment_mod, regex_mod,
probe_mod, service_mod, payloads_mod, udp_mod, afpacket_mod,
xdp_mod, afxdp_mod, packet_io_mod, tx_mod, txcmd_mod,
classify_mod, dedup_mod, rx_mod, netutil_mod, rawprobe_mod,
ndp_mod, stealth_mod, output_mod, connect_mod, scancmd_mod,
}) catch @panic("OOM");
const smoke_cmd = b.addSystemCommand(&.{b.getInstallPath(.bin, "zingela")});
smoke_cmd.addArg("smoke");
if (b.args) |args| smoke_cmd.addArgs(args);
smoke_cmd.step.dependOn(b.getInstallStep());
const smoke_step = b.step("smoke", "AF_PACKET ground-truth smoke on the installed binary (setcap it first)");
smoke_step.dependOn(&smoke_cmd.step);
const test_step = b.step("test", "Run unit tests");
const test_mods = [_]*std.Build.Module{ packet_mod, cli_mod, smoke_mod, cookie_mod, numtheory_mod, targets_mod, ratelimit_mod, template_mod, segment_mod, regex_mod, probe_mod, service_mod, payloads_mod, udp_mod, afpacket_mod, xdp_mod, afxdp_mod, packet_io_mod, tx_mod, txcmd_mod, classify_mod, dedup_mod, rx_mod, netutil_mod, rawprobe_mod, ndp_mod, stealth_mod, output_mod, connect_mod, scancmd_mod };
for (test_mods) |mod| {
const t = b.addTest(.{ .root_module = mod });
const rt = b.addRunArtifact(t);
test_step.dependOn(&rt.step);
}
return .{
.exe = exe,
.test_mods = test_mods,
.packet = packet_mod,
.cookie = cookie_mod,
.targets = targets_mod,
.template = template_mod,
.dedup = dedup_mod,
};
}

View File

@ -0,0 +1,282 @@
#!/usr/bin/env bash
# ©AngelaMos | 2026
# install.sh
set -euo pipefail
# --- config ---------------------------------------------------------------
REPO_OWNER="CarterPerez-dev"
REPO_NAME="Cybersecurity-Projects"
PROJECT_SUBDIR="PROJECTS/advanced/zig-stateless-scanner"
BINARY="zingela"
TAGLINE="stateless mass TCP/UDP scanner - single static Zig binary"
REPO_URL="https://github.com/${REPO_OWNER}/${REPO_NAME}.git"
INSTALL_DIR="${ZINGELA_INSTALL_DIR:-$HOME/.local/bin}"
DEFAULT_BRANCH="main"
ZIG_VER="0.16.0"
ZIG_MIN="0.16.0"
DO_SETCAP=1
# --- colors (gated so `| bash`, logs and CI stay clean) -------------------
if [ -t 2 ] && [ -z "${NO_COLOR:-}" ]; then
BOLD=$'\033[1m'; DIM=$'\033[2m'; RED=$'\033[31m'; GREEN=$'\033[32m'
YELLOW=$'\033[33m'; VIOLET=$'\033[38;2;139;92;246m'; RESET=$'\033[0m'
else
BOLD=""; DIM=""; RED=""; GREEN=""; YELLOW=""; VIOLET=""; RESET=""
fi
info() { printf '%s\n' " ${VIOLET}+${RESET} $*" >&2; }
ok() { printf '%s\n' " ${GREEN}+${RESET} $*" >&2; }
warn() { printf '%s\n' " ${YELLOW}!${RESET} $*" >&2; }
die() { printf '%s\n' " ${RED}x $*${RESET}" >&2; exit 1; }
header(){ printf '\n%s\n\n' "${BOLD}${VIOLET}--- $* ---${RESET}" >&2; }
have() { command -v "$1" >/dev/null 2>&1; }
trap 'printf "%s\n" "${RED}x install failed${RESET}" >&2' ERR
TMP_DIR=""
cleanup() { [ -n "$TMP_DIR" ] && rm -rf "$TMP_DIR"; return 0; }
trap cleanup EXIT
banner() {
printf '%s' "${VIOLET}${BOLD}" >&2
cat >&2 <<'ART'
____ _ _
|_ /(_) _ _ __ _ ___| | __ _
/ / | || ' \ / _` |/ -_) |/ _` |
/___||_||_||_|\__, |\___|_|\__,_|
|___/
ART
printf '%s\n' "${RESET}" >&2
printf '%s\n' " ${DIM}${TAGLINE}${RESET}" >&2
}
# --- privilege + package manager fan --------------------------------------
SUDO=""
if [ "$(id -u)" -ne 0 ]; then
if have sudo; then SUDO="sudo"; fi
fi
pkg_install() {
if have apt-get; then $SUDO apt-get update -y || warn "apt update had errors; continuing"
$SUDO apt-get install -y --no-install-recommends "$@"
elif have dnf; then $SUDO dnf install -y "$@"
elif have pacman; then $SUDO pacman -S --needed --noconfirm "$@"
elif have zypper; then $SUDO zypper install -y "$@"
elif have apk; then $SUDO apk add "$@"
else die "no known package manager. Install manually: $*"; fi
}
download() {
if have curl; then curl -fsSL "$1" -o "$2" || return 1
elif have wget; then wget -qO "$2" "$1" || return 1
else die "need curl or wget"; fi
}
version_ge() { [ "$(printf '%s\n%s\n' "$2" "$1" | sort -V | head -1)" = "$2" ]; }
# --- args -----------------------------------------------------------------
usage() {
cat >&2 <<USAGE
install.sh - install ${BINARY}
./install.sh [options]
curl -fsSL https://angelamos.com/${BINARY}/install.sh | bash
options:
--prefix DIR install dir (default: ${INSTALL_DIR})
--no-setcap skip granting raw-socket capabilities (use sudo or --connect instead)
-h, --help this help
USAGE
}
while [ $# -gt 0 ]; do
case "$1" in
--prefix) INSTALL_DIR="$2"; shift 2 ;;
--prefix=*) INSTALL_DIR="${1#*=}"; shift ;;
--no-setcap) DO_SETCAP=0; shift ;;
-h|--help) usage; exit 0 ;;
*) die "unknown option: $1 (try --help)" ;;
esac
done
# --- OS / arch (Linux only: raw AF_PACKET + std.os.linux) -----------------
OS="$(uname -s)"; ARCH="$(uname -m)"
case "$OS" in
Linux) ;;
Darwin) die "${BINARY} is Linux-only (raw AF_PACKET / XDP). Run it in a Linux VM or WSL2." ;;
MINGW*|MSYS*|CYGWIN*) die "${BINARY} is Linux-only. Use WSL2." ;;
*) die "unsupported OS: $OS (${BINARY} is Linux-only)" ;;
esac
case "$ARCH" in
x86_64|amd64) MUSL_ARCH="x86_64" ;;
aarch64|arm64) MUSL_ARCH="aarch64" ;;
*) die "unsupported arch: $ARCH (${BINARY} builds for x86_64 and aarch64)" ;;
esac
# --- bootstrap: works in-clone OR piped from a domain ---------------------
clone_repo() {
local cache="$1"
if git clone --depth 1 --filter=blob:none --sparse --branch "$DEFAULT_BRANCH" --quiet "$REPO_URL" "$cache" 2>/dev/null \
&& git -C "$cache" sparse-checkout set "$PROJECT_SUBDIR" 2>/dev/null; then
return 0
fi
rm -rf "$cache"
git clone --depth 1 --branch "$DEFAULT_BRANCH" --quiet "$REPO_URL" "$cache"
}
resolve_project_dir() {
if [ -f "./build.zig" ] && [ -d "./src" ]; then pwd; return; fi
if [ -f "./${PROJECT_SUBDIR}/build.zig" ]; then printf '%s\n' "$(pwd)/${PROJECT_SUBDIR}"; return; fi
local self="${BASH_SOURCE[0]:-}"
if [ -n "$self" ] && [ -f "$(dirname "$self")/build.zig" ]; then (cd "$(dirname "$self")" && pwd); return; fi
if ! have git; then warn "git missing - installing it"; pkg_install git; fi
have git || die "could not install git; install it then re-run"
local cache="${XDG_CACHE_HOME:-$HOME/.cache}/${BINARY}-src"
if [ -d "$cache/.git" ]; then
info "updating cached clone at $cache"
git -C "$cache" pull --ff-only --quiet 2>/dev/null || warn "pull failed; using existing clone"
else
info "cloning ${REPO_URL} (sparse: ${PROJECT_SUBDIR})"
clone_repo "$cache"
fi
printf '%s\n' "$cache/${PROJECT_SUBDIR}"
}
# --- toolchain: Zig 0.16, auto-fetched if missing/too old -----------------
need_toolchain() {
if have zig; then
local v; v="$(zig version 2>/dev/null | head -1)"
if version_ge "$v" "$ZIG_MIN"; then ok "zig $v"; return; fi
warn "zig $v is older than ${ZIG_MIN}; fetching a private ${ZIG_VER}"
else
info "zig not found; fetching ${ZIG_VER}"
fi
local zroot="zig-${MUSL_ARCH}-linux-${ZIG_VER}"
local zdir="${XDG_CACHE_HOME:-$HOME/.cache}/${BINARY}-zig"
if [ ! -x "$zdir/$zroot/zig" ]; then
mkdir -p "$zdir"
TMP_DIR="${TMP_DIR:-$(mktemp -d)}"
info "downloading https://ziglang.org/download/${ZIG_VER}/${zroot}.tar.xz"
download "https://ziglang.org/download/${ZIG_VER}/${zroot}.tar.xz" "$TMP_DIR/zig.tar.xz" \
|| die "could not download Zig ${ZIG_VER}"
if ! tar -xf "$TMP_DIR/zig.tar.xz" -C "$zdir" 2>/dev/null; then
pkg_install xz-utils 2>/dev/null || pkg_install xz 2>/dev/null || true
tar -xf "$TMP_DIR/zig.tar.xz" -C "$zdir" || die "could not extract Zig (need tar + xz)"
fi
fi
export PATH="$zdir/$zroot:$PATH"
have zig || die "zig still not on PATH after fetch"
ok "zig $(zig version)"
}
build_from_source() {
info "zig build --release=safe (compiling ${BINARY}; this can take a minute)"
zig build --release=safe
[ -x "zig-out/bin/${BINARY}" ] || die "build did not produce zig-out/bin/${BINARY}"
mkdir -p "$INSTALL_DIR"
install -m 0755 "zig-out/bin/${BINARY}" "$INSTALL_DIR/$BINARY"
ok "built + installed ${INSTALL_DIR}/${BINARY}"
}
try_prebuilt() {
local tag asset url
tag="$(download "https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/releases" /dev/stdout 2>/dev/null \
| grep '"tag_name":' | grep -o '"zingela-[^"]*"' | head -1 | tr -d '"')" || true
[ -n "$tag" ] || { info "no published ${BINARY} release yet - building from source"; return 1; }
asset="zingela-${MUSL_ARCH}-linux-musl"
url="https://github.com/${REPO_OWNER}/${REPO_NAME}/releases/download/${tag}/${asset}"
TMP_DIR="${TMP_DIR:-$(mktemp -d)}"
info "downloading prebuilt ${tag} (${asset})"
download "$url" "$TMP_DIR/$BINARY" || { warn "no prebuilt ${asset} in ${tag}; building from source"; return 1; }
mkdir -p "$INSTALL_DIR"
install -m 0755 "$TMP_DIR/$BINARY" "$INSTALL_DIR/$BINARY"
ok "installed prebuilt ${tag} -> ${INSTALL_DIR}/${BINARY}"
return 0
}
# --- PATH wiring ----------------------------------------------------------
wire_path() {
case ":$PATH:" in *":$INSTALL_DIR:"*) ok "$INSTALL_DIR already on PATH"; return ;; esac
local shell rc=""
shell="$(basename "${SHELL:-bash}")"
case "$shell" in
zsh) rc="$HOME/.zshrc" ;;
fish) mkdir -p "$HOME/.config/fish/conf.d"
echo "fish_add_path $INSTALL_DIR" > "$HOME/.config/fish/conf.d/${BINARY}.fish"
ok "added to fish conf.d" ;;
bash) rc="$HOME/.bashrc"; [ -f "$rc" ] || rc="$HOME/.bash_profile" ;;
*) rc="$HOME/.profile" ;;
esac
if [ -n "$rc" ] && ! grep -q "$INSTALL_DIR" "$rc" 2>/dev/null; then
printf '\nexport PATH="%s:$PATH"\n' "$INSTALL_DIR" >> "$rc"
ok "added $INSTALL_DIR to PATH in $rc"
fi
export PATH="$INSTALL_DIR:$PATH"
}
# --- raw-socket capabilities (so `zingela scan` needs no sudo) ------------
grant_caps() {
local dest="$INSTALL_DIR/$BINARY"
if [ "$DO_SETCAP" -ne 1 ]; then
warn "skipping setcap (--no-setcap). Raw scans need: ${SUDO:+sudo }setcap cap_net_raw,cap_net_admin=eip \"$dest\""
return 0
fi
if ! have setcap; then
warn "setcap not found. For raw scans, install libcap then grant caps:"
warn " ${SUDO:+sudo }apt-get install -y libcap2-bin (or dnf/pacman equivalent)"
warn " ${SUDO:+sudo }setcap cap_net_raw,cap_net_admin=eip \"$dest\""
warn "or scan unprivileged right now: ${BINARY} scan --connect --target <cidr> --ports <list>"
return 0
fi
if $SUDO setcap cap_net_raw,cap_net_admin=eip "$dest"; then
ok "granted CAP_NET_RAW + CAP_NET_ADMIN - raw scans run WITHOUT sudo"
else
warn "could not setcap (needs root). Enable raw scans without sudo via:"
warn " ${SUDO:+sudo }setcap cap_net_raw,cap_net_admin=eip \"$dest\""
warn "until then: run under sudo, or use ${BINARY} scan --connect (no caps needed)"
fi
return 0
}
# --- main -----------------------------------------------------------------
# main() runs only after bash has read the whole file, and `</dev/null`
# denies children the pipe, so `curl ... | bash` never stops early.
main() {
banner
if have "$BINARY"; then info "existing install at $(command -v "$BINARY") - updating"; fi
if ! try_prebuilt; then
header "Build from source"
PROJECT_DIR="$(resolve_project_dir)"
cd "$PROJECT_DIR"
need_toolchain
build_from_source
fi
wire_path
grant_caps
header "Verify"
if have "$BINARY"; then
ok "$BINARY -> $(command -v "$BINARY")"
"$BINARY" --version 2>/dev/null || true
else
warn "installed to $INSTALL_DIR but not on PATH yet - open a new shell"
fi
printf '\n%s\n\n' " ${GREEN}${BOLD}${BINARY} is ready.${RESET}" >&2
cat >&2 <<FOOTER
${DIM}quick start:${RESET}
${VIOLET}${BINARY} --help${RESET}
${VIOLET}${BINARY} scan --target 192.0.2.0/24 --ports 80,443 --rate 20000${RESET}
${VIOLET}${BINARY} scan --connect --target 192.0.2.0/24 --ports 22${RESET} ${DIM}(no caps needed)${RESET}
${DIM}the example target 192.0.2.0/24 is a reserved documentation range that ${BINARY}
skips by design; replace it with a range you are authorized to scan.${RESET}
${DIM}note: capabilities are cleared whenever the binary is replaced, so re-run this
installer (or the setcap line) after every upgrade.${RESET}
${DIM}docs: https://github.com/${REPO_OWNER}/${REPO_NAME}/tree/main/${PROJECT_SUBDIR}${RESET}
FOOTER
return 0
}
main "$@" </dev/null

View File

@ -0,0 +1,147 @@
# =============================================================================
# ©AngelaMos | 2026
# justfile
# =============================================================================
set shell := ["bash", "-uc"]
project := file_name(justfile_directory())
version := `git describe --tags --always 2>/dev/null || echo "dev"`
bin := justfile_directory() / "zig-out/bin/zingela"
# =============================================================================
# Default
# =============================================================================
default:
@just --list --unsorted
# =============================================================================
# Build (plain zig build is Debug; the shipped artifact is ReleaseSafe)
# =============================================================================
[group('build')]
build:
zig build
[group('build')]
safe:
zig build -Doptimize=ReleaseSafe
[group('build')]
fast:
zig build -Doptimize=ReleaseFast
# ReleaseSafe with the AF_XDP TX backend compiled in
[group('build')]
xdp:
zig build -Doptimize=ReleaseSafe -Dxdp=true
# static musl binaries for every distribution target -> zig-out/release/
[group('build')]
dist:
zig build release
# =============================================================================
# Test
# =============================================================================
[group('test')]
test:
zig build test
[group('test')]
test-verbose:
zig build test --summary all
# the full matrix: Debug + ReleaseSafe, each with and without -Dxdp
[group('test')]
test-all:
zig build test --summary all
zig build test -Doptimize=ReleaseSafe --summary all
zig build test -Dxdp=true --summary all
zig build test -Doptimize=ReleaseSafe -Dxdp=true --summary all
# =============================================================================
# Bench
# =============================================================================
# hot-path microbenchmarks, ReleaseFast, measured on this host
[group('bench')]
bench:
zig build bench
# =============================================================================
# Run
# =============================================================================
# run the built binary with any args, e.g. `just run --help`
[group('run')]
run *ARGS: build
{{bin}} {{ARGS}}
# SYN/UDP scan; pass flags, e.g. `just scan --target 192.0.2.0/24 --ports 80`
[group('run')]
scan *ARGS: build
{{bin}} scan {{ARGS}}
# grant raw-socket caps so scans run without sudo (reapply after every rebuild)
[group('run')]
setcap: build
sudo setcap cap_net_raw,cap_net_admin=eip {{bin}}
# AF_PACKET ground-truth smoke on the installed binary (needs caps: run `just setcap`)
[group('run')]
smoke:
zig build smoke
# =============================================================================
# Lint and Format
# =============================================================================
[group('lint')]
fmt:
zig fmt build.zig build.zig.zon src
[group('lint')]
fmt-check:
zig fmt --check build.zig build.zig.zon src
# =============================================================================
# Install
# =============================================================================
# one-shot install to PATH + setcap (prebuilt-first, source fallback)
[group('install')]
install:
./install.sh
[group('install')]
uninstall:
./uninstall.sh
# =============================================================================
# CI / Quality (the always-green gate; fmt-check and smoke are separate:
# smoke needs raw-socket caps, and fmt has pre-existing debt to clear)
# =============================================================================
[group('ci')]
ci: build test
# =============================================================================
# Utilities
# =============================================================================
[group('util')]
info:
@echo "Project: {{project}}"
@echo "Version: {{version}}"
@echo "Binary: {{bin}}"
@echo "OS: {{os()}} ({{arch()}})"
@zig version | xargs -I{} echo "Zig: {}"
[group('util')]
clean:
-rm -rf zig-out
-rm -rf .zig-cache
@echo "Build artifacts cleaned"

View File

@ -0,0 +1,62 @@
<!-- ©AngelaMos | 2026 -->
<!-- 00-OVERVIEW.md -->
# zingela: Overview
zingela is a stateless, line-rate mass port scanner. You give it a range of addresses and ports, it sends one crafted probe to each, and it classifies every reply as open, closed, or filtered without ever holding a connection table. It is written in Zig 0.16, ships as a single static binary with no libpcap and no libgmp, and it is the direct descendant of two tools: masscan (Robert Graham, 2013) and zmap (Durumeric, Wustrow, and Halderman, USENIX Security 2013).
This folder teaches how it works, from the security theory down to the bytes on the wire.
## Why stateless scanning exists
A normal TCP client tracks every connection: a socket, a state machine, a retransmit timer, a receive buffer. That is fine for a few thousand connections. It falls apart at internet scale. To probe all 3.7 billion routable IPv4 addresses on one port, a stateful scanner would need billions of live socket structures and the kernel bookkeeping to match. It cannot be done on one machine.
The stateless trick is to carry the state in the packet itself. zingela encodes the identity of each probe into the TCP initial sequence number using a keyed hash. When a reply comes back, the acknowledgement number carries that identity back, and a single hash recompute proves the reply is genuinely a response to a probe zingela sent. No table, no timers, no per-target memory. The transmit side and the receive side share almost nothing and run flat out.
This is the same design that let zmap scan the entire public IPv4 space in about 45 minutes from a single machine in 2013, a result that turned internet-wide scanning from a research curiosity into an everyday measurement tool.
## The honest positioning
Read this before you believe any speed claim, from us or anyone else.
On stock Linux hardware, masscan, zmap, and zingela all hit the same wall: the kernel `AF_PACKET` transmit path tops out around 1.5 to 2.5 million packets per second on a single core. Every one of these tools meets that ceiling. There is no raw-throughput bragging number to win on identical hardware, and zingela does not claim one.
The only road past that ceiling in masscan is proprietary: PF_RING ZC, which needs a paid ntop license, an out-of-tree kernel module, and specific Intel NICs. Its headline figures (10 Mpps on the README, higher in dual-NIC demos) are all PF_RING, never a stock kernel. zingela's road is `AF_XDP`, mainline in Linux since kernel 4.18, with no license and no proprietary module. That backend ships today behind the `-Dxdp` build flag. The full head-to-head against masscan on 10GbE hardware is future work, and these docs will never quote a line rate that has not been measured on real hardware.
So the defensible win is not "faster." It is: acceleration with no paywall, memory safety proven under Zig's ReleaseSafe checks, a single static binary, correctness that masscan never cleanly solved, and a modern interface. The [performance section of MECHANICS](MECHANICS.md) shows the measured hot-path numbers and explains why the CPU is never the bottleneck.
## What works today
- TCP SYN scan over IPv4 and IPv6, using a raw kernel-bypass transmit ring.
- UDP scan with per-protocol payloads and honest open-versus-filtered reporting.
- A TCP connect scan that needs no privileges, for locked-down or cloud environments.
- Automatic detection of hypervisors that silently drop raw sends, with a fallback to connect mode.
- Service and banner detection on open ports, opt-in and two-phase.
- A stealth and evasion suite, gated behind an explicit authorization acknowledgement.
- SipHash cookie statelessness, cyclic-group address permutation, token-bucket rate control, and a non-overridable exclusion of reserved address ranges.
- A truecolor live dashboard and greppable NDJSON output.
## Quick start
```
curl -fsSL https://angelamos.com/zingela/install.sh | bash
zingela scan --target 192.0.2.0/24 --ports 80,443 --rate 20000
```
The installer lands `zingela` on your PATH and grants the raw-socket capabilities so it runs without sudo. If you are on a box where you cannot or should not send raw packets, add `--connect` for the unprivileged scanner.
The target shown, `192.0.2.0/24`, is a reserved documentation range (RFC 5737) that zingela skips by design, so it reports zero targets. Substitute a range you own or are authorized to scan.
## Prerequisites for reading
You will get the most from these docs if you are comfortable with the TCP three-way handshake, the shape of IPv4 and TCP headers, and basic modular arithmetic. You do not need to know Zig; the walkthroughs name functions and files, not language trivia. Where a concept has a famous real-world example, we anchor it there.
## The rest of this folder
| Doc | What it covers |
|---|---|
| [01-CONCEPTS.md](01-CONCEPTS.md) | the security theory: statelessness, SYN cookies, what a scan can observe, responsible scanning, and the incidents that shaped all of it |
| [02-ARCHITECTURE.md](02-ARCHITECTURE.md) | the system design: the two-engine model, the module map, and the backend ladder, with diagrams |
| [03-IMPLEMENTATION.md](03-IMPLEMENTATION.md) | a guided walk through the code, module by module |
| [MECHANICS.md](MECHANICS.md) | the byte-level and math-level deep dive: the cookie, the checksum, the cyclic group, and the measured performance |
| [04-CHALLENGES.md](04-CHALLENGES.md) | ways to extend zingela, from a real AF_XDP benchmark to new probe modules |

View File

@ -0,0 +1,69 @@
<!-- ©AngelaMos | 2026 -->
<!-- 01-CONCEPTS.md -->
# Concepts
This doc explains the ideas zingela is built on, and grounds each in a real event so the stakes are concrete.
## The three-way handshake, and what a probe can learn
A TCP connection opens with three packets. The client sends a SYN. If the port is open, the server answers with a SYN-ACK. The client completes the connection with an ACK. If the port is closed, the server answers the SYN with a RST instead. If a firewall is dropping the traffic, nothing comes back at all.
A stateless SYN scan sends only the first packet and reads the answer:
```
zingela target
| ----- SYN --------> | open -> SYN-ACK comes back
| ----- SYN --------> | closed -> RST comes back
| ----- SYN --------> | filtered -> silence
```
zingela never sends the final ACK, so the connection is never established and the target application never sees a completed session. This is why a SYN scan is fast and light. It is also why the classification has exactly three outcomes: open (SYN-ACK), closed (RST), and filtered (no reply within the wait window). UDP is murkier, and gets its own honest treatment below.
## Statelessness: carry the state in the packet
The central idea. A stateful scanner remembers every probe it sent so it can match a reply. A stateless scanner remembers nothing and instead makes each reply prove its own legitimacy.
zingela does this with a keyed hash called a SYN cookie. Before sending a probe to a target, it computes a value from the four-tuple (source address, source port, destination address, destination port) using SipHash keyed with per-scan random entropy, and writes the low 32 bits into the TCP sequence number field. A real target that answers a SYN echoes that sequence number plus one in the acknowledgement field of its SYN-ACK. When the reply arrives, zingela recomputes the same hash from the packet's addresses and ports and checks that the acknowledgement equals the cookie plus one. If it matches, the reply is genuine. If it does not, the packet is a stray, a spoof, or a stale echo, and it is dropped for free.
The payoff is enormous. There is no connection table, so memory use is constant no matter how many billions of targets you sweep. The transmit engine and receive engine share no per-probe state, so they run as independent threads at full speed. Spoofed replies are rejected by arithmetic rather than by a firewall rule.
The cost is subtle and worth understanding. Because the scanner holds no record of what it sent, it cannot know a probe was lost, so loss looks identical to a filtered port. Serious stateless scanners answer this with unconditional retransmission (send every probe a few times) rather than with response tracking, because tracking would reintroduce the state you worked so hard to remove.
## SYN cookies came from a real attack
The cookie idea is not a scanner invention. It was Daniel Bernstein's 1996 defense against SYN flood denial-of-service attacks, in which an attacker sends floods of SYNs and never completes the handshake, exhausting the server's half-open connection table. Bernstein's answer was to stop storing half-open connections and instead encode the needed state in the sequence number itself, validating it when the ACK returns. A stateless scanner runs that same trick from the other side of the wire: the scanner, not the server, is the party that refuses to hold state.
## Walking the address space without a list
To scan a range you must visit every address in it, ideally in a scrambled order so you do not hammer one subnet at a time and trip its intrusion detection. The naive way is to build a list, shuffle it, and iterate. At internet scale the list alone is tens of gigabytes.
zingela borrows zmap's answer: a multiplicative cyclic group over a prime just above the size of the target space. It keeps three numbers (a current value, a generator, and the prime) and advances with one multiply and one modulo per target. Because the generator is a primitive root of the prime, the sequence visits every element of the space exactly once before returning to the start. It is a perfect shuffle with O(1) memory: no list, no bitmap of remaining work, no per-address random number call.
masscan solves the same problem with a block cipher (a Feistel network it calls BlackRock2). The 2024 "Ten Years of ZMap" retrospective measured the consequence: masscan finds notably fewer hosts than zmap, likely because of biases in that randomization. zingela takes the cyclic-group road precisely to avoid that bias. The [cyclic group section of MECHANICS](MECHANICS.md) shows the math.
## Rate limiting, and why the default is slow
zingela defaults to 10,000 packets per second, and it warns loudly before you push into the millions. That conservatism is deliberate, and it is a lesson written in outages.
On 25 January 2003 the SQL Slammer worm (exploiting CVE-2002-0649 in Microsoft SQL Server on UDP port 1434) demonstrated stateless scanning at its most destructive. It was a single 376-byte UDP packet that, on infecting a host, immediately began blasting copies to random addresses as fast as the network card allowed. It infected around 75,000 hosts in ten minutes, doubling roughly every 8.5 seconds, and the sheer volume of scan traffic saturated links and knocked parts of the internet offline. Slammer held no state and rate-limited nothing. It is the cautionary twin of every stateless scanner.
The lesson is that a tool which can emit packets at line rate is a tool that can flood a network by accident. masscan's own aggressive defaults have gotten it null-routed by ISPs. zingela uses a token bucket to pace transmission and makes fast scanning an explicit, warned choice rather than the default.
## Reserved ranges are excluded by construction
Some address blocks must never be scanned: loopback, private RFC 1918 space, link-local, multicast, and the documentation ranges. zingela checks a reserved-range table before it crafts any packet, and that exclusion floor cannot be overridden by a flag. If you point it at a range that overlaps reserved space, the reserved portion is subtracted and simply never probed. This is why aiming the scanner at `10.0.0.0/8` yields zero targets: the entire block is RFC 1918 private space and is removed before the first packet.
## Source spoofing is gated, not default
You can forge the source IP of a scan. Doing it by default would be reckless, and it barely works: only about a fifth of autonomous systems on the internet permit spoofed egress, because most implement the anti-spoofing filtering described in BCP 38. The legitimate use is testing your own network's BCP 38 compliance. zingela therefore treats spoofing and every other evasion feature as gated behind an explicit `--authorized-scan` acknowledgement, never as a quiet default.
## The legal line
Scanning sends unsolicited packets to machines you may not own. In the United States that can fall under the Computer Fraud and Abuse Act, the same 1986 statute under which Robert Tappan Morris was convicted after his 1988 worm scanned and infected roughly 6,000 machines, about a tenth of the internet of the day. Courts have treated unauthorized scanning inconsistently, but the safe rule is simple and absolute: scan only systems you own or have explicit written permission to test.
The same techniques serve defense. When Heartbleed (CVE-2014-0160) broke in April 2014, researchers used zmap to scan the entire internet repeatedly, measuring how many servers were vulnerable and how fast operators patched. Internet-wide measurement, vulnerability tracking, and asset inventory are exactly what these tools are for, when you have the authority to run them. zingela's defaults, its gating, and its exclusion floor are there to keep the tool on the right side of that line.
## Why aggressive scanning gets you noticed
The 2016 Mirai botnet scanned TCP ports 23 and 2323 across the entire IPv4 space, trying about 60 default telnet credentials, and assembled a botnet large enough to take down Krebs on Security, OVH, and the Dyn DNS provider in October 2016. It was loud, fast, and indiscriminate, and it was trivially detectable precisely because of that. The stealth suite in zingela exists so that authorized testers can study detectability (jitter, decoys, OS-realistic fingerprints, alternate scan types), not so that anyone can be quieter while doing harm. That is why it is gated. See [04-CHALLENGES.md](04-CHALLENGES.md) for the evasion topics as study exercises.

View File

@ -0,0 +1,112 @@
<!-- ©AngelaMos | 2026 -->
<!-- 02-ARCHITECTURE.md -->
# Architecture
zingela is two machines bolted together: a stateless line-rate transmit and receive core that owns the packet hot path, and a memory-safe control plane that parses your intent, paces the sending, and presents the results. This doc shows how they fit.
## The big picture
```
you control plane data plane
------------ ------------------------------------ --------------------
--target -> cli.zig -> scancmd.zig tx.zig (transmit)
--ports parse validate, build Config -> pull target
--rate help select backend stamp frame
--backend banner launch engines rate-gate
| \ push to ring
| \ |
v v v
output.zig rx.zig (receive) packet_io.zig
dashboard read frame AF_XDP or
table validate cookie AF_PACKET or
NDJSON classify connect
^ dedup
| push found host
+---------------+
```
The control plane never touches a raw socket in the hot loop. The data plane never allocates after startup. That separation is what keeps the scanner both safe and fast.
## The stateless data flow
Follow one probe and its reply all the way through. This is the heart of the design.
```
TRANSMIT RECEIVE
-------- -------
targets.Engine.next() packet_io rxPoll()
gives (ip, port) reads a frame
| |
v v
cookie.seq(ip,port,src,srcport) classify.classifyTcp()
= low 32 bits of is it SYN-ACK / RST / ICMP?
SipHash(4-tuple) |
| v
v cookie.validateSynAck(ack,...)
template.stamp(frame, ip, port) ack == cookie + 1 ?
writes Eth+IP+TCP, |
puts cookie in TCP seq yes --+-- no
| | |
v v v
ratelimit token gate dedup.insert drop (stray/spoof)
| new host?
v |
packet_io txSubmit + txKick --- wire ---> output emit
```
Nothing links the left column to the right except arithmetic. The cookie written into the sequence number on transmit is the same cookie recomputed and checked on receive. There is no shared table, no correlation ID lookup, no per-probe memory. A reply that does not carry a valid cookie is discarded before it can pollute the results.
## The two engines
The transmit engine and the receive engine run as concurrent tasks launched with `io.concurrent` over Zig's `std.Io.Threaded`. This is not the old `async` keyword, which Zig removed, and it is not a future per probe. It is two long-lived workers.
The transmit engine runs hot. It pulls targets from the address permutation, stamps each into a preallocated frame buffer, passes it through the token-bucket rate gate, and hands it to the packet backend. After startup it does not allocate: the transmit ring is memory-mapped once, and per-packet scratch comes from a fixed buffer.
The receive engine reads frames from the backend, classifies each as SYN-ACK, RST, or a relevant ICMP error, validates the cookie, deduplicates against a lockless open-addressed hash table so a host that answers twice is reported once, and pushes newly found hosts to the output side. Replies are sparse compared to probes, so the receive engine is far less hot than the transmit engine, which is why the backend design below can afford to be asymmetric.
## The backend ladder
The packet input and output path is chosen at runtime through one interface (`packet_io.zig`) with several implementations. The scanner core does not know or care which one is active.
```
--backend auto picks the first that works:
1. AF_XDP zero-copy fastest, driver-dependent -Dxdp build
2. AF_XDP with XDP_SKB copy mode, works on more drivers -Dxdp build
3. AF_PACKET + TX_RING universal, kernel-bypass TX ring always built
+ QDISC_BYPASS the v1 default, matches masscan-stock
4. AF_PACKET sendto plain, used by the ground-truth smoke
5. connect scan TCP via the OS stack, no raw needed --connect
```
The AF_XDP path is asymmetric: it accelerates transmit and pairs with an `AF_PACKET` receive path. Replies are sparse, so this trades a few percent of theoretical receive throughput for a much simpler design with no receive-side steering or map wiring. When `--backend auto` runs, a two-socket self-probe first checks whether raw sends actually leave the machine. On a cloud instance or a VM where the hypervisor silently drops raw frames, that probe fails and zingela falls back to the connect scanner with a clear notice, rather than reporting a scan that sent nothing.
## The module map
| Module | Responsibility |
|---|---|
| `main.zig` | entry point: parse arguments, build config, dispatch to a subcommand |
| `cli.zig` | argument parsing, help, the banner and version |
| `scancmd.zig` | the scan command: validate, select backend, launch transmit and receive, drive output |
| `txcmd.zig` | the transmit-only blast command |
| `targets.zig` | the cyclic-group permutation engine, primitive-root finder, address and port picker, exclusion floor |
| `numtheory.zig` | modular exponentiation, primality, primitive-root testing for the permutation |
| `packet.zig` | wire-format headers, the RFC 1071 checksum (scalar and SIMD), OS-realistic SYN presets |
| `cookie.zig` | SipHash SYN-cookie generation and validation, IPv4 and IPv6 |
| `template.zig` | the SYN frame template that gets stamped per target |
| `ratelimit.zig` | the token-bucket pacer |
| `tx.zig` | the transmit engine |
| `rx.zig` | the receive engine |
| `classify.zig` | reply classification into open, closed, filtered |
| `dedup.zig` | the lockless open-addressed dedup table |
| `packet_io.zig` | the backend interface, with `afpacket.zig`, `afxdp.zig`, and `connect.zig` implementations |
| `udp.zig` | UDP payloads and UDP-specific classification |
| `service.zig` | the opt-in banner and service detection phase |
| `stealth.zig` | the gated evasion features |
| `output.zig` | the live dashboard, results table, and NDJSON |
| `netutil.zig`, `ndp.zig`, `rawprobe.zig` | interface and gateway resolution, IPv6 neighbor discovery, the cloud self-probe |
## Why the split matters for safety
The 2003 SQL Slammer worm and every buffer-overflow scanning worm since share a root cause: hand-written packet code in C that corrupts memory under load. zingela builds and tests under Zig's ReleaseSafe mode first, where an out-of-bounds slice, an integer overflow, or a null dereference is a defined trap rather than silent memory corruption. The wire-format structs carry compile-time size assertions, every checksum and cookie is checked against a published test vector, and the whole scan is validated end to end inside a network namespace before any release. The [implementation walkthrough](03-IMPLEMENTATION.md) shows where each of these guards lives.

View File

@ -0,0 +1,58 @@
<!-- ©AngelaMos | 2026 -->
<!-- 03-IMPLEMENTATION.md -->
# Implementation Walkthrough
A guided tour of the code. It names functions and files, never line numbers, so it stays correct as the source moves. Read it with the source open beside you. For the byte-level and math-level details, follow the pointers into [MECHANICS.md](MECHANICS.md).
## Wire formats and the checksum: `packet.zig`
Everything the scanner puts on the wire starts here. The Ethernet, IPv4, TCP, UDP, and IPv6 headers are declared as `extern struct` so their field order and packing match the wire exactly, and each carries a compile-time size assertion so a mistaken field can never silently change the layout. Multi-byte fields are converted to network byte order explicitly at the point of writing, never left to chance.
The checksum lives in two functions. `checksum` is the scalar one's-complement sum from RFC 1071. `checksumSimd` is the same math over a vector accumulator for large buffers. Both are validated against the published RFC 1071 worked example. `tcpChecksum` and `tcpChecksum6` build the pseudo-header and run the sum over the TCP segment for IPv4 and IPv6. There is also `incrementalUpdate`, the RFC 1624 trick that patches a checksum when a single field changes without resumming the whole packet.
`ScanType` and `OsProfile` encode the stealth variations. `ScanType.probeFlags` returns the TCP flag byte for a syn, fin, null, xmas, maimon, ack, or window scan, and `OsProfile.options` returns the TCP option bytes of a realistic Linux, Windows, or macOS SYN so a fingerprint looks like a real client rather than a scanner.
The `Addr` union is how one result path serves both address families: it holds either a `u32` for IPv4 or a `[16]u8` for IPv6, so the classification, output, and dedup code is written once.
## The cookie: `cookie.zig`
This is statelessness in about sixty lines. A `Cookie` is a 16-byte key, created from per-scan random entropy. `generate` packs the four-tuple into a small buffer and returns `std.hash.SipHash64(2, 4).toInt` over it, a full 64-bit hash. `seq` truncates that to the 32 bits that fit in a TCP sequence number. `validateSynAck` recomputes `seq` from the reply's addresses and ports and returns whether the acknowledgement equals `seq +% 1`, using wrapping addition because the cookie can be `0xFFFFFFFF` and a plain add would overflow-trap in a safe build.
The IPv6 variants `generate6`, `seq6`, and `validateSynAck6` do the same over 16-byte addresses. `udpSrcPort` reuses the hash to derive a per-target source port for UDP, so the reply's destination port itself carries validating information. A unit test reproduces the canonical SipHash empty-message vector, so the primitive is proven, not assumed.
## The address engine: `targets.zig` and `numtheory.zig`
`parseCidr` turns `192.0.2.0/24` into a `Range` of start and end addresses. `IpPicker.build` takes your ranges, subtracts every reserved block through `subtractReserved`, sorts what remains, and builds a cumulative-prefix index so that a flat integer can be mapped to a concrete address with a binary search in `IpPicker.at`. This is where `10.0.0.0/8` collapses to nothing: the reserved subtraction removes the whole private block.
`Engine` is the permutation. `Engine.init` computes the total size of the address-and-port space, finds the smallest prime above it with `numtheory.smallestPrimeAbove`, and picks a fresh primitive root with `numtheory.findPrimitiveRoot`. Note the difference from zmap here: zmap hardcodes a table of eleven prime and primitive-root pairs, while zingela computes the prime for the exact size of your scan at runtime, so a small scan gets a small group and wastes no iterations re-rolling out-of-range values. `Engine.next` advances the group with `numtheory.mulMod`, decodes the resulting element into an address and port through the picker, and returns one `Target`. `initShard` slices the group into contiguous arcs so several machines can share one scan by seed.
`numtheory.findPrimitiveRoot` is the interesting one. Rather than brute-force testing, it factors `prime - 1` with `distinctPrimeFactors` and, for each random candidate, checks with `isPrimitiveRoot` that no `modExp(candidate, (prime-1)/q, prime)` equals one. A candidate that passes generates the whole group. The math is in [MECHANICS.md](MECHANICS.md).
## Stamping frames: `template.zig`
`SynTemplate.init` builds a base frame once from a `Config` (source and destination MAC, source address and port, cookie, OS profile, scan type), laying down the Ethernet, IPv4, and TCP headers with everything that does not change between targets. `stamp` is the per-target hot function: it copies the base, writes the destination address, varies the IP identification field, writes the destination port, computes the cookie with `cookie.seq` and places it in the sequence or acknowledgement field depending on the scan type, and finishes with the IP and TCP checksums. `stampVariant` layers decoy source addresses on top for the stealth suite. `SynTemplate6` is the IPv6 counterpart.
## Pacing: `ratelimit.zig`
`TokenBucket` is a nanosecond bank. `init` sets a per-token step in nanoseconds from your requested packets per second and a capacity for short bursts. `takeBatch` reads the monotonic clock, credits elapsed time into the bank, and returns how many tokens the transmit engine may spend right now, which is how the sender stays at rate without busy-waiting. `refund` returns tokens when a send could not be completed, and `withJitter` perturbs the timing for the Poisson jitter mode. This is a genuine token bucket, distinct from masscan's proportional-feedback controller over a timestamp ring.
## The engines: `tx.zig` and `rx.zig`
`tx.zig` is the transmit loop: prime the bucket, pull targets from the `Engine`, stamp them through the template, gate on the bucket, and batch them into the backend's transmit ring before kicking the kernel to send. It allocates nothing after startup. `rx.zig` opens the receive socket for the right ethertype and reads frames in a loop.
Classification lives in `classify.zig`. `classifyTcp` inspects a received TCP segment and decides open, closed, or filtered, gated on a valid cookie so that only genuine replies count, and maps relevant ICMP errors to filtered. `classifyTcp6` does the same for IPv6, including ICMPv6 unreachables. Deduplication lives in `dedup.zig`: `Dedup.insert` mixes the key with an fmix64 finalizer and places it in an open-addressed table with linear probing, returning whether the host was newly seen so each host is reported once.
## The backends: `packet_io.zig`, `afpacket.zig`, `afxdp.zig`, `connect.zig`
`packet_io.zig` defines the interface the engines call: open, reserve a transmit slot, submit, kick, poll for received frames, close. `afpacket.zig` implements it over an `AF_PACKET` socket with a memory-mapped `PACKET_TX_RING` and `PACKET_QDISC_BYPASS`, the universal path that needs no kernel modules. `afxdp.zig` implements the accelerated path over `AF_XDP` with its own user-memory region and rings, built only when `-Dxdp` is set. `connect.zig` is the unprivileged fallback: it makes raw non-blocking `connect` calls through `std.os.linux`, waits on them with `poll`, and reads the socket error to classify open, closed, or filtered. It has its own sized thread pool because a connect blocks a thread, so concurrency equals pool size.
This raw-socket approach is deliberate. The connect scanner drives non-blocking sockets and `poll` itself rather than going through the standard networking layer's connect-with-timeout, which `connect.zig` does not use for the scan path.
## UDP, service detection, stealth, and output
`udp.zig` holds the compile-time payload table and the UDP classification, where an ICMP type-3 code-3 unreachable means closed and silence is reported honestly as open-or-filtered because a UDP service may simply not answer a probe it does not recognize. `service.zig` is the opt-in second phase: on an open port it sends a NULL probe and an HTTP request, grabs the banner, and detects TLS without decrypting it. `stealth.zig` gathers the gated evasion features. `output.zig` renders the truecolor live dashboard and the results table to the terminal while writing NDJSON to standard output, so the visual and machine views never collide.
## Where the proofs live
Every one of these modules ships unit tests in the same file, run with `zig build test`. The checksum has its RFC vector, the cookie has its SipHash vector and a cookie-plus-one round trip, the address engine has a bijection property test over a small space, and the dedup table has growth and collision tests. The whole pipeline is exercised end to end inside a network namespace before release. That is the repository rule: no code without proof.

View File

@ -0,0 +1,54 @@
<!-- ©AngelaMos | 2026 -->
<!-- 04-CHALLENGES.md -->
# Challenges and Extensions
Ways to take zingela further, ordered roughly from approachable to deep. Each names the code it touches and the idea it teaches. Some are genuine gaps in the current build, marked as such. Scan only what you are authorized to scan while testing any of these.
## Warm up
### Add a probe payload
`udp.zig` holds a compile-time table of per-protocol UDP payloads (the bytes that make a DNS, NTP, or SNMP service answer). Add one for a protocol it does not cover yet, for example a memcached stats request or an IKE handshake. You will learn why UDP scanning needs a real payload: unlike TCP, a bare UDP probe to an open port usually gets no reply, so silence is honestly reported as open-or-filtered. A good payload turns some of those into definite opens. This is the same reason the 2003 SQL Slammer worm fit its whole exploit in one 376-byte UDP packet to port 1434: UDP services answer content, not connection attempts.
### Extend service detection
`service.zig` runs a NULL probe and an HTTP request on open ports and grabs the banner. Add a probe for another common service, say an SSH version string or a TLS ClientHello that records the certificate. Note the boundary the project holds deliberately: it detects TLS but does not compute a JA4 fingerprint, because a dedicated Rust tool already does that. Respect that boundary or you are duplicating work.
## Build something real
### A real AF_XDP benchmark
This is the honest open question of the whole project. The `AF_XDP` transmit backend ships behind `-Dxdp`, but the head-to-head against masscan on 10GbE hardware has not been measured. Set up two machines with capable NICs, run zingela with `-Dxdp` against a sink, measure sustained packets per second with `perf`, and compare to masscan on the same hardware with and without PF_RING. Publish the real number. The Zippier ZMap paper measured zmap at 14.23 Mpps versus masscan at 6.4 Mpps on 10G, so there is a concrete target to reproduce and beat. Do not accept a veth or loopback figure as a line rate; those measure the kernel loopback, not the NIC.
### Rate warnings and a hard gate
The design calls for a prominent warning above one million packets per second and an explicit confirmation gate above ten million, so that fast scanning is always a deliberate choice. Wire that into `ratelimit.zig` and the argument parser. The reason is written in outages: masscan's aggressive defaults have gotten it null-routed by ISPs, and Slammer showed what an unpaced stateless sender does to a network. This teaches you where responsibility lives in a tool that can flood a link by accident.
### An atomic resume checkpoint
A long scan that dies halfway should be resumable. Because the address engine is a cyclic group with O(1) state (a current value, a generator, a prime, and a step count), the entire progress of a scan is a handful of integers. Periodically write them to disk atomically, and add a flag to resume from that file. This teaches why the stateless permutation is not just fast but operationally convenient: you can checkpoint an internet-wide scan in a few bytes, which a shuffled address list could never do.
## Go deep
### IPv6 UDP and IPv6 stealth
The current IPv6 support is TCP SYN only. UDP scanning and the stealth suite are IPv4 only. Extending them to IPv6 means reworking the UDP payload path and the evasion features to carry `packet.Addr` all the way through, the way the TCP path already does. The dedup key for IPv6 is a lossy hash of the 144-bit address-and-port down to 64 bits, so think about whether your extension needs an exact key. This is a real architecture exercise in how far a union type carries you.
### Embedded IPv4-in-IPv6 literals
Addresses like `::ffff:1.2.3.4` embed an IPv4 address in IPv6 notation. The parser in `netutil.zig` does not accept them yet. Adding it is a small, well-scoped parsing task with sharp edge cases, a good way to learn the IPv6 text format and to practice property-testing a parser against its inverse.
### Sharding across machines
`Engine.initShard` already slices the cyclic group into contiguous arcs by shard identifier and count, so several machines sharing one seed can each scan a disjoint slice of the same space with no coordination. Build the orchestration around it: a launcher that starts N shards, collects their NDJSON, and merges the results. This is how internet-scale scans are actually run, and it teaches why a seeded deterministic permutation is the right primitive for distribution.
### A results store and a detection view
zingela emits NDJSON to standard output. Feed it into a store (SQLite, or a columnar file) and build queries over it: new hosts since the last scan, services that changed, ports that opened. This is the measurement use case that internet scanning exists for. When Heartbleed broke in 2014, researchers scanned the whole internet repeatedly with zmap precisely to track which servers stayed vulnerable over time. A results store is what turns a scanner into a measurement instrument.
## Study, do not weaponize
### Detectability experiments
The stealth suite (jitter, decoys, OS-realistic fingerprints, alternate scan types), gated behind `--authorized-scan`, exists so that authorized testers can study how a scan looks to an intrusion detection system. Stand up a lab with your own IDS, scan your own targets, and measure which techniques change the alert profile and which do not. The 2016 Mirai botnet was caught in part because its scanning was loud and uniform. Understanding detectability is defensive knowledge. Using it to scan systems you do not own is not, and the gating is there to keep that distinction sharp.

View File

@ -0,0 +1,137 @@
<!-- ©AngelaMos | 2026 -->
<!-- MECHANICS.md -->
# Mechanics
The byte-level and math-level deep dive. Where [03-IMPLEMENTATION.md](03-IMPLEMENTATION.md) says what each module does, this doc shows the arithmetic that makes it correct and fast. Everything here matches the source in `cookie.zig`, `packet.zig`, `targets.zig`, `numtheory.zig`, `dedup.zig`, and `ratelimit.zig`.
## The SYN cookie, byte by byte
The cookie is what lets zingela hold no state. `generate` builds a 12-byte message from the four-tuple, in network byte order, and hashes it:
```
data[12]:
0 4 6 10 12
+--------+------+------------+----+
| ip_them|p_them| ip_me |p_me|
+--------+------+------------+----+
u32 BE u16 BE u32 BE u16 BE
cookie64 = SipHash64(2,4)(data, key) key = 16 random bytes per scan
seq32 = low 32 bits of cookie64
```
SipHash is a keyed pseudo-random function. Without the key you cannot predict its output, so an attacker cannot forge a sequence number that will validate. The `(2, 4)` are the compression and finalization round counts of the standard SipHash-2-4. A unit test in `cookie.zig` reproduces the published SipHash empty-message vector, which proves the primitive is wired correctly.
On transmit, `seq32` goes into the TCP sequence field. A target that accepts the SYN answers with a SYN-ACK whose acknowledgement field is your sequence number plus one, because TCP acknowledges the next byte it expects. On receive, `validateSynAck` recomputes `seq32` from the reply's own addresses and ports and checks:
```
ack == seq32 +% 1
```
The `+%` is wrapping addition. It matters: `seq32` can be `0xFFFFFFFF`, and in a safe Zig build a plain `+ 1` on that would trap on overflow. Wrapping makes `0xFFFFFFFF + 1` become `0x00000000`, exactly as the target's TCP stack computes it.
Why this rejects spoofs. A packet that was not generated in response to one of our probes will, with overwhelming probability, carry an acknowledgement that does not equal the keyed hash of its own four-tuple plus one. An attacker would need the per-scan key to forge one. So validation is a single hash recompute and a compare, no table lookup, and it throws away strays, late duplicates, and injected spoofs for free.
For UDP, `udpSrcPort` derives the source port itself from the hash, so the reply's destination port carries the validating information even when the payload does not.
## The RFC 1071 checksum
The internet checksum is the one's-complement sum of 16-bit words. `checksum` in `packet.zig` implements it directly:
```
sum = 0
for each 16-bit big-endian word w in the buffer:
sum += w (sum is 32-bit, so carries pile up high)
if one odd byte remains:
sum += byte << 8 (pad on the right with zero)
while sum >> 16 != 0: (fold the carries back in)
sum = (sum & 0xffff) + (sum >> 16)
return ~sum (one's complement, low 16 bits)
```
The fold loop is the end-around carry that defines one's-complement arithmetic: any overflow above bit 15 is added back into the low word. A worked feel for it: if the running sum reached `0x1_2345`, one fold gives `0x2345 + 0x1 = 0x2346`, and the returned checksum is `~0x2346 = 0xDCB9`. The receiver runs the identical sum including the checksum field and expects `0xFFFF`, which is how a corrupt packet is caught.
`checksumSimd` computes the same value faster on large buffers. It reads the buffer in blocks the width of the machine's vector unit, reinterprets each block as a vector of 16-bit words, byte-swaps them on a little-endian CPU so the arithmetic is big-endian, and accumulates into a vector of 32-bit lanes. After the vectorized body it reduces the lanes to one sum, handles any tail bytes with the scalar loop, and folds and complements exactly as above. The result is identical to the scalar function, which the tests assert.
There is a third function, `incrementalUpdate`, from RFC 1624. When exactly one 16-bit field of a packet changes, you do not need to resum the whole thing. Given the old checksum, the old word, and the new word:
```
sum = ~old_check + ~old_word + new_word
fold carries
return ~sum
```
This is why stamping a new destination address into a cached template does not cost a full checksum pass over every packet.
## The cyclic group permutation
The address engine visits every address and port exactly once, in scrambled order, with three numbers of state. The math is the multiplicative group of integers modulo a prime.
Pick a prime `p` just larger than the number of targets `N`. The set `{1, 2, ..., p-1}` under multiplication modulo `p` is a cyclic group of order `p-1`. A **primitive root** `g` is a generator of that group: the sequence
```
g^1, g^2, g^3, ... (mod p)
```
hits every one of the `p-1` nonzero residues exactly once before it repeats. So the engine keeps a current value and advances it:
```
current = (current * g) mod p one multiply, one modulo, per target
```
Each `current` is a distinct integer in `[1, p-1]`. If it happens to exceed `N` (there are only a handful of such values, since `p` is just above `N`), the engine simply advances again without emitting, which is the re-roll. Every value in `[1, N]` is produced exactly once, in an order that looks random because multiplication by a primitive root scrambles the sequence.
Encoding both address and port in one element is a division. For target index `idx` in `[1, N]`, let `idx0 = idx - 1`, then:
```
ip_position = idx0 / number_of_ports
port_position = idx0 % number_of_ports
```
so one traversal of the group randomizes the entire address-and-port space at once, not port by port.
Finding a primitive root without brute force is the clever part, in `numtheory.findPrimitiveRoot`. A candidate `g` generates the whole group if and only if, for every distinct prime factor `q` of `p-1`, `g^((p-1)/q) mod p` is not one. If any of those powers is one, `g` only generates a proper subgroup and is rejected. So the code factors `p-1` once with `distinctPrimeFactors`, then tests random candidates with `modExp` and `isPrimitiveRoot` until one passes. Each scan gets a fresh generator, so each scan is a different permutation.
zingela differs from zmap here in a way worth stating. zmap hardcodes eleven prime and primitive-root pairs, one per supported space size, the largest being `2^48 + 23`. zingela calls `smallestPrimeAbove(N)` for the exact size of your scan and finds a generator at runtime. A scan of a `/24` on one port uses a prime near 256, not a prime near `2^48`, so it wastes no iterations re-rolling values that fall outside a giant fixed group.
## The dedup table
A host that answers on two ports, or answers a retransmitted probe twice, must be counted once. `dedup.zig` is an open-addressed hash set of 64-bit keys with linear probing.
The key packs the address and port: `(ip << 16) | port`. Its maximum value is `0x0000FFFFFFFFFFFF`, which can never equal the empty-slot sentinel `0xFFFFFFFFFFFFFFFF`, so the sentinel is safe.
The hash is an fmix64 finalizer:
```
x ^= x >> 33
x *= 0xff51afd7ed558ccd
x ^= x >> 33
```
This spreads the low-entropy key across all 64 bits so that sequential addresses do not cluster into one probe chain. `insert` computes the slot from the hash masked to the table size, then probes forward linearly until it finds the key (a duplicate, return false) or an empty slot (insert, return true). The table grows and rehashes when it passes seven-tenths full, which keeps probe chains short. Because the table is owned by the single receive engine, it needs no locks.
## The token bucket
`ratelimit.zig` paces transmission with a nanosecond bank rather than a sleep. `init` computes a per-token cost `step_ns = 1_000_000_000 / rate` and a capacity for short bursts. `takeBatch` reads the monotonic clock, adds the elapsed nanoseconds since the last call into the bank up to the cap, and returns how many whole tokens (`bank / step_ns`) the sender may spend now, deducting them. The sender never busy-waits: it asks for a batch, sends that many, and asks again. `refund` returns tokens for sends that could not complete, and `withJitter` perturbs the step for Poisson timing. This is a true token bucket, which is a different mechanism from masscan's proportional-feedback controller over a 256-slot timestamp ring.
## Measured performance
These are the hot-path functions timed by `zig build bench` on an Intel Core i7-14700KF, single core, ReleaseFast. Each measurement varies its input every iteration and folds the result into a printed value so the optimizer cannot delete the work. Numbers scale with the CPU; run the bench on your own box.
| Operation | ns/op | Rate |
|---|---|---|
| RFC 1071 checksum, scalar, 40 B | 6.0 | 6.7 GB/s |
| RFC 1071 checksum, scalar, 1500 B | 185 | 8.1 GB/s |
| RFC 1071 checksum, SIMD, 1500 B | 30.4 | 49 GB/s |
| SipHash cookie generate | 14.0 | 71 M/s |
| SipHash cookie validate | 14.8 | 68 M/s |
| SYN frame stamp, full frame | 22.9 | 44 M/s |
| Cyclic-group permutation step | 4.6 | 216 M/s |
| Dedup insert | 15.4 | 65 M/s |
Two things are worth reading out of this table.
First, the frame-stamp rate against the ceiling. A single core stamps about 44 million complete SYN frames per second. The `AF_PACKET` kernel transmit path drains at 1.5 to 2.5 million packets per second. So the CPU builds frames roughly twenty times faster than the kernel can send them. The scanner is never CPU-bound on stock hardware. This is the whole basis of the honest positioning: since every scanner meets the same kernel ceiling, there is no raw-throughput win to claim there, and the only real path to more packets per second is bypassing the kernel with `AF_XDP`.
Second, the SIMD checksum is faster than scalar only on large buffers. On a 40-byte header the vector setup does not pay for itself, so scalar wins. On a 1500-byte frame the vector version is about six times faster. The scanner stamps small headers, so `template.stamp` uses the scalar `checksum`, and the benchmark makes that choice visible rather than assumed.

View File

@ -0,0 +1,194 @@
// ©AngelaMos | 2026
// bench.zig
const std = @import("std");
const linux = std.os.linux;
const packet = @import("packet");
const cookie = @import("cookie");
const targets = @import("targets");
const template = @import("template");
const dedup = @import("dedup");
const warmup_frac: u64 = 16;
const iters_checksum_small: u64 = 100_000_000;
const iters_checksum_mtu: u64 = 5_000_000;
const iters_cookie: u64 = 100_000_000;
const iters_stamp: u64 = 30_000_000;
const dedup_keys: u64 = 4_000_000;
const dedup_cap: usize = 1 << 23;
const spread_multiplier: u64 = 0x9E3779B97F4A7C15;
const engine_cidr = "1.0.0.0/8";
const engine_port: u16 = 80;
const engine_seed: u64 = 0xC0FFEE;
const small_len: usize = 40;
const mtu_len: usize = 1500;
const cookie_key = [_]u8{0x42} ** 16;
const bench_src_ip: u32 = 0x0A000001;
const bench_src_port: u16 = 0xC000;
const bench_them_ip: u32 = 0x08080808;
const bench_dst_ip: u32 = 0x01020304;
const bench_src_mac = [_]u8{ 0x02, 0x00, 0x00, 0x00, 0x00, 0x01 };
const bench_dst_mac = [_]u8{ 0x02, 0x00, 0x00, 0x00, 0x00, 0x02 };
fn monoNow() u64 {
var ts: linux.timespec = undefined;
_ = linux.clock_gettime(.MONOTONIC, &ts);
return @as(u64, @intCast(ts.sec)) * std.time.ns_per_s + @as(u64, @intCast(ts.nsec));
}
fn report(name: []const u8, iters: u64, ns_total: u64, bytes_per_op: u64) void {
if (iters == 0 or ns_total == 0) {
std.debug.print(" {s:<38} no measurement (0 iterations or 0 ns)\n", .{name});
return;
}
const fi: f64 = @floatFromInt(iters);
const fns: f64 = @floatFromInt(ns_total);
const ns_per = fns / fi;
const mops = fi / (fns / 1e9) / 1e6;
if (bytes_per_op > 0) {
const total_bytes: f64 = @floatFromInt(iters * bytes_per_op);
const gbps = total_bytes / fns;
std.debug.print(" {s:<38} {d:>9.2} ns/op {d:>9.1} Mops/s {d:>7.2} GB/s\n", .{ name, ns_per, mops, gbps });
} else {
std.debug.print(" {s:<38} {d:>9.2} ns/op {d:>9.1} Mops/s\n", .{ name, ns_per, mops });
}
}
fn benchChecksum(name: []const u8, iters: u64, buf: []u8, comptime f: fn ([]const u8) u16) u64 {
var acc: u64 = 0;
var w: u64 = 0;
while (w < iters / warmup_frac) : (w += 1) {
buf[0] = @truncate(w);
acc +%= f(buf);
}
acc = 0;
const t0 = monoNow();
var i: u64 = 0;
while (i < iters) : (i += 1) {
buf[0] = @truncate(i);
buf[buf.len - 1] = @truncate(i >> 8);
acc +%= f(buf);
}
report(name, iters, monoNow() - t0, buf.len);
return acc;
}
fn benchCookieGen(ck: cookie.Cookie) u64 {
var acc: u64 = 0;
var w: u64 = 0;
while (w < iters_cookie / warmup_frac) : (w += 1) {
acc +%= ck.generate(bench_them_ip +% @as(u32, @truncate(w)), @truncate(w), bench_src_ip, bench_src_port);
}
acc = 0;
const t0 = monoNow();
var i: u64 = 0;
while (i < iters_cookie) : (i += 1) {
const ip: u32 = bench_them_ip +% @as(u32, @truncate(i));
acc +%= ck.generate(ip, @truncate(i), bench_src_ip, bench_src_port);
}
report("cookie generate (SipHash)", iters_cookie, monoNow() - t0, 0);
return acc;
}
fn benchCookieValidate(ck: cookie.Cookie) u64 {
var acc: u64 = 0;
var w: u64 = 0;
while (w < iters_cookie / warmup_frac) : (w += 1) {
const ip: u32 = bench_them_ip +% @as(u32, @truncate(w));
const ack: u32 = @truncate(w *% spread_multiplier);
acc +%= @intFromBool(ck.validateSynAck(ack, ip, @truncate(w), bench_src_ip, bench_src_port));
}
acc = 0;
var i: u64 = 0;
const t0 = monoNow();
while (i < iters_cookie) : (i += 1) {
const ip: u32 = bench_them_ip +% @as(u32, @truncate(i));
const ack: u32 = @truncate(i *% spread_multiplier);
acc +%= @intFromBool(ck.validateSynAck(ack, ip, @truncate(i), bench_src_ip, bench_src_port));
}
report("cookie validate (SipHash)", iters_cookie, monoNow() - t0, 0);
return acc;
}
fn benchStamp() u64 {
const ck = cookie.Cookie.init(cookie_key);
const tmpl = template.SynTemplate.init(.{
.src_mac = bench_src_mac,
.dst_mac = bench_dst_mac,
.src_ip = bench_src_ip,
.src_port = bench_src_port,
.cookie = ck,
});
var out: [template.SynTemplate.max_frame_len]u8 = undefined;
var acc: u64 = 0;
var w: u64 = 0;
while (w < iters_stamp / warmup_frac) : (w += 1) {
const n = tmpl.stamp(&out, bench_dst_ip +% @as(u32, @truncate(w)), @truncate(w));
acc +%= out[n - 1];
}
acc = 0;
const t0 = monoNow();
var i: u64 = 0;
while (i < iters_stamp) : (i += 1) {
const ip: u32 = bench_dst_ip +% @as(u32, @truncate(i));
const n = tmpl.stamp(&out, ip, @truncate(i));
acc +%= @as(u64, out[n - 1]) +% n;
}
report("SYN template stamp (full frame)", iters_stamp, monoNow() - t0, 0);
return acc;
}
fn benchEngine(alloc: std.mem.Allocator) !u64 {
const range = try targets.parseCidr(engine_cidr);
const ports = [_]u16{engine_port};
var eng = try targets.Engine.init(alloc, &.{range}, &ports, engine_seed);
defer eng.deinit();
var acc: u64 = 0;
var count: u64 = 0;
const t0 = monoNow();
while (eng.next()) |t| {
acc +%= @as(u64, t.ip) +% t.port;
count += 1;
}
report("address engine next() [/8 traversal]", count, monoNow() - t0, 0);
return acc;
}
fn benchDedup(alloc: std.mem.Allocator) !u64 {
var d = try dedup.Dedup.init(alloc, dedup_cap);
defer d.deinit();
var acc: u64 = 0;
const t0 = monoNow();
var i: u64 = 0;
while (i < dedup_keys) : (i += 1) {
acc +%= @intFromBool(d.insert(i *% spread_multiplier));
}
report("dedup insert (empty -> 4M, 2^23 slots)", dedup_keys, monoNow() - t0, 0);
return acc;
}
pub fn main() !void {
const alloc = std.heap.page_allocator;
var sink: u64 = 0;
std.debug.print("\nzingela hot-path microbenchmarks (ReleaseFast, this host)\n", .{});
std.debug.print("each op varies its input per iteration; results fold into a printed sink to defeat elision\n\n", .{});
var buf: [mtu_len]u8 = undefined;
for (&buf, 0..) |*byte, i| byte.* = @truncate(i *% 131 +% 7);
sink +%= benchChecksum("RFC1071 checksum scalar (40B)", iters_checksum_small, buf[0..small_len], packet.checksum);
sink +%= benchChecksum("RFC1071 checksum SIMD (40B)", iters_checksum_small, buf[0..small_len], packet.checksumSimd);
sink +%= benchChecksum("RFC1071 checksum scalar (1500B)", iters_checksum_mtu, buf[0..mtu_len], packet.checksum);
sink +%= benchChecksum("RFC1071 checksum SIMD (1500B)", iters_checksum_mtu, buf[0..mtu_len], packet.checksumSimd);
const ck = cookie.Cookie.init(cookie_key);
sink +%= benchCookieGen(ck);
sink +%= benchCookieValidate(ck);
sink +%= benchStamp();
sink +%= try benchEngine(alloc);
sink +%= try benchDedup(alloc);
std.debug.print("\nanti-elision sink: 0x{x}\n", .{sink});
}

View File

@ -546,13 +546,13 @@ pub fn renderServices(out: *std.Io.Writer, level: ColorLevel, rows: []const Serv
try out.writeAll(" ");
try span(out, level, chrome_gray, "\u{2502} ");
try renderCell(out, level,"HOST", w_host, bright_white);
try renderCell(out, level, "HOST", w_host, bright_white);
try span(out, level, chrome_gray, " \u{2502} ");
try renderCell(out, level,"PORT", w_port, bright_white);
try renderCell(out, level, "PORT", w_port, bright_white);
try span(out, level, chrome_gray, " \u{2502} ");
try renderCell(out, level,"SERVICE", w_service, bright_white);
try renderCell(out, level, "SERVICE", w_service, bright_white);
try span(out, level, chrome_gray, " \u{2502} ");
try renderCell(out, level,"VERSION / INFO", w_info, bright_white);
try renderCell(out, level, "VERSION / INFO", w_info, bright_white);
try span(out, level, chrome_gray, " \u{2502}");
try out.writeByte('\n');
@ -571,16 +571,16 @@ pub fn renderServices(out: *std.Io.Writer, level: ColorLevel, rows: []const Serv
try out.writeAll(" ");
try span(out, level, chrome_gray, "\u{2502} ");
try renderCell(out, level,ipbuf[0..ipw.end], w_host, bright_white);
try renderCell(out, level, ipbuf[0..ipw.end], w_host, bright_white);
try span(out, level, chrome_gray, " \u{2502} ");
try pad(out, w_port - port_str.len);
try setFg(out, level, bright_white);
try out.writeAll(port_str);
try resetFg(out, level);
try span(out, level, chrome_gray, " \u{2502} ");
try renderCell(out, level,r.service, w_service, neon_green);
try renderCell(out, level, r.service, w_service, neon_green);
try span(out, level, chrome_gray, " \u{2502} ");
try renderCell(out, level,info_disp, w_info, bright_white);
try renderCell(out, level, info_disp, w_info, bright_white);
try span(out, level, chrome_gray, " \u{2502}");
try out.writeByte('\n');
}

View File

@ -293,27 +293,26 @@ const window_macos: u16 = 65535;
const syn_opts_masscan = [_]u8{ opt_mss, opt_mss_len, mss_ethernet_hi, mss_ethernet_lo };
const syn_opts_linux = [_]u8{
opt_mss, opt_mss_len, mss_ethernet_hi, mss_ethernet_lo,
opt_sack_perm, opt_sack_perm_len,
opt_ts, opt_ts_len, 0, 0,
0, 0, 0, 0,
0, 0, opt_nop, opt_wscale,
opt_wscale_len, wscale_linux,
opt_mss, opt_mss_len, mss_ethernet_hi, mss_ethernet_lo,
opt_sack_perm, opt_sack_perm_len, opt_ts, opt_ts_len,
0, 0, 0, 0,
0, 0, 0, 0,
opt_nop, opt_wscale, opt_wscale_len, wscale_linux,
};
const syn_opts_windows = [_]u8{
opt_mss, opt_mss_len, mss_ethernet_hi, mss_ethernet_lo,
opt_nop, opt_wscale, opt_wscale_len, wscale_windows,
opt_nop, opt_nop, opt_sack_perm, opt_sack_perm_len,
opt_mss, opt_mss_len, mss_ethernet_hi, mss_ethernet_lo,
opt_nop, opt_wscale, opt_wscale_len, wscale_windows,
opt_nop, opt_nop, opt_sack_perm, opt_sack_perm_len,
};
const syn_opts_macos = [_]u8{
opt_mss, opt_mss_len, mss_ethernet_hi, mss_ethernet_lo,
opt_nop, opt_wscale, opt_wscale_len, wscale_macos,
opt_nop, opt_nop, opt_ts, opt_ts_len,
0, 0, 0, 0,
0, 0, 0, 0,
opt_sack_perm, opt_sack_perm_len, opt_eol, opt_eol,
opt_mss, opt_mss_len, mss_ethernet_hi, mss_ethernet_lo,
opt_nop, opt_wscale, opt_wscale_len, wscale_macos,
opt_nop, opt_nop, opt_ts, opt_ts_len,
0, 0, 0, 0,
0, 0, 0, 0,
opt_sack_perm, opt_sack_perm_len, opt_eol, opt_eol,
};
pub const max_syn_options_len: usize = syn_opts_macos.len;

View File

@ -14,25 +14,37 @@ const dns_version_bind = [_]u8{
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x07, 'v', 'e',
'r', 's', 'i',
'o', 'n', 0x04,
'b', 'i', 'n',
'd', 0x00, 0x00,
0x10, 0x00, 0x03,
0x07, 'v',
'e', 'r',
's', 'i',
'o', 'n',
0x04, 'b',
'i', 'n',
'd', 0x00,
0x00, 0x10,
0x00, 0x03,
};
const snmp_get_public = [_]u8{
0x30, 0x26,
0x02, 0x01, 0x00,
0x04, 0x06, 'p', 'u', 'b', 'l', 'i', 'c',
0xa0, 0x19,
0x02, 0x01, 0x00,
0x02, 0x01, 0x00,
0x02, 0x01, 0x00,
0x02, 0x01,
0x00, 0x04,
0x06, 'p',
'u', 'b',
'l', 'i',
'c', 0xa0,
0x19, 0x02,
0x01, 0x00,
0x02, 0x01,
0x00, 0x02,
0x01, 0x00,
0x30, 0x0e,
0x30, 0x0c,
0x06, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x01, 0x00,
0x06, 0x08,
0x2b, 0x06,
0x01, 0x02,
0x01, 0x01,
0x01, 0x00,
0x05, 0x00,
};
@ -43,11 +55,14 @@ const netbios_node_status = [_]u8{
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x20, 'C', 'K',
0x20, 'C',
'K',
} ++ ([_]u8{'A'} ** 30) ++ [_]u8{
0x00,
0x00, 0x21,
0x00, 0x01,
0x00,
0x21,
0x00,
0x01,
};
const ssdp_msearch =
@ -65,11 +80,21 @@ const mdns_services = [_]u8{
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x09, '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', 's',
0x07, '_', 'd', 'n', 's', '-', 's', 'd',
0x04, '_', 'u', 'd', 'p',
0x05, 'l', 'o', 'c', 'a', 'l',
0x00,
0x09, '_',
's', 'e',
'r', 'v',
'i', 'c',
'e', 's',
0x07, '_',
'd', 'n',
's', '-',
's', 'd',
0x04, '_',
'u', 'd',
'p', 0x05,
'l', 'o',
'c', 'a',
'l', 0x00,
0x00, 0x0c,
0x00, 0x01,
};

View File

@ -0,0 +1,56 @@
#!/usr/bin/env bash
# ©AngelaMos | 2026
# uninstall.sh
set -euo pipefail
BINARY="zingela"
INSTALL_DIR="${ZINGELA_INSTALL_DIR:-$HOME/.local/bin}"
CACHE_SRC="${XDG_CACHE_HOME:-$HOME/.cache}/${BINARY}-src"
CACHE_ZIG="${XDG_CACHE_HOME:-$HOME/.cache}/${BINARY}-zig"
if [ -t 2 ] && [ -z "${NO_COLOR:-}" ]; then
BOLD=$'\033[1m'; DIM=$'\033[2m'; GREEN=$'\033[32m'
YELLOW=$'\033[33m'; VIOLET=$'\033[38;2;139;92;246m'; RESET=$'\033[0m'
else
BOLD=""; DIM=""; GREEN=""; YELLOW=""; VIOLET=""; RESET=""
fi
info() { printf '%s\n' " ${VIOLET}+${RESET} $*" >&2; }
ok() { printf '%s\n' " ${GREEN}+${RESET} $*" >&2; }
warn() { printf '%s\n' " ${YELLOW}!${RESET} $*" >&2; }
have() { command -v "$1" >/dev/null 2>&1; }
usage() {
cat >&2 <<USAGE
uninstall.sh - remove ${BINARY}
./uninstall.sh [--prefix DIR]
USAGE
}
while [ $# -gt 0 ]; do
case "$1" in
--prefix) INSTALL_DIR="$2"; shift 2 ;;
--prefix=*) INSTALL_DIR="${1#*=}"; shift ;;
-h|--help) usage; exit 0 ;;
*) warn "unknown option: $1"; shift ;;
esac
done
main() {
printf '\n%s\n\n' "${BOLD}${VIOLET}--- removing ${BINARY} ---${RESET}" >&2
local dest="$INSTALL_DIR/$BINARY"
if [ -e "$dest" ]; then rm -f "$dest"; ok "removed $dest"; else info "no binary at $dest"; fi
for c in "$CACHE_SRC" "$CACHE_ZIG"; do
if [ -d "$c" ]; then rm -rf "$c"; ok "removed cache $c"; fi
done
warn "if you want to drop it from PATH, delete this line from your shell rc:"
printf '%s\n' " ${DIM}export PATH=\"${INSTALL_DIR}:\$PATH\"${RESET}" >&2
printf '\n%s\n\n' " ${GREEN}${BOLD}${BINARY} removed.${RESET}" >&2
return 0
}
main "$@" </dev/null

View File

@ -25,7 +25,7 @@
<h2 align="center"><strong>View Complete Projects:</strong></h2>
<div align="center">
<a href="https://github.com/CarterPerez-dev/Cybersecurity-Projects/tree/main/PROJECTS">
<img src="https://img.shields.io/badge/Full_Source_Code-34/70-blue?style=for-the-badge&logo=github" alt="Projects"/>
<img src="https://img.shields.io/badge/Full_Source_Code-36/70-blue?style=for-the-badge&logo=github" alt="Projects"/>
</a>
</div>
@ -120,9 +120,9 @@ Tools, courses, certifications, communities, and frameworks for cybersecurity pr
| **[Credential Enumeration](./PROJECTS/intermediate/credential-enumeration)**<br>Post-exploitation credential collection | ![2-4d](https://img.shields.io/badge/⏱_2--4d-blue) ![Nim](https://img.shields.io/badge/Nim-FFE953?logo=nim&logoColor=black) ![Intermediate](https://img.shields.io/badge/●_Intermediate-yellow) | Credential extraction • Browser forensics • Red team tooling • Nim language<br>[Source Code](./PROJECTS/intermediate/credential-enumeration) \| [Docs](./PROJECTS/intermediate/credential-enumeration/learn) |
| **[Binary Analysis Tool](./PROJECTS/intermediate/binary-analysis-tool)**<br>Disassemble and analyze executables | ![3-5d](https://img.shields.io/badge/⏱_3--5d-blue) ![Rust](https://img.shields.io/badge/Rust-000000?logo=rust&logoColor=white) ![Intermediate](https://img.shields.io/badge/●_Intermediate-yellow) | Binary analysis • String extraction • Malware detection<br>[Source Code](./PROJECTS/intermediate/binary-analysis-tool) \| [Docs](./PROJECTS/intermediate/binary-analysis-tool/learn)<br>[![axumortem.carterperez-dev.com](https://img.shields.io/badge/axumortem.carterperez--dev.com-E8730C?style=flat&logo=googlechrome&logoColor=white)](https://axumortem.carterperez-dev.com/) |
| **[Chaos Engineering Security Tool](./SYNOPSES/intermediate/Chaos.Engineering.Security.Tool.md)**<br>Inject security failures to test resilience | ![3-5d](https://img.shields.io/badge/⏱_3--5d-blue) ![Go](https://img.shields.io/badge/Go-00ADD8?logo=go&logoColor=white) ![Intermediate](https://img.shields.io/badge/●_Intermediate-yellow) | Chaos engineering • Security resilience • Credential spraying • Auth testing<br>[Learn More](./SYNOPSES/intermediate/Chaos.Engineering.Security.Tool.md) |
| **[Credential Rotation Enforcer](./SYNOPSES/intermediate/Credential.Rotation.Enforcer.md)**<br>Track and enforce credential rotation policies | ![2-4d](https://img.shields.io/badge/⏱_2--4d-blue) ![Python](https://img.shields.io/badge/Python-3776AB?logo=python&logoColor=white) ![Intermediate](https://img.shields.io/badge/●_Intermediate-yellow) | Credential hygiene • Secret rotation • Compliance dashboards • API integration<br>[Source Code](./PROJECTS/intermediate/credential-rotation-enforcer) \| [Docs](./PROJECTS/intermediate/credential-rotation-enforcer/learn) |
| **[Credential Rotation Enforcer](./SYNOPSES/intermediate/Credential.Rotation.Enforcer.md)**<br>Track and enforce credential rotation policies | ![2-4d](https://img.shields.io/badge/⏱_2--4d-blue) ![Crystal](https://img.shields.io/badge/Crystal-black?logo=crystal&logoColor=white) ![Intermediate](https://img.shields.io/badge/●_Intermediate-yellow) | Credential hygiene • Secret rotation • Compliance dashboards • API integration<br>[Source Code](./PROJECTS/intermediate/credential-rotation-enforcer) \| [Docs](./PROJECTS/intermediate/credential-rotation-enforcer/learn) |
| **[Race Condition Exploiter](./SYNOPSES/intermediate/Race.Condition.Exploiter.md)**<br>TOCTOU race condition attack & defense lab | ![3-5d](https://img.shields.io/badge/⏱_3--5d-blue) ![FastAPI](https://img.shields.io/badge/FastAPI-009688?logo=fastapi) ![React](https://img.shields.io/badge/React-61DAFB?logo=react&logoColor=black) ![Intermediate](https://img.shields.io/badge/●_Intermediate-yellow) | TOCTOU attacks • Double-spend bugs • Concurrent exploitation • Race visualization<br>[Learn More](./SYNOPSES/intermediate/Race.Condition.Exploiter.md) |
| **[Self-Hosted Shodan Clone](./SYNOPSES/intermediate/Self.Hosted.Shodan.Clone.md)**<br>Internet-connected device search engine | ![3-5d](https://img.shields.io/badge/⏱_3--5d-blue) ![Go](https://img.shields.io/badge/Go-00ADD8?logo=go&logoColor=white) ![React](https://img.shields.io/badge/React-61DAFB?logo=react&logoColor=black) ![Intermediate](https://img.shields.io/badge/●_Intermediate-yellow) | Service fingerprinting • Network scanning • OSINT • Search engine design<br>[Learn More](./SYNOPSES/intermediate/Self.Hosted.Shodan.Clone.md) |
| **[Zingela Stateless Scanner](./PROJECTS/advanced/zig-stateless-scanner)**<br>Line-rate stateless mass TCP/UDP port scanner | ![1-2w](https://img.shields.io/badge/⏱_1--2w-blue) ![Zig](https://img.shields.io/badge/Zig-F7A41D?logo=zig&logoColor=white) ![Advanced](https://img.shields.io/badge/●_Advanced-red) | Stateless SYN scanning • SipHash cookies • Cyclic-group permutation • AF_PACKET / AF_XDP<br>[Source Code](./PROJECTS/advanced/zig-stateless-scanner) \| [Docs](./PROJECTS/advanced/zig-stateless-scanner/learn) |
| **[JA3/JA4 TLS Fingerprinting Tool](./SYNOPSES/intermediate/JA3.JA4.TLS.Fingerprinting.Tool.md)**<br>Fingerprint TLS clients by handshake | ![2-4d](https://img.shields.io/badge/⏱_2--4d-blue) ![Rust](https://img.shields.io/badge/Rust-000000?logo=rust&logoColor=white) ![Intermediate](https://img.shields.io/badge/●_Intermediate-yellow) | TLS handshake analysis • JA3/JA4 hashing • Bot detection • Malware C2 identification<br>[Source Code](./PROJECTS/intermediate/ja3-ja4-tls-fingerprinting) \| [Docs](./PROJECTS/intermediate/ja3-ja4-tls-fingerprinting/learn)<br>[![mkultraalumni.com](https://img.shields.io/badge/mkultraalumni.com-E8730C?style=flat&logo=googlechrome&logoColor=white)](https://mkultraalumni.com/) |
| **[Mobile App Security Analyzer](./SYNOPSES/intermediate/Mobile.App.Security.Analyzer.md)**<br>Decompile and analyze mobile apps | ![3-5d](https://img.shields.io/badge/⏱_3--5d-blue) ![Python](https://img.shields.io/badge/Python-3776AB?logo=python&logoColor=white) ![Intermediate](https://img.shields.io/badge/●_Intermediate-yellow) | APK/IPA analysis • Reverse engineering • OWASP Mobile<br>[Learn More](./SYNOPSES/intermediate/Mobile.App.Security.Analyzer.md) |
| **[DLP Scanner](./PROJECTS/intermediate/dlp-scanner)**<br>Data Loss Prevention for files, DBs, and traffic | ![2-4d](https://img.shields.io/badge/⏱_2--4d-blue) ![Python](https://img.shields.io/badge/Python-3776AB?logo=python&logoColor=white) ![Intermediate](https://img.shields.io/badge/●_Intermediate-yellow) | PII detection • GDPR/HIPAA compliance • Pattern matching • Data classification<br>[Source Code](./PROJECTS/intermediate/dlp-scanner) \| [Docs](./PROJECTS/intermediate/dlp-scanner/learn) |