Pesquisar este blog

sexta-feira, 19 de junho de 2015

Como colocar a data e hora no nome do arquivo (Batch/MS-DOS)

, Nesta dica rápida irei mostrar como colocar a data e a hora no nome do arquivo, usando o formato DD-MM-AAAA-HH-MM. Isso será muito útil quando você precisar criar arquivos de log e back-up.
MS-DOS
echo nomedoarquivo%date:~0,2%-%date:~3,2%-%date:~6,10%-%time:~0,2%-%time:~3,2%.txt
BASH
echo nomedoarquivo`date +%d-%m-%y-%hh-%mm`.txt

Obrigado por ler!!!
Deixe seu comentário é sempre uma motivação a mais (Ou não :b).


Retirado de : http://www.blog.dbrunonascimento.com.br/dicas-rapidas/como-colocar-a-data-e-hora-no-nome-do-arquivo-batch-ms-dos

sexta-feira, 12 de junho de 2015

MODELO DE SARG.CONF


MODELO DE SARG.CONF

#!/bin/sh
# SARG - Daily/Weekly/Monthly Squid usage reports creation tool
# Written by Ugo Viti

# ----------------------------------------------------------------------------
#
# Copyright (C) 2005 Ugo Viti
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# ----------------------------------------------------------------------------


# Thanks for enanchements to:
# - martijn
# - Stas Degteff https://sourceforge.net/users/stas_degteff/

VER=20050202

## What is this?
# sarg-reports (this file) is a simple bash script written to automate
# the SARG (a powerful squid log analyzer) reports and log management.
# Sarg it self, provide to end user a generic interface to create
# reports based on squid access log (begin of log to current date).
# sarg-reports (this script) is useful because it allow you to easly
# create and manage Daily, Weekly and Monthly reports.
# Try it, within 5 minutes you will be ready to rule :-)
# using sarg-reports is very easy, read the following 3 steps to know how

## Requirements
# a) An unix system with bash shell (like GNU/Linux, FreeBSD, etc...)
# b) Squid - http://www.squid-cache.org
# c) Sarg - http://web.onda.com.br/orso/sarg.html


##
## Installation guide and configuration parameters
##

# 1) Download Squid and Sarg, Install, Configure and Tune
#    they before continue reading

# 2) In root crontab (crontab -e) insert the following lines:
#    (the today report creation time depend mostly of your squid server
#    load average, tune it):
#
#    --- BEGIN ROOT CRONTAB ---
#    PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
#    00 08-18/1 * * * sarg-reports today
#    00 00      * * * sarg-reports daily
#    00 01      * * 1 sarg-reports weekly
#    30 02      1 * * sarg-reports monthly
#    --- END ROOT CRONTAB ---
#
#    REMEMBER: if you use logrotate, configure it to rotate the logs within MONTHLY basis,
#              AFTER sarg-reports created the monthly html report.

# 3) Customize the following variables:
#    (Please, configure accurately the sarg.conf file before)
#
#        (SARG) The sarg executable location
#      (CONFIG) The sarg main configuration file location
#     (HTMLOUT) Location where will be saved the reports
#   (PAGETITLE) The title of main index page
#     (LOGOIMG) Image logo to view in main index page
#    (LOGOLINK) HTTP web page link of logo
#       (DAILY) Word 'daily' translation, translate it to your language
#      (WEEKLY) Word 'weekly' translation, translate it to your language
#     (MONTHLY) Word 'monthly' translation, translate it to your language
# (EXCLUDELOG1) Exclude text from cron emails
#       +       (normally, sarg, during cron activity, if it don't find any valid records,
# (EXCLUDELOG2) it will output an error message (usually on 'today' reports).
#               I don't want to be warned by email about this, so, i wrote the 'text'
#               that will be never logged.
#               This is useful to receive email of real problems only (enjoy that)

#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
## Italian Language
       SARG=/usr/bin/sarg
     CONFIG=/etc/sarg/sarg.conf
    HTMLOUT=/var/www/html/admin/log/proxy
  PAGETITLE="Statistiche Proxy di $(hostname)"
    LOGOIMG=http://www.initzero.it/images/initzero-logo.jpg
   LOGOLINK=http://www.initzero.it
      DAILY=Giornaliero
     WEEKLY=Settimanale
    MONTHLY=Mensile
