Results 1 to 9 of 9

Thread: unable to import Scapy

  1. #1
    Junior Member
    Join Date
    May 2008
    Posts
    35

    Default unable to import Scapy

    i am unable to import scapy module into python interpreter env in backtrack i just install scapy 2.X on BT3 but it just dosent happen every thing work well on my ubuntu box any suggestion???

  2. #2
    Moderator KMDave's Avatar
    Join Date
    Jan 2010
    Posts
    2,281

    Default

    Maybe an errormessage or log would help.
    Tiocfaidh ár lá

  3. #3
    Junior Member
    Join Date
    May 2008
    Posts
    35

    Default

    Code:
    bt ~ # python
    Python 2.5.1 (r251:54863, May  4 2007, 16:52:23)
    [GCC 4.1.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import scapy
    >>> from scapy import *
    >>> lsc()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    NameError: name 'lsc' is not defined
    >>> ARP().show()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    NameError: name 'ARP' is not defined
    >>>

  4. #4
    Moderator KMDave's Avatar
    Join Date
    Jan 2010
    Posts
    2,281

    Default

    Did you check the dependencies for scapy?
    I am not that good in python but it looks to me that some other libraries or alike are missing.

    Did a quick google search and came up with this. Maybe it helps.
    Tiocfaidh ár lá

  5. #5
    Junior Member
    Join Date
    May 2008
    Posts
    35

    Default

    scapy in general launches properly functions properly when invoked in the terminal
    Code:
    bt scapy-2.0.0.10 # scapy.py
    /usr/local/sbin/scapy.py:3200: Warning: 'with' will become a reserved keyword in Python 2.6
    /usr/local/sbin/scapy.py:3202: Warning: 'with' will become a reserved keyword in Python 2.6
    Welcome to Scapy (1.2.0.2)
    >>> ls()
    but its just that in backtrack 3 python interpreter environment is unable to import scapy as a module i guess the module is not being recognised by python.

    i wrote a small tool in python which is functioning properly in Ubuntu but it just dosent seem to be functioning in backtrack when run under backtrack it returns a error saying the function "sendp" is not recognized

  6. #6
    Member
    Join Date
    Jun 2007
    Posts
    218

    Default

    Copy scapy.py to /usr/lib/python2.5/site-packages

  7. #7
    Junior Member
    Join Date
    May 2008
    Posts
    35

    Default

    Quote Originally Posted by level View Post
    Copy scapy.py to /usr/lib/python2.5/site-packages
    copied scapy.py from /usr/bin/scapy.py to /usr/lib/python2.5/site-packages

    still dosent work i'm unable to understand what is going wrong

    Does the above step work for u level???

  8. #8
    Jenkem Addict imported_wyze's Avatar
    Join Date
    Jul 2007
    Posts
    1,543

    Default

    You might want to check your environment variables. You could also throw scapy.py in the same directory as whatever executable you are trying to run.
    dd if=/dev/swc666 of=/dev/wyze

  9. #9
    Junior Member
    Join Date
    May 2008
    Posts
    35

    Default

    Thanks alot for all the help got it fixed atlast just downloaded a latest copy of scapy install it in root directory and then copied the folder scapy-2.0.0.10 and replaced the folder scapy in "/usr/lib/python-2.5/site-packages"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •