Skip to content

Commit

Permalink
update grayhat warfare task
Browse files Browse the repository at this point in the history
  • Loading branch information
m-q-t committed Jun 18, 2021
1 parent 7d6db29 commit ea3890f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/tasks/helpers/cloud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def aws_key_valid?(client, bucket_name)

# extracts the bucket_name from a URL
# there can be different types of naming schemes - virtual hosted & path_style
def parse_bucket_name_from_url(bucket_url)
def extract_bucket_name_from_url(bucket_url)
# Virtual Hosted Style
# https://bucketname.s3.amazonaws.com
# https://bucketname.s3-us-west-2.amazonaws.com/
Expand Down
6 changes: 3 additions & 3 deletions lib/tasks/search_grayhat_warfare.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ def run

# get it, make sure we don't have an empty response
output = JSON.parse(http_get_body(search_uri))
_log 'Unable to find any results.' unless output
return unless output

output['buckets'].each do |b|
# {"id"=>1096, "bucket"=>"example.amazonaws.com", "fileCount"=>11, "type"=>"aws"}
# {"id"=>137, "bucket"=>"abteststore.blob.core.windows.net", "fileCount"=>2, "type"=>"azure", "container"=>"files"}
if b['type'] == 'aws'
_create_entity 'AwsS3Bucket', {
'name' => "https://#{b["bucket"]}",
'uri' => "https://#{b["bucket"]}",
'name' => extract_bucket_name_from_url(b['bucket']),
'bucket_uri' => "https://#{b["bucket"]}",
'fileCount' => b['fileCount'],
'type' => b['type']
}
elsif b['type'] == 'azure'
_create_entity 'AzureBlob', {
Expand Down

0 comments on commit ea3890f

Please sign in to comment.