EXCLUDELOG1="SARG: Nessun records trovato."
EXCLUDELOG2="SARG: Fine"
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
## Russian Language
#       SARG="/usr/bin/sarg"
#     CONFIG=/etc/sarg/sarg.conf
#    HTMLOUT=/var/www/sarg-reports
#  PAGETITLE="óÔÁÔÉÓÔÉËÁ ÓÅÒ×ÅÒÁ ÐÒÏËÓÉ Squid"   # russian koi8-r
#    LOGOIMG=http://litek.ru/images/logotop.gif
#   LOGOLINK=http://litek.ru
#      DAILY="åÖÅÄÎÅ×ÎÁÑ"     # russian koi8-r
#     WEEKLY="åÖÅÎÅÄÅÌØÎÁÑ"   # russian koi8-r
#    MONTHLY="åÖÅÍÅÓÑÞÎÁÑ"    # russian koi8-r
#EXCLUDELOG1="SARG: Records in file:"
#EXCLUDELOG2="SARG: ïÔÞÅÔ ÕÓÐÅÛÎÏ ÓÇÅÎÅÒÉÒÏ×ÁÎ ×" # sarg.conf: language Russian_koi8
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


######################################################################
## The configuration is end, so don't touch anything bellow

# TEMP Files
R=$RANDOM
[ -n "$R" ] || R="$(od -An -d -N2 /dev/urandom | tr -d ' ')"
TMPFILE=/tmp/sarg-reports.$R
 ERRORS="${TMPFILE}.errors"

# Date Calc
MANUALDATE=$2
case "$(uname)" in
"FreeBSD")
         TODAY=$(date +%d/%m/%Y)
     YESTERDAY=$(date -v-1d +%d/%m/%Y)
       WEEKAGO=$(date -v-1w +%d/%m/%Y)
      MONTHAGO=$(date -v-1m +01/%m/%Y)-$(date -v-1m +31/%m/%Y)
   ;;
"OpenBSD")
         TODAY=$(date +%d/%m/%Y)
     YESTERDAY=$(date -r $((`date +%s` - 86400 )) +%d/%m/%Y)
       WEEKAGO=$(date -r $((`date +%s` - 604800)) +%d/%m/%Y)
      MONTHAGO=$(perl -e '@t=localtime(time); $y=$t[4]==0?$t[5]+1899:$t[5]+1900; $m=$t[4]==0?12:$t[4]; print "1/$m/$y-",$m==2?$y%4>0?28:29:$m==4||$m==6||$m==9||$m==11?30:31 ,"/$m/$y\n";')
   ;;
*)
         TODAY=$(date --date "today" +%d/%m/%Y)
     YESTERDAY=$(date --date "1 day ago" +%d/%m/%Y)
       WEEKAGO=$(date --date "1 week ago" +%d/%m/%Y)
      MONTHAGO=$(date --date "1 month ago" +01/%m/%Y)-$(date --date "1 month ago" +31/%m/%Y)
   ;;
esac

# Fix for Red Hat 9 systems and coreutils prior to 5.0 version
export LC_ALL=C

# Main index.html creation
create_index_html ()
{
  echo -e "\
  \n\
  \n\
  $PAGETITLE\n\
  \n\
  \n\
 
\n\
    \n\
    \n\
      \n\
        \n\
      \n\
      \n\
        \n\
      \n\
      \n\
        \n\
      \n\
      \n\
        \n\
      \n\
   
$PAGETITLE
$DAILY
$WEEKLY
$MONTHLY
\n\
 
\n\
  \n\
  " > $HTMLOUT/index.html
}


# Functions
exclude_from_log ()
{
  cat $ERRORS | grep -v "$EXCLUDELOG1" | grep -v "$EXCLUDELOG2"
  rm -f $TMPFILE*
}

manual ()
{
  DAILYOUT=$HTMLOUT/$DAILY
  mkdir -p $DAILYOUT
  create_index_html
  if [ -z "$MANUALDATE" ]
    then
      echo "No date given, please specify a valid date (DD/MM/YYYY)"
    else
      $SARG -f $CONFIG -d $MANUALDATE -o $DAILYOUT
  fi
}

today ()
{
  DAILYOUT=$HTMLOUT/$DAILY
  mkdir -p $DAILYOUT
  create_index_html
  $SARG -f $CONFIG -d $TODAY -o $DAILYOUT >$ERRORS 2>&1
  exclude_from_log
}

daily ()
{
  DAILYOUT=$HTMLOUT/$DAILY
  mkdir -p $DAILYOUT
  create_index_html
  $SARG -f $CONFIG -d $YESTERDAY -o $DAILYOUT >$ERRORS 2>&1
  exclude_from_log
}

