Skip to content

Commit

Permalink
Fixed sphinx documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaker-97 committed Aug 4, 2020
1 parent 152d2e8 commit 9f7c04e
Show file tree
Hide file tree
Showing 136 changed files with 24,278 additions and 26 deletions.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Binary file added docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file added docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/modules.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/sendit.applications.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/sendit.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/sendit.handlers.doctree
Binary file not shown.
Binary file not shown.
Binary file added docs/_build/doctrees/sendit.protocols.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: db278be3ad9a9df6eb6cd25181fe4adb
tags: 645f666f9bcd5a90fca523b33c5a78b7
71 changes: 71 additions & 0 deletions docs/_build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
Sendit Documentation
==================================
Sendit is a Python library for handcrafting, sending, and receiving packets. You can modify any value in Ethernet, ARP, IPv4, IPv6, TCP, and UDP protocols and send it. This allows you to send and receive data as a different MAC and/or IP address, do things such as mapping out a network using ARP, modify values to prevent OS fingerprinting, and so much more. While Sendit works at layers 2 to 4, meaning we are working with frames, packets, and segments, for purposes of simplicity in this documentation all units of data will be referred to as packets, their layer specified by the protocol being discussed.

.. toctree::
:maxdepth: 4
:caption: Contents:

modules.rst
index.rst#Build
Project Info
============
* Github: https://github.com/mbaker-97/sendit
* PyPi: https://pypi.org/project/sendit/


Installing
==========
Install with pip

.. code-block:: bash
pip install sendit==1.0.6
Basics
======
Every protocol layer is its own object. To create a datagram, we start by creating the highest layer object we are working with, then creating the next highest, and passing the first object to the second, and so on.
For example:

.. code-block:: python
from sendit.protocols.EtherFrame import EtherFrame
from sendit.protocols.IPv4 import IPv4
from sendit.protocols.TCP import TCP
payload = "The quick brown fox jumps over the lazy dog" # String payload
l4_tcp = TCP(50000, 50001, "127.0.0.1", "127.0.0.1", 1024, payload) # Change 1st ip to yours, 2nd to target.
# Creates IPv4 packet:
l3 = IPv4("127.0.0.1", "127.0.0.1", l4_tcp, protocol="tcp") # Change 1st ip to yours, 2nd to target
# Creates Etherframe:
l2 = EtherFrame("AA:BB:CC:DD:EE:FF", "00:11:22:33:44:55", l3) # Change 1st mac to yours, 2nd to target
In the above example, l2, the EtherFrame, contains l4_tcp, a TCP object, inside l3, an IPv4 object.

Sending Data
============
Now that you know how to create the data, how do you send it? Sendit has a class called Raw_NIC. Raw_NIC is a wrapper class around a raw socket. All protocols have a as_bytes() function, which turns the data contained in the objects into their properly formatted bytes ready to send on the line. Calling a lower protocol's as_bytes function calls all higher protocols as_bytes functions. To take the above example, and to expand it. Using a Raw_NIC's send function automatically calls the as_bytes function of the object passed into it,

.. code-block:: python
from sendit.protocols.EtherFrame import EtherFrame
from sendit.protocols.IPv4 import IPv4
from sendit.protocols.TCP import TCP
from sendit.handlers.raw_nic import Raw_NIC
payload = "The quick brown fox jumps over the lazy dog" # String payload
l4_tcp = TCP(50000, 50001, "127.0.0.1", "127.0.0.1", 1024, payload) # Change 1st ip to yours, 2nd to target.
# Creates IPv4 packet:
l3 = IPv4("127.0.0.1", "127.0.0.1", l4_tcp, protocol="tcp") # Change 1st ip to yours, 2nd to target
# Creates Etherframe:
l2 = EtherFrame("AA:BB:CC:DD:EE:FF", "00:11:22:33:44:55", l3) # Change 1st mac to yours, 2nd to target
nic = Raw_NIC("lo") # Creates raw_nic on loopback interface
nic.send(l2)
Advanced Usage
==================

For advanced usage, please read through the documentation of the modules to get a full idea of what each class offers

* :ref:`genindex`
* :ref:`modindex`
7 changes: 7 additions & 0 deletions docs/_build/html/_sources/modules.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sendit
======

