easywins 0.1.0 → 0.2.1

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.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YjE1OGI0OWQ5Y2Q2NWUzMzQ1ZjQ3MzI5NTlhNzAzYmVlYjNiNmM4MQ==
5
+ data.tar.gz: !binary |-
6
+ Y2Q3OGQwYTI4ODM3MzNlNTYxNTdhZDNmYmQ3NzlhMmU4OTg1ZGJlNQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NDc1MjQ3Y2Y2MmJmM2QxZTc4MTZiM2JhN2VmYzViMmRmODY0MjlkNjUxOGU0
10
+ YjZlZGUzM2Y5MGRhNDI4MGIxZjU0NzMyZDMyMjJlMjFmOWU4YTI1N2I2ZDA5
11
+ NjhlM2E3ZDhhMWI3YmJjZmRhOThhNGE5YzFiNGVkNWYxYjFjYWY=
12
+ data.tar.gz: !binary |-
13
+ Yzc5ZTMzMDU2NzA2MmY4ZDAwZmRiMGRkYWIwYTZlZjRjMDU5NjQxNTgyYjk0
14
+ M2JlNTI1NDY1ZjcyZjUxODg5NDQxMGRiMzRiNDE1ZWU4ZmQ4ZDdjNTIyMDk5
15
+ NDJlZGRiYzNjZWI4ZDA2ZWYyNzU4N2UzY2FjYTU2OTM4NzhlYmU=
data/README.md CHANGED
@@ -19,13 +19,14 @@ list of common *easy win* paths: https://github.com/pwnwiki/webappurls
19
19
 
20
20
  Probe a web server for common files and endpoints that are useful for gathering information or gaining a foothold.
21
21
 
22
- v0.1.0
22
+ v0.2.1
23
23
 
24
24
  Options:
25
25
  -h, --help Show command line help
26
26
  -g, --get Use GET requests instead of HEAD (slower but stealthier)
27
27
  -s, --sleep Sleep between 0 and 10 seconds before each request
28
28
  -x, --spoof Spoof X-Forwarded-For header with random IP addresses
29
+ -u, --update Update list of paths from GitHub
29
30
  --timeout SECONDS Request timeout in seconds
30
31
  (default: 2.5)
31
32
  -r, --retries RETRIES Number of retries on failed requests
@@ -20,7 +20,21 @@ class App
20
20
 
21
21
  not_found_codes = [404]
22
22
 
23
- print "\n [*] Checking to see if the server is alive... "
23
+ print "\n"
24
+
25
+ if !Easywins::ListManager.file_exists? || options.include?('update')
26
+ print " [*] Downloading latest list of paths from GitHub... "
27
+ begin
28
+ Easywins::ListManager.update_file!
29
+ print Paint["done.\n", :green]
30
+ rescue Easywins::ListManager::UpdateError => e
31
+ print Paint["FAILED!\n", :red]
32
+ puts " [*] e.message; exiting."
33
+ exit!
34
+ end
35
+ end
36
+
37
+ print " [*] Checking to see if the server is alive... "
24
38
  if target.alive?
25
39
  print Paint["yes, good.\n", :green]
26
40
  else
@@ -55,12 +69,13 @@ class App
55
69
  end
56
70
  end
57
71
 
58
- puts " [*] Checking the server for #{Easywins::PATHS.count} interesting paths...\n\n"
59
-
72
+ list = Easywins::ListManager.get_list
60
73
  thread_pool = Thread.pool(options[:threads].to_i)
61
- column_width = Easywins::PATHS.max { |a, b| a.length <=> b.length }.length + target.base_url.length
74
+ column_width = list.max { |a, b| a.length <=> b.length }.length + target.base_url.length
75
+
76
+ puts " [*] Checking the server for #{list.count} interesting paths...\n\n"
62
77
 
63
- Easywins::PATHS.shuffle.each do |path|
78
+ list.shuffle.each do |path|
64
79
  thread_pool.process do
65
80
  sleep Random.rand(10) if options.include?('sleep')
