<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>cryp7.net</title>
    <description>Just this site ya know</description>
    <link>https://cryp7.net/</link>
    <atom:link href="https://cryp7.net/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Wed, 13 Nov 2019 06:15:35 +0000</pubDate>
    <lastBuildDate>Wed, 13 Nov 2019 06:15:35 +0000</lastBuildDate>
    <generator>Jekyll v3.8.5</generator>
    
      <item>
        <title>Disabling macOS Mojave dark mode for a specific app</title>
        <description>&lt;h1 id=&quot;howto---disable-macos-mojave-dark-mode-for-a-specificsingle-app&quot;&gt;HOWTO - disable macOS (Mojave) dark mode for a specific/single app&lt;/h1&gt;

&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;While macOS Dark mode is great, in general, I find myself confusing it with specific app modes. Namely, Google Chrome Icognito.&lt;/p&gt;

&lt;p&gt;Therefore, the following instructions provide a quickstart/reminder of how to disable Dark Mode for particular apps.&lt;/p&gt;

&lt;h2 id=&quot;find-the-application-bundle&quot;&gt;Find the application Bundle&lt;/h2&gt;

&lt;p&gt;Use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osascript&lt;/code&gt; command to find the Bundle name:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;osascript -e 'id of app &quot;Some Random App&quot;'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For example, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Google Chrome&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;osascript -e 'id of app &quot;Google Chrome&quot;'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;disable-dark-mode-for-a-bundle&quot;&gt;Disable Dark mode for a Bundle&lt;/h2&gt;

&lt;p&gt;Now use the following command to disable the app &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Bundle_Identifier&lt;/code&gt; retrived from the previous step:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;defaults write Bundle_Identifier NSRequiresAquaSystemAppearance -bool yes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Continuing the previous example:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;defaults write com.google.Chrome NSRequiresAquaSystemAppearance -bool yes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;restart&quot;&gt;Restart&lt;/h2&gt;

