How to hack a password protected Word document

If you need to edit a Word 2010 document that has been protected against a editing with a password, all you have to do is this.

  • Save the document as an XML file
  • Open the XML file in Notepad or any other text editor
  • Look for the code that looks something like this:

w:documentProtection w:edit=”forms” w:enforcement=”1″ w:cryptProviderType=”rsaFull” w:cryptAlgorithmClass=”hash” w:cryptAlgorithmType=”typeAny” w:cryptAlgorithmSid=”4″ w:cryptSpinCount=”100000″ w:hash=”QtaIYzaqdsNY6+rDiZireRTIcR0=” w:salt=”Nm32FUBbspiQM+Rpm9VWIg==”

  • Delete it
  • Save the changes to the XML file
  • Open the XML file again in word, and save it as a word file again

It should also work in other versions of Word, but I only tested it with 2010 files

Men are like Bluetooth women are like Wifi

MILF – Moro Islamic Liberation Front

I suspect very few westerners think of a militant Islamist group when they hear the acronym MILF, but there is in fact a group in the Philippines called the Moro Islamic Liberation Front, or MILF for short.

To be fair the group probably thought up the name before the other more well known meaning of MILF came to be. The group was formed in 1981 when some members seperated from the Moro National Liberation Front group.

I highly recommend bringing up this group in serious discussions. It is very entertaining to watch peoples reactions when you keep saying milf during a serious discussion about politics, religion, terror or other important subjects

If you try to Google MILF the first million results will be anything but the Moro Islamic Liberation Front, so here is the links to the Wikipedia page about the MILF group as well as the more popular meaning of the acronym

The group: http://en.wikipedia.org/wiki/Moro_Islamic_Liberation_Front
The other thing: http://en.wikipedia.org/wiki/MILF_(slang)

Ajax.php causing high load on the server

If you are running a wordpress blog you might experience a very high number of “hits” to “/wp-admin/admin-ajax.php”. This can cause a very high load on the server, and if you are running your blog on a shared hosting platform, your hosting provider might even disable the script.
To resolve this you can make the changes below to ensure the script exits quickly if no action is supplied with the file request.

Change this
15 define(‘WP_ADMIN’, true);
16
17 require_once(‘../wp-load.php’);
18
19 if ( ! isset( $_REQUEST['action'] ) )
20 die(‘-1′);
21
22 require_once(‘./includes/admin.php’);

To This
15 define(‘WP_ADMIN’, true);
16
17 if ( ! isset( $_REQUEST['action'] ) )
18 die(‘-1′);
19
20 require_once(‘../wp-load.php’);
21
22 require_once(‘./includes/admin.php’);

For more info see this page: http://core.trac.wordpress.org/changeset/15606

or this http://wordpress.org/support/topic/wp-adminadmin-ajaxphp-with-some-27767-hits-on-this-file

WordPress post expire or category change

I have found the following plugins for wordpress that will enable an expiration date on a wordpress post. Some can also change the category, or at least be modified to add that functionality.

None of these are perfect so if you know of a better way to automatically change posts category on a certain date, please comment.

“Auto Delete Post” can, despite the name be setup to change the category instead… without changing any code.

“Post Expirator” can only delete the post, or set the status to Draft, however according to this forum post, a simple code change will enable category change.

“Atropos” Will also only delete the post, however here is modified version that will allow category change.

Customize exchange 2010 theme

To create your own theme for Microsoft Exchange 2010 you can copy the files from one of the existing themes and customize them to you liking. And easy way to do it is to copy the theme that most resembles your desired outcome, end then simply customize the header image, and preview thumbnail.

When you are done simply create a new folder in the themes directory and copy your customized theme.

The theme file can be found in here “…\V14\Client Access\OWA\<version number>\themes”

E.g. “C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\Owa\14.1.218.13\themes”

You can also customize the sign-in and sign-out pages which can be found here:

“\V14\Client Access\OWA\<version number>\themes\resources”

More info here: http://technet.microsoft.com/en-us/library/ee633483.aspx

Set default theme in Exchange 2010 OWA

In exchange 2010 SP1 users can set their own theme. To globally set the default theme run this cmdlet

“set-owavirtualdirectory “owa (default web site)” –defaultTheme mytheme”