weekly ()
{
  WEEKLYOUT=$HTMLOUT/$WEEKLY
  mkdir -p $WEEKLYOUT
  create_index_html
  $SARG -f $CONFIG -d $WEEKAGO-$YESTERDAY -o $WEEKLYOUT >$ERRORS 2>&1
  exclude_from_log
}

monthly ()
{
  MONTHLYOUT=$HTMLOUT/$MONTHLY
  mkdir -p $MONTHLYOUT
  create_index_html
  $SARG -f $CONFIG -d $MONTHAGO -o $MONTHLYOUT >$ERRORS 2>&1
  exclude_from_log
}

case $1 in
    manual)
        manual
        ;;
    today)
        today
        ;;
    daily)
        daily
        ;;
    weekly)
        weekly
        ;;
    monthly)
        monthly
        ;;
     *)
        echo "SARG - Daily / Weekly / Monthly - Squid proxy usage reports creation tool"
        echo "Written by Ugo Viti "
        echo "Version: $VER"
        echo
        echo "Usage: $0 [OPTIONS]"
        echo
        echo "Allowed options:"
        echo "    manual,  Create Manual report"
        echo "     today,  Create Today report"
        echo "     daily,  Create Daily report"
        echo "    weekly,  Create Weekly report"
        echo "    montly,  Create Monthly report"
        exit 0
esac


## HISTORY:
# 20050502 - Stas Degteff added support for non latin Charset and added support for OpenBSD
# 20030826 - FreeBSD support (thanks to martijn to let me coding on your FreeBSD server :-))
# 20030715 - Some cleanups
# 20030623 - Manual report creation
# 20030620 - Main Index creation
# 20030619 - Solved 'sort' bug on Red Hat 9 systems
# 20030618 - First Version


## TODO:
# - Smarty weekly recognition...
#   Like "begin of last week to end of last week",
#   doesn't like this script do: "7 days ago to yesterday"
# - Monthly recognition isn't so elegant (is very ugly, i know)
# - Suggestions are welcome :-)
# - If you Rotate the squid logs before sarg-reports will run,
#   it will not create any html reports
#   (TIPS: Rotate the logs after sarg-reports)




Retirado de: https://build.opensuse.org/package/view_file?file=sarg-reports&package=sarg&project=openSUSE%3AFactory


terça-feira, 21 de abril de 2015

10 maiores ferramentas de avaliação de segurança - Top 10 Security Assessment Tools

Security Assessment Tools
Modern data centres deploy firewalls and managed networking components, but still feel insecure because of crackers. Hence, there is a crucial need for tools that accurately assess network vulnerability. This article brings you the top 10 assessment tools to address these issues, categorised based on their popularity, functionality and ease of use.
Vulnerabilities are unfortunately an integral part of every software and hardware system. A bug in the operating system, a loophole in a commercial product, or the  misconfiguration of critical infrastructure components makes systems susceptible to attacks. Malicious techies can penetrate systems via these vulnerabilities, for personal or commercial gains. While technically this is not very easy, there have been enough successful attempts to cause one to worry.
Earlier, it was believed that this was true only for commercial products. Yet, lately, open source systems have been cracked, resulting in data theft and a loss of reputation or money. Apart from local area networks, websites are also vulnerable and have become the prime target of crackers. In short, vulnerabilities can be exploited from within the organisation, as well as over the Internet by unknown people.
On the bright side, with the number of attacks increasing, there are now a slew of tools to detect and stop malware and cracking attempts. The open source world has many such utilities (and distros). Here, I must mention BackTrack Linux, which has gained international fame for its wide range of vulnerability assessment and digital forensics software utilities. The most recent version also contains powerful wireless vulnerability testing tools.
Though there are literally hundreds of tools, I have selected the top 10 based on the fact that no other tool can really replace them. The primary selection criteria have been the feature set, how widespread the product is within the security community, and simplicity.
Please refer to Figure 1, which shows the top five tools I chose for network assessment, while Figure 2 shows the leading Web vulnerability scanning products. Of course, only FOSS tools are mentioned. I have presented the tools in the order that they are expected to be used to detect vulnerabilities; this should provide a systematic approach to readers who wish to make a career as certified penetration testers.
Top 5 network security scanners
Figure 1: Top 5 network security scanners
Top 5 web security scanners
Figure 2: Top 5 web security scanners

The top 5 network security assessment tools

