Category Archives: Miscellaneous

Enable TLS 1.1 and 1.2 in Mozilla Firefox 24.0

For you Firefox users out there here’s the way to enable TLS 1.1 and 1.2.

Mozilla Firefox 24.0 defaults to SSL 3.0 for the lowest type of encryption and TLS 1.0 as the highest type of encryption.

Type in

about:config

in the address bar and move past the warning.
Type in

security.tls.version.max

and replace the ‘1’ with ‘3’ to enable TLS 1.2.

You may also set the lowest allowed encryption menthod by doing as follows.

Type

security.tls.version.min

and replace the ‘0’ with ‘1’ to switch from SSL 3.0 to TLS 1.0.

You may also look up the reference over at Mozilla by yourself here

// CrashMAG

Creating a bootable firmware bios update iso for your Supermicro motherboard

This is a short guide in how you can create your own bootable DOS iso image so that you may upgrade the bios of your Supermicro motherboard. A short overview of the process is as follows.

    Downloading the freedos OEM CD builder
    Downloading 64-bit binaries for mkisofs.exe (Optional depending on your OS)
    Downloading the BIOS firmware
    Booting the ISO and running the BIOS update

Downloading the freedos OEM CD builder

    Go to http://www.fdos.org/bootdisks/ and download the FDOEMCD.builder.zip file.
    Extract the content to any location of your choice. I prefer to use the “extract here” option provided by tools such as 7-zip. So from here on, this folder will be referred to as “FDOEMCD”.

Downloading 64-bit binaries for mkisofs.exe

It should go without saying that you only need this step if you’re on a 64-bit Operating System.

    Go to http://smithii.com/cdrtools and download the cdtools-latest.zip.
    From this zip file, extract “mkisofs.exe” and “cygwin1.dll” and put them in your “FDOEMCD” folder. Accept the prompt for overwriting the “mkisofs.exe” file already there.

Downloading the BIOS firmware

    Go to http://www.supermicro.com/support/bios/ and download the BIOS for your particular motherboard.
    Extract the content of this .zip file into “FDOEMCD\CDROOT”.
    The ISO will be read-only so you’ll need to modify “FDOEMCD\CDROOT\AMI_2.bat” file. Remove the 2 following entries:

– REN AFUDOSU.SMC AFUDOSU.EXE
– REN AFUDOSU.EXE AFUDOSU.SMC

    Then rename AFUDOSU.smc files to an executable (.exe). I have no idea why they do it this way, but they do. And due to read-only media we’re creating it’s a no go.

Creating the ISO image

Simply run “FDOEMCD\makeiso.bat” from command prompt. And you’ll end up with fdoem.iso in this folder.

Booting the ISO and upgrading the BIOS

Boot the iso using your preferred choice, most likely being IPMI. Run the following

ami_2.bat <your bios binary file>

Wait until it is done and reboot.

// CrashMAG

Fix host network issues with VMWare Workstation or Virtual Box using bridged networking

If you’ve ever experienced temporary loss of connectivity or other weird issues when you run virtual machines in VMWare Workstation and/or Virtual Box then you’re in for a treat. The issue is to my knowledge specific to Intel network cards. I’m not sure how relevant it is but I was running Windows 7 SP1 64-bit with the most recent drivers at the time when I started noticing the issue.

This is about two modes that you can set via the registry for your network card to fix the issue. What you need to use depends on your network card.

Allow tagged frames to be passed to your packet capture software by going into the registry and either add a registry dword and value or change the value of the registry key. The registry change required is determined by the driver in use

Registry Key          Adapter Driver
MonitorModeEnabled    e1g, e1e, e1y
MonitorMode           e1q, e1k, e1c, e1d, ixe, ixn, ixt

To solve my issue with my Intel PRO/1000 PT Dual Port Server card I added the DWORD key “MonitorMode” to the following registry path

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0007

with a value of “2” to fix my issue. Note: Due to my dual port adapter I had two entries for my 1 physical network card.

Anyways, head on over to the Intel support article for a detailed description on how to correct this issue for yourself.

Good luck!

// CrashMAG

Testing SMTP, POP3 and IMAP protocol access

This article assumes you have access to telnet and openssl. The example tests have been run against a Microsoft Exchange 2010 server. The IP and hostname have been obfuscated. The commands needed to perform these protocol access tests will be the same on both Linux and Windows.

