How can i assign a number to another using sprintf?

import scapy.all as scapy pkt = scapy.rdpcap(’99.pcap’) test = pkt[0].sprintf("%IP.src%=%127.0.0.1%") print(test) result: scapy.error.Scapy_Exception: Bad format string [%127.0.0.1%] How can i assign 127.0.0.1 using the sprintf function ? >Solution : try this it may work: import scapy.all as scapy pkt = #the file assignment = pkt[0].sprintf(‘%IP.src%’) assignment = ‘127.0.0.1’ print(assignment) Note: sprintf expression cannot have the… Read More How can i assign a number to another using sprintf?

Why am i getting this error when i try to answer my own dns request?

import scapy.all as scapy p = scapy.DNS(qd=scapy.DNSQR(qname=’www.example.com’), an=scapy.DNSRR(rrname=’127.0.0.1′)) scapy.send(p) result : Traceback (most recent call last): File "/home/kali/PROJECTS/server.py", line 3, in <module> scapy.send(p) File "/usr/lib/python3/dist-packages/scapy/sendrecv.py", line 425, in send return _send( File "/usr/lib/python3/dist-packages/scapy/sendrecv.py", line 395, in _send results = __gen_send(socket, x, inter=inter, loop=loop, File "/usr/lib/python3/dist-packages/scapy/sendrecv.py", line 360, in __gen_send s.send(p) File "/usr/lib/python3/dist-packages/scapy/arch/linux.py", line 605, in… Read More Why am i getting this error when i try to answer my own dns request?