Vulnerability scanning of a network needs to be done from both within the network as well as without (from both “sides” of the firewall). The approach I would suggest is to start from the network evaluation phase, where sniffing and primary attacks are performed. The gathered data is used in the attack phase to exploit the exposed vulnerabilities.

Wireshark

The very first step in vulnerability assessment is to have a clear picture of what is happening on the network. Wireshark (previously named Ethereal) works in promiscuous mode to capture all traffic of a TCP broadcast domain.
Customised filters can be set to intercept specific traffic; for example, to capture communication between two IP addresses, or capture UDP-based DNS queries on the network. Traffic data can be dumped into a capture file, which can be reviewed later. Additional filters can also be set during the review.
Typically, the tester is looking for stray IP addresses, spoofed packets, unnecessary packet drops, and suspicious packet generation from a single IP address. Wireshark gives a broad and clear picture of what is happening on the network.
However, it does not have its own intelligence, and should be used as a data provider. Due to its great GUI, any person with even some basic knowledge can use it.

Nmap

This is probably the only tool to remain popular for almost a decade. This scanner is capable of crafting packets and performing scans to a granular TCP level, such as SYN scan, ACK scan, etc. It has built-in signature-checking algorithms to guess the OS and version, based on network responses such as a TCP handshake.
Nmap is effective enough to detect remote devices, and in most cases correctly identifies firewalls, routers, and their make and model. Network administrators can use Nmap to check which ports are open, and also if those ports can be exploited further in simulated attacks. The output is plain text and verbose; hence, this tool can be scripted to automate routine tasks and to grab evidence for an audit report.
You can read the series of Nmap articles published earlier for better understanding.

Metasploit

Once sniffing and scanning is done using the above tools, it’s time to go to the OS and application level. Metasploit is a fantastic, powerful open source framework that performs rigorous scans against a set of IP addresses.
Unlike many other frameworks, it can also be used for anti-forensics. Expert programmers can write a piece of code exploiting a particular vulnerability, and test it with Metasploit to see if it gets detected. This process can be reversed technically — when a virus attacks using some unknown vulnerability, Metasploit can be used to test the patch for it.
While this is a commercial tool, I have mentioned it here because the community edition is free, yet makes no compromises on the feature set.

OpenVAS

The Nessus scanner is a famous commercial utility, from which OpenVAS branched out a few years back to remain open source. Though Metasploit and OpenVAS are very similar, there is still a distinct difference.
OpenVAS is split into two major components — a scanner and a manager. A scanner may reside on the target to be scanned and feed vulnerability findings to the manager. The manager collects inputs from multiple scanners and applies its own intelligence to create a report.
In the security world, OpenVAS is believed to be very stable and reliable for detecting the latest security loopholes, and for providing reports and inputs to fix them. A built-in Greenbone security assistant provides a GUI dashboard to list all vulnerabilities and the impacted machines on the network.
Creating detailed reports is one thing that makes OpenVAS a tool favoured by infrastructure security managers.

Aircrack

The list of network scanners would be incomplete without wireless security scanners. Today’s infrastructure contains wireless devices in the data centre as well as in corporate premises to facilitate mobile users. While having WPA-2 security is believed to be adequate for 802.11 WLAN standards, misconfiguration and the use of over-simple passwords leaves such networks open to attacks.
Aircrack is a suite of software utilities that acts as a sniffer, packet crafter and packet decoder. A targeted wireless network is subjected to packet traffic to capture vital details about the underlying encryption. A decryptor is then used to brute-force the captured file, and find out passwords. Aircrack is capable of working on most Linux distros, but the one in BackTrack Linux is highly preferred.

The top five Web security assessment tools

Scanning websites is an entirely different ballgame from network scans. In the case of websites, the scope of the scan ranges from Layer 2 to 7, considering the intrusiveness of the latest vulnerabilities. The correct approach for scanning websites starts from Web-level access, right up to scanning all backend components such as databases. While most Web security scanners are automated, there could be a need for manual scripting, based on the situation.

Nikto

Let’s start with this tool because of its feature set. This open source tool is widely used to scan websites, mainly because it supports HTTP and HTTPS, and also provides findings in an interactive fashion. Nikto can crawl a website just the way a human would, and that too in the least amount of time. It uses a technique called mutation, whereby it creates combinations of various HTTP tests together to form an attack, based on the Web server configuration and the hosted code.
Thus, it finds critical loopholes such as file upload misconfiguration, improper cookie handling, cross-scripting errors, etc. Nikto dumps all findings in a verbose mode, which helps in knowing more about the Web vulnerabilities, in detail. However, it can also result in too many things getting notified, some of which may be false alarms. Hence, care should be taken while interpreting Nikto logs.

