Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
abuvanth committed Aug 28, 2019
1 parent 267ab33 commit 9c107c4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
Binary file modified .DS_Store
Binary file not shown.
15 changes: 9 additions & 6 deletions kicks3/kicks3.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def islist(obj):
else:
return False
def check_listings (bucket):
unauth=False
auth=False
s3=boto3.client('s3')
try:
session = requests.Session()
Expand All @@ -27,7 +29,7 @@ def check_listings (bucket):
auth=True
except Exception,e:
#print str(e)
return (False,False)
return (unauth,auth)
return (unauth, auth)

def get_bucket_acl(bucket):
Expand Down Expand Up @@ -73,7 +75,7 @@ def scan_s3(f,silent=False):
get_acl=get_bucket_acl(line)
if not silent:
print('Bucketname - '+line,'unauth_list - '+str(listing[0]),'auth_list - '+str(listing[1]),'auth_write - '+str(upload),'get-bucket-acl'+str(get_acl))
s3out.write('Bucketname - '+line+','+'unauth_list - '+str(listing[0])+','+'auth_list - '+str(listing[1])+','+'auth_write - '+str(upload)+','+'get-bucket-acl'+str(get_acl+'\n'))
s3out.write('Bucketname - '+line+','+'unauth_list - '+str(listing[0])+','+'auth_list - '+str(listing[1])+','+'auth_write - '+str(upload)+','+'get-bucket-acl'+str(get_acl)+'\n')
s3out.close()
result=result+[(line,listing[0],listing[1],upload,get_acl)]
return result
Expand Down Expand Up @@ -143,9 +145,10 @@ def finds3(sitelist,cookies='',sub=0):
cookies=args['cookie']
if args['list']:
sitelist=sitelist+open(args['list'],'r').readlines()
s3=finds3(sitelist,cookies,sub=args['subdomain'])
if s3[0]!='Bucket not found':
results=scan_s3(s3,silent=True)
s3urls=finds3(sitelist,cookies,sub=args['subdomain'])
if s3urls[0]!='Bucket not found':
bucketname=get_bucket_name(s3urls)
results=scan_s3(bucketname,silent=True)
for i in results:
print("Bucket name: "+i[0])
if i[1]:
Expand All @@ -159,6 +162,6 @@ def finds3(sitelist,cookies='',sub=0):
else:
print (Fore.RED +"[*] File Not Upload ... Access Denied [*]")
if i[4]:
print(Fore.RED +"[*] Get acl read")
print(Fore.GREEN +"[*] Get acl read")
else:
print (s3[0])
9 changes: 7 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import kicks3
blist=open('s3.buckets.txt','r').readlines()
result=kicks3.scan_s3(blist)
blist=open('s3_bucket_pub.csv','r').readlines()
b_list=[]
for i in blist:
print(i)
b_list.append(i.split(',')[3])
print(b_list)
#result=kicks3.scan_s3(blist)

0 comments on commit 9c107c4

Please sign in to comment.