Skip to content

Commit 2e8d19e

Browse files
committed
Retab all the things (except external/)
1 parent 0ecba37 commit 2e8d19e

File tree

293 files changed

+34801
-34801
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

293 files changed

+34801
-34801
lines changed

data/exploits/capture/http/forms/extractforms.rb

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
require 'timeout'
1616

1717
def usage
18-
$stderr.puts "#{$0} [site list] [output-dir]"
19-
exit(0)
18+
$stderr.puts "#{$0} [site list] [output-dir]"
19+
exit(0)
2020
end
2121

2222
input = ARGV.shift() || usage()
@@ -25,32 +25,32 @@ def usage
2525
doc = Hpricot(File.open(input))
2626
doc.search("//form").each do |form|
2727

28-
# Extract the form
29-
res = "<form"
30-
form.attributes.each do |attr|
31-
res << " #{attr[0]}='#{attr[1].gsub("'", "")}'"
32-
end
33-
res << "> "
28+
# Extract the form
29+
res = "<form"
30+
form.attributes.each do |attr|
31+
res << " #{attr[0]}='#{attr[1].gsub("'", "")}'"
32+
end
33+
res << "> "
3434

35-
# Strip out the value
36-
form.search("//input") do |inp|
35+
# Strip out the value
36+
form.search("//input") do |inp|
3737

38-
inp.attributes.keys.each do |ikey|
39-
if (ikey.downcase == "value")
40-
inp[ikey] = ""
41-
next
42-
end
38+
inp.attributes.keys.each do |ikey|
39+
if (ikey.downcase == "value")
40+
inp[ikey] = ""
41+
next
42+
end
4343

44-
if(inp.attributes[ikey] =~ /^http/i)
45-
inp[ikey] = ""
46-
next
47-
end
44+
if(inp.attributes[ikey] =~ /^http/i)
45+
inp[ikey] = ""
46+
next
47+
end
4848

49-
end
49+
end
5050

51-
res << inp.to_html
52-
end
53-
res << "</form>"
51+
res << inp.to_html
52+
end
53+
res << "</form>"
5454
end
5555

5656
$stdout.puts res

data/exploits/capture/http/forms/grabforms.rb

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -15,72 +15,72 @@
1515
require 'timeout'
1616

1717
def usage
18-
$stderr.puts "#{$0} [site list] [output-dir]"
19-
exit(0)
18+
$stderr.puts "#{$0} [site list] [output-dir]"
19+
exit(0)
2020
end
2121

2222
sitelist = ARGV.shift() || usage()
2323
output = ARGV.shift() || usage()
2424

2525
File.readlines(sitelist).each do |site|
26-
site.strip!
27-
next if site.length == 0
28-
next if site =~ /^#/
29-
30-
out = File.join(output, site + ".txt")
31-
File.unlink(out) if File.exists?(out)
32-
33-
fd = File.open(out, "a")
34-
26+
site.strip!
27+
next if site.length == 0
28+
next if site =~ /^#/
29+
30+
out = File.join(output, site + ".txt")
31+
File.unlink(out) if File.exists?(out)
32+
33+
fd = File.open(out, "a")
34+
3535

36-
["", "www."].each do |prefix|
37-
begin
38-
Timeout.timeout(10) do
39-
doc = Hpricot(open("http://#{prefix}#{site}/"))
40-
doc.search("//form").each do |form|
36+
["", "www."].each do |prefix|
37+
begin
38+
Timeout.timeout(10) do
39+
doc = Hpricot(open("http://#{prefix}#{site}/"))
40+
doc.search("//form").each do |form|
4141

42-
# Extract the form
43-
res = "<form"
44-
form.attributes.each do |attr|
45-
res << " #{attr[0]}='#{attr[1].gsub("'", "")}'"
46-
end
47-
res << "> "
42+
# Extract the form
43+
res = "<form"
44+
form.attributes.each do |attr|
45+
res << " #{attr[0]}='#{attr[1].gsub("'", "")}'"
46+
end
47+
res << "> "
4848

49-
# Strip out the value
50-
form.search("//input") do |inp|
49+
# Strip out the value
50+
form.search("//input") do |inp|
5151

52-
inp.attributes.keys.each do |ikey|
53-
if (ikey.downcase == "value")
54-
inp[ikey] = ""
55-
next
56-
end
52+
inp.attributes.keys.each do |ikey|
53+
if (ikey.downcase == "value")
54+
inp[ikey] = ""
55+
next
56+
end
5757

58-
if(inp.attributes[ikey] =~ /^http/i)
59-
inp[ikey] = ""
60-
next
61-
end
58+
if(inp.attributes[ikey] =~ /^http/i)
59+
inp[ikey] = ""
60+
next
61+
end
6262

63-
end
63+
end
6464

65-
res << inp.to_html
66-
end
67-
res << "</form>"
65+
res << inp.to_html
66+
end
67+
res << "</form>"
6868

