Skip to content

Commit

Permalink
Update BSQLinjector.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoiz authored Jul 12, 2018
1 parent fc1d5c5 commit 2f0fc2b
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions BSQLinjector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
alls = "n" # if all special characters should be included in enumeration
run = 0 # parameter specifies if program should continue when always true condition is detected


$i = 0 # main counter for characters

# set all variables
Expand Down Expand Up @@ -166,22 +167,32 @@
# get connection host and port
z = 1
loop do
break if File.readlines($file)[z].chomp.empty?
if File.readlines($file)[z].include?("Host: ")
$remote = File.readlines($file)[z].split(" ")[1]
if $proto == "http"
$port = 80
else
$port = 443
end
if $remote.include?(":")
$port = $remote.split(":")[1]
$remote = $remote.split(":")[0]
begin
break if File.readlines($file)[z].chomp.empty?
if File.readlines($file)[z].include?("Host: ")
$remote = File.readlines($file)[z].split(" ")[1]
if $proto == "http"
$port = 80
else
$port = 443
end
if $remote.include?(":")
$port = $remote.split(":")[1]
$remote = $remote.split(":")[0]
end
end
rescue
puts "[-] Wrong HTTP file format."
exit(1)
end
z = z + 1
end

if $remote == ""
puts "[-] Cannot retrieve hostname."
exit(1)
end

# Configure main request
def configreq(chars)

Expand Down

0 comments on commit 2f0fc2b

Please sign in to comment.