Author: Robin David License: GNU GPLv3 Repo: https://github.com/RobinDavid
Copyright (c) 2012 Robin David
PyStack is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version http://www.gnu.org/licenses/.
Author: Robin David License: GNU GPLv3 Repo: https://github.com/RobinDavid
Copyright (c) 2012 Robin David
PyStack is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version http://www.gnu.org/licenses/.
Blocks ICMP port unreachable packets sent by the kernel when a UDP port is hit without any service listening.
Blocks outgoing packets coming from the kernel using iptables command.
Author: Robin David License: GNU GPLv3 Repo: https://github.com/RobinDavid
Copyright (c) 2012 Robin David
PyStack is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version http://www.gnu.org/licenses/.
Bases: object
PyStack is the class that wrap all the layers together. It builds an entire stack linking all the layers. It implement the Singleton Pattern. So within a script or across modules if they all create a Pystack object only one will be instantiated and all the connections and request will be handled by this one. It provides a method call register_tcp_application to attach a TCP application to the stack like a server or a client. Of course the stack should be started with run to start listening packet and stop to stop listening packets.
Register a TCP application on the stack. So basically create a tcp session for the app and attach the TCPSession to the TCP layer.
Just call the start_listening of the Ethernet layer (which hold the ScapyIO). Except for reactor which normally catch SIGINT to stop the reactor. Here we catch the SIGINT oursleves and stop the reactor by changing a boolean (which is tested periodically)
Author: Robin David License: GNU GPLv3 Repo: https://github.com/RobinDavid
Copyright (c) 2012 Robin David
PyStack is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version http://www.gnu.org/licenses/.
Create a connection and return the socket connected
socket class that will replace the genuine one located in _socket
Bind the application on the given port regardless of if this is an UDP or TCP socket
Should be implemented in order to fake socket class. Does not do what expected may imply the app to crash if called.
Write received bytes in the given buffer. (not tested)
Return information received in the socket, but also the originating peer
Write received bytes in the given buffer. (not tested)