From bded69bfe314a28f48378f856deffe8300545252 Mon Sep 17 00:00:00 2001
From: Guillaume Valadon <guillaume@valadon.net>
Date: Thu, 7 Jul 2016 17:01:29 +0200
Subject: [PATCH] Simple pipe example
---
doc/notebooks/Scapy in 15 minutes.ipynb | 44 ++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/doc/notebooks/Scapy in 15 minutes.ipynb b/doc/notebooks/Scapy in 15 minutes.ipynb
index faeb7620..4683931e 100644
--- a/doc/notebooks/Scapy in 15 minutes.ipynb
+++ b/doc/notebooks/Scapy in 15 minutes.ipynb
@@ -1367,9 +1367,51 @@
}
],
"prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Pipes"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Pipes are an advanced Scapy feature that aims sniffing, modifying and printing packets. The API provides several buildings blocks. All of them, have high entries and exits (>>) as well as low (>) ones.\n",
+ "\n",
+ "For example, the `CliFeeder` is used to send message from the Python command line to a low exit. It can be combined to the `InjectSink` that reads message on its low entry and inject them to the specified network interface. These blocks can be combined as follows:"
+ ]
+ },
+ {
+ "cell_type": "raw",
+ "metadata": {},
+ "source": [
+ "# Instanciate the blocks\n",
+ "clf = CLIFeeder()\n",
+ "ijs = InjectSink(\"enx3495db043a28\")\n",
+ "\n",
+ "# Plug blocks together\n",
+ "clf > ijs\n",
+ "\n",
+ "# Create and start the engine\n",
+ "pe = PipeEngine(clf)\n",
+ "pe.start()"
+ ]
+ },
+ {
+ "cell_type": "raw",
+ "metadata": {},
+ "source": [
+ "Packet can be sent using the following command on the prompt:\n",
+ "\n",
+ "clf.send(\"Hello Scapy !\")"
+ ]
}
],
"metadata": {}
}
]
-}
\ No newline at end of file
+}
--
GitLab