66
81
  begin
@@ -105,6 +120,7 @@ class App
105
120
  on('-g', '--get', "Use GET requests instead of HEAD (slower but stealthier)")
106
121
  on('-s', '--sleep', "Sleep between 0 and 10 seconds before each request")
107
122
  on('-x', '--spoof', "Spoof X-Forwarded-For header with random IP addresses")
123
+ on('-u', '--update', "Update list of paths from GitHub")
108
124
  on('-t', '--timeout SECONDS', "Request timeout in seconds")
109
125
  on('-r', '--retries RETRIES', "Number of retries on failed requests")
110
126
  on('-t THREADS', '--threads', "Number of threads to use")
@@ -7,93 +7,8 @@ require 'thread/pool'
7
7
 
8
8
  require 'easywins/version'
9
9
  require 'easywins/http_client'
10
+ require 'easywins/list_manager'
10
11
  require 'easywins/target'
11
12
 
12
13
  module Easywins
13
- PATHS = [
14
- '/.bzr/README',
15
- '/.git/config',
16
- '/.hg/requires',
17
- '/.htaccess',
18
- '/.htpasswd',
19
- '/.svn/wc.db',
20
- '/_layouts/groups.aspx',
21
- '/_layouts/people.aspx',
22
- '/access.log',
23
- '/admin',
24
- '/admin.nsf',
25
- '/administration/index.php',
26
- '/administrator/',
27
- '/apc.php',
28
- '/awstats/',
29
- '/axis2/axis2-web/HappyAxis.jsp',
30
- '/backup.tar.gz',
31
- '/backup/',
32
- '/backups/',
33
- '/bb-admin',
34
- '/c99.php',
35
- '/cacti',
36
- '/CFIDE/adminapi/administrator.cfc',
37
- '/CFIDE/administrator/enter.cfm',
38
- '/CFIDE/administrator/index.cfm',
39
- '/CFIDE/scripts/ajax/FCKeditor/editor/filemanager/connectors/cfm/upload.cfm',
40
- '/cgi-bin/cvsweb',
41
- '/cgi-bin/php',
42
- '/cgi-bin/php5',
43
- '/CHANGELOG.txt',
44
- '/console/',
45
- '/crossdomain.xml',
46
- '/data',
47
- '/dev/',
48
- '/elmah.axd',
49
- '/error.log',
50
- '/exchange/',
51
- '/files',
52
- '/ghost',
53
- '/include/',
54
- '/includes/',
55
- '/index.php?-s',
56
- '/index.php?url=admin',
57
- '/info.php',
58
- '/install',
59
- '/INSTALL.txt',
60
- '/install/upgrade.php',
61
- '/jmx-console/',
62
- '/login',
63
- '/logon',
64
- '/logs/',
65
- '/manager',
66
- '/manager/html',
67
- '/manual/',
68
- '/na_admin/ataglance.html',
69
- '/owa',
70
- '/pgmyadmin/',
71
- '/phpinfo.php',
72
- '/phpmyadmin/',
73
- '/plesk',
74
- '/pls/admin',
75
- '/private',
76
- '/Providers/HtmlEditorProviders/Fck/fcklinkgallery.aspx',
77
- '/README.txt',
78
- '/robots.txt',
79
- '/rockmongo/index.php',
80
- '/server-status',
81
- '/sitemap.xml',
82
- '/sites/default/files/backup_migrate/',
83
- '/temp',
84
- '/test.php',
85
- '/test/',
86
- '/tmp',
87
- '/trace.axd',
88
- '/upload/',
89
- '/uploads/',
90
- '/user.php',
91
- '/webalizer/',
92
- '/webdav/',
93
- '/webmin',
94
- '/WorkArea/version.xml',
95
- '/wp-admin/',
96
- '/wsman',
97
- '/xampp/'
98
- ]
99
14
  end