Samurai framework

Once a baseline check is performed by Nikto, the next step is to take the “deep-dive” approach. Samurai is a framework — a bunch of powerful utilities, each one targeted for a specific set of vulnerabilities.
It comes as a Linux distribution, purely focusing on penetration-testing tools such as WebScarab for HTTP mapping, W3AF plugins for application-based attacks, and it also has tools to test browser-based exploits. It is amazing to note that the most recent version can find vulnerabilities that are usually not detected even by a few commercial software products.

Safe3 scanner

While the first two tools are good for static websites, for portals needing user ID and password, we need something that can deal with HTTP sessions and cookies. Safe3 scanner is a fantastic open source project, which has gained momentum and fame because it can handle almost all types of authentication, including NTLM.
It contains a Web crawler (a spider like that of search engines) capable of ignoring duplicate page scans and yet detect client-side JavaScript vulnerabilities. Safe3 scans also detect the possibility of the latest AJAX-based attacks and even report vulnerable script libraries. It comes with a user-friendly GUI and is capable of creating nice management reports.

Websecurify

Though very similar to Samurai, Websecurify also brings application-level assessment into play. In case of a large Web farm where code is maintained by a team of developers, following standards can sometimes yield insecure code like passwords mentioned in code, physical file paths in libraries, etc. Websecurify can traverse code and find such loopholes swiftly.
A nice feature is that it allows you to create screenshots of the problem areas automatically, which helps in preparing audit reports. It is one of the very few platform-independent tools and also supports mobile coding, which is helping it get more popular in the cyber-security assessment world.

SQLmap

Unless I mention a tool to detect SQL-injection attacks, this article would not be complete. Though this is a very old “first-generation” type of attack, many public websites still fail to fix it. SQLmap is capable of not just exploiting SQL-injection faults, but can also take over the database server. Since it focuses on a specific task, it works at great speed to fingerprint databases, find out the underlying file system and OS, and eventually fetch data from the server. It supports almost all well-known database engines, and can also perform password-guessing attacks. This tool can be combined with the other four tools mentioned above to scan a website aggressively.
A vulnerability assessment tool should include network scanning as well as website vulnerability exploitation. Open source software is prone to attacks too; hence, network administrators must know about the reputed scanners and use them in their daily tasks to make their infrastructure secure and stable.

By on February 22, 2012
Retirado de : http://www.opensourceforu.com/2012/02/top-10-security-assessment-tools/

quarta-feira, 15 de abril de 2015

Como instalar Moodle localmente, ou até em um Pen Drive, sem fazer nenhuma alteração em seu computador



Como instalar Moodle localmente, ou até em um Pen Drive, sem fazer nenhuma alteração em seu computador

Autor: Fábio Fontana de Souza - Publicado em


moodle_logo_transp_letterO Moodle é um ambiente virtual de aprendizagem gratuito e muito utilizado em cursos a distância em especial nos universitários, de capacitação e empresariais. Por possuir muitos recursos que devem ser corretamente configurados, professores e tutores gostariam de poder contar com um simulador do ambiente. Nesse tutorial ensinarei a instalar localmente o Moodle ou até em um pen drive com um programa inteiramente gratuito e portátil, ou seja, que dispensa instalação e que não faz nenhuma alteração em seu computador. Vou somente comentar os passos mais importantes para não dificultar a instalação.

