<?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>Unified Diff &#187; Security</title>
	<atom:link href="http://www.unifieddiff.com/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.unifieddiff.com</link>
	<description>I should do that! How hard could it be?!</description>
	<lastBuildDate>Sat, 30 Jan 2010 01:23:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Dipping Duck</title>
		<link>http://www.unifieddiff.com/2009/05/12/dipping-duck/</link>
		<comments>http://www.unifieddiff.com/2009/05/12/dipping-duck/#comments</comments>
		<pubDate>Wed, 13 May 2009 03:53:04 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Why Sys Admins Hate Me]]></category>
		<category><![CDATA[Win32 & MFC]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.unifieddiff.com/?p=164</guid>
		<description><![CDATA[So I was trying to read a document on my computer at work today, while making notes on a piece of paper. But every five minutes the screensaver would activate, causing me to stop writing, type my password, and find my place in the document again. Needless to say it was quite annoying.


Now you might [...]]]></description>
			<content:encoded><![CDATA[<p>So I was trying to read a document on my computer at work today, while making notes on a piece of paper. But every five minutes the screensaver would activate, causing me to stop writing, type my password, and find my place in the document again. Needless to say it was quite annoying.</p>
<p align="center"><img src="/images/dilbert2045782050802.gif" alt="Dilbert comic" /></p>
<span id="more-164"></span>
<p>Now you might be wondering why I don&#8217;t just change the screensaver time-out or turn off the requirement for a password. Well even though I&#8217;m a local administrator, there is a domain-wide GPO that prevents me from doing so. (Yes I know I can edit the registry, but that setting doesn&#8217;t survive a GP refresh.) I understand the reason for the policy, but five minutes seems a bit too short.</p>
<p>I wanted to fix this problem AND keep my job at the same time. Alice&#8217;s &#8220;dipping duck&#8221; inspired me to write a simple program to simulate mouse movement.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;">#include &lt;windows.h&gt;</span>
&nbsp;
<span style="color: #0000ff;">int</span> WINAPI WinMain<span style="color: #008000;">&#40;</span> HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, <span style="color: #0000ff;">int</span> nCmdShow <span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    HANDLE htmr <span style="color: #000080;">=</span> CreateWaitableTimer<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">NULL</span>, TRUE, L<span style="color: #FF0000;">&quot;CheckIdle&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    LARGE_INTEGER lidt<span style="color: #008080;">;</span>
    LASTINPUTINFO lii<span style="color: #008080;">;</span>
&nbsp;
    __int64 qwdt <span style="color: #000080;">=</span> <span style="color: #000040;">-</span><span style="color: #0000dd;">30</span> <span style="color: #000040;">*</span> <span style="color: #0000dd;">10000000</span><span style="color: #008080;">;</span> <span style="color: #666666;">// 30 seconds</span>
    lidt.<span style="color: #007788;">LowPart</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>DWORD<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#40;</span>qwdt <span style="color: #000040;">&amp;</span> <span style="color: #208080;">0xFFFFFFFF</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    lidt.<span style="color: #007788;">HighPart</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>LONG<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#40;</span>qwdt <span style="color: #000080;">&gt;&gt;</span> <span style="color: #0000dd;">32</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #0000ff;">while</span><span style="color: #008000;">&#40;</span> TRUE <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
        SetWaitableTimer<span style="color: #008000;">&#40;</span>htmr, <span style="color: #000040;">&amp;</span>lidt, <span style="color: #0000dd;">0</span>, <span style="color: #0000ff;">NULL</span>, <span style="color: #0000ff;">NULL</span>, FALSE<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        WaitForSingleObject<span style="color: #008000;">&#40;</span>htmr, INFINITE<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
        RtlZeroMemory<span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>lii, <span style="color: #0000dd;">sizeof</span><span style="color: #008000;">&#40;</span>LASTINPUTINFO<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        lii.<span style="color: #007788;">cbSize</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">sizeof</span><span style="color: #008000;">&#40;</span>LASTINPUTINFO<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        BOOL ret <span style="color: #000080;">=</span> GetLastInputInfo<span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>lii<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
        <span style="color: #0000ff;">int</span> threshold <span style="color: #000080;">=</span> <span style="color: #0000dd;">3</span> <span style="color: #000040;">*</span> <span style="color: #0000dd;">60</span><span style="color: #008080;">;</span> <span style="color: #666666;">// 3 minutes</span>
        <span style="color: #0000ff;">int</span> idletime <span style="color: #000080;">=</span> ret <span style="color: #008080;">?</span> <span style="color: #008000;">&#40;</span>GetTickCount<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">-</span> lii.<span style="color: #007788;">dwTime</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">/</span> <span style="color: #0000dd;">1000</span> <span style="color: #008080;">:</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
&nbsp;
        BOOL scrnsvr <span style="color: #000080;">=</span> FALSE<span style="color: #008080;">;</span>
        SystemParametersInfo<span style="color: #008000;">&#40;</span>SPI_GETSCREENSAVERRUNNING, <span style="color: #0000dd;">0</span>, <span style="color: #000040;">&amp;</span>scrnsvr, <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
        <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span> idletime <span style="color: #000080;">&gt;</span> threshold <span style="color: #000040;">&amp;&amp;</span> <span style="color: #000040;">!</span>scrnsvr <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
            MOUSEINPUT mi<span style="color: #008080;">;</span>
            RtlZeroMemory<span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>mi, <span style="color: #0000dd;">sizeof</span><span style="color: #008000;">&#40;</span>MOUSEINPUT<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
            mi.<span style="color: #007788;">dwFlags</span> <span style="color: #000080;">=</span> MOUSEEVENTF_MOVE<span style="color: #008080;">;</span>
            mi.<span style="color: #007788;">dx</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>
            mi.<span style="color: #007788;">dy</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>
&nbsp;
            INPUT in<span style="color: #008080;">;</span>
            in.<span style="color: #007788;">type</span> <span style="color: #000080;">=</span> INPUT_MOUSE<span style="color: #008080;">;</span>
            in.<span style="color: #007788;">mi</span> <span style="color: #000080;">=</span> mi<span style="color: #008080;">;</span>
&nbsp;
            SendInput<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">1</span>, <span style="color: #000040;">&amp;</span>in, <span style="color: #0000dd;">sizeof</span><span style="color: #008000;">&#40;</span>in<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>



<p>Every thirty seconds the program checks to see if the computer is idle. After three minutes of inactivity (and if the screensaver isn&#8217;t running), it moves the mouse cursor one pixel down and to the right. If I lock the workstation or manually activate the screensaver, the program won&#8217;t do anything. To compile this program, create a new empty C++ Win32 application project. Add a new cpp file, drop in the code above, and hit &#8220;Build Solution&#8221;.</p>
<p>Now the screensaver won&#8217;t be a nuisance when I&#8217;m trying to read. I just have to make sure to hit Win-L before I leave my desk!</p>]]></content:encoded>
			<wfw:commentRss>http://www.unifieddiff.com/2009/05/12/dipping-duck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CLAWS Lives!</title>
		<link>http://www.unifieddiff.com/2008/03/29/claws-lives/</link>
		<comments>http://www.unifieddiff.com/2008/03/29/claws-lives/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 18:13:01 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[CLAWS]]></category>
		<category><![CDATA[Identity Management]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[RIT]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://www.robertjcarroll.com/2008/03/29/claws-lives/</guid>
		<description><![CDATA[Well I finally did it. Last summer I set out to build and run CLAWS in my own environment. I was able to get parts of it running, but there were a few problems I was stuck on. I haven&#8217;t had much time to work on it since then, but over spring break I managed [...]]]></description>
			<content:encoded><![CDATA[<p>Well I finally did it. Last summer I set out to build and run CLAWS in my own environment. I was able to get parts of it running, but there were a few problems I was stuck on. I haven&#8217;t had much time to work on it since then, but over spring break I managed to get everything built and installed.</p>
<p>My goal was to get CLAWS running the way RIT uses it, and then write patches to the main codebase. If certain people in high places liked the changes I made, they could take the patches and apply them upstream. Even if that doesn&#8217;t happen, I could always fork the project and continue development on my own. For political reasons, I&#8217;d have to wait to do this until after I graduate.</p>
<p>The <a href="http://paws.unifieddiff.com/">PAWS Project</a> is aimed at taking what is now a very RIT-centric software system and transforming it into something the general public can use. Much to the chagrin of some un-named information security officials, CLAWS is open source and so I can (at very least) develop from the r2977 snapshot.</p>
<p>In the coming few months I plan to have my documentation finished for building and installing CLAWS. I should have a lighter schedule this summer, so I&#8217;m hoping to get most of my development work done then.</p>]]></content:encoded>
			<wfw:commentRss>http://www.unifieddiff.com/2008/03/29/claws-lives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RIT Grows Some CLAWS</title>
		<link>http://www.unifieddiff.com/2006/10/05/claws/</link>
		<comments>http://www.unifieddiff.com/2006/10/05/claws/#comments</comments>
		<pubDate>Fri, 06 Oct 2006 02:12:52 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[CLAWS]]></category>
		<category><![CDATA[Identity Management]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[RIT]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://www.robertjcarroll.com/2006/10/05/claws/</guid>
		<description><![CDATA[Managing thousands of user accounts in a heterogeneous computing environment can be a nightmare. Then throw in the need to manage user identities and network access to over forty-thousand network devices. What is a systems administrator to do? Enter CLAWS, RIT&#8217;s new open-source enterprise account, identity, and computer management tool.
The CLAWS central server manages communications [...]]]></description>
			<content:encoded><![CDATA[<p>Managing thousands of user accounts in a heterogeneous computing environment can be a nightmare. Then throw in the need to manage user identities and network access to over forty-thousand network devices. What is a systems administrator to do? Enter CLAWS, RIT&#8217;s new open-source enterprise account, identity, and computer management tool.</p>
<p>The CLAWS central server manages communications between the various clients and back-end systems. A self-help tool allows students to activate an account and edit identity and mail preferences. The Help Desk client provides account management functions for staff that streamlines account creation and maintenance across the multiple systems.</p>
<p>Right now, CLAWS is used in production by both students and Help Desk staff. We are presently working to integrate <a href="/projects/ipedit/">IPEdit</a> functionality into CLAWS. Visit the <a href="http://claws.rit.edu/">project homepage</a> for more information.</p>]]></content:encoded>
			<wfw:commentRss>http://www.unifieddiff.com/2006/10/05/claws/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Active Directory and Linux</title>
		<link>http://www.unifieddiff.com/2006/06/16/active-directory-linux/</link>
		<comments>http://www.unifieddiff.com/2006/06/16/active-directory-linux/#comments</comments>
		<pubDate>Sat, 17 Jun 2006 03:47:50 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.robertjcarroll.com/2006/06/16/active-directory-linux/</guid>
		<description><![CDATA[I maintain several client and server machines that, up until recently, all authenticated users locally. I wanted a more centralized mechanism that could handle the various users and systems on the network. The big catch is that a few key system run Linux while others run Windows. So after doing some research, I turned to [...]]]></description>
			<content:encoded><![CDATA[<p>I maintain several client and server machines that, up until recently, all authenticated users locally. I wanted a more centralized mechanism that could handle the various users and systems on the network. The big catch is that a few key system run Linux while others run Windows. So after doing some research, I turned to Active Directory.</p>
<p>My first chore was to install Windows Server 2003 and configure it to be a domain controller. This part was fairly easy, although a little time-consuming. Once that was working I was able to quickly join the Windows machines to the domain. Now to deal with Linux&#8230; for that I chose Windows Services for Unix. This software alters the AD schema to allow for Unix account attributes. On the Linux machines, I installed OpenLDAP, a Kerberos client, configured PAM&#8230; and voila! Now AD users can authenticate on the Linux machines.</p>
<p>My home-made DHCP/DNS configuration tool, however, was a little trickier. The data for this tool is stored in a MySQL database and accessed via a PHP script. If I wanted to grant someone access to the tool, I needed to first give them a MySQL account. Since Active Directory is basically an LDAP server, I rewrote the authentication mechanism to query AD.</p>
<p>With very little work, I was able to simplify authentication and account management. While this is not new technology, I still feel all warm and fuzzy with a sense of accomplishment.</p>]]></content:encoded>
			<wfw:commentRss>http://www.unifieddiff.com/2006/06/16/active-directory-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOW TO: Work Least-Privileged in Windows XP</title>
		<link>http://www.unifieddiff.com/2006/02/25/howto-least-privileged-winxp/</link>
		<comments>http://www.unifieddiff.com/2006/02/25/howto-least-privileged-winxp/#comments</comments>
		<pubDate>Sat, 25 Feb 2006 23:48:53 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.robertjcarroll.com/2006/02/25/howto-least-privileged-winxp/</guid>
		<description><![CDATA[Have you ever been the victim of a computer virus, worm, or other malicious software program? If so, then you understand what a pain it is to recover. Often times, the only way to fix the problems is to do a clean re-install of Windows. Of course you can buy anti-virus and anit-spyware products, but [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever been the victim of a computer virus, worm, or other malicious software program? If so, then you understand what a pain it is to recover. Often times, the only way to fix the problems is to do a clean re-install of Windows. Of course you can buy anti-virus and anit-spyware products, but these programs are all meant for after-the-fact. Wouldn&#8217;t it be nice to be able to stop malicious software (malware) in its tracks <u>before</u> damage is done?</p>
<p>Enter the &#8220;least privilege&#8221; security model. This approach to computing is very simple &#8212; only give yourself enough privileges to accomplish the task you need to perform. For example: do you need to be able to delete all of your system files while you write a letter in Microsoft Word? The answer would be &#8220;no, of course not!&#8221; But running with full privileges, you would be able to do so.</p>
<span id="more-13"></span>
<p>This is how malware spreads. Users visit websites that exploit known vulnerabilities in Internet Explorer. Since the default setup in Windows XP is to be an administrator, these programs can freely install themselves without your knowledge or consent. Working least-privileged solves this problem because without the privileges to tamper with system files, malware can&#8217;t invade your computer (easily).</p>
<p>Are you sold yet? Great! Now let&#8217;s set it up. Traditionally, working with with a non-privileged account has a real pain. But there are some tricks to help you.</p>
&nbsp;<br />
<p><b>1. Creating an Unprivileged Account</b></p>
<p>This step really depends on how you are setup right now. If you already have an account, then we need to adjust your privileges. Either way, you&#8217;ll need to logoff (Start > Logoff). Once you&#8217;re at the Welcome screen, press and hold the Control and Alt keys and the press the Delete key twice. You should now be presented with a login window. Type &#8220;administrator&#8221; for the user name and your password (or leave it empty).</p>
<p>Once logged in, pop yourself into the &#8220;User Accounts&#8221; control panel (Start > Control Panel > User Accounts). Select your own user account and choose &#8220;Change my account type&#8221;. Select &#8220;Limited User&#8221; and click OK. If you don&#8217;t have a password on your &#8220;administrator&#8221; account, you will want to set one now.</p>
<p><b>2. Turn-off Simple File Sharing (Optional)</b></p>
<p>This may fall more into the category of preference, but I think it makes life easier. Windows manages permission on securable objects (this includes files and folders) with Access Control Lists (ACL). When Simple File Sharing is turned-on, Windows will handle editing these lists for you. Doing this yourself gives you greater flexibility, but can cause you to lose data if you make a mistake.</p>
<p>To do this, open &#8220;My Computer&#8221;. From the &#8220;Tools&#8221; menu, choose &#8220;Folder Options&#8221;. Click on the &#8220;View&#8221; tab and you should see of list with checkboxes. Scroll to the bottom of this list, uncheck &#8220;Use Simple File Sharing (Recommended)&#8221;, and click OK.</p>
<p><b>3. Changing the Default Owner (XP Pro Only)</b></p>
<p>When a member of the Administrators group creates a file or folder, that user is the default owner. This can cause headaches when running least-privileged because you could end-up with write access to system files. By making the Administrators group the default owner, you eliminate that risk.</p>
<p>To accomplish this, you will need to open the Local Security Policy editor (Control Panel > Administrative Tools > Local Security Policy). In the left-hand pane, choose &#8220;Local Policies&#8221; and then &#8220;Security Options&#8221;. In the right-hand pane, find &#8220;System objects: Default owner for objects created by members of the administrators group&#8221;. Choose &#8220;Administrators Group&#8221; from the drop-down list and click OK.</p>
<p><b>4. Secondary Logon Service</b></p>
<p>What happens when you&#8217;re working and you need to make a change? Should you logoff and logon as an administrator? No!&#8230; there is an easier way. The Secondary Logon service allows you to  run any application as another user by right-clicking on the file and choosing &#8220;Run As&#8230;&#8221;.</p>
<p>This should be enabled by default, but lets just make sure. Run the Computer Management applet (Control Panel > Administrative Tools > Computer Management). Choose &#8220;Services &#038; Applications&#8221; and then &#8220;Services&#8221;. In the right-hand pane, find &#8220;Secondary Logon&#8221;, right-click, and choose &#8220;Properties&#8221;. Make sure startup type is &#8220;Automatic&#8221; and then click &#8220;Start&#8221; if the service is not already started.</p>
<p><b>5. Elevate Your Own Account (Optional)</b></p>
<p>Somtimes you need to make changes to your own account, but require administive privileges. You could change your account privileges (using Run As) and then logoff and logon again. But there is an easier way&#8230; <a href="http://www.robertjcarroll.com/projects/general-utilities#makeadmin">Make Admin</a>. This program will allow you to change your account privileges on-the-fly for specific applications.</p>
<br/>
<p>Well, that was relatively painless (I hope). It will take some getting used to, but in the long-run, you&#8217;ll be glad you did. Oh, one more tip: you should do this on a clean install of Windows for best results.</p>]]></content:encoded>
			<wfw:commentRss>http://www.unifieddiff.com/2006/02/25/howto-least-privileged-winxp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
