def initiator(globalBaseUrl):
"""take a url and set up s3 auth. Then call the driver"""
global s3
# alternate way to authenticate in else.
# use what you prefer
if True:
access_key = os.environ.get('AWS_ACCESS_KEY_ID')
secret_key = os.environ.get('AWS_SECRET_ACCESS_KEY')
if access_key is None or secret_key is None:
print printWarning("""No access credentials available.
Please export your AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
Details: http://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html
""")
sys.exit(0)
s3 = boto3.resource('s3', config=Config(signature_version='s3v4'))
else:
# If you prefer to supply the credentials here,
# make sure you flip the if condition to False
# and subsitiute the necessary data :)
s3 = boto3.resource('s3',
aws_access_key_id=ACCESS_ID,
aws_secret_access_key=ACCESS_KEY,
config=Config(signature_version='s3v4')
)
print printScreen("[>]Initiating...", "blue")
print printScreen("[>]Press Ctrl+C to terminate script", "blue")
scanner(globalBaseUrl)
driver(globalBaseUrl)
评论列表
文章目录