from scapy.all import * class Custom_HTTP_Server(HTTP_Server): def answer(self, pkt): if pkt.Path == b"/": return HTTPResponse() / ( "

OK

" ) else: return HTTPResponse( Status_Code=b"404", Reason_Phrase=b"Not Found", ) / ( "

404 - Not Found

" ) server = HTTP_Server.spawn( port=80, iface="eth0", )