Testing SMTP

Test using plain text

Execute the following command to initiate a plain text connection over port 25.

telnet smtp.server.com 25

Example output

The following is the typical output you’ll see as a response from a SMTP server. In this case being Microsoft Exchange 2010.

Trying 74.161.5.111...
Connected to smtp.server.com.
Escape character is '^]'.
220 smtp.server.com Microsoft ESMTP MAIL Service ready at Thu, 3 May 2012 13:06:21 +0200

Test using an encrypted connection

Execute the following command to initiate an encrypted connection over port 25.

openssl s_client -starttls smtp -crlf -connect smtp.server.com:25

Parameters

Beneath you’ll see the documentation for the parameters used in the above example.

-starttls protocol
send the protocol-specific message(s) to switch to TLS for communication.  protocol is a keyword for the intended protocol.  Currently, the only supported keywords are "smtp", "pop3", "imap", and "ftp".
-crlf
this option translated a line feed from the terminal into CR+LF as required by some servers.

Example output

There’s little to see here mainly because I had to exclude the certificate verification information to anonymize the test server.

<certificate verification output>
250 CHUNKING

Tip: You may run the usual SMTP commands directly from the command prompt after you initiated the encrypted connection.

Testing IMAP

Test using plain text

Execute the following command to initiate a plain text connection over the standard IMAP port 143.

telnet imap.server.com 143

Example output

The following is the typical output you’ll see as a response from an IMAP server. In this case being Microsoft Exchange 2010.

Trying 74.161.5.111...
Connected to imap.server.com.
Escape character is '^]'.
* OK The Microsoft Exchange IMAP4 service is ready.

Test using an encrypted connection

openssl s_client -connect imap.server.com:993

Example output

<certificate verification output>
* OK The Microsoft Exchange IMAP4 service is ready.

Testing POP3

Test using plain text

telnet pop.server.com 110

Example output

The following is the typical output you’ll see as a response from a POP server. In this case being Microsoft Exchange 2010.

Trying 74.161.5.111...
Connected to pop.server.com.
Escape character is '^]'.
+OK The Microsoft Exchange POP3 service is ready.

Test using an encrypted connection

openssl s_client -connect pop.server.com:995

Example output

<certificate verification output>
+OK The Microsoft Exchange POP3 service is ready.

References

SMTP – Simple Mail Transfer Protocol
IMAP – INTERNET MESSAGE ACCESS PROTOCOL
POP 3 – Post Office Protocol – Version 3
The OpenSSL Project

// CrashMAG

Creating a bootable USB to install Windows 7 or Windows Server 2008 R2

This will quickly run through the steps necessary to create a bootable USB to install Windows 7 or Windows 2008 R2. Most likely adaptable for Windows Vista & Windows Server 2008 as well.

Required to proceed

  • USB Flash Drive (4.5GB+).
  • Windows 7 or Windows 2008 R2 installation medium.
  • Computer already running Windows 7 or Windows 2008 R2.