@@ -0,0 +1,44 @@
1
+ module Easywins
2
+ class ListManager
3
+ LIST_LOCATION = "#{File.dirname(__FILE__)}/../../paths.txt"
4
+ DOWNLOAD_URL = 'https://raw.githubusercontent.com/pwnwiki/webappurls/master/webappurls.txt'
5
+
6
+ class UpdateError < StandardError; end
7
+
8
+ def self.file_exists?
9
+ File.exists?(LIST_LOCATION)
10
+ end
11
+
12
+ def self.update_file!
13
+ download = download_file!
14
+ if download.code != 200 || download.body.size.zero?
15
+ raise UpdateError.new("Unable to download list from #{DOWNLOAD_URL}")
16
+ end
17
+ write_to_file!(download.body)
18
+ end
19
+
20
+ def self.get_list
21
+ sanitize_list(File.read(LIST_LOCATION))
22
+ end
23
+
24
+ private
25
+
26
+ def self.download_file!
27
+ http_client.do_get(DOWNLOAD_URL)
28
+ end
29
+
30
+ def self.write_to_file!(content)
31
+ open(LIST_LOCATION, 'w') do |f|
32
+ f.puts(sanitize_list(content).join("\n"))
33
+ end
34
+ end
35
+
36
+ def self.sanitize_list(list)
37
+ list.split("\n").map { |l| l.strip }.delete_if { |l| l.empty? || !l.start_with?('/') }
38
+ end
39
+
40
+ def self.http_client
41
+ @http_client ||= Easywins::HttpClient.new
42
+ end
43
+ end
44
+ end
@@ -48,9 +48,9 @@ module Easywins
48
48
  raise InvalidBaseUrlError.new("#{url} is an invalid URL") unless valid_url?(url)
49
49
  normalized_url = url.dup
50
50
  use_ssl = (normalized_url =~ /^https/) || (normalized_url =~ /:443\b/)
51
- ends_with_slash = normalized_url =~ /\/$/
52
51
 
53
- normalized_url.chop! if ends_with_slash
52
+ normalized_url.chop! if normalized_url.end_with?('?')
53
+ normalized_url.chop! if normalized_url.end_with?('/')
54
54
  normalized_url.gsub!(/^https?:\/\//i, '')
55
55
 
56
56
  "http#{'s' if use_ssl}://#{normalized_url}".downcase
@@ -1,3 +1,3 @@
1
1
  module Easywins
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easywins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 0.2.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Michael Henriksen
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-05-10 00:00:00.000000000 Z
11
+ date: 2014-05-13 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: httparty
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: methadone
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: paint
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: thread
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: bundler
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ~>
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ~>
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rake
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ! '>='
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ! '>='
108
95
  - !ruby/object:Gem::Version
@@ -125,32 +112,32 @@ files:
125
112
  - easywins.gemspec
126
113
  - lib/easywins.rb
127
114
  - lib/easywins/http_client.rb
115
+ - lib/easywins/list_manager.rb
128
116
  - lib/easywins/target.rb
129
117
  - lib/easywins/version.rb
130
118
  homepage: https://github.com/michenriksen/easywins
131
119
  licenses:
132
120
  - MIT
121
+ metadata: {}
133
122
  post_install_message:
134
123
  rdoc_options: []
135
124
  require_paths:
136
125
  - lib
137
126
  required_ruby_version: !ruby/object:Gem::Requirement
138
- none: false
139
127
  requirements:
140
128
  - - ! '>='
141
129
  - !ruby/object:Gem::Version
142
130
  version: '0'
143
131
  required_rubygems_version: !ruby/object:Gem::Requirement
144
- none: false
145
132
  requirements:
146
133
  - - ! '>='
147
134
  - !ruby/object:Gem::Version
148
135
  version: '0'
149
136
  requirements: []
150
137
  rubyforge_project:
151
- rubygems_version: 1.8.23
138
+ rubygems_version: 2.2.2
152
139
  signing_key:
153
- specification_version: 3
140
+ specification_version: 4
154
141
  summary: Probe a web server for common files and endpoints that are useful for gathering
155
142
  information or gaining a foothold.
156
143
  test_files: []