-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjop.rb
48 lines (42 loc) · 1.2 KB
/
jop.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#/usr/bin/env ruby
require 'net/http'
def web_count(server_ip,variable)
file = File.new("kurdistan.txt","w")
(0..6).each do |pages|
req = Net::HTTP.get_response(URI.parse("http://www.bing.com/search?q=ip%3a#{server_ip}+%22.php%3f#{variable}%3d%22&go=&filt=all&first=#{pages*10 + 1}&FORM=PERE1")) #get the request
bodys = req.body
my_array = bodys.split('"') # split the text
my_array.each do |words|
if words.scan(".php?#{variable}=").size > 0 then #scan for the .php?id=
if words.scan("http://").size > 0 then
file.puts words
end
end
end
end
file.close
end
def check_sql()
file = File.open("kurdistan.txt","r")
file.each_line do |x|
web_v = x+"'"
web_v["\n"]=""
sql = Net::HTTP.get_response(URI.parse(web_v))
if sql.body.downcase.scan("sql").size > 0 then
puts "this web is vulnerable : #{x}"
end
end
end
if ARGV.size .eql?(2) == false
puts "\n usage: ruby jop.rb 127.0.0.1 id"
else
begin
puts "####################################"
puts "# shared by raykoo expert #"
puts "####################################"
web_count(ARGV[0],ARGV[1])
check_sql()
rescue
puts "cant extract website"
end
end