Para instalar o Moodle em um pen drive iremos utilizar o programa USBWebserver que é um software gratuito e que dispensa instalação. Para baixá-lo clique aqui e acesse a página do desenvolvedor. Também baixe o pacote standard do Moodle clicando aqui.
Agora é descompactar as duas pastas em seu computador ou diretamente no dispositivo USB (portátil) e entrando na do USBWebserver clique em “usbwebserver.exe”.
usb2
Agora clique em Instelligen e em Taal, clique em English e depois em Opslaan para modificar o idioma para inglês, o programa será reiniciado. Pelo que vi no site do desenvolvedor tem a possibilidade de aplicar o idioma português, mas como não vamos precisar muito da interface acho mais interessante deixar em português.
usb3
Agora vamos em General e PHPMyAdmin
usb4
Será aberta essa tela em seu navegador padrão, repare que o usuário e senha a serem utilizados estão listados na própria página. Digite o usuário e senha e clique em executar.
usb5
Agora clique em Banco de Dados
usb6
Agora crie um banco de dados com as seguintes configurações:
moodle7
Volte na pasta do USBWebserver, entre na pasta root e cole a pasta descompactada do moodle.
moodle1
Em seu navegador digite o seguinte endereço:
moodle2
Pronto agora é começar a instalação: escolha o idioma, clique em Próximo:
moodle3
Clique novamente em Próximo
moodle4
Próximo
moodle5
Agora digite o nome do banco de dados que criamos (moodle) e nome do usuário (root) e senha (usbw).
moodle6
Continuar
moodle8
Vai dar esse erro mas não se desespere!
moodle9
Vamos voltar ao phpMyAdmin e clicar em Moodle
moodle10
Agora em Privilégios
moodle11
E em collation escolha utf8_unicode_ci (nas outras instalações podemos fazer isso logo na criação do banco de dados).
moodle12
Agora voltamos a página que deu erro e clicamos em recarregar.
moodle13
Clique em continuar
moodle14
Agora é só preencher os dados
moodle15
Mais uma página para preencher
moodle16
E pronto! O ambiente está liberado para todos os testes que você quiser realizar.
moodle17
Qualquer dúvida deixe um comentário.
Um forte abraço,
Fábio Fontana de Souza


Retirado de: https://dicasdofabio.wordpress.com/2012/03/07/como-instalar-moodle-localmente-ou-at-em-um-pen-drive-sem-fazer-nenhuma-alterao-em-seu-computador/
Em : 15/04/2015 - 15:08

sábado, 20 de dezembro de 2014

Word - Como Desbloquear documentos do Word Protegidos. (Remover a senha)

Tirado de:http://discipulodonada.blogspot.com.br/2014/02/como-desbloquear-documentos-do-word.html

Em: 20/12/2014


Muitas vezes nos deparamos com documentos de texto protegidos, eles podem estar no formato '.rtf'; '.doc'; '.docx' dentre outros menos conhecidos. Esta proteção normalmente é colocada em documentos que tem formulários e se deseja que apenas os dados do formulário sejam alterados, porém as necessidades mudam e volta e meia precisamos alterar algum dado deste documento.


A dica a seguir funciona perfeitamente em arquivos com a extensão '.docx', os quais são criados com o word a partir da versão 2007. Caso você tenha um arquivo '.doc' ou '.rtf', salve ele como '.docx'.

Para remover a proteção você precisará ter o programa winrar instalado em seu computador (alterar a extensão do arquivo de '.docx' para '.zip' também leva ao mesmo resultado, porém tenha certeza do que você está fazendo e que o winrar é o aplicativo padrão para abrir arquivos com extensão ".zip").

Para este exemplo vou utilizar o documento denominado teste.docx, muitos tem as extensões dos arquivos ocultas, no caso o sufixo '.docx' não aparecerá.






1º Passo: Clique com o botão direito (auxíliar) sobre o arquivo, então selecione 'Abrir Com' e depois selecione 'WinRAR'












2º Passo: Abra a pasta word.

3º Passo: Mova o arquivo settings.xml para a pasta onde está o arquivo teste.docx. Caso tenha dificuldades é só clicar sobre o arquivo settings, segurar enquanto clica e arrastar para baixo do 
arquivo teste.docx


4º Passo: Abra o arquivo com o Bloco de Notas.

Para exemplificar eu estou exibindo na imagem a seguir  a tag (trecho de código dentro do arquivo settings.xml) que deve ser removida.

5º Passo: Localize o trecho similar ao apresentado acima e apague, depois salve o arquivo. Lembre de apagar a partir do caractere 'Menor que' (<) até o primeira sequência de caracteres 'Barra e Maior que' (/>). Veja como o texto se parece dentro do bloco de notas

 6º passo: Agora é necessário mover o arquivo settings.xml que você acabou de alterar para dentro do winrar, sobrescrevendo o original.
Quando aparecer a janela do winrar apenas aperte em OK.
Abra o arquivo teste.docx normalmente, verifique se funcionou e de seu Feedback aqui no Blog.


Copiado de: http://discipulodonada.blogspot.com.br/2014/02/como-desbloquear-documentos-do-word.html
Em : 20/12/2014

Update: Segue link com dica para remover em arquivos com extensão .doc
http://jf.eti.br/como-remover-a-protecao-de-documentos-word-doc/