wepawet 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/wepawet/wepawet.rb +12 -3
- data/test/test_wepawet.rb +8 -1
- data/wepawet.gemspec +2 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/wepawet/wepawet.rb
CHANGED
@@ -10,7 +10,12 @@ module Wepawet
|
|
10
10
|
|
11
11
|
# Wepawet::Submit is used to submit new files and/or URLs into the wepawet system.
|
12
12
|
class Submit
|
13
|
-
def initialize(config
|
13
|
+
def initialize(config = {
|
14
|
+
'wepawetSubmitUrl' => 'http://wepawet.cs.ucsb.edu/services/upload.php',
|
15
|
+
'wepawetQueryUrl' => 'http://wepawet.cs.ucsb.edu/services/query.php',
|
16
|
+
'wepawetDomainUrl' => 'http://wepawet.cs.ucsb.edu/services/domain.php',
|
17
|
+
'wepawetUrlUrl' => 'http://wepawet.cs.ucsb.edu/services/url.php',
|
18
|
+
})
|
14
19
|
@config = config
|
15
20
|
end
|
16
21
|
|
@@ -37,7 +42,6 @@ module Wepawet
|
|
37
42
|
['user','passwd','referer'].each do |opt|
|
38
43
|
params[opt] = @config[opt] if @config[opt]
|
39
44
|
end
|
40
|
-
puts @config['wepawetSubmitUrl']
|
41
45
|
uri = URI.parse(@config['wepawetSubmitUrl'])
|
42
46
|
http = Net::HTTP.new(uri.host, uri.port)
|
43
47
|
http.use_ssl = (uri.scheme == 'https')
|
@@ -59,7 +63,12 @@ module Wepawet
|
|
59
63
|
end
|
60
64
|
|
61
65
|
class Query
|
62
|
-
def initialize(config
|
66
|
+
def initialize(config = {
|
67
|
+
'wepawetSubmitUrl' => 'http://wepawet.cs.ucsb.edu/services/upload.php',
|
68
|
+
'wepawetQueryUrl' => 'http://wepawet.cs.ucsb.edu/services/query.php',
|
69
|
+
'wepawetDomainUrl' => 'http://wepawet.cs.ucsb.edu/services/domain.php',
|
70
|
+
'wepawetUrlUrl' => 'http://wepawet.cs.ucsb.edu/services/url.php',
|
71
|
+
})
|
63
72
|
@config = config
|
64
73
|
end
|
65
74
|
|
data/test/test_wepawet.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'helper'
|
2
|
-
|
2
|
+
require 'pp'
|
3
3
|
class TestWepawet < Test::Unit::TestCase
|
4
4
|
should "submit submit http://example.com for analysis" do
|
5
5
|
config = {
|
@@ -13,8 +13,15 @@ class TestWepawet < Test::Unit::TestCase
|
|
13
13
|
assert_equal(32, hash.length)
|
14
14
|
assert(hash =~ /^[a-fA-F0-9]{32}$/)
|
15
15
|
q = Wepawet::Query.new(config)
|
16
|
+
begin
|
17
|
+
sleep 2
|
18
|
+
resp = q.by_taskid(hash)
|
19
|
+
end while resp['status'] == 'queued'
|
20
|
+
pp resp
|
16
21
|
resp = q.by_taskid(hash)
|
17
22
|
assert("http://example.com", resp['url'])
|
23
|
+
assert("benign", resp['result'])
|
24
|
+
assert("processed", resp['status'])
|
18
25
|
resp = q.by_domain("example.com")
|
19
26
|
assert("example.com", resp['domain'])
|
20
27
|
resp = q.by_url("http://example.com")
|
data/wepawet.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{wepawet}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Chris Lee"]
|
12
|
-
s.date = %q{2011-04-
|
12
|
+
s.date = %q{2011-04-25}
|
13
13
|
s.description = %q{Wepawet is a service for detecting and analyzing web-based malware. It currently handles Flash, JavaScript, and PDF files. http://wepawet.cs.ucsb.edu}
|
14
14
|
s.email = %q{rubygems@chrislee.dhs.org}
|
15
15
|
s.executables = ["wepawet"]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wepawet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Lee
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-04-
|
18
|
+
date: 2011-04-25 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|