Files
metasploit-gs/api/Msf/Post/Linux/Wsl.html
T
jenkins-metasploit c3f5bd3de2 Reboot gh-pages
2026-05-08 17:08:43 +00:00

238 lines
19 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Module: Msf::Post::Linux::Wsl
&mdash; Documentation by YARD 0.9.37
</title>
<link rel="stylesheet" href="../../../css/style.css" type="text/css" />
<link rel="stylesheet" href="../../../css/common.css" type="text/css" />
<script type="text/javascript">
pathId = "Msf::Post::Linux::Wsl";
relpath = '../../../';
</script>
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="../../../class_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="../../../_index.html">Index (W)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../../Msf.html" title="Msf (module)">Msf</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Post.html" title="Msf::Post (class)">Post</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Linux.html" title="Msf::Post::Linux (module)">Linux</a></span></span>
&raquo;
<span class="title">Wsl</span>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="../../../class_list.html">
<svg width="24" height="24">
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
</svg>
</a>
</div>
<div class="clear"></div>
</div>
<div id="content"><h1>Module: Msf::Post::Linux::Wsl
</h1>
<div class="box_info">
<dl>
<dt>Includes:</dt>
<dd><span class='object_link'><a href="Kernel.html" title="Msf::Post::Linux::Kernel (module)">Kernel</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/msf/core/post/linux/wsl.rb</dd>
</dl>
</div>
<h2>
Instance Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#wsl%3F-instance_method" title="#wsl? (instance method)">#<strong>wsl?</strong> &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns a boolean if the kernel includes WSL indicators.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods included from <span class='object_link'><a href="Kernel.html" title="Msf::Post::Linux::Kernel (module)">Kernel</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Kernel.html#aslr_enabled%3F-instance_method" title="Msf::Post::Linux::Kernel#aslr_enabled? (method)">#aslr_enabled?</a></span>, <span class='object_link'><a href="Kernel.html#cpu_flags-instance_method" title="Msf::Post::Linux::Kernel#cpu_flags (method)">#cpu_flags</a></span>, <span class='object_link'><a href="Kernel.html#dmesg_restrict%3F-instance_method" title="Msf::Post::Linux::Kernel#dmesg_restrict? (method)">#dmesg_restrict?</a></span>, <span class='object_link'><a href="Kernel.html#exec_shield_enabled%3F-instance_method" title="Msf::Post::Linux::Kernel#exec_shield_enabled? (method)">#exec_shield_enabled?</a></span>, <span class='object_link'><a href="Kernel.html#grsec_installed%3F-instance_method" title="Msf::Post::Linux::Kernel#grsec_installed? (method)">#grsec_installed?</a></span>, <span class='object_link'><a href="Kernel.html#kaiser_enabled%3F-instance_method" title="Msf::Post::Linux::Kernel#kaiser_enabled? (method)">#kaiser_enabled?</a></span>, <span class='object_link'><a href="Kernel.html#kernel_arch-instance_method" title="Msf::Post::Linux::Kernel#kernel_arch (method)">#kernel_arch</a></span>, <span class='object_link'><a href="Kernel.html#kernel_config-instance_method" title="Msf::Post::Linux::Kernel#kernel_config (method)">#kernel_config</a></span>, <span class='object_link'><a href="Kernel.html#kernel_hardware-instance_method" title="Msf::Post::Linux::Kernel#kernel_hardware (method)">#kernel_hardware</a></span>, <span class='object_link'><a href="Kernel.html#kernel_modules-instance_method" title="Msf::Post::Linux::Kernel#kernel_modules (method)">#kernel_modules</a></span>, <span class='object_link'><a href="Kernel.html#kernel_name-instance_method" title="Msf::Post::Linux::Kernel#kernel_name (method)">#kernel_name</a></span>, <span class='object_link'><a href="Kernel.html#kernel_release-instance_method" title="Msf::Post::Linux::Kernel#kernel_release (method)">#kernel_release</a></span>, <span class='object_link'><a href="Kernel.html#kernel_version-instance_method" title="Msf::Post::Linux::Kernel#kernel_version (method)">#kernel_version</a></span>, <span class='object_link'><a href="Kernel.html#kpti_enabled%3F-instance_method" title="Msf::Post::Linux::Kernel#kpti_enabled? (method)">#kpti_enabled?</a></span>, <span class='object_link'><a href="Kernel.html#kptr_restrict%3F-instance_method" title="Msf::Post::Linux::Kernel#kptr_restrict? (method)">#kptr_restrict?</a></span>, <span class='object_link'><a href="Kernel.html#lkrg_installed%3F-instance_method" title="Msf::Post::Linux::Kernel#lkrg_installed? (method)">#lkrg_installed?</a></span>, <span class='object_link'><a href="Kernel.html#mmap_min_addr-instance_method" title="Msf::Post::Linux::Kernel#mmap_min_addr (method)">#mmap_min_addr</a></span>, <span class='object_link'><a href="Kernel.html#pax_installed%3F-instance_method" title="Msf::Post::Linux::Kernel#pax_installed? (method)">#pax_installed?</a></span>, <span class='object_link'><a href="Kernel.html#selinux_enforcing%3F-instance_method" title="Msf::Post::Linux::Kernel#selinux_enforcing? (method)">#selinux_enforcing?</a></span>, <span class='object_link'><a href="Kernel.html#selinux_installed%3F-instance_method" title="Msf::Post::Linux::Kernel#selinux_installed? (method)">#selinux_installed?</a></span>, <span class='object_link'><a href="Kernel.html#smap_enabled%3F-instance_method" title="Msf::Post::Linux::Kernel#smap_enabled? (method)">#smap_enabled?</a></span>, <span class='object_link'><a href="Kernel.html#smep_enabled%3F-instance_method" title="Msf::Post::Linux::Kernel#smep_enabled? (method)">#smep_enabled?</a></span>, <span class='object_link'><a href="Kernel.html#uname-instance_method" title="Msf::Post::Linux::Kernel#uname (method)">#uname</a></span>, <span class='object_link'><a href="Kernel.html#unprivileged_bpf_disabled%3F-instance_method" title="Msf::Post::Linux::Kernel#unprivileged_bpf_disabled? (method)">#unprivileged_bpf_disabled?</a></span>, <span class='object_link'><a href="Kernel.html#userns_enabled%3F-instance_method" title="Msf::Post::Linux::Kernel#userns_enabled? (method)">#userns_enabled?</a></span>, <span class='object_link'><a href="Kernel.html#yama_enabled%3F-instance_method" title="Msf::Post::Linux::Kernel#yama_enabled? (method)">#yama_enabled?</a></span>, <span class='object_link'><a href="Kernel.html#yama_installed%3F-instance_method" title="Msf::Post::Linux::Kernel#yama_installed? (method)">#yama_installed?</a></span>, <span class='object_link'><a href="Kernel.html#yama_ptrace_scope-instance_method" title="Msf::Post::Linux::Kernel#yama_ptrace_scope (method)">#yama_ptrace_scope</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../File.html" title="Msf::Post::File (module)">File</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../File.html#_append_file_powershell-instance_method" title="Msf::Post::File#_append_file_powershell (method)">#_append_file_powershell</a></span>, <span class='object_link'><a href="../File.html#_append_file_unix_shell-instance_method" title="Msf::Post::File#_append_file_unix_shell (method)">#_append_file_unix_shell</a></span>, <span class='object_link'><a href="../File.html#_can_echo%3F-instance_method" title="Msf::Post::File#_can_echo? (method)">#_can_echo?</a></span>, <span class='object_link'><a href="../File.html#_read_file_meterpreter-instance_method" title="Msf::Post::File#_read_file_meterpreter (method)">#_read_file_meterpreter</a></span>, <span class='object_link'><a href="../File.html#_read_file_powershell-instance_method" title="Msf::Post::File#_read_file_powershell (method)">#_read_file_powershell</a></span>, <span class='object_link'><a href="../File.html#_read_file_powershell_fragment-instance_method" title="Msf::Post::File#_read_file_powershell_fragment (method)">#_read_file_powershell_fragment</a></span>, <span class='object_link'><a href="../File.html#_shell_command_with_success_code-instance_method" title="Msf::Post::File#_shell_command_with_success_code (method)">#_shell_command_with_success_code</a></span>, <span class='object_link'><a href="../File.html#_shell_process_with_success_code-instance_method" title="Msf::Post::File#_shell_process_with_success_code (method)">#_shell_process_with_success_code</a></span>, <span class='object_link'><a href="../File.html#_unix_max_line_length-instance_method" title="Msf::Post::File#_unix_max_line_length (method)">#_unix_max_line_length</a></span>, <span class='object_link'><a href="../File.html#_win_ansi_append_file-instance_method" title="Msf::Post::File#_win_ansi_append_file (method)">#_win_ansi_append_file</a></span>, <span class='object_link'><a href="../File.html#_win_ansi_write_file-instance_method" title="Msf::Post::File#_win_ansi_write_file (method)">#_win_ansi_write_file</a></span>, <span class='object_link'><a href="../File.html#_win_bin_append_file-instance_method" title="Msf::Post::File#_win_bin_append_file (method)">#_win_bin_append_file</a></span>, <span class='object_link'><a href="../File.html#_win_bin_write_file-instance_method" title="Msf::Post::File#_win_bin_write_file (method)">#_win_bin_write_file</a></span>, <span class='object_link'><a href="../File.html#_write_file_meterpreter-instance_method" title="Msf::Post::File#_write_file_meterpreter (method)">#_write_file_meterpreter</a></span>, <span class='object_link'><a href="../File.html#_write_file_powershell-instance_method" title="Msf::Post::File#_write_file_powershell (method)">#_write_file_powershell</a></span>, <span class='object_link'><a href="../File.html#_write_file_powershell_fragment-instance_method" title="Msf::Post::File#_write_file_powershell_fragment (method)">#_write_file_powershell_fragment</a></span>, <span class='object_link'><a href="../File.html#_write_file_unix_shell-instance_method" title="Msf::Post::File#_write_file_unix_shell (method)">#_write_file_unix_shell</a></span>, <span class='object_link'><a href="../File.html#append_file-instance_method" title="Msf::Post::File#append_file (method)">#append_file</a></span>, <span class='object_link'><a href="../File.html#attributes-instance_method" title="Msf::Post::File#attributes (method)">#attributes</a></span>, <span class='object_link'><a href="../File.html#cd-instance_method" title="Msf::Post::File#cd (method)">#cd</a></span>, <span class='object_link'><a href="../File.html#chmod-instance_method" title="Msf::Post::File#chmod (method)">#chmod</a></span>, <span class='object_link'><a href="../File.html#copy_file-instance_method" title="Msf::Post::File#copy_file (method)">#copy_file</a></span>, <span class='object_link'><a href="../File.html#dir-instance_method" title="Msf::Post::File#dir (method)">#dir</a></span>, <span class='object_link'><a href="../File.html#directory%3F-instance_method" title="Msf::Post::File#directory? (method)">#directory?</a></span>, <span class='object_link'><a href="../File.html#executable%3F-instance_method" title="Msf::Post::File#executable? (method)">#executable?</a></span>, <span class='object_link'><a href="../File.html#exist%3F-instance_method" title="Msf::Post::File#exist? (method)">#exist?</a></span>, <span class='object_link'><a href="../File.html#expand_path-instance_method" title="Msf::Post::File#expand_path (method)">#expand_path</a></span>, <span class='object_link'><a href="../File.html#exploit_data-instance_method" title="Msf::Post::File#exploit_data (method)">#exploit_data</a></span>, <span class='object_link'><a href="../File.html#exploit_source-instance_method" title="Msf::Post::File#exploit_source (method)">#exploit_source</a></span>, <span class='object_link'><a href="../File.html#file%3F-instance_method" title="Msf::Post::File#file? (method)">#file?</a></span>, <span class='object_link'><a href="../File.html#file_local_write-instance_method" title="Msf::Post::File#file_local_write (method)">#file_local_write</a></span>, <span class='object_link'><a href="../File.html#file_remote_digestmd5-instance_method" title="Msf::Post::File#file_remote_digestmd5 (method)">#file_remote_digestmd5</a></span>, <span class='object_link'><a href="../File.html#file_remote_digestsha1-instance_method" title="Msf::Post::File#file_remote_digestsha1 (method)">#file_remote_digestsha1</a></span>, <span class='object_link'><a href="../File.html#file_remote_digestsha2-instance_method" title="Msf::Post::File#file_remote_digestsha2 (method)">#file_remote_digestsha2</a></span>, <span class='object_link'><a href="../File.html#find_writable_directories-instance_method" title="Msf::Post::File#find_writable_directories (method)">#find_writable_directories</a></span>, <span class='object_link'><a href="../File.html#immutable%3F-instance_method" title="Msf::Post::File#immutable? (method)">#immutable?</a></span>, <span class='object_link'><a href="../File.html#initialize-instance_method" title="Msf::Post::File#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="../File.html#mkdir-instance_method" title="Msf::Post::File#mkdir (method)">#mkdir</a></span>, <span class='object_link'><a href="../File.html#pwd-instance_method" title="Msf::Post::File#pwd (method)">#pwd</a></span>, <span class='object_link'><a href="../File.html#read_file-instance_method" title="Msf::Post::File#read_file (method)">#read_file</a></span>, <span class='object_link'><a href="../File.html#readable%3F-instance_method" title="Msf::Post::File#readable? (method)">#readable?</a></span>, <span class='object_link'><a href="../File.html#rename_file-instance_method" title="Msf::Post::File#rename_file (method)">#rename_file</a></span>, <span class='object_link'><a href="../File.html#rm_f-instance_method" title="Msf::Post::File#rm_f (method)">#rm_f</a></span>, <span class='object_link'><a href="../File.html#rm_rf-instance_method" title="Msf::Post::File#rm_rf (method)">#rm_rf</a></span>, <span class='object_link'><a href="../File.html#setuid%3F-instance_method" title="Msf::Post::File#setuid? (method)">#setuid?</a></span>, <span class='object_link'><a href="../File.html#stat-instance_method" title="Msf::Post::File#stat (method)">#stat</a></span>, <span class='object_link'><a href="../File.html#upload_and_chmodx-instance_method" title="Msf::Post::File#upload_and_chmodx (method)">#upload_and_chmodx</a></span>, <span class='object_link'><a href="../File.html#upload_file-instance_method" title="Msf::Post::File#upload_file (method)">#upload_file</a></span>, <span class='object_link'><a href="../File.html#writable%3F-instance_method" title="Msf::Post::File#writable? (method)">#writable?</a></span>, <span class='object_link'><a href="../File.html#write_file-instance_method" title="Msf::Post::File#write_file (method)">#write_file</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Common.html" title="Msf::Post::Common (module)">Common</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Common.html#clear_screen-instance_method" title="Msf::Post::Common#clear_screen (method)">#clear_screen</a></span>, <span class='object_link'><a href="../Common.html#cmd_exec-instance_method" title="Msf::Post::Common#cmd_exec (method)">#cmd_exec</a></span>, <span class='object_link'><a href="../Common.html#cmd_exec_get_pid-instance_method" title="Msf::Post::Common#cmd_exec_get_pid (method)">#cmd_exec_get_pid</a></span>, <span class='object_link'><a href="../Common.html#cmd_exec_with_result-instance_method" title="Msf::Post::Common#cmd_exec_with_result (method)">#cmd_exec_with_result</a></span>, <span class='object_link'><a href="../Common.html#command_exists%3F-instance_method" title="Msf::Post::Common#command_exists? (method)">#command_exists?</a></span>, <span class='object_link'><a href="../Common.html#create_process-instance_method" title="Msf::Post::Common#create_process (method)">#create_process</a></span>, <span class='object_link'><a href="../Common.html#get_env-instance_method" title="Msf::Post::Common#get_env (method)">#get_env</a></span>, <span class='object_link'><a href="../Common.html#get_envs-instance_method" title="Msf::Post::Common#get_envs (method)">#get_envs</a></span>, <span class='object_link'><a href="../Common.html#initialize-instance_method" title="Msf::Post::Common#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="../Common.html#peer-instance_method" title="Msf::Post::Common#peer (method)">#peer</a></span>, <span class='object_link'><a href="../Common.html#report_virtualization-instance_method" title="Msf::Post::Common#report_virtualization (method)">#report_virtualization</a></span>, <span class='object_link'><a href="../Common.html#rhost-instance_method" title="Msf::Post::Common#rhost (method)">#rhost</a></span>, <span class='object_link'><a href="../Common.html#rport-instance_method" title="Msf::Post::Common#rport (method)">#rport</a></span></p>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="wsl?-instance_method">
#<strong>wsl?</strong> &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a boolean if the kernel includes WSL indicators</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
11
12
13</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/msf/core/post/linux/wsl.rb', line 11</span>
<span class='kw'>def</span> <span class='id identifier rubyid_wsl?'>wsl?</span>
<span class='id identifier rubyid_kernel_release'>kernel_release</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-microsoft</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Fri May 8 17:01:08 2026 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.37 (ruby-3.1.5).
</div>
</div>
</body>
</html>