flipkart-incubator / Astra

Automated Security Testing For REST API's
Apache License 2.0
2.49k stars 396 forks source link

NameError: global name 'scanid' is not defined #94

Open nulldreams opened 5 years ago

nulldreams commented 5 years ago

Hi! First of all, thanks for this project!

So, I've got a Postman collection named "teste.json", when I start astra cli, I've got this error below.

In the first test, I've got this error UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 537: ordinal not in range(128), but I "fix" inserting a code in Astra/core/parsers.py.

Code:

import sys
reload(sys)
sys.setdefaultencoding('utf8')

Error after fix

$ python astra.py -c Postman -n teste.json 

                        _             
            /\       | |            
           /  \   ___| |_ _ __ __ _ 
          / /\ \ / __| __| '__/ _` |
         / ____ \__ \ |_| | | (_| |
        /_/    \_\___/\__|_|  \__,_|

[-]Failed to detect login url. Do you want to contiune without authentication?(y/n):y
Traceback (most recent call last):
  File "astra.py", line 298, in <module>
    main()
  File "astra.py", line 288, in main
    scan_core(collection_type,collection_name,url,headers,method,body,loginurl,loginheaders,logindata,login_require) 
  File "astra.py", line 196, in scan_core
    modules_scan(url,method,headers,body,scanid)        
NameError: global name 'scanid' is not defined