&lt;p&gt;Unfortunately, one must restart the app in order for the new settings to take effect :(&lt;/p&gt;

&lt;h2 id=&quot;resetting&quot;&gt;Resetting&lt;/h2&gt;

&lt;p&gt;For whatever reason, should you want to reset the Bundle to defaults use the following command:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;defaults delete Bundle_Identifier NSRequiresAquaSystemAppearance
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;references&quot;&gt;References&lt;/h1&gt;

&lt;p&gt;All credit goes to the following post (this is just a tl;dr :)&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;https://www.tekrevue.com/tip/exclude-app-dark-mode-macos-mojave/&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Tue, 26 Mar 2019 00:00:00 +0000</pubDate>
        <link>https://cryp7.net/2019/mojave-disable-dark-mode-specific-app/</link>
        <guid isPermaLink="true">https://cryp7.net/2019/mojave-disable-dark-mode-specific-app/</guid>
        
        
      </item>
    
      <item>
        <title>AWS WAF Bypass</title>
        <description>&lt;h1 id=&quot;introduction&quot;&gt;Introduction&lt;/h1&gt;

&lt;p&gt;I (finally!) got around to playing with &lt;a href=&quot;https://aws.amazon.com/waf/&quot;&gt;AWS WAF&lt;/a&gt; last November. My initial PoC was to grab &lt;a href=&quot;https://www.owasp.org/index.php/Category:OWASP_WebGoat_Project&quot;&gt;OWASP WebGoat&lt;/a&gt; and focus on the SQL injection module to see how it blocks those attacks. After spending a couple days of free-time without any blocks it slowly dawned on me that I was actually bypassing the attack. So thinking I had lost all my offensive skills, forgotten everything I had learned from &lt;a href=&quot;https://twitter.com/infoseckeatron&quot;&gt;@infoseckeatron&lt;/a&gt;’s (seriously outstanding!) &lt;a href=&quot;https://www.infosecinstitute.com/&quot;&gt;InfoSec Institue&lt;/a&gt; CEH bootcamp, I turned to some trusted web app developer friends of mine to check my work. When they came back with, “Nah, you’re good, and you should submit that to Amazon for review!” I did so, and what follows is our journey to properly block these simple SQL injection bypasses.&lt;/p&gt;

&lt;h1 id=&quot;disclaimer&quot;&gt;Disclaimer&lt;/h1&gt;

&lt;p&gt;This research was done entirely independent of any employer past or present.&lt;/p&gt;

&lt;h1 id=&quot;vulnerability-disclosure-report&quot;&gt;Vulnerability Disclosure Report&lt;/h1&gt;

&lt;p&gt;Below is my vulnerability disclosure report as sent to aws-security@amazon.com unedited; except for anti-spam email obfuscation. While the attachment is missing, a representative github repo of this journey is available at &lt;a href=&quot;https://github.com/enkaskal/aws-waf-sqli-bypass-PoC&quot;&gt;enkaskal/aws-waf-sqli-bypass-PoC&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;N.B. The UserData in this initial commit is likely out of date/wrong. At least I had to update it for the &lt;em&gt;Simplified Example&lt;/em&gt; section (below); however at the time I swear it JustWork’d(TM)&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;-----Original Message-----
From: stefan _at_ cryp7 _dot_ net
Sent: Tue, 13 Feb 2018 05:28
To: aws-security@amazon.com
Subject: WAF SQLi bypass

Hello,
 
I was recently investigating the AWS WAF service and believe I have stumbled upon an SQLi bypass. Originally, I was just trying to ensure the rules were working correctly and 
I thought I was misconfiguring my test environment; however, after some troubleshooting it became clear that was not the case. While it may be considered a low priority issue 
that doesn’t warrant a vulnerability disclosure, I thought it best to err on the side of caution; especially since I don’t have an active support contract to submit via the 
ticketing system and didn’t want to post it publicly via the forums.
 
Attached is a tarball that includes the following:
 
* README.md
 * A report describing my findings.
* bypass/
 * Puppeteer scripts that attempt to automate the bypass (both numeric and string).
* cf/
 * A standalone CloudFormation template to assist in reproducing my findings.
* .sh
 * Helper (bash) scripts to assist the reviewer.
* demo.gif
 * An animated gif demonstrating the successful WAF bypass using the ssqli.sh helper.
 
Just in case the attachment is filtered for some reason, the same tarball is available via Dropbox at: [REDACTED]
 
SHA256SUM: b5bb12d38bb1ca930fd138730eae795229302cc93741e4e991af703b79c4524a
 
Finally, the automated scripts are _fairly_ deterministic, but I have found repeated invocations can demonstrate non-determinism that I believe is due to timeouts or (possibly) 
chrome headless crashing. The main point of the Puppeteer scripts was to codify the bypass and while I normally would’ve done some more testing and cleanup; QA was already 
dragging on and therefore I decided it best to just submit as is. However please don’t hesitate to contact me if you have any questions or would like me to pair/screen share with a reviewer.
 
Very Respectfully,
 
-- 
 
Stefan Schwoegler
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;initial-response&quot;&gt;Initial Response&lt;/h1&gt;

&lt;p&gt;After ~1mo I received the following response:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;-----Original Message-----
From: aws-security@amazon.com
Sent: Mon, 12 Mar 2018 20:56:54 +0000
To: stefan _at_ cryp7 _dot_ net
Subject: RE: WAF SQLi bypass

Hi Stefan,

Thank you for reaching out to us regarding the Security Issue. After reaching out to the service team, they concluded that the issue came from the fact that several sequential transforms
were used in your WAF configuration. Currently the API does not have a way to specify multiple sequential transforms. However, the documentation did not reflect this at the time of your report.
We have updated it and it is now available at the following link: https://docs.aws.amazon.com/waf/latest/developerguide/getting-started.html#getting-started-wizard-create-string-condition.
If you discover otherwise or become aware of another security concern specific to AWS products and services, please do not hesitate to contact us again at aws-security@amazon.com.

Thank you again for helping us protect our customers!

Best Regards

[REDACTED]
AWS Security
https://aws.amazon.com/security
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;N.B. Name has been [REDACTED] to protect the innocent. Also, there was typical “status” correspondences during the ~1mo so it’s not like there was total silence during the interim.&lt;/p&gt;

&lt;h1 id=&quot;my-reply&quot;&gt;My Reply&lt;/h1&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;-----Original Message-----
From: stefan _at_ cryp7 _dot_ net
Sent: Wed, 11 Apr 2018 02:44
To: aws-security@amazon.com
Subject: RE: WAF SQLi bypass

[REDACTED],

Thank you for your reply.

It was a pleasure working with you all, and given this response, plus the fact you have publicly posted your remediation I would like to publish this work to my personal blog.
I would like to include content from our correspondences but will not include any identifying information other than an AWS Security Support Representative. One thing that would 
be very helpful is if AWS could also provide the steps or a modified version of my submission that would block the SQL injection. This would really help me hammer home a good 
teaching example for the blog post.

Can you help in getting the improved solution or steps to that solution?

Can you also confirm that there is not an issue publishing my work to a personal blog with the caveats above?

Very Respectfully,

--
Stefan Schwoegler
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;their-response&quot;&gt;Their Response&lt;/h1&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;-----Original Message-----
From: aws-security@amazon.com
Sent: Wed, 11 Apr 2018 16:10:06 +0000
To: stefan _at_ cryp7 _dot_ net
Subject: RE: WAF SQLi bypass

Hi Stefan,

Thank you for notifying us about the blog post. I will look into it and get back to you with a status update within 5 business days. 
In the meantime, if you have already drafted the blog post, we would greatly appreciate it if you could share this draft with us.

If you have any further questions or concerns, please do not hesitate to contact us. If you wish to protect your email, you may use PGP; our key is here:

https://aws.amazon.com/security/aws-pgp-public-key

If you would like AWS Security to encrypt its communications to you, please provide us with your public PGP key also.

Thanks again!

Best Regards

[REDACTED]
AWS Security
https://aws.amazon.com/security
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;a-simplified-example&quot;&gt;A Simplified Example&lt;/h1&gt;

&lt;p&gt;Given Amazon’s response at this point I decided to put together a simplified example: &lt;a href=&quot;https://github.com/enkaskal/aws-waf-sqli-bypass-PoC/tree/simplified&quot;&gt;https://github.com/enkaskal/aws-waf-sqli-bypass-PoC/tree/simplified&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is a single rule WebACL with &lt;em&gt;ONLY&lt;/em&gt; a Body FieldToMatch + CMD_LINE TextTransformation which I feels highlights my findings.&lt;/p&gt;

&lt;p&gt;I then sent it to them along with a draft of this blog post for review.&lt;/p&gt;

&lt;h1 id=&quot;resolution&quot;&gt;Resolution&lt;/h1&gt;

&lt;p&gt;After providing the simplified example, and a draft of this blog post for review prior to publication, I was contacted by Principal/Senior AWS staff asking for a teleconference. During the call, they agreed with my initial findings/expectations, and asked that I halt publication so that we could continue to work together to properly mitigate these attacks. After some back and forth collaboration with the team, including ensuring that not only do compound SQL statements using a single ‘;’ but also canonical solutions were also handled, I can happily report these injection flaws are now properly protected against in AWS WAF!&lt;/p&gt;
</description>
        <pubDate>Fri, 09 Nov 2018 00:00:00 +0000</pubDate>
        <link>https://cryp7.net/2018/aws-waf-bypass/</link>
        <guid isPermaLink="true">https://cryp7.net/2018/aws-waf-bypass/</guid>
        
        
      </item>
    
      <item>
        <title>Medium to GitHub Pages Migration</title>
        <description>&lt;p&gt;My apologies for the “blackout.” I put all posts on hold while I setup CloudFlare DNS &amp;amp; GitHub Pages+Jekyll for my blog. JIC Twitter™ decides to kill my content ;P&lt;/p&gt;

&lt;p&gt;Hope all is well with my followers.&lt;/p&gt;

&lt;p&gt;–183r space cowboy&lt;/p&gt;
</description>
        <pubDate>Thu, 18 May 2017 00:00:00 +0000</pubDate>
        <link>https://cryp7.net/2017/medium2github-pages-migration/</link>
        <guid isPermaLink="true">https://cryp7.net/2017/medium2github-pages-migration/</guid>
        
        
      </item>
    
      <item>
        <title>cryp7.net discord server</title>
        <description>&lt;p&gt;cryp7.net now has a discord server. use this invite link to join (never expires :) if you would like to chat with us: &lt;a href=&quot;https://discord.gg/P6rSfGS&quot;&gt;https://discord.gg/P6rSfGS&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;–183r space cowboy&lt;/p&gt;
</description>
        <pubDate>Thu, 18 May 2017 00:00:00 +0000</pubDate>
        <link>https://cryp7.net/2017/discord-server/</link>
        <guid isPermaLink="true">https://cryp7.net/2017/discord-server/</guid>
        
        
      </item>
    
      <item>
        <title>Must See Movies Of All Time</title>
        <description>&lt;h1 id=&quot;this-is-a-living-document&quot;&gt;&lt;center&gt;&lt;span style=&quot;color:red&quot;&gt;This is a living document.&lt;/span&gt;&lt;/center&gt;&lt;/h1&gt;

&lt;h2 id=&quot;its-intern-season-again&quot;&gt;It’s intern season again…&lt;/h2&gt;

&lt;h4 id=&quot;so-we-found-ourselves-compiling-a-list-of-must-see-movies&quot;&gt;So we found ourselves compiling a list of must see movies!&lt;/h4&gt;

&lt;p&gt;Here’s what we came up as a first draft:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;sneakers&lt;/li&gt;
  &lt;li&gt;spy game&lt;/li&gt;
  &lt;li&gt;blade runner&lt;/li&gt;
  &lt;li&gt;pulp fiction/reservoir dogs&lt;/li&gt;
  &lt;li&gt;LOTR/hobbit trilogies&lt;/li&gt;
  &lt;li&gt;indiana jones trilogy&lt;/li&gt;
  &lt;li&gt;star wars (machete order: http://www.nomachetejuggling.com/2011/11/11/the-star-wars-saga-suggested-viewing-order/)&lt;/li&gt;
  &lt;li&gt;all star trek movies&lt;/li&gt;
  &lt;li&gt;ghostbusters&lt;/li&gt;
  &lt;li&gt;caddyshack&lt;/li&gt;
  &lt;li&gt;fight club, american beauty, the beach (i maintain these are all basically the same stories retold in different ways)&lt;/li&gt;
  &lt;li&gt;pitch black/chronicles of riddick “trilogy”&lt;/li&gt;
  &lt;li&gt;rounders&lt;/li&gt;
  &lt;li&gt;the way of the gun&lt;/li&gt;
  &lt;li&gt;boondock saints&lt;/li&gt;
  &lt;li&gt;suicide kings&lt;/li&gt;
  &lt;li&gt;usual suspects&lt;/li&gt;
  &lt;li&gt;man on fire&lt;/li&gt;
  &lt;li&gt;godfather 1 &amp;amp; 2 (skip 3)&lt;/li&gt;
  &lt;li&gt;casino&lt;/li&gt;
  &lt;li&gt;goodfellas&lt;/li&gt;
  &lt;li&gt;carlito’s way&lt;/li&gt;
  &lt;li&gt;scarface&lt;/li&gt;
  &lt;li&gt;true romance&lt;/li&gt;
  &lt;li&gt;good will hunting&lt;/li&gt;
  &lt;li&gt;die hard (all)&lt;/li&gt;
  &lt;li&gt;heat&lt;/li&gt;
  &lt;li&gt;12 monkies&lt;/li&gt;
  &lt;li&gt;shawshank redemption&lt;/li&gt;
  &lt;li&gt;inception&lt;/li&gt;
  &lt;li&gt;goodfellas&lt;/li&gt;
  &lt;li&gt;se7en&lt;/li&gt;
  &lt;li&gt;casablanca&lt;/li&gt;
  &lt;li&gt;dial m for muder&lt;/li&gt;
  &lt;li&gt;rear window (original 1954)&lt;/li&gt;
  &lt;li&gt;mr smith goes to washington&lt;/li&gt;
  &lt;li&gt;soylent green&lt;/li&gt;
  &lt;li&gt;2001: a space odyssey&lt;/li&gt;
  &lt;li&gt;terminator 1 &amp;amp; 2&lt;/li&gt;
  &lt;li&gt;robocop&lt;/li&gt;
  &lt;li&gt;total recall (original and remake)&lt;/li&gt;
  &lt;li&gt;back to the future trilogy&lt;/li&gt;
  &lt;li&gt;memento&lt;/li&gt;
  &lt;li&gt;dr strangelove&lt;/li&gt;
  &lt;li&gt;the shining&lt;/li&gt;
  &lt;li&gt;crocodile dundee&lt;/li&gt;
  &lt;li&gt;taxi driver&lt;/li&gt;
  &lt;li&gt;to kill a mockingbird (original)&lt;/li&gt;
  &lt;li&gt;the sting&lt;/li&gt;
  &lt;li&gt;the hustler/color of money&lt;/li&gt;
  &lt;li&gt;cocktail&lt;/li&gt;
  &lt;li&gt;lock, stock, and two smoking barrells/snatch&lt;/li&gt;
  &lt;li&gt;swingers/made&lt;/li&gt;
  &lt;li&gt;braveheart/gladiator&lt;/li&gt;
  &lt;li&gt;the sixth sense&lt;/li&gt;
  &lt;li&gt;kill bill&lt;/li&gt;
  &lt;li&gt;full metal jacket&lt;/li&gt;
  &lt;li&gt;platoon&lt;/li&gt;
  &lt;li&gt;the princess bride&lt;/li&gt;
  &lt;li&gt;the bourne identity trilogy&lt;/li&gt;
  &lt;li&gt;rocky&lt;/li&gt;
  &lt;li&gt;toy story&lt;/li&gt;
  &lt;li&gt;monsters, inc&lt;/li&gt;
  &lt;li&gt;(insert all classic disney movies which i’m sure you’ve seen including charlie and the chocolate factory [original])&lt;/li&gt;
  &lt;li&gt;groundhog day&lt;/li&gt;
  &lt;li&gt;last of the mohicans&lt;/li&gt;
  &lt;li&gt;red&lt;/li&gt;
  &lt;li&gt;dangerous liasons (cruel intentions is the “modern” remake)&lt;/li&gt;
  &lt;li&gt;hitchhiker’s guide to the galaxy (and then read all the books!)&lt;/li&gt;
  &lt;li&gt;black hawk down&lt;/li&gt;
  &lt;li&gt;thirteen days&lt;/li&gt;
  &lt;li&gt;prometheus, alien, aliens&lt;/li&gt;
  &lt;li&gt;wag the dog&lt;/li&gt;
  &lt;li&gt;office space&lt;/li&gt;
  &lt;li&gt;blazing saddles&lt;/li&gt;
  &lt;li&gt;history of the world part 2&lt;/li&gt;
  &lt;li&gt;spaceballs&lt;/li&gt;
  &lt;li&gt;clerks/dogma&lt;/li&gt;
  &lt;li&gt;groundhog day&lt;/li&gt;
  &lt;li&gt;there’s something about mary&lt;/li&gt;
  &lt;li&gt;dazed and confused&lt;/li&gt;
  &lt;li&gt;superbad&lt;/li&gt;
  &lt;li&gt;dumb and dumber&lt;/li&gt;
  &lt;li&gt;austin powers&lt;/li&gt;
  &lt;li&gt;the jerk&lt;/li&gt;
  &lt;li&gt;old school&lt;/li&gt;
  &lt;li&gt;national lampoons vacation&lt;/li&gt;
  &lt;li&gt;zombieland&lt;/li&gt;
  &lt;li&gt;american pie&lt;/li&gt;
  &lt;li&gt;the hangover&lt;/li&gt;
  &lt;li&gt;trading places&lt;/li&gt;
  &lt;li&gt;boiler room&lt;/li&gt;
  &lt;li&gt;avatar&lt;/li&gt;
  &lt;li&gt;ted&lt;/li&gt;
  &lt;li&gt;saving private ryan (band of brothers series on hbo is much better tho)&lt;/li&gt;
  &lt;li&gt;oceans 11 (nothing beats the original but the remakes are pretty good too)&lt;/li&gt;
  &lt;li&gt;blood diamond&lt;/li&gt;
  &lt;li&gt;simpsons movie&lt;/li&gt;
  &lt;li&gt;slumdog millionaire&lt;/li&gt;
  &lt;li&gt;american history x&lt;/li&gt;
  &lt;li&gt;happy gilmore/billy madison/black sheep&lt;/li&gt;
  &lt;li&gt;edward scissorhands&lt;/li&gt;
  &lt;li&gt;friday&lt;/li&gt;
  &lt;li&gt;fear and loathing in las vegas&lt;/li&gt;
  &lt;li&gt;training day&lt;/li&gt;
  &lt;li&gt;james bond (anything with sean connery or roger moore skip the rest)&lt;/li&gt;
  &lt;li&gt;hunt for red october&lt;/li&gt;
  &lt;li&gt;the rock&lt;/li&gt;
  &lt;li&gt;highlander&lt;/li&gt;
  &lt;li&gt;time bandits&lt;/li&gt;
  &lt;li&gt;bill &amp;amp; ted’s excellent adventure&lt;/li&gt;
  &lt;li&gt;forrest gump&lt;/li&gt;
  &lt;li&gt;wizard of oz&lt;/li&gt;
  &lt;li&gt;it’s a wonderful life&lt;/li&gt;
  &lt;li&gt;a christmas story&lt;/li&gt;
  &lt;li&gt;jaws&lt;/li&gt;
  &lt;li&gt;ET&lt;/li&gt;
  &lt;li&gt;army of darkness&lt;/li&gt;
  &lt;li&gt;short circuit&lt;/li&gt;
  &lt;li&gt;breakfast club&lt;/li&gt;
  &lt;li&gt;ferris bueller’s day off&lt;/li&gt;
  &lt;li&gt;war games (NOT THE SEQUEL)&lt;/li&gt;
  &lt;li&gt;top gun&lt;/li&gt;
  &lt;li&gt;goonies&lt;/li&gt;
  &lt;li&gt;gremlns&lt;/li&gt;
  &lt;li&gt;poltergeist&lt;/li&gt;
  &lt;li&gt;beetlejuice&lt;/li&gt;
  &lt;li&gt;lost boys&lt;/li&gt;
  &lt;li&gt;who framed roger rabbit&lt;/li&gt;
  &lt;li&gt;big&lt;/li&gt;
  &lt;li&gt;the shining&lt;/li&gt;
  &lt;li&gt;coming to america&lt;/li&gt;
  &lt;li&gt;karate kid&lt;/li&gt;
  &lt;li&gt;predator&lt;/li&gt;
  &lt;li&gt;dirty dancing&lt;/li&gt;
  &lt;li&gt;roadhouse&lt;/li&gt;
  &lt;li&gt;batman&lt;/li&gt;
  &lt;li&gt;weird science&lt;/li&gt;
  &lt;li&gt;when harry met sally&lt;/li&gt;
  &lt;li&gt;boyz n the hood&lt;/li&gt;
  &lt;li&gt;schindler’s list&lt;/li&gt;
  &lt;li&gt;sandlot (you’re killin me smalls!)&lt;/li&gt;
  &lt;li&gt;don’t tell mom the babysitter’s dead&lt;/li&gt;
  &lt;li&gt;independence day&lt;/li&gt;
  &lt;li&gt;wayne’s world&lt;/li&gt;
  &lt;li&gt;a few good men&lt;/li&gt;
  &lt;li&gt;days of thunder&lt;/li&gt;
  &lt;li&gt;minority report&lt;/li&gt;
  &lt;li&gt;parenthood&lt;/li&gt;
  &lt;li&gt;a clockwork orange&lt;/li&gt;
  &lt;li&gt;close encounters of the third kind&lt;/li&gt;
  &lt;li&gt;tombstone&lt;/li&gt;
  &lt;li&gt;real genius&lt;/li&gt;
  &lt;li&gt;stripes/spies like us&lt;/li&gt;
  &lt;li&gt;Joe Versus the Volcano&lt;/li&gt;
  &lt;li&gt;dreamcatcher&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Wed, 08 Jun 2016 00:00:00 +0000</pubDate>
        <link>https://cryp7.net/2016/must-see-movies-of-all-time/</link>
        <guid isPermaLink="true">https://cryp7.net/2016/must-see-movies-of-all-time/</guid>
        
        
      </item>
    
      <item>
        <title>Favorite Quotes</title>
        <description>&lt;h1 id=&quot;this-is-a-living-document&quot;&gt;&lt;center&gt;&lt;span style=&quot;color:red&quot;&gt;This is a living document.&lt;/span&gt;&lt;/center&gt;&lt;/h1&gt;

&lt;h4 id=&quot;what-follows-is-a-list-of-my-favorite-quotes&quot;&gt;What follows is a list of my favorite quotes.&lt;/h4&gt;

&lt;h2 id=&quot;from-the-original-ida-disassembler-faq&quot;&gt;From the (original?) IDA Disassembler FAQ:&lt;/h2&gt;
&lt;blockquote&gt;
  &lt;p&gt;Q: How do I view the disassembly in C/VB etc?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;A: You must create a file called sissy.ini and add the line “LANG C=Yes”.&lt;/p&gt;

  &lt;p&gt;Jokes aside, this is not something IDA can do. The output is ASM.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Tue, 24 May 2016 00:00:00 +0000</pubDate>
        <link>https://cryp7.net/2016/favorite-quotes/</link>
        <guid isPermaLink="true">https://cryp7.net/2016/favorite-quotes/</guid>
        
        
      </item>
    
      <item>
        <title>Upgrading firmware on Cisco Small Business SG300 Series Managed Switch</title>
        <description>&lt;p&gt;Because I’ll never remember how I did this!&lt;/p&gt;

&lt;h1 id=&quot;prerequisite&quot;&gt;Prerequisite&lt;/h1&gt;

&lt;p&gt;As usual nothing is straight-forward ;)&lt;/p&gt;

&lt;h2 id=&quot;tftp-server&quot;&gt;TFTP Server&lt;/h2&gt;

&lt;p&gt;Luckily on MacOSX it’s built in :)&lt;/p&gt;