Step 1 – Formatting and creating a boot partition on the USB flash drive

  • Plug in your USB Flash Drive.
  • Open a command prompt as administrator (Right click on Start > All Programs > Accessories > Command Prompt and select “Run as administrator”.
  • Find the drive number of your USB Drive by typing the following into the Command Prompt window, “diskpart”.
  • DISKPART> list disk

    The number of your USB drive will listed. You’ll need this for the next step. I’ll assume that the USB flash drive is disk 1. Format the drive by typing the next instructions into the same window. Replace the number “1” with the number of your disk below.

    DISKPART> select disk 1
    DISKPART> clean
    DISKPART> create partition primary
    DISKPART> select partition 1
    DISKPART> active
    DISKPART> format FS=NTFS QUICK
    DISKPART> assign
    DISKPART> exit
    

    Your drive is now formatted and marked bootable.

    Step 2 – Copy the files from the Windows 7/Windows 2008 R2 ISO over to the USB stick

    Start up cmd.exe again or use Windows Explorer to perform the same action. I prefer robocopy for this. Drive D is the mounted ISO image. Drive E is the bootable USB stick.

    robocopy D:\ E:\ /MIR

    Parameter reference

    /MIR :: MIRror a directory tree (equivalent to /E plus /PURGE).

    Step 3 – Make the USB flash drive bootable

    • Insert your Windows 7 or Windows 2008 R2 DVD into your drive.
    • Open a command prompt as administrator (Start > All Programs > Accessories > Command Prompt and select “Run as administrator”.
    • Change your directory to the DVD’s boot directory where bootsect.exe is located.
    E:
    cd E:\boot
    

    Use bootsect to set the USB as a bootable NTFS drive. I’m assuming that your USB flash drive has been labeled disk E:\ by your computer.

    bootsect.exe /nt60 e:

    You can now close the command prompt window.

    Step 4 – Use the USB flash drive to install your chosen operating system

    Now you can either enter the BIOS commonly by pressing “F2” on boot and choose “USB HDD” as your first boot medium. Or press “F12” and select the USB flash drive interactively.

    At this point you can run through the installation as you ordinarily would.

    // CrashMAG

Git Cheat Sheet

This is just a short cheat sheet for useful Git commands.

Create

Clone an existing repository

$ git clone ssh://user@domain.com/repo.git

Create a new local repository

$ git init

Local changes

Changes in your working directory

$ git status

Changes to tracked files

$ git diff

Add all current changes to the next commit

$ git add .

Add changes in <file> to the next commit

$ git add -p <file>

Commit all local changes in tracked files

$ git commit -a

Commit previously staged changes

$ git commit

Change the last commit

$ git commit --amend

Commit history

Show all commits, starting with the newest one

$ git log

Show changes over time for a specific file

$ git log -p <file>

Who changed what and when in <file>

$ git blame <file>

Branches & tags

List all existing branches

$ git branch

Switch HEAD branch

$ git checkout <branch>

Create a new branch based on your current HEAD

$ git branch <new_branch>

Create a new tracking branch based on a remote branch

$ git branch --track <new_branch> <remote_branch>

Delete a local branch

$ git branch -d <branch>

Mark the current commit with a tag

$ git tag <tag_name>

Update & publish

List all currently configured remotes

$ git remote -v

Show information about a remote

$ git remote show <remote>

Add new remote repository, named <remote>

$ git remote add <remote> <url>

Download all changes from <remote>, but don‘t integrate into HEAD

$ git fetch <remote>

Download changes and directly merge/integrate into HEAD

$ git pull <remote> <branch>

Publish local changes on a remote

$ git push <remote> <branch>

Delete a branch on the remote

$ git push <remote> :<branch>

Publish your tags

$ git push --tags

Merge & rebase

Merge <branch> into your current HEAD

$ git merge <branch>

Rebase your current HEAD onto <branch>
Do not rebase published commits!

$ git rebase <branch>

Abort a rebase

$ git rebase --abort

Continue a rebase after resolving conflicts

$ git rebase --continue

Use your configured merge tool to solve conflicts

$ git mergetool

Use your editor to manually solve conflicts and (after resolving) mark file as resolved

$ git add <resolved_file>
$ git rm <resolved_file>

Undo

Discard all local changes in your working directory

$ git reset --hard HEAD

Discard local changes in a specific file

$ git checkout HEAD <file>

Revert a commit (by producing a new commit with contrary changes)

$ git revert <commit>

Reset your HEAD pointer to a previous commit… and discard all changes since then

$ git reset --hard <commit>

…and preserve all changes as unstaged changes

$ git reset <commit>

…and preserve uncommitted local changes

$ git reset --keep <commit>

References

http://www.git-scm.com
http://help.github.com/

// CrashMAG

How you tell Firefox 4 to open links in a new tab instead of a new window

There’s so little useful information on the matter so I’ve decided to post about it. And the default option under Preferences -> Tabs called “Open new windows in a new tab instead” does not work. I have no idea why, and I’m embarrassed on behalf of Mozilla that it doesn’t. However here’s how you fix it.

This is what you have to do to have Firefox 4 open your links in a new tab instead of a new window.

1. In your URL bar enter “about:config”.
2. Accept the prompt.
3. Search up the line

browser.link.open_newwindow.restriction

4. Change the default value “2” to “0”.

Once you’ve set it to “0” it will immediately work.

Further refrence can be found here http://kb.mozillazine.org/About:config_entries

// CrashMAG