hi,
I'm a lecturer from Indonesia and I'm teaching cybersecurity course.
I need to use Python and Scapy to do sniffing and snooping, so I installed:
Python3.7 works fine, however when I try to use any class from Scapy, it said "NameError: name <class< is not defined"
I'm a lecturer from Indonesia and I'm teaching cybersecurity course.
I need to use Python and Scapy to do sniffing and snooping, so I installed:
Code:
# /usr/ports/lang/python37
# /usr/ports/net/scapy
Code:
$ python3.7
Python 3.7.9 (default, Apr 26 2021, 05:45:03)
[Clang 10.0.1 ([email]git@github.com[/email]:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611a on freebsd12
Type "help", "copyright", "credits" or "license" for more information.
>>> from scapy.all import *
>>> a=IP()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'IP' is not defined
>>> dir(scapy)
['AnyStr', 'VERSION', 'VERSION_MAIN', '_SCAPY_PKG_DIR', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', '_tmp', '_version', '_version_from_git_describe', 'all', 'ansmachine', 'arch', 'as_resolvers', 'asn1', 'asn1fields', 'asn1packet', 'automaton', 'autorun', 'base_classes', 'compat', 'config', 'consts', 'dadict', 'data', 'error', 'extlib', 'fields', 'layers', 'libs', 'main', 'modules', 'os', 'packet', 'pipetool', 'plist', 'pton_ntop', 're', 'route', 'scapypipes', 'sendrecv', 'sessions', 'subprocess', 'supersocket', 'themes', 'utils', 'utils6', 'volatile']