Note that if a user has already applied a theme, the theme applied globally will not alter their choice.

More info: http://technet.microsoft.com/en-us/library/ff459257.aspx


Redirect exchange 2010 OWA URL

The best way to redirect exchange 2010 OWA is to use the HTTP Redirection feature in IIS. Note that for this to work you also need to disable SSL on the default website. Be aware that whenever you make changes to settings on the default web site, IIS will push them down to any virtual directory below which does not explicitly set that setting itself.

To setup the redirect do this:

  • Select the Default Web Site in IIS Manager, and open the HTTP Redirect option under IIS.
  • Select the Redirect requests to this destination check box and type the absolute path of the /owa virtual directory, e.g. https://mail.contoso.com/owa.
  • Under Redirect Behavior, select the Only redirect requests to content in this directory (not subdirectories) check box.
  • In the Status code list, click Found (302).

Now you need to remove the enforced redirect from each of the virtual directories under the Default Web Site. Select HTTP redirect of each virtual directory individually, and uncheck the “Redirect requests to this destination” checkbox. You’ll need to do this on the following virtual directories:

  • aspnet_client
  • Autodiscover
  • ecp
  • EWS
  • Microsoft-Server-ActiveSync
  • OAB
  • PowerShell
  • RpcWithCert

Next you have to disable SSL on the default website. Again you have to be careful as the SSL setting on the default web site will be inherited down to any virtual directory below which does not explicitly set that setting itself.

To disable SSL for the Default Web Site open the SSL Settings properties and uncheck the Require SSL checkbox.

Now you have to check the “Require SSL” for the following virtual directories:

  • Autodiscover
  • ecp
  • EWS
  • Microsoft-Server-ActiveSync
  • OAB
  • owa
  • Rpc
  • RpcWithCert

For all the changes to take effect, open a Command Prompt window, and then type iisreset /noforce to restart IIS.

Resources:

http://technet.microsoft.com/en-us/library/aa998359.aspx

http://briandesmond.com/blog/redirecting-owa-urls-in-exchange-2010/

Automatically redirect exchange 2003 users from exchange 2010 CAS

If a users mailbox is located on Exchange 2003 the Exchange 2010 CAS can silently redirect the user’s browser session to https://legacy.contoso.com/exchange using a hidden FBA form with the fields populated. OWA will return a small web page containing a hidden form with the same information as what the user had originally submitted to CAS2010 FBA page (username, password, public/private selector, URL to redirect to after logon) and a submit URL synthesized from The Exchange2003URL property defined on the CAS2010 OWA virtual directory, and target Exchange -specific path and query string. The web page will also contain script to automatically submit the form as soon as it is loaded. This is the last part of the logon process that CAS2010 will have a role in. Afterwards, no remnant of the user session should stick around.

FE2003 will consume that hidden form’s data, authenticate the user and proxy the request to the Exchange 2003 mailbox server and provide the data view back to the user. The response will contain an FBA cookie for the legacy namespace, and from that point on all user activity within the session will go to the legacy FE only.

To set the the exchange2003URL property on the exchange 2010 OWA virtual directory run the following in EMS:

Set-OwaVirtualDirectory “owa (Default Web Site)” -Exchange2003Url “https://exch2003.mydomain.com/exchange”

Resources:

http://msexchangeteam.com/archive/2009/12/02/453367.aspx

http://social.technet.microsoft.com/Forums/pl-PL/exchange2010/thread/ea850adc-f0c4-476d-8043-699d8bbe1506

Adsense shortcode

To embed AdSense anywhere in posts or pages using a shortcode:
Open the functions.php file in your theme and paste the following code. Don’t forget to modify the JavaScript code with your own AdSense code!

[sourcecode]
function showads() {
return ‘<div id="adsense"><script type="text/javascript"><!–
google_ad_client = "pub-XXXXXXXXXXXXXX";
google_ad_slot = "4668915978";
google_ad_width = 468;
google_ad_height = 60;
//–>
</script>

<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>’;
}

add_shortcode(‘adsense’, ‘showads’);
[/sourcecode]

Once you have saved functions.php, you can use the following shortcode to display AdSense anywhere on your posts and pages:

[sourcecode][adsense][/sourcecode]

The AdSense code is wrapped with an adsense div element, so you can style it the way you want inusing style.css file.