&lt;p&gt;To enable it you will need to use the following command:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Note: the -F is because it is disabled by default.&lt;/p&gt;

&lt;h2 id=&quot;firewall&quot;&gt;Firewall&lt;/h2&gt;

&lt;p&gt;Since you’re running a server make sure your firewall isn’t blocking you!&lt;/p&gt;

&lt;h1 id=&quot;download&quot;&gt;Download&lt;/h1&gt;

&lt;p&gt;https://software.cisco.com/download/navigator.html?mdfid=283009439&amp;amp;flowid=18905&lt;/p&gt;

&lt;p&gt;Note: I’ve found all the port (e.g. sg300–10 vs sg300–28p) and power (POE) variations to be the same firmware. For example, sg300–10 is the same as sg300–28p. YMMV&lt;/p&gt;

&lt;h3 id=&quot;warning-firmware-formatchanges&quot;&gt;Warning: Firmware Format Changes!&lt;/h3&gt;

&lt;p&gt;If your firmware version is &amp;lt; 1.3.7.18 (sh ver) then you need to upgrade to that first as there was a change in both the firmware and boot formats!
If you don’t you will see the following error in the web console:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;entry already exists in the Copy History table…&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And the following in the CLI or logs:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;%TFTP-A-TftpTxERROR: An error message was sent: 0 &lt;Closed by=&quot;&quot; application=&quot;&quot;&gt;&lt;/Closed&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then shell onto the switch and copy the firmware over:&lt;/p&gt;

