CorpWatch Company ID Information Search - Metasploit


This page contains detailed information about how to use the auxiliary/gather/corpwatch_lookup_id metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: CorpWatch Company ID Information Search
Module: auxiliary/gather/corpwatch_lookup_id
Source code: modules/auxiliary/gather/corpwatch_lookup_id.rb
Disclosure date: -
Last modification time: 2019-03-05 04:43:03 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: -

This module interfaces with the CorpWatch API to get publicly available info for a given CorpWatch ID of the company. If you don't know the CorpWatch ID, please use the corpwatch_lookup_name module first.

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.

Basic Usage


msf > use auxiliary/gather/corpwatch_lookup_id
msf auxiliary(corpwatch_lookup_id) > show targets
    ... a list of targets ...
msf auxiliary(corpwatch_lookup_id) > set TARGET target-id
msf auxiliary(corpwatch_lookup_id) > show options
    ... show and set options ...
msf auxiliary(corpwatch_lookup_id) > exploit

Go back to menu.

Msfconsole Usage


Here is how the gather/corpwatch_lookup_id auxiliary module looks in the msfconsole:

msf6 > use auxiliary/gather/corpwatch_lookup_id

msf6 auxiliary(gather/corpwatch_lookup_id) > show info

       Name: CorpWatch Company ID Information Search
     Module: auxiliary/gather/corpwatch_lookup_id
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  Brandon Perry <[email protected]>

Check supported:
  No

Basic options:
  Name           Current Setting  Required  Description
  ----           ---------------  --------  -----------
  CHILD_LIMIT    5                no        Set limit to how many children we can get
  CW_ID                           yes       The CorpWatch ID of the company
  GET_CHILDREN   true             no        Get children companies
  GET_FILINGS    false            no        Get all filings
  GET_HISTORY    false            no        Get company history
  GET_LOCATIONS  true             no        Get locations for company
  GET_NAMES      true             no        Get all registered names ofr the company
  YEAR           2020             no        Year to look up

Description:
  This module interfaces with the CorpWatch API to get publicly 
  available info for a given CorpWatch ID of the company. If you don't 
  know the CorpWatch ID, please use the corpwatch_lookup_name module 
  first.

References:
  http://api.corpwatch.org/

Module Options


This is a complete list of options available in the gather/corpwatch_lookup_id auxiliary module:

msf6 auxiliary(gather/corpwatch_lookup_id) > show options

Module options (auxiliary/gather/corpwatch_lookup_id):

   Name           Current Setting  Required  Description
   ----           ---------------  --------  -----------
   CHILD_LIMIT    5                no        Set limit to how many children we can get
   CW_ID                           yes       The CorpWatch ID of the company
   GET_CHILDREN   true             no        Get children companies
   GET_FILINGS    false            no        Get all filings
   GET_HISTORY    false            no        Get company history
   GET_LOCATIONS  true             no        Get locations for company
   GET_NAMES      true             no        Get all registered names ofr the company
   YEAR           2020             no        Year to look up

Advanced Options


Here is a complete list of advanced options supported by the gather/corpwatch_lookup_id auxiliary module:

msf6 auxiliary(gather/corpwatch_lookup_id) > show advanced

Module advanced options (auxiliary/gather/corpwatch_lookup_id):

   Name                  Current Setting                                     Required  Description
   ----                  ---------------                                     --------  -----------
   DOMAIN                WORKSTATION                                         yes       The domain to use for Windows authentication
   DigestAuthIIS         true                                                no        Conform to IIS, should work for most servers. Only set to false for non-IIS servers
   FingerprintCheck      true                                                no        Conduct a pre-exploit fingerprint verification
   HttpClientTimeout                                                         no        HTTP connection and receive timeout
   HttpPassword                                                              no        The HTTP password to specify for authentication
   HttpRawHeaders                                                            no        Path to ERB-templatized raw headers to append to existing headers
   HttpTrace             false                                               no        Show the raw HTTP requests and responses
   HttpTraceColors       red/blu                                             no        HTTP request and response colors for HttpTrace (unset to disable)
   HttpTraceHeadersOnly  false                                               no        Show HTTP headers only in HttpTrace
   HttpUsername                                                              no        The HTTP username to specify for authentication
   SSLVersion            Auto                                                yes       Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
   UserAgent             Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)  no        The User-Agent header to use for all requests
   VERBOSE               false                                               no        Enable detailed status messages
   WORKSPACE                                                                 no        Specify the workspace for this module

Auxiliary Actions


This is a list of all auxiliary actions that the gather/corpwatch_lookup_id module can do:

msf6 auxiliary(gather/corpwatch_lookup_id) > show actions