69-
fd.write(res)
70-
end
71-
end
72-
break
73-
rescue ::Timeout::Error
74-
$stderr.puts "#{prefix}#{site} timed out"
75-
rescue ::Interrupt
76-
raise $!
77-
rescue ::Exception => e
78-
$stderr.puts "#{prefix}#{site} #{e.class} #{e}"
79-
end
80-
end
81-
82-
fd.close
83-
84-
File.unlink(out) if (File.size(out) == 0)
69+
fd.write(res)
70+
end
71+
end
72+
break
73+
rescue ::Timeout::Error
74+
$stderr.puts "#{prefix}#{site} timed out"
75+
rescue ::Interrupt
76+
raise $!
77+
rescue ::Exception => e
78+
$stderr.puts "#{prefix}#{site} #{e.class} #{e}"
79+
end
80+
end
81+
82+
fd.close
83+
84+
File.unlink(out) if (File.size(out) == 0)
8585

8686
end

data/exploits/psnuffle/ftp.rb

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -8,71 +8,71 @@
88

99
class SnifferFTP < BaseProtocolParser
1010

11-
def register_sigs
12-
self.sigs = {
13-
:banner => /^(220\s*[^\r\n]+)/i,
14-
:user => /^USER\s+([^\s]+)/i,
15-
:pass => /^PASS\s+([^\s]+)/i,
16-
:login_pass => /^(230\s*[^\n]+)/i,
17-
:login_fail => /^(5\d\d\s*[^\n]+)/i,
18-
:bye => /^221/
19-
}
20-
end
11+
def register_sigs
12+
self.sigs = {
13+
:banner => /^(220\s*[^\r\n]+)/i,
14+
:user => /^USER\s+([^\s]+)/i,
15+
:pass => /^PASS\s+([^\s]+)/i,
16+
:login_pass => /^(230\s*[^\n]+)/i,
17+
:login_fail => /^(5\d\d\s*[^\n]+)/i,
18+
:bye => /^221/
19+
}
20+
end
2121

22-
def parse(pkt)
23-
# We want to return immediatly if we do not have a packet which is handled by us
24-
return unless pkt.is_tcp?
25-
return if (pkt.tcp_sport != 21 and pkt.tcp_dport != 21)
26-
s = find_session((pkt.tcp_sport == 21) ? get_session_src(pkt) : get_session_dst(pkt))
27-
s[:sname] ||= "ftp"
22+
def parse(pkt)
23+
# We want to return immediatly if we do not have a packet which is handled by us
24+
return unless pkt.is_tcp?
25+
return if (pkt.tcp_sport != 21 and pkt.tcp_dport != 21)
26+
s = find_session((pkt.tcp_sport == 21) ? get_session_src(pkt) : get_session_dst(pkt))
27+
s[:sname] ||= "ftp"
2828

29-
self.sigs.each_key do |k|
30-
# There is only one pattern per run to test
31-
matched = nil
32-
matches = nil
29+
self.sigs.each_key do |k|
30+
# There is only one pattern per run to test
31+
matched = nil
32+
matches = nil
3333

34-
if(pkt.payload =~ self.sigs[k])
35-
matched = k
36-
matches = $1
37-
end
34+
if(pkt.payload =~ self.sigs[k])
35+
matched = k
36+
matches = $1
37+
end
3838

39-
case matched
39+
case matched
4040

41-
when :login_fail
42-
if(s[:user] and s[:pass])
43-
report_auth_info(s.merge({:active => false}))
44-
print_status("Failed FTP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]}")
41+
when :login_fail
42+
if(s[:user] and s[:pass])
43+
report_auth_info(s.merge({:active => false}))
44+
print_status("Failed FTP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]}")
4545

46-
s[:pass] = ""
47-
return
48-
end
46+
s[:pass] = ""
47+
return
48+
end
4949

50-
when :login_pass
51-
if(s[:user] and s[:pass])
52-
report_auth_info(s)
53-
print_status("Successful FTP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]}")
54-
# Remove it form the session objects so freeup memory
55-
sessions.delete(s[:session])
56-
return
57-
end
50+
when :login_pass
51+
if(s[:user] and s[:pass])
52+
report_auth_info(s)
53+
print_status("Successful FTP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]}")
54+
# Remove it form the session objects so freeup memory
55+
sessions.delete(s[:session])
56+
return
57+
end
5858

59-
when :banner
60-
# Because some ftp server send multiple banner we take only the first one and ignore the rest
61-
if not (s[:info])
62-
s[:info] = matches
63-
report_service(s)
64-
end
59+
when :banner
60+
# Because some ftp server send multiple banner we take only the first one and ignore the rest
61+
if not (s[:info])
62+
s[:info] = matches
63+
report_service(s)
64+
end
6565

66-
when :bye
67-
sessions.delete(s[:session])
66+
when :bye
67+
sessions.delete(s[:session])
6868

69-
when nil
70-
# No matches, no saved state
71-
else
72-
sessions[s[:session]].merge!({k => matches})
73-
end # end case matched
69+
when nil
70+
# No matches, no saved state
71+
else
72+
sessions[s[:session]].merge!({k => matches})
73+
end # end case matched
7474

75-
end # end of each_key
76-
end # end of parse
75+
end # end of each_key
76+
end # end of parse
7777
end
7878

0 commit comments

Comments
 (0)