&lt;p&gt;Note: While I love the new web interface on these switches I still do this CLI.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;switch# copy tftp://A.B.C.D/sx300_fw-1413.ros image
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally, you will need to activate the new image and reboot the switch:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;switch#sh bootv
Image  Filename   Version     Date                    Status
-----  ---------  ---------   ---------------------   -----------
1      image-1    1.3.7.18    12-Jan-2014  18:02:59   Active*
2      image-2    1.4.1.3     29-Mar-2015  16:24:16   Not active
switch#boot system image-2
switch#reload
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;cleanup&quot;&gt;Cleanup&lt;/h1&gt;

&lt;p&gt;You’re running a server and your firewall is probably disabled…&lt;strong&gt;FIXIT!&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id=&quot;tftp-server-1&quot;&gt;TFTP Server&lt;/h2&gt;

&lt;p&gt;To shutdown on MacOSX use the following:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo launchctl unload /System/Library/LaunchDaemons/tftp.plist
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;firewall-1&quot;&gt;Firewall&lt;/h2&gt;

&lt;p&gt;Close any ports opened in Prerequisites; above.&lt;/p&gt;

&lt;h1 id=&quot;references&quot;&gt;References&lt;/h1&gt;

&lt;p&gt;This blog post is just a combination of the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://aplawrence.com/MacOSX/tftp.html&quot;&gt;http://aplawrence.com/MacOSX/tftp.html&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://cmc.site11.com/2014/01/how-to-upgrade-firmware-and-boot-image-on-cisco-sg300-switch/&quot;&gt;http://cmc.site11.com/2014/01/how-to-upgrade-firmware-and-boot-image-on-cisco-sg300-switch/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Sun, 06 Dec 2015 00:00:00 +0000</pubDate>
        <link>https://cryp7.net/2015/upgrading-cisco-sg300-series-firmware/</link>
        <guid isPermaLink="true">https://cryp7.net/2015/upgrading-cisco-sg300-series-firmware/</guid>
        
        
      </item>
    
      <item>
        <title>HOWTO generate a certificate signing request (CSR)</title>
        <description>&lt;h1 id=&quot;subjectaltname-must-always-be-used-rfc-2818-4217-1-paragraph&quot;&gt;&lt;center&gt;&lt;span style=&quot;color:red&quot;&gt;subjectAltName must always be used (RFC 2818 4.2.1.7, 1. paragraph)&lt;/span&gt;&lt;/center&gt;&lt;/h1&gt;