Auxiliary actions:

   Name  Description
   ----  -----------

Evasion Options


Here is the full list of possible evasion options supported by the gather/corpwatch_lookup_id auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 auxiliary(gather/corpwatch_lookup_id) > show evasion

Module evasion options:

   Name                          Current Setting  Required  Description
   ----                          ---------------  --------  -----------
   HTTP::header_folding          false            no        Enable folding of HTTP headers
   HTTP::method_random_case      false            no        Use random casing for the HTTP method
   HTTP::method_random_invalid   false            no        Use a random invalid, HTTP method for request
   HTTP::method_random_valid     false            no        Use a random, but valid, HTTP method for request
   HTTP::pad_fake_headers        false            no        Insert random, fake headers into the HTTP request
   HTTP::pad_fake_headers_count  0                no        How many fake headers to insert into the HTTP request
   HTTP::pad_get_params          false            no        Insert random, fake query string variables into the request
   HTTP::pad_get_params_count    16               no        How many fake query string variables to insert into the request
   HTTP::pad_method_uri_count    1                no        How many whitespace characters to use between the method and uri
   HTTP::pad_method_uri_type     space            no        What type of whitespace to use between the method and uri (Accepted: space, tab, apache)
   HTTP::pad_post_params         false            no        Insert random, fake post variables into the request
   HTTP::pad_post_params_count   16               no        How many fake post variables to insert into the request
   HTTP::pad_uri_version_count   1                no        How many whitespace characters to use between the uri and version
   HTTP::pad_uri_version_type    space            no        What type of whitespace to use between the uri and version (Accepted: space, tab, apache)
   HTTP::uri_dir_fake_relative   false            no        Insert fake relative directories into the uri
   HTTP::uri_dir_self_reference  false            no        Insert self-referential directories into the uri
   HTTP::uri_encode_mode         hex-normal       no        Enable URI encoding (Accepted: none, hex-normal, hex-noslashes, hex-random, hex-all, u-normal, u-all, u-random)
   HTTP::uri_fake_end            false            no        Add a fake end of URI (eg: /%20HTTP/1.0/../../)
   HTTP::uri_fake_params_start   false            no        Add a fake start of params to the URI (eg: /%3fa=b/../)
   HTTP::uri_full_url            false            no        Use the full URL for all HTTP requests
   HTTP::uri_use_backslashes     false            no        Use back slashes instead of forward slashes in the uri
   HTTP::version_random_invalid  false            no        Use a random invalid, HTTP version for request
   HTTP::version_random_valid    false            no        Use a random, but valid, HTTP version for request

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

No response from server.


Here is a relevant code snippet related to the "No response from server." error message:

59:	      'uri'      => uri + ".xml",
60:	      'method'   => 'GET'
61:	    }, 25)
62:	
63:	    if res == nil
64:	      print_error("No response from server.")
65:	      return
66:	    end
67:	
68:	    begin
69:	      doc = REXML::Document.new(res.body)

Malformed XML or broken response


Here is a relevant code snippet related to the "Malformed XML or broken response" error message:

66:	    end
67:	
68:	    begin
69:	      doc = REXML::Document.new(res.body)
70:	    rescue
71:	      print_error("Malformed XML or broken response")
72:	      return
73:	    end
74:	
75:	    root = doc.root
76:	

No document root, no results returned


Here is a relevant code snippet related to the "No document root, no results returned" error message:

73:	    end
74:	
75:	    root = doc.root
76:	
77:	    if doc.root == nil
78:	      print_error("No document root, no results returned")
79:	      return
80:	    end
81:	
82:	    elements = root.get_elements("result")
83:	

No results returned


Here is a relevant code snippet related to the "No results returned" error message:

80:	    end
81:	
82:	    elements = root.get_elements("result")
83:	
84:	    if elements.blank? || elements.length == 0
85:	      print_error("No results returned")
86:	      return
87:	    end
88:	
89:	    results = elements[0]
90:	

No results returned


Here is a relevant code snippet related to the "No results returned" error message:

87:	    end
88:	
89:	    results = elements[0]
90:	
91:	    if results == nil
92:	      print_error("No results returned")
93:	      return
94:	    end
95:	
96:	    elements = results.get_elements("companies")
97:	

No companies returned


Here is a relevant code snippet related to the "No companies returned" error message:

94:	    end
95:	
96:	    elements = results.get_elements("companies")
97:	
98:	    if elements == nil || elements.length == 0
99:	      print_error("No companies returned")
100:	      return
101:	    end
102:	
103:	    results = elements[0]
104:	

No results returned


Here is a relevant code snippet related to the "No results returned" error message:

101:	    end
102:	
103:	    results = elements[0]
104:	
105:	    if results == nil || results.elements == nil
106:	      print_error("No results returned")
107:	      return
108:	    end
109:	
110:	    results.elements.each { |e|
111:	      loot << ("CorpWatchID: " + (cwid = grab_text(e, "cw_id")))

Server down or bad response


Here is a relevant code snippet related to the "Server down or bad response" error message:

158:	        'uri'     => uri + "/locations.xml",
159:	        'method'  => 'GET'
160:	      }, 25)
161:	
162:	      if res == nil
163:	        print_error("Server down or bad response")
164:	        return
165:	      end
166:	
167:	      begin
168:	        doc = REXML::Document.new(res.body)

Query returned bad or poorly formatted data.


Here is a relevant code snippet related to the "Query returned bad or poorly formatted data." error message:

165:	      end
166:	
167:	      begin
168:	        doc = REXML::Document.new(res.body)
169:	      rescue
170:	        print_error("Query returned bad or poorly formatted data.")
171:	        return
172:	      end
173:	
174:	      root = doc.root
175:	

no results returned


Here is a relevant code snippet related to the "no results returned" error message:

174:	      root = doc.root
175:	
176:	      elements = root.get_elements("result")
177:	
178:	      if elements == nil || elements.length == 0
179:	        print_error("no results returned")
180:	        return
181:	      end
182:	
183:	      results = elements[0]
184:	

No results returned


Here is a relevant code snippet related to the "No results returned" error message:

181:	      end
182:	
183:	      results = elements[0]
184:	
185:	      if results == nil
186:	        print_status("No results returned")
187:	      else
188:	        results = results.get_elements("locations")[0]
189:	
190:	        results.elements.each { |e|
191:	          loot << ("CorpWatch ID: " + (cwid = grab_text(e, "cw_id")))

Server down or bad response


Here is a relevant code snippet related to the "Server down or bad response" error message:

230:	        'uri'     => uri + "/names.xml",
231:	        'method'  => 'GET'
232:	      }, 25)
233:	
234:	      if res == nil
235:	        print_error("Server down or bad response")
236:	        return
237:	      end
238:	
239:	      begin
240:	        doc = REXML::Document.new(res.body)

Query returned bad or poorly formatted XML


Here is a relevant code snippet related to the "Query returned bad or poorly formatted XML" error message:

237:	      end
238:	
239:	      begin
240:	        doc = REXML::Document.new(res.body)
241:	      rescue
242:	        print_error("Query returned bad or poorly formatted XML")
243:	        return
244:	      end
245:	
246:	      root = doc.root
247:	

document root nil


Here is a relevant code snippet related to the "document root nil" error message:

244:	      end
245:	
246:	      root = doc.root
247:	
248:	      if root == nil
249:	        print_error("document root nil")
250:	        return
251:	      end
252:	
253:	      elements = root.get_elements("result")
254:	

Returned no or broken results


Here is a relevant code snippet related to the "Returned no or broken results" error message:

251:	      end
252:	
253:	      elements = root.get_elements("result")
254:	
255:	      if elements == nil || elements.length == 0
256:	        print_error("Returned no or broken results")
257:	        return
258:	      end
259:	
260:	      results = elements[0]
261:	

No results returned


Here is a relevant code snippet related to the "No results returned" error message:

258:	      end
259:	
260:	      results = elements[0]
261:	
262:	      if results == nil
263:	        print_status("No results returned")
264:	      else
265:	        results = results.get_elements("names")[0]
266:	
267:	        results.elements.each { |e|
268:	          loot << ("Name: " + (name = grab_text(e, "company_name")))

Server down or response broken


Here is a relevant code snippet related to the "Server down or response broken" error message:

292:	        'uri'     => uri + "/filings.xml",
293:	        'method'  => 'GET'
294:	      }, 25)
295:	
296:	      if res == nil
297:	        print_error("Server down or response broken")
298:	        return
299:	      end
300:	
301:	      begin
302:	        doc = REXML::Document.new(res.body)

Query return bad or broken data


Here is a relevant code snippet related to the "Query return bad or broken data" error message:

299:	      end
300:	
301:	      begin
302:	        doc = REXML::Document.new(res.body)
303:	      rescue
304:	        print_error("Query return bad or broken data")
305:	        return
306:	      end
307:	
308:	      root = doc.root
309:	

Results were either broken or not returned


Here is a relevant code snippet related to the "Results were either broken or not returned" error message:

308:	      root = doc.root
309:	
310:	      elements = root.get_elements("result")
311:	
312:	      if elements == nil || elements.length == 0
313:	        print_error("Results were either broken or not returned")
314:	        return
315:	      end
316:	
317:	      results = elements[0]
318:	