.. toctree::
:maxdepth: 4

sendit
54 changes: 54 additions & 0 deletions docs/_build/html/_sources/sendit.applications.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
sendit.applications package
===========================

Submodules
----------

sendit.applications.arp\_daemon module
--------------------------------------

.. automodule:: sendit.applications.arp_daemon
:members:
:undoc-members:
:show-inheritance:

sendit.applications.arpmap module
---------------------------------

.. automodule:: sendit.applications.arpmap
:members:
:undoc-members:
:show-inheritance:

sendit.applications.basic\_examples module
------------------------------------------

.. automodule:: sendit.applications.basic_examples
:members:
:undoc-members:
:show-inheritance:

sendit.applications.ipv4\_handler module
----------------------------------------

.. automodule:: sendit.applications.ipv4_handler
:members:
:undoc-members:
:show-inheritance:

sendit.applications.ipv6\_handler module
----------------------------------------

.. automodule:: sendit.applications.ipv6_handler
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: sendit.applications
:members:
:undoc-members:
:show-inheritance:
62 changes: 62 additions & 0 deletions docs/_build/html/_sources/sendit.handlers.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
sendit.handlers package
=======================

Submodules
----------

sendit.handlers.arp\_handler module
-----------------------------------

.. automodule:: sendit.handlers.arp_handler
:members:
:undoc-members:
:show-inheritance:

sendit.handlers.ethernet\_handler module
----------------------------------------

.. automodule:: sendit.handlers.ethernet_handler
:members:
:undoc-members:
:show-inheritance:

sendit.handlers.ipv4\_handler module
------------------------------------

.. automodule:: sendit.handlers.ipv4_handler
:members:
:undoc-members:
:show-inheritance:

sendit.handlers.ipv6\_handler module
------------------------------------

.. automodule:: sendit.handlers.ipv6_handler
:members:
:undoc-members:
:show-inheritance:

sendit.handlers.raw\_nic module
-------------------------------

.. automodule:: sendit.handlers.raw_nic
:members:
:undoc-members:
:show-inheritance:

sendit.handlers.udp\_handler module
-----------------------------------

.. automodule:: sendit.handlers.udp_handler
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: sendit.handlers
:members:
:undoc-members:
:show-inheritance:
22 changes: 22 additions & 0 deletions docs/_build/html/_sources/sendit.helper_functions.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
sendit.helper\_functions package
================================

Submodules
----------

sendit.helper\_functions.helper module
--------------------------------------

.. automodule:: sendit.helper_functions.helper
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: sendit.helper_functions
:members:
:undoc-members:
:show-inheritance:
62 changes: 62 additions & 0 deletions docs/_build/html/_sources/sendit.protocols.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
sendit.protocols package
========================

Submodules
----------

sendit.protocols.arp module
---------------------------

.. automodule:: sendit.protocols.arp
:members:
:undoc-members:
:show-inheritance:

sendit.protocols.etherframe module
----------------------------------

.. automodule:: sendit.protocols.etherframe
:members:
:undoc-members:
:show-inheritance:

sendit.protocols.ipv4 module
----------------------------

.. automodule:: sendit.protocols.ipv4
:members:
:undoc-members:
:show-inheritance:

sendit.protocols.ipv6 module
----------------------------

.. automodule:: sendit.protocols.ipv6
:members:
:undoc-members:
:show-inheritance:

sendit.protocols.tcp module
---------------------------

.. automodule:: sendit.protocols.tcp
:members:
:undoc-members:
:show-inheritance:

sendit.protocols.udp module
---------------------------

.. automodule:: sendit.protocols.udp
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: sendit.protocols
:members:
:undoc-members:
:show-inheritance:
21 changes: 21 additions & 0 deletions docs/_build/html/_sources/sendit.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
sendit package
==============

Subpackages
-----------

.. toctree::
:maxdepth: 4

sendit.applications
sendit.handlers
sendit.helper_functions
sendit.protocols

Module contents
---------------

.. automodule:: sendit
:members:
:undoc-members:
:show-inheritance:

0 comments on commit 9f7c04e

Please sign in to comment.