<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Follow-up on &amp;quot;Setting color for *all* CMD shells based on admin/elevation status&amp;quot;</title><link>http://blogs.msdn.com/aaron_margosis/archive/2007/06/27/follow-up-on-setting-color-for-all-cmd-shells-based-on-admin-elevation-status.aspx</link><description>Improvements on my earlier post about setting color and title for CMD (and PowerShell) windows, based on admin/elevation status</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Follow-up on "Setting color for *all* CMD shells based on admin/elevation status"</title><link>http://blogs.msdn.com/aaron_margosis/archive/2007/06/27/follow-up-on-setting-color-for-all-cmd-shells-based-on-admin-elevation-status.aspx#3555577</link><pubDate>Wed, 27 Jun 2007 02:57:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3555577</guid><dc:creator>anonymous</dc:creator><description>&lt;P&gt;Ehm... why don't you simply use FSUTIL? For non-admin privileges (due to its LUA problem) it returns with error code 1, which is best for the cmd.exe shell.&lt;/P&gt;
&lt;P&gt;BTW, what is this PingBack SPAM all about?&lt;/P&gt;
&lt;DIV class=ajmReply&gt;
&lt;P&gt;@anonymous:&amp;nbsp; Excellent idea -- FSUTIL works fine for this purpose on both XP and Vista.&amp;nbsp; And a lot shorter than the cacls command line.&lt;/P&gt;
&lt;P&gt;I deleted one instance of the pingback.&amp;nbsp; It happens whenever a blog post references another blog post.&lt;/P&gt;
&lt;P&gt;-- Aaron&lt;/P&gt;&lt;/DIV&gt;</description></item><item><title>re: Follow-up on "Setting color for *all* CMD shells based on admin/elevation status"</title><link>http://blogs.msdn.com/aaron_margosis/archive/2007/06/27/follow-up-on-setting-color-for-all-cmd-shells-based-on-admin-elevation-status.aspx#3658511</link><pubDate>Mon, 02 Jul 2007 14:05:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3658511</guid><dc:creator>Alexander Sukhovey</dc:creator><description>&lt;P&gt;Even better choice may be AT.EXE since it exists in Windows 2000 while FSUTIL.EXE was new to Windows XP.&lt;/P&gt;
&lt;P&gt;--&lt;/P&gt;
&lt;P&gt;Al&lt;/P&gt;
&lt;DIV class=ajmReply&gt;
&lt;P&gt;@Al:&amp;nbsp; I haven't tested the use of AutoRun on 2000, but I would guess that it would work the same way.&amp;nbsp; And AT.EXE is definitely more portable for this purpose.&amp;nbsp; Thanks!&lt;/P&gt;
&lt;P&gt;-- Aaron&lt;/P&gt;&lt;/DIV&gt;</description></item><item><title>re: Follow-up on "Setting color for *all* CMD shells based on admin/elevation status"</title><link>http://blogs.msdn.com/aaron_margosis/archive/2007/06/27/follow-up-on-setting-color-for-all-cmd-shells-based-on-admin-elevation-status.aspx#3697209</link><pubDate>Thu, 05 Jul 2007 07:46:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3697209</guid><dc:creator>anonymous</dc:creator><description>&lt;P&gt;Oh oh... two big issues there:&lt;/P&gt;
&lt;P&gt;At first, I patched fsutil so it runs without admin privileges, since some of its functionalities (hardlinks, sparse, files) don't require either. Now it has become unsuitable for this purpose. Better go bck to cacls.&lt;/P&gt;
&lt;P&gt;The second problem is that is invokes the program from the current directory. If you have a malicious cacls.exe (or a freshly patched fsutil.exe) laying around and you're launchung the shell from the explorer context menu, it will execute the local program, which is a security vulnerability. One should always reference it with the complete path, thus %windir%\system32\cacls.exe.&lt;/P&gt;
&lt;DIV class=ajmReply&gt;
&lt;P&gt;&lt;EM&gt;[Aaron Margosis] Hopefully you're first "big issue" won't affect anyone else.&amp;nbsp; (Patching system binaries is... risky.&amp;nbsp; BTW, on Vista, "mklink /h" now lets standard users create hard links).&amp;nbsp; You are absolutely correct about the second issue -- I'll update the post accordingly.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Note though that&amp;nbsp;when you choose "Run as administrator", the current directory is set to %windir%\system32, so that attack won't work in the elevated case.&lt;/EM&gt;&lt;/P&gt;&lt;/DIV&gt;</description></item><item><title>re: Follow-up on "Setting color for *all* CMD shells based on admin/elevation status"</title><link>http://blogs.msdn.com/aaron_margosis/archive/2007/06/27/follow-up-on-setting-color-for-all-cmd-shells-based-on-admin-elevation-status.aspx#3707727</link><pubDate>Thu, 05 Jul 2007 18:52:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3707727</guid><dc:creator>Hofi</dc:creator><description>&lt;P&gt;Just a tiny correction. You should use &lt;/P&gt;
&lt;P&gt;%SystemRoot%\ because %windir% is does not exist in a command.com &lt;/P&gt;
&lt;P&gt;[b]%SystemRoot%\system32\FSUTIL.exe &amp;gt; nul 2&amp;gt; nul &amp;amp;&amp;amp; (color FC &amp;amp; title ADMIN - %USERDOMAIN%\%USERNAME%) || (title NONADMIN - %USERDOMAIN%\%USERNAME%)[/b]&lt;/P&gt;
&lt;P&gt;works fine both for cmd.exe and command.com&lt;/P&gt;
&lt;DIV class=ajmReply&gt;
&lt;P&gt;&lt;EM&gt;[Aaron Margosis] But command.com doesn't invoke the AutoRun line anyway, does it?&lt;/EM&gt;&lt;/P&gt;&lt;/DIV&gt;</description></item><item><title>re: Follow-up on "Setting color for *all* CMD shells based on admin/elevation status"</title><link>http://blogs.msdn.com/aaron_margosis/archive/2007/06/27/follow-up-on-setting-color-for-all-cmd-shells-based-on-admin-elevation-status.aspx#3709218</link><pubDate>Thu, 05 Jul 2007 20:16:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3709218</guid><dc:creator>Hofi</dc:creator><description>&lt;p&gt;If ntcmdprompt present in config.nt then AutoRun will be invoked.&lt;/p&gt;
&lt;p&gt;Give it a try, on my XP SP2 box that is the way it works.&lt;/p&gt;
</description></item><item><title>re: Follow-up on "Setting color for *all* CMD shells based on admin/elevation status"</title><link>http://blogs.msdn.com/aaron_margosis/archive/2007/06/27/follow-up-on-setting-color-for-all-cmd-shells-based-on-admin-elevation-status.aspx#3718202</link><pubDate>Fri, 06 Jul 2007 05:02:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3718202</guid><dc:creator>anonymous</dc:creator><description>&lt;p&gt;Patching system binaries is... risky? Come on, it's IDA Pro with the PDB debug data, and seeing a &lt;/p&gt;
&lt;p&gt;call _IsUserAdmin(void)&lt;/p&gt;
&lt;p&gt;test eax,eax&lt;/p&gt;
&lt;p&gt;jnz short check_params_and_run&lt;/p&gt;
&lt;p&gt;complain_not_admin()&lt;/p&gt;
&lt;p&gt;is obvious. Now it's just 6 NOPs and making the jump unconditional. And then loading it into IDA and checking it again.&lt;/p&gt;
&lt;p&gt;Sorry, this really can't go wrong.&lt;/p&gt;
&lt;p&gt;For the command.com issue: Huh? command.com? Does this thin even exist? And I though it just launched cmd.exe. Anyway, %windir% exists on command.com since Windows 95, but %systemroot% might not.&lt;/p&gt;
</description></item><item><title>re: Follow-up on "Setting color for *all* CMD shells based on admin/elevation status"</title><link>http://blogs.msdn.com/aaron_margosis/archive/2007/06/27/follow-up-on-setting-color-for-all-cmd-shells-based-on-admin-elevation-status.aspx#3723644</link><pubDate>Fri, 06 Jul 2007 12:18:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3723644</guid><dc:creator>Hofi</dc:creator><description>&lt;p&gt;I've tried it once again.&lt;/p&gt;
&lt;p&gt;There is no %windir% environment variable just %systemroot%. &lt;/p&gt;
&lt;p&gt;Tried it on XP SP2 fully patched and a clean Vista installation also.&lt;/p&gt;
&lt;p&gt;start cmd.exe&lt;/p&gt;
&lt;p&gt;type &lt;/p&gt;
&lt;p&gt;set&lt;/p&gt;
&lt;p&gt;check for %windiw%&lt;/p&gt;
&lt;p&gt;You will find it.&lt;/p&gt;
&lt;p&gt;type command.com&lt;/p&gt;
&lt;p&gt;type&lt;/p&gt;
&lt;p&gt;set&lt;/p&gt;
&lt;p&gt;check for %windir%&lt;/p&gt;
&lt;p&gt;You won't find it&lt;/p&gt;
&lt;p&gt;(i've checked that it is not depending on the ntcmdprompt, %windir% is not defined in XP and Vista command.com)&lt;/p&gt;
</description></item><item><title>Closing all command shells from one command shell</title><link>http://blogs.msdn.com/aaron_margosis/archive/2007/06/27/follow-up-on-setting-color-for-all-cmd-shells-based-on-admin-elevation-status.aspx#3948632</link><pubDate>Thu, 19 Jul 2007 06:39:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3948632</guid><dc:creator>Daniel</dc:creator><description>&lt;P&gt;Hi is it possible to close all command shells from one command shell?&lt;/P&gt;
&lt;DIV class=ajmReply&gt;
&lt;P&gt;&lt;EM&gt;[Aaron Margosis] Not that I'm aware of.&lt;/EM&gt;&lt;/P&gt;&lt;/DIV&gt;</description></item><item><title>re: Follow-up on "Setting color for *all* CMD shells based on admin/elevation status"</title><link>http://blogs.msdn.com/aaron_margosis/archive/2007/06/27/follow-up-on-setting-color-for-all-cmd-shells-based-on-admin-elevation-status.aspx#3960947</link><pubDate>Thu, 19 Jul 2007 21:50:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3960947</guid><dc:creator>Alexander Sukhovey</dc:creator><description>&lt;p&gt;@Daniel &lt;/p&gt;
&lt;p&gt;You can try &amp;quot;TASKKILL /IM cmd.exe&amp;quot;. It should work if the cmd shell you are running the command in is the last one open otherwise it'll be killed before all other cmd windows are closed. &lt;/p&gt;
&lt;p&gt;Or you can write a script that will determine PID of cmd process it is running under and skip it while closing all other windows. I'm not sure though it is what you're after.&lt;/p&gt;
</description></item><item><title>re: Follow-up on "Setting color for *all* CMD shells based on admin/elevation status"</title><link>http://blogs.msdn.com/aaron_margosis/archive/2007/06/27/follow-up-on-setting-color-for-all-cmd-shells-based-on-admin-elevation-status.aspx#4209357</link><pubDate>Fri, 03 Aug 2007 20:39:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4209357</guid><dc:creator>Sam Black</dc:creator><description>&lt;P&gt;Is there any way to get Vista to *NOT* put "Administrator" in the title (or at least not at the beginning of the title)? When you've got multiple command windows open, it's impossible to tell which is which on the task bar.&lt;/P&gt;
&lt;DIV class=ajmReply&gt;
&lt;P&gt;&lt;EM&gt;[Aaron Margosis] There's no way built into Windows to do that.&amp;nbsp; But a custom program that calls the &lt;/EM&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms633546.aspx" target=_blank&gt;&lt;EM&gt;SetWindowText&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt; Windows API can change the title to anything you want it to (*).&amp;nbsp; But if CMD changes its own title to something else (e.g., using the "TITLE" command) it will prepend "Administrator:" (or non-English equivalent) again if running in an elevated context.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;(*) Note that this is subject to change at any time.&lt;/EM&gt;&lt;/P&gt;&lt;/DIV&gt;</description></item><item><title>Ламинат цены</title><link>http://blogs.msdn.com/aaron_margosis/archive/2007/06/27/follow-up-on-setting-color-for-all-cmd-shells-based-on-admin-elevation-status.aspx#8891783</link><pubDate>Sun, 24 Aug 2008 14:34:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8891783</guid><dc:creator>ламинат</dc:creator><description>&lt;p&gt;0jThank's.7s I compleatly disagree with last post . &amp;nbsp;xle &lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;&lt;a rel="nofollow" target="_new" href="http://skuper.ru&amp;quot;&amp;gt;паркет&amp;lt;/a&amp;gt;"&gt;http://skuper.ru&amp;quot;&amp;gt;паркет&amp;lt;/a&amp;gt;&lt;/a&gt; 8k&lt;/p&gt;
</description></item></channel></rss>