No results returned


Here is a relevant code snippet related to the "No results returned" error message:

315:	      end
316:	
317:	      results = elements[0]
318:	
319:	      if results == nil
320:	        print_status("No results returned")
321:	      else
322:	        elements = results.get_elements("filings")
323:	
324:	        if elements == nil
325:	          print_error("Results broken or not returned")

Results broken or not returned


Here is a relevant code snippet related to the "Results broken or not returned" error message:

320:	        print_status("No results returned")
321:	      else
322:	        elements = results.get_elements("filings")
323:	
324:	        if elements == nil
325:	          print_error("Results broken or not returned")
326:	          return
327:	        end
328:	
329:	        results = elements[0]
330:	

No filings found


Here is a relevant code snippet related to the "No filings found" error message:

327:	        end
328:	
329:	        results = elements[0]
330:	
331:	        if results == nil
332:	          print_status("No filings found")
333:	        else
334:	          results.elements.each { |e|
335:	            loot << ("Central Index Key: " + (cik = grab_text(e, "cik")))
336:	            loot << ("\nYear filed: " + (year_filed = grab_text(e, "year")))
337:	            loot << ("\nQuarter filed: " + (quarter_filed = grab_text(e, "quarter")))

Server down or bad response


Here is a relevant code snippet related to the "Server down or bad response" error message:

372:	        'uri'      => child_uri,
373:	        'method'   => 'GET'
374:	      }, 25)
375:	
376:	      if res == nil
377:	        print_error("Server down or bad response")
378:	        return
379:	      end
380:	
381:	      begin
382:	        doc = REXML::Document.new(res.body)

Query return bad or broken data


Here is a relevant code snippet related to the "Query return bad or broken data" error message:

379:	      end
380:	
381:	      begin
382:	        doc = REXML::Document.new(res.body)
383:	      rescue
384:	        print_error("Query return bad or broken data")
385:	        return
386:	      end
387:	
388:	      root = doc.root
389:	

No results were returned.


Here is a relevant code snippet related to the "No results were returned." error message:

390:	      elements = root.get_elements("result")
391:	
392:	      results = elements[0]
393:	
394:	      if results == nil
395:	        print_status("No results were returned.")
396:	      else
397:	        results = results.get_elements("companies")[0]
398:	
399:	        if results == nil
400:	          print_status("No results returned")

No results returned


Here is a relevant code snippet related to the "No results returned" error message:

395:	        print_status("No results were returned.")
396:	      else
397:	        results = results.get_elements("companies")[0]
398:	
399:	        if results == nil
400:	          print_status("No results returned")
401:	        else
402:	          results.elements.each { |e|
403:	            loot << ("CorpWatch ID: " + (cwid = grab_text(e, "cw_id")))
404:	            loot << ("\nCentral Index Key: " + (cik = grab_text(e, "cik")))
405:	            loot << ("\nCompany Name: " + (name = grab_text(e, "company_name")))

Server down or bad response


Here is a relevant code snippet related to the "Server down or bad response" error message:

453:	        'uri'     => uri + "/history.xml",
454:	        'method'  => 'GET'
455:	      }, 25)
456:	
457:	      if res == nil
458:	        print_error("Server down or bad response")
459:	        return
460:	      end
461:	
462:	      begin
463:	        doc = REXML::Document.new(res.body)

Query return bad or broken data


Here is a relevant code snippet related to the "Query return bad or broken data" error message:

460:	      end
461:	
462:	      begin
463:	        doc = REXML::Document.new(res.body)
464:	      rescue
465:	        print_error("Query return bad or broken data")
466:	        return
467:	      end
468:	
469:	      root = doc.root
470:	

No results.


Here is a relevant code snippet related to the "No results." error message:

469:	      root = doc.root
470:	
471:	      elements = root.get_elements("result")
472:	
473:	      if elements == nil || elements.length == 0
474:	        print_error("No results.")
475:	        return
476:	      end
477:	
478:	      results = elements[0]
479:	

No results returned.


Here is a relevant code snippet related to the "No results returned." error message:

476:	      end
477:	
478:	      results = elements[0]
479:	
480:	      if results == nil
481:	        print_status("No results returned.")
482:	      else
483:	        results = results.get_elements("companies")[0]
484:	
485:	        results.elements.each { |e|
486:	          loot << ("CorpWatch ID: " + (cwid = grab_text(e, "cw_id")))

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • Brandon Perry <bperry.volatile[at]gmail.com>

Version


This page has been produced using Metasploit Framework version 6.2.29-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.