def transmit(self, sock, node, edge): """ Render and transmit a node, process callbacks accordingly.
Args: sock (Target, optional): Socket-like object on which to transmit node node (pgraph.node.node (Node), optional): Request/Node to transmit edge (pgraph.edge.edge (pgraph.edge), optional): Edge along the current fuzz path from "node" to next node. """
data = None
# if the edge has a callback, process it. the callback has the option to render the node, modify it and return. if edge.callback: data = edge.callback(self, node, edge, sock)
# if no data was returned by the callback, render the node here. if not data: data = node.render()
def initialize_ftp(session, username, password): s_initialize("user") s_string("USER") s_delim(" ") s_string(username.encode('ascii')) s_static("\r\n")
s_initialize("pass") s_string("PASS") s_delim(" ") s_string(password.encode('ascii')) s_static("\r\n")
s_initialize("stor") s_string("STOR") s_delim(" ") s_string("AAAA") s_static("\r\n")
s_initialize("retr") s_string("RETR") s_delim(" ") s_string("AAAA") s_static("\r\n")
def my_callback(session, node, edge, sock): session.targets[0].send('more data')
session.connect(s_get("user")) session.connect(s_get("user"), s_get("pass"), my_callback) session.connect(s_get("pass"), s_get("stor")) session.connect(s_get("pass"), s_get("retr"))