&lt;h1 id=&quot;if-you-set-subjectaltname-you-have-to-use-it-for-all-host-names-email-addresses-etcnot-just-the-additional-entries&quot;&gt;&lt;center&gt;&lt;span style=&quot;color:red&quot;&gt;If you set subjectAltName, you have to use it for all host names, email addresses, etc.&lt;br /&gt;NOT JUST THE “ADDITIONAL” ENTRIES.&lt;/span&gt;&lt;/center&gt;&lt;/h1&gt;

&lt;blockquote&gt;
  &lt;p&gt;CN is only evaluated if subjectAltName is not present and only for compatibility with old, non-compliant software.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;As of chrome 58+ this is why you will have problems and should follow these instructions :)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1 id=&quot;doworkson&quot;&gt;DoWorkSon&lt;/h1&gt;

&lt;p&gt;Enough with the warnings…let’s get shit done!&lt;/p&gt;

&lt;h1 id=&quot;copy-opensslcnf&quot;&gt;Copy openssl.cnf&lt;/h1&gt;

&lt;p&gt;while not necessary since the openssl.cnf has the CA sections separate from the user sections, I like to get my CA setup self-contained in a directory.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;your cwd needs to be wherever you’re gonna generate. if you don’t know what that means quit now!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;Ubuntu/Debian
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cp /etc/ssl/openssl.cnf openssl-san.cnf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;RedHat/CentOS
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cp /etc/pki/tls/openssl.cnf openssl-san.cnf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Cygwin (MinGW?)
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cp /usr/ssl/openssl.cnf openssl-san.cnf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;MacOSX (El Capitan)
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cp /System/Library/OpenSSL/openssl.cnf openssl-san.cnf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;edit-openssl-sancnf&quot;&gt;Edit openssl-san.cnf&lt;/h1&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;...
[req]
req_extensions = v3_req
[v3_req]
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = server1.yourdomain.tld
DNS.2 = mail.yourdomain.tld
DNS.3 = www.yourdomain.tld
DNS.4 = www.sub.yourdomain.tld
DNS.5 = mx.yourdomain.tld
DNS.6 = support.yourdomain.tld
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;generate-the-csr&quot;&gt;Generate the CSR&lt;/h1&gt;

