.

ImportError: No module named all scapy

<<

Xtophertaito

Post Fri May 10, 2013 6:22 am

ImportError: No module named all scapy

Hey all,
I google the above error without solution.kindly suggest how solve the problem.
I studying with violent python book now.
However on page 177 I got stucked!
Here is my story, code and error message on mac osx 10.8.
I run the code on the command line not backtrack.
code:

import re
import optparse
from scapy.all import *  
def findCreditCard(pkt):
   raw = pkt.sprintf('%Raw.load%')
   americaRE = re.findall('3[47][0-9]{13}', raw)
   masterRE = re.findall('5[1-5][0-9]{14}', raw)
   visaRE = re.findall('4[0-9]{12}(?:[0-9]{3})?', raw)

   if americaRE:
       print '[+] Found American Express Card: ' + americaRE[0]
   if masterRE:
       print '[+] Found MasterCard Card: ' + masterRE[0]
   if visaRE:
       print '[+] Found Visa Card: ' + visaRE[0]


def main():
   parser = optparse.OptionParser('usage %prog -i <interface>')
   parser.add_option('-i', dest='interface', type='string',\
     help='specify interface to listen on')
   (options, args) = parser.parse_args()

   if options.interface == None:
       print parser.usage
       exit(0)
   else:
       conf.iface = options.interface

   try:
       print '[*] Starting Credit Card Sniffer.'
       sniff(filter='tcp', prn=findCreditCard, store=0)
   except KeyboardInterrupt:
       exit(0)


if __name__ == '__main__':
   main()
my command line output:

Traceback (most recent call last):
 File "/Users/user/Desktop/scapy.py", line 10, in <module>
   from scapy.all import *  
 File "/Users/user/Desktop/scapy.py", line 10, in <module>
   from scapy.all import *  
ImportError: No module named all
logout

[Process completed]


I installed  scapy 2.0.0 on python 2.7

Thanks.
Xtophertaito
Last edited by Xtophertaito on Fri May 10, 2013 6:24 am, edited 1 time in total.
<<

dynamik

Recruiters
Recruiters

Posts: 1119

Joined: Sun Nov 09, 2008 11:00 am

Location: Mile High City

Post Fri May 10, 2013 7:43 am

Re: ImportError: No module named all scapy

Try:
from scapy import *
The day you stop learning is the day you start becoming obsolete.
<<

Dark_Knight

User avatar

Sr. Member
Sr. Member

Posts: 294

Joined: Mon Aug 11, 2008 7:03 pm

Post Fri May 10, 2013 1:18 pm

Re: ImportError: No module named all scapy

hmmm I had no issues running this as is on KALI. Adding to from scapy import * did generate an error.
CEH, OSCP, GPEN, GWAPT, GCIA
http://sector876.blogspot.com
<<

dynamik

Recruiters
Recruiters

Posts: 1119

Joined: Sun Nov 09, 2008 11:00 am

Location: Mile High City

Post Fri May 10, 2013 3:15 pm

Re: ImportError: No module named all scapy

It's a difference between versions.
The day you stop learning is the day you start becoming obsolete.
<<

Xtophertaito

Post Fri May 10, 2013 10:16 pm

Re: ImportError: No module named all scapy

@ ajohnson
  from scapy import *
The above statement output :
  ImportError: No module named all.

See below:

File "/Users/user/Desktop/ex09.py", line 3, in <module>
    from scapy import * 
  File "/Users/user/Desktop/scapy.py", line 4, in <module>
    from scapy.all import * 
ImportError: No module named all
logout

Thanks for the reply and I am still stucked here
<<

m0wgli

User avatar

Sr. Member
Sr. Member

Posts: 308

Joined: Fri Jul 20, 2012 3:34 pm

Post Sat May 11, 2013 4:10 am

Re: ImportError: No module named all scapy

Security + | OSWP | eCPPT (Silver & Gold) | CSTA

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

.
Powered by phpBB® Forum Software © phpBB Group.
Designed by ST Software