Santandersecurityresearch / corsair_scan

Corsair_scan is a security tool to test Cross-Origin Resource Sharing (CORS).
MIT License
122 stars 15 forks source link

AttributeError: module 'corsair_scan' has no attribute 'corsair_scan' #26

Closed MauroEldritch closed 3 years ago

MauroEldritch commented 3 years ago

Description

Trying to run the provided example, I receive the following error:

Traceback (most recent call last):
  File "/usr/local/bin/corsair", line 18, in <module>
    print (corsair_scan.corsair_scan(data, verify=True))
AttributeError: module 'corsair_scan' has no attribute 'corsair_scan'

Is there something I'm missing? Really curious to try your tool. Thanks.

What I Did

Ran the provided example.

javixeneize commented 3 years ago

Hi! Thanks for opening the issue. This is one of the typical python errors :), looks like it can't resolve the module.

Have you installed it as a dependency with pip, or are you just cloning the repo?

Thanks

MauroEldritch commented 3 years ago

Hi Javi! Gracias por la pronta respuesta ;)

I've installed it with pip3 just as stated in the README.md.

Thanks!

javixeneize commented 3 years ago

Sin problema ;)

I see what is the problem... The module to import is corsair_scan.corsair_scan.

Just do the import like this

import corsair_scan.corsair_scan as corsair .....

print (corsair.corsair_scan(data, verify=True))

Thanks for pointing out!

MauroEldritch commented 3 years ago

Works perfectly now, thanks for the support!

Looking forward for the CLI release!

Best, Mauro

javixeneize commented 3 years ago

@MauroEldritch CLI has just been released :)