&lt;p&gt;My notes on generating private keys and CSR’s. (that I never remember)&lt;/p&gt;

&lt;p&gt;Used with, for example, a new HTTPS server.&lt;/p&gt;

&lt;h2 id=&quot;simultaneous-key-and-request-generation&quot;&gt;Simultaneous key and request generation&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl req -newkey rsa:4096 -nodes -keyout cryp7.net.key -out cryp7.net.csr -days 365
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-nodes&lt;/code&gt; places an &lt;em&gt;unencrypted&lt;/em&gt; copy of the private key in the server’s key file. This is typically used so that the sysadmin doesn’t need to type in the password when restarting apache; for example.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;!!!You should secure this with restrictive permissions at a minimum!!!&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Answer the prompts noting:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;CN (A.K.A Common Name) section is the name of the server (e.g. cryp7.net)&lt;/li&gt;
  &lt;li&gt;extra attributes (namely challenge password and optional company name) can be ignored by using the enter (return) key&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;setting-permissions-on-the-new-key&quot;&gt;Setting permissions on the new key&lt;/h3&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;chown root:root cryp7.net.key
chmod 0400 cryp7.net.key
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;generate-a-csr-using-an-existing-key&quot;&gt;Generate a CSR using an existing key&lt;/h2&gt;

&lt;p&gt;Used, for example, to sign your own intermediate CA certificate&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl req -new -config openssl.cnf -key private/vpn.ca.key -out vpn.ca.csr -days 1825
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;since you’re specifying the openssl.cnf, all prompts should all be defaulted as desired.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1 id=&quot;request-signing&quot;&gt;Request signing&lt;/h1&gt;

&lt;p&gt;Now send off the server.csr to your CA.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;once sent, the CSR is no longer needed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1 id=&quot;prepare-a-pkcs12-file&quot;&gt;Prepare a PKCS#12 file&lt;/h1&gt;

&lt;p&gt;Combines the public and private key in an encrypted format (symmetrical) for use with email clients, etc.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Before 2011–02–19 (needs the CA cert)
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl pkcs12 -export -in my.crt -inkey my.key -in root.pem -out my.p12
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;On or after 2011–02–19 (doesn’t need CA cert)
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl pkcs12 -export -in my.crt -inkey my.key -out my.p12
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;see-also&quot;&gt;See Also&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://cryp7.net/2015/howto-become-your-own-CA/&quot;&gt;HOWTO become your own CA&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;references&quot;&gt;References&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.g-loaded.eu/2005/11/10/be-your-own-ca/&quot;&gt;http://www.g-loaded.eu/2005/11/10/be-your-own-ca/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://wiki.cacert.org/EmailCertificates&quot;&gt;http://wiki.cacert.org/EmailCertificates&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://wiki.cacert.org/FAQ/subjectAltName&quot;&gt;http://wiki.cacert.org/FAQ/subjectAltName&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Fri, 20 Nov 2015 00:00:00 +0000</pubDate>
        <link>https://cryp7.net/2015/howto-generate-a-CSR/</link>
        <guid isPermaLink="true">https://cryp7.net/2015/howto-generate-a-CSR/</guid>
        
        
      </item>
    
      <item>
        <title>HOWTO become your own certificate authority (CA)</title>
        <description>&lt;p&gt;My notes (that I never remember) on creating a self-signed root certificate authority (CA).&lt;/p&gt;

&lt;h1 id=&quot;create-the-ca&quot;&gt;Create the CA&lt;/h1&gt;

&lt;p&gt;First, setup the standard directory structure&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mkdir ca
cd ca
mkdir certs newcerts crl requests
mkdir -m 0700 private
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;the rest of this document presumes your working directory is ca!!!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;copy-opensslcnf&quot;&gt;Copy openssl.cnf&lt;/h2&gt;

&lt;p&gt;while not necessary since the openssl.cnf has the CA sections separate from the user sections, i like to get my ca setup self contained in a directory&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;cygwin
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cp /usr/ssl/openssl.cnf ./
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;RedHat/CentOS
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cp /etc/pki/tls/openssl.cnf ./
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Ubuntu/Debian
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cp /etc/ssl/openssl.cnf ./
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;MacOSX (El Capitan)
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cp /System/Library/OpenSSL/openssl.cnf ./
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;set-opensslcnf-permissions&quot;&gt;Set openssl.cnf permissions&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;chmod 0600 openssl.cnf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;edit-opensslcnf&quot;&gt;Edit openssl.cnf&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[CA_default]
dir = .
certificate = $dir/certs/cryp7.net.ca.crt
private_key = $dir/private/cryp7.net.ca.key
[req_distinguished_name]
countryName_default = US
stateOrProvinceName_default = california
localityName_default = los angeles
0.organizationName_default = cryp7.net
organizationalUnitName_default = information assurance directorate
commonName_default = cryp7.net certificate authority
emailAddress_default = root@cryp7.net
# Extension copying option: use with caution.
copy_extensions = copy # allow SAN CSR cert generation (review v3 extensions when signing with caution!!! especially with policy_anything!)
default_md = sha512 # which message digest to use.
[v3_ca]
keyUsage = cRLSign, keyCertSign
nsCertType = sslCA,emailCA,objCA
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Setup db and serial files&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;touch index.txt
echo 01 &amp;gt; serial
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;generate-the-ca-keypair&quot;&gt;Generate the CA keypair&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl req -config openssl.cnf -newkey rsa:4096 -sha512 -x509 -extensions v3_ca -keyout private/cryp7.net.ca.key -out certs/cryp7.net.ca.crt -days 1825
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;signing-a-request&quot;&gt;Signing a request&lt;/h1&gt;

&lt;p&gt;When a request is received place the .csr file in the requests directory then execute:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl ca -config openssl.cnf -policy policy_anything -infiles requests/server.csr
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There are two default policies defined in a default openssl.cnf:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;policy_match (default) — which requires that the country, state, and organizational unit all matches and common name is supplied&lt;/li&gt;
  &lt;li&gt;policy_anything — common name is supplied&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;all other fields are optional&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;to specify a policy on the commandline use -policy policy_name&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4 id=&quot;what-this-does&quot;&gt;what this does:&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;shows you the request and asks if you would like to sign it&lt;/li&gt;
  &lt;li&gt;backup database index file (index.txt) to *.old&lt;/li&gt;
  &lt;li&gt;stores signing in database index file&lt;/li&gt;
  &lt;li&gt;creates database index attributes file (index.txt.attr)&lt;/li&gt;
  &lt;li&gt;asks for commit&lt;/li&gt;
  &lt;li&gt;backup serial to serial.old&lt;/li&gt;
  &lt;li&gt;increments the serial&lt;/li&gt;
  &lt;li&gt;stores signed certificate in newcert/NN.pem (this is the filethat should be sent back to the requester)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;using -out certs/server.crt, above, can optionally be used to pick the output path/filename&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1 id=&quot;signing-an-intermediate-ca-request&quot;&gt;Signing an intermediate CA request&lt;/h1&gt;

&lt;p&gt;While the CSR portion is the same as a regular request, signing is a little different. you must sign a CA as a CA (of course); for example:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl ca -extensions v3_ca -policy policy_anything -config openssl.cnf -infiles requests/range.cryp7.net.ca.csr
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;fingerprinting&quot;&gt;Fingerprinting&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;sha-1 (default)
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl x509 -noout -in certs/cryp7ca.crt -fingerprint
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;md5
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl x509 -noout -in certs/cryp7ca.crt -fingerprint -md5
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;sha256
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl x509 -noout -in certs/cryp7ca.crt -fingerprint -sha256
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;sha512
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl x509 -noout -in certs/cryp7ca.crt -fingerprint -sha512
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;generating-diffie-hellman-pairs-eg-for-use-with-an-openvpn-server&quot;&gt;Generating Diffie-Hellman pairs (e.g. for use with an OpenVPN server)&lt;/h4&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl dhparam -out private/dh-params.pem 2048
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;In the previous example the integer &lt;strong&gt;2048&lt;/strong&gt; is the key size and may be modified. See dhparam(1).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;performing this step is equivalent to running &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./build-dh&lt;/code&gt; in section “Generate Diffie Hellman parameters” of &lt;a href=&quot;http://www.openvpn.net/index.php/open-source/documentation/howto.html#pki&quot;&gt;Setting up your own Certificate Authority (CA) and generating certificates and keys for an OpenVPN server and multiple clients&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1 id=&quot;file-extension-definitions&quot;&gt;File extension definitions&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;key — private key&lt;/li&gt;
  &lt;li&gt;csr — certificate signing request&lt;/li&gt;
  &lt;li&gt;crt — certificate&lt;/li&gt;
  &lt;li&gt;crl — certificate revocation list&lt;/li&gt;
  &lt;li&gt;pem — base64 encoded x.509 certificate&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;see-also&quot;&gt;See Also&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://cryp7.net/2015/howto-generate-a-CSR/&quot;&gt;HOWTO generate a CSR&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;references&quot;&gt;References&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.tldp.org/HOWTO/SSL-Certificates-HOWTO/index.html&quot;&gt;http://www.tldp.org/HOWTO/SSL-Certificates-HOWTO/index.html&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.g-loaded.eu/2005/11/10/be-your-own-ca/&quot;&gt;http://www.g-loaded.eu/2005/11/10/be-your-own-ca/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://sial.org/howto/openssl/&quot;&gt;http://sial.org/howto/openssl/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://samat.org/cheat_sheets/openssl&quot;&gt;http://samat.org/cheat_sheets/openssl&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.openvpn.net/index.php/open-source/documentation/howto.html&quot;&gt;OpenVPN HOWTO&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;changelog&quot;&gt;Changelog&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;20151105 — migrated to medium&lt;/li&gt;
  &lt;li&gt;20170321 — migrated from sha1 to sha2 (sha512)&lt;/li&gt;
  &lt;li&gt;20170518 - migrated to github pages&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Thu, 05 Nov 2015 00:00:00 +0000</pubDate>
        <link>https://cryp7.net/2015/howto-become-your-own-CA/</link>
        <guid isPermaLink="true">https://cryp7.net/2015/howto-become-your-own-CA/</guid>
        
        
      </item>
    
      <item>
        <title>infected linode -&gt; vmware &amp; anti-virus that caught my in-the-wild (ITW) malware</title>
        <description>&lt;h3 id=&quot;tldr&quot;&gt;tl;dr&lt;/h3&gt;
&lt;ol&gt;
  &lt;li&gt;Get a Kaspersky free trial.&lt;/li&gt;
  &lt;li&gt;If it doesn’t slow down your system and you can live with broken exceptions (e.g. don’t scan your malware research directory) buy it immediately!&lt;/li&gt;
  &lt;li&gt;Else, get a trial of ESET (and purchase it at the end of said trial :)&lt;/li&gt;
  &lt;li&gt;If you’re too cheap to purchase AV (hey, no judgments :) then checkout Avast! or Sophos.&lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;p&gt;Recently (ok november of last year; so relatively recently ;) i had a linode that was infected by malware. i was first alerted by the excessive amount of egress traffic being used on my account; however after missing the email notification(s), and therefore exhausting my monthly transfer limit, linode’s NOC (SOC?) shutdown my instance. no fault to them; that’s exactly what i would’ve done as well. after contacting support and having a very helpful, responsive, and friendly conversation i was able to gain access to the halted instance.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;this-is-when-i-learned-two-very-important-lessons&quot;&gt;this is when i learned two very important lessons&lt;/h3&gt;

&lt;hr /&gt;

&lt;p&gt;first, i used this incident as an opportunity to (finally!) learn how to migrate a linode to a vm, but more generically &lt;strong&gt;dd&lt;/strong&gt; via &lt;strong&gt;ssh&lt;/strong&gt;. My notes are as follows:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;new virtual machine based on your linode specs (i used vmware fusion pro to create a new vm with 1GB RAM, 24GB disk NOT split into multiple files; not sure this is needed, but AWS import made this a habit)&lt;/li&gt;
  &lt;li&gt;boot into rescue disc (i used the latest kali iso)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ssh user@A.B.C.D &quot;dd if=/dev/xvda&quot; | dd of=/dev/sda&lt;/code&gt; &lt;sup id=&quot;a1&quot;&gt;&lt;a href=&quot;#f1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
  &lt;li&gt;mount /dev/sda /mnt&lt;/li&gt;
  &lt;li&gt;for i in /dev /dev/pts /proc /sys /run; do mount -B $i /mnt$i; done&lt;/li&gt;
  &lt;li&gt;chroot /mnt&lt;/li&gt;
  &lt;li&gt;update /etc/resolv.conf (i used 8.8.8.8 and 8.8.4.4; which it turned out so did the malware! N.B. DNS is often overlooked, so be careful and don’t forget you have your local ISP; not to mention OpenDNS, etc.)&lt;/li&gt;
  &lt;li&gt;yum install kernel grub2 (I was using CentOS; adjust for your package manager)&lt;/li&gt;
  &lt;li&gt;grub2-mkconfig -o /boot/grub2/grub.cfg&lt;/li&gt;
  &lt;li&gt;install grub
  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grub2-install --boot-directory=/boot /dev/sda --force&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This allowed me to get a local infected vm for further research. Luckily (for me ;) the malcode persisted and I immediately started seeing a large stream of outbound traffic (don’t forget to use bridged networking in your test lab/cyber range [or not as the case may be ;]). Further, it seemed to be a different host from before which told me it was highly likely the malcode had checked into C2.&lt;/p&gt;

&lt;p&gt;ok, so the hunt is on to find out what process. a quick look through netstat showed that ls was sending udp traffic. clearly; not normal. further, by inspecting /proc i quickly found the malcode in /boot. after copying what looked like a mktemp(3) filename off and checking it on virustotal.com i found a couple of shocking revelations…which brings me to the second lesson/teaching moment for this exercise.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;anti-virus software is not only ALIVE AND WELL; there is very little AV that &lt;em&gt;actually&lt;/em&gt; catches ITW malcode! ok, so this isn’t a shocking revelation in and of itself; nor is it surprising which vendors caught this trojan: basically the same players we’ve all seen recommended time and time again
&lt;img src=&quot;https://cryp7.net/assets/images/itw-malware-virustotal-1.png&quot; alt=&quot;itw-malware-virustotal-first&quot; /&gt;
however, the surprise (for me at least) came ~2mo later when i re-analyzed
&lt;img src=&quot;https://cryp7.net/assets/images/itw-malware-virustotal-2.png&quot; alt=&quot;itw-malware-virustotal-second&quot; /&gt;&lt;/p&gt;

&lt;p&gt;so the real story here is that only ~26% of vendors caught a known trojan 2+ months after it was publicly disclosed to exist! further, some of them are just re-bundles of the original 6 that have been “tuned” for performance.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;my take away’s from all this:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;dd via ssh — very cool!&lt;/li&gt;
  &lt;li&gt;Kaspersky and ESET NOD32 are quantified as #1 and #2 in my book for endpoint protection.&lt;sup id=&quot;a2&quot;&gt;&lt;a href=&quot;#f2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;sup id=&quot;a3&quot;&gt;&lt;a href=&quot;#f3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;sup id=&quot;a4&quot;&gt;&lt;a href=&quot;#f4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
  &lt;li&gt;The little guy is exposed, can, and will be attacked; even on modern, monitored platforms.&lt;sup id=&quot;a5&quot;&gt;&lt;a href=&quot;#f5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
  &lt;li&gt;Castle theory is dead; long live the castle mentality!&lt;/li&gt;
  &lt;li&gt;Defense in Depth is more relevant than ever. (Embrace a more modern protection methodology/approach such as immunology or policing.)&lt;sup id=&quot;a6&quot;&gt;&lt;a href=&quot;#f6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
  &lt;li&gt;Use a SIEM framework/solution; if possible.&lt;sup id=&quot;a7&quot;&gt;&lt;a href=&quot;#f7&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;–183r space cowboy&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;footnotes&quot;&gt;Footnotes&lt;/h3&gt;

&lt;p&gt;&lt;b id=&quot;f1&quot;&gt;1&lt;/b&gt;: ok so i didn’t actually test this cli. instead i followed their docs (ref: https://www.linode.com/docs/migrate-to-linode/disk-images/copying-a-disk-image-over-ssh) copied to an image file first, (WHICH TOOK FOREVER!) and then i had to copy (again!) all 24GB to the new vm created in step1. hopefully the above works and saves me (and you!) some time in the future :) &lt;a href=&quot;#a1&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b id=&quot;f2&quot;&gt;2&lt;/b&gt;: I will continue to use ESET as it has a crazy low system utilization (Kaspersky at similar settings just owned my current and previous macbook pros) &lt;a href=&quot;#a2&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b id=&quot;f3&quot;&gt;3&lt;/b&gt;: Further, Kaspersky still doesn’t handle scanning exceptions properly; where ESET NOD32 works exactly as I would expect.&lt;a href=&quot;#a3&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b id=&quot;f4&quot;&gt;4&lt;/b&gt;: Moreover, ESET claims to have never (?) missed an ITW threat; which as seen above is also my experience. While, Avast is a good free product (that works on MacOSX and Windows) as is Sophos, (free only for MacOSX)&lt;a href=&quot;#a4&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b id=&quot;f5&quot;&gt;5&lt;/b&gt;: APT? http://blog.malwaremustdie.org/2014/09/mmd-0028-2014-fuzzy-reversing-new-china.html&lt;a href=&quot;#a5&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b id=&quot;f6&quot;&gt;6&lt;/b&gt;: I like to run Sophos’s excellent and free unified threat mangement system (formerly astaro security gateway [http://www.sophos.com/en-us/products/free-tools/sophos-utm-home-edition.aspx] as my core router and therefore prefer a more robust endpoint solution; see previous comments.&lt;a href=&quot;#a6&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b id=&quot;f7&quot;&gt;7&lt;/b&gt;: I use AlienVault products as they are Open Source based but also offer commercial support and improvements.&lt;a href=&quot;#a7&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Fri, 20 Mar 2015 00:00:00 +0000</pubDate>
        <link>https://cryp7.net/2015/infected-linode2vmware-and-AV-that-caught-my-ITW-malware/</link>
        <guid isPermaLink="true">https://cryp7.net/2015/infected-linode2vmware-and-AV-that-caught-my-ITW-malware/</guid>
        
        
      </item>
    
  </channel>
</rss>
