quinta-feira, 11 de setembro de 2008

Construindo um PDC com SAMBA (Linux) Debian

1a ETAPA – NO SERVIDOR LINUX

Instalando o Samba

apt-get install samba-common
apt-get install samba
apt-get install samba-doc
apt-get install smbclient
apt-get install smbfs

Modificando o arquivo de configuração do samba

vi /etc/samba/smb.conf

[global]
workgroup = SUAEMPRESA
netbios name = SERVIDOR
server string = PDC
interfaces = lo eth0
name resolve order = lmhosts, host, wins, bcast
encrypt passwords = yes
os level = 33
preferred master = auto
domain master = yes
local master = yes
security = user
domain logons = yes
logon script = %U.bat
max log size = 50000
logon path = \\%L\profiles\%U

[Home]
#comment = Pasta de Dados do Usuário
path = /arquivos/Publico
browseable = yes
writable = yes
create mask = 777
directory mask = 777
available = yes
valid users = artur luis

[netlogon]
path = /var/lib/samba/netlogon
read only = yes
browseable = no

[profiles]
path = /var/lib/samba/profiles
read only = no
create mask = 0600
directory mask = 0700
browseable = no

[Temp]
comment = Pasta Temporária
path = /home/Publico/Temp
browseable = yes
read only = no
writable = yes
create mask = 777
directory mask = 777
available = yes
valid users = @usuarios artur luis

[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
# Set public = yes to allow user 'guest account' to print
guest ok = yes
writable = yes
printable = yes

Vamos criar um grupo específico para os computadores

groupadd micros

Vamos agora, criar um grupo padrão para nossos usuários

groupadd usuários
groupadd Administradores

Agora, vamos adicionar as máquinas (micros) windows xp, em nosso samba:

useradd -g micros -c "Maquina de Dominio" -s /bin/false -d /dev/null micro01$
useradd -g micros -c "Maquina de Dominio" -s /bin/false -d /dev/null micro02$

smbpasswd -m -a micro01$
smbpasswd -m -a micro02$

Agora vamos adicionar nossos usuários ao nosso servidor linux

adduser --ingroup usuarios --disabled-login artur
adduser --ingroup usuarios --disabled-login luis

Agora vamos adicionar nossos usuários ao servidor samba

smbpasswd –a root
smbpasswd –a artur
smbpasswd –a luis

Agora vamos criar as pastas para o profile e para os logons

mkdir /var/lib/samba/netlogon
mkdir /var/lib/samba/profiles
chmod 775 /var/lib/samba/netlogon
chmod 1777 /var/lib/samba/profiles

Agora vamos criar uma diretiva no linux que permitirá usuários administradores no windows:

net groupmap add ntgroup="Domain Admins" rid=512 unixgroup=Administradores

Obs: Qualquer usuário que você atribuir ao grupo (no linux) Administradores, também no windows, será um usuário administrador.

Agora que nosso servidor está configurado, vamos reiniciar o serviço:

/etc/init.d/samba restart


2a ETAPA – NAS ESTAÇÕES WINDOWS XP

1) Logue-se como administrador do sistemas local.


2) Vá ao Painel de Controle, e entre no item Sistema. A tela propriedades de sistema será aberta.


3) No campo Descrição do Computador, coloque algo que descreva a máquina (opcional).


4) Clique na TAB (Nome do Computador) e no botão Alterar na parte de baixo da janela.


5) No campo nome do computador, coloque um nome de no máximo 15 caracteres para identificar a máquina na rede (lembre-se que o nome do computador deve ser criado lá no servidor linux, veja os passos onde fala a respeito do MICRO01). Como exemplo criamos a máquina MICRO01.

6) Clique em grupo de trabalho e digite o nome do grupo de trabalho na caixa de diálogo. Aquele que você criou na seção [global] do SAMBA (em nosso exemplo, foi SUAEMPRESA), note que o grupo de trabalho deve ser o mesmo citado no item workgroup = SUAEMPRESA (da seção GLOBAL).

7) Clique em OK e aguarde a mensagem confirmando sua entrada no grupo de trabalho. Será necessário reiniciar a máquina.


Após ter reiniciado, vamos agora configurar o registro para entrar no domínio, vejamos como:


8) Atualize o registro para permitir a entrada no domínio, Vá em:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\netlogon\parameters

e modifique os seguintes parâmetros:

"RequireSignOrSeal"=dword:00000000
"SignSecureChannel"=dword:00000000


9) Feito isto, vá em Painel de Controle/FerramentasAdministrativas/Diretiva de segurança local/diretivas locais/opções de segurança.

Lembre-se de estar como administrador:


10) Desative os seguintes parâmetros, para uma busca mais rápida identifique as linhas começando com Membro de domínio, desativando as linhas seguintes:

Membro de domínio: criptografar ou assinar digitalmente os dados de canal seguro (sempre)

Membro de domínio: desativar alterações de senha de conta da máquina

Membro de domínio: requer uma chave de sessão de alta segurança (Windows 2000 ou posterior)


11) Após feito isto feche a tela, e reinicie a máquina.


12) Após reiniciar a máquina, volte na tela de alteração de identificação de máquina na rede, Clique com o mouse em "Domínio" e digite o nome do domínio na caixa de diálogo (no nosso exemplo, o domínio é SUAEMPRESA).


13) Na tela seguinte, será lhe pedido o nome de usuário e senha. Entre com o root e a senha do root (senha lá do servidor linux).


OBS: O primeiro login no servidor samba (na estação windows), deve ser obrigatoriamente com o usuário root


14) Clique em OK e aguarde a mensagem confirmando sua entrada no domínio. Será necessário reiniciar a máquina após concluir este passo.

15) Pronto agora na tela de autenticação, clique em opções para escolher o domínio de sua rede. Escolha um usuário já cadastrado no Linux e no samba.

Por Artur Luis da C Silva
em 11 de setembro de 2008

sexta-feira, 5 de setembro de 2008

BackTrack 3 Final Install (Automatic !) + Dual Boot

a / Download
b/ Burn to CD, tutorial
c/ Reboot the computer to the Live CD
d/ Begin Step I, II & III :

In this example, we will be working on such a HDD :

Windows a_ : 40go ; system type : HPFS/NTFS ; partition : dev/hda1
Free Space : 120go ;

We are going to use the 120go free space in order to create a 20go partition. We will install BT3F on this new 20go partition.

BackTrack 3 Final Screenshot :

BackTrack 3 Final Screen with LILO.conf

I - Partition and Format
a/ CFDISK

Invoke cfdisk in order to create your 20 go partition :

# cfdisk

cfdisk - Partition for BackTrack 3 Final

Learn about how to use this program here :
http://en.wikipedia.org/wiki/Cfdisk
http://www.linux.org/docs/ldp/howto/IBM7248-HOWTO/cfdisk.html

Now, your hard disk might be so :

Windows__ : 40go_ ; File System : HPFS/NTFS ; partition : dev/hda1
BackTrack _: 20go _; File System : ext2 ___(__; partition : dev/hda5
Free Space : 100go ;

After having partitioned your HDD with cfdisk, you might need to reboot your computer to have read/write access over your new partition (here, dev/hda5) ! Indeed, without any reboot, you might be unable to fomat the partition to ext2 with mke2fs.

b/ MKE2FS

Use mke2fs in order to format your new partition into an ext2 File System.
In this example, we assume that BT3F will be installed on /dev/hda5.
In reality, your new partition could also be /dev/hda2, dev/hda3, etc …

Invoke this command to format /dev/hda5 to an ext2 File System :

# mke2fs /dev/hda5

mke2fs ext2 format for BackTrack 3 Final install on HDD

c/ MOUNT

We will create a folder (via mkdir) and mount (via mount) the new partition (/dev/hda5) in this new folder (mnt/backtrack).

In step II, we will use this emplacement to install BackTrack 3 Final on the HDD with the Installer which was provided with BackTrack 3 Beta.

Create your backtrack Folder and mount mnt/hd5 in it :

# cd /
# mkdir mnt/backtrack
# mount /dev/hda5 /mnt/backtrack

II - Installing BackTrack 3 Final

Now that your HDD is partitioned, you can install BT3F manually, see :
http://forums.remote-exploit.org/showthread.php?t=14751

But in this tutorial, we will install BackTrack 3 Final automatically with the Installer which was provided with BackTrack 3 Beta, since BackTrack 3 Final does not come with any installer.

a/ Download the BackTrack Installer here :
http://kin.calvin.free.fr/prgms/BT3.kmdr

b/ Launch the Installer

BackTrack 3 Beta Installer, used for BackTrack 3 Final

- Install BackTrack to : /mnt/bactrack
- Select Installation method : Real
- Do not restore Original MBR after lilo

III - Booting BT3F and configurating LILO

Now backtrack is installed on your HDD, reboot and cross your fingers. The LILO Boot menu should show up at startup but you will notice that you will be unable to boot Windows or any other OS than BackTrack.

Boot with LILO

To be able to boot Windows, you have to make changes in the etc/lilo.conf file:

# cd /
# nano /etc/lilo.conf

The main changes are indicated in green :
—————–

boot = /dev/hda
prompt
timeout =1200

change-rules
reset
vga = 792
image = /boot/vmlinuz
root = current
label = BackTrack

read-only

#Windows Boot possibility :
other = /dev/hda1
label = Windows
table = /dev/hda

—————–

Do not forget to apply the changes :

# lilo -v

IV - EXTRA

1/ Drivers
a/ Have read/write rights over NTFS via GNU/Linux
The driver is available here :
http://www.ntfs-3g.org/

b/ Have read/write rights over ext2/ext3 via Windows
The driver in available here :
http://www.fs-driver.org/

2/ FIX for slapt-get
http://download.airdump.net/air/backtrack/fix/bt3-fix.tar.gz

Locate it and decompress it in a folder :

# cd /
# cd root
# mkdir bt3-fix
# mv bt3-fix.tar.gz ./bt3-fix
# tar -zxvf ./bt3-fix/bt3-fix.tar.gz
# cd bt3-fix

Install the softwares :

# installpkg gpgme-1.1.4-i486-1.tgz
# installpkg gnupg-1.4.7-i486-1.tgz
# installpkg libassuan-1.0.1-i486-1.tgz
# installpkg slapt-get-0.9.12c-i386-1.tgz

Update slapt-get to finish proceeding the software’s installation :
slapt-get --update

For more informations about this fix:
http://airdump.net/papers/backtrack-3-slapt-get-correcting

3/ Addons (nothing to do with a Network Security Suite)

Gslapt :
# slapt-get --install gslapt

gFTP :
# slapt-get --install gftp

ImageMagick :
# slapt-get --install imagemagick

Feel free to comment here !
Read more on this blog : http://kin.calvin.free.fr/blog

BackTrack 3 Final Install (Automatic !) + Dual Boot

BackTrack 3 Final Install (Automatic !) + Dual Boot

Pour de l’aide en Français, tu peux poster un commentaire.

a / Download
b/ Burn to CD, tutorial
c/ Reboot the computer to the Live CD
d/ Begin Step I, II & III :

In this example, we will be working on such a HDD :

Windows a_ : 40go ; system type : HPFS/NTFS ; partition : dev/hda1
Free Space : 120go ;

We are going to use the 120go free space in order to create a 20go partition. We will install BT3F on this new 20go partition.

BackTrack 3 Final Screenshot :

BackTrack 3 Final Screen with LILO.conf

I - Partition and Format
a/ CFDISK

Invoke cfdisk in order to create your 20 go partition :

# cfdisk

cfdisk - Partition for BackTrack 3 Final

Learn about how to use this program here :
http://en.wikipedia.org/wiki/Cfdisk
http://www.linux.org/docs/ldp/howto/IBM7248-HOWTO/cfdisk.html

Now, your hard disk might be so :

Windows__ : 40go_ ; File System : HPFS/NTFS ; partition : dev/hda1
BackTrack _: 20go _; File System : ext2 ___(__; partition : dev/hda5
Free Space : 100go ;

After having partitioned your HDD with cfdisk, you might need to reboot your computer to have read/write access over your new partition (here, dev/hda5) ! Indeed, without any reboot, you might be unable to fomat the partition to ext2 with mke2fs.


b/ MKE2FS

Use mke2fs in order to format your new partition into an ext2 File System.
In this example, we assume that BT3F will be installed on /dev/hda5.
In reality, your new partition could also be /dev/hda2, dev/hda3, etc …

Invoke this command to format /dev/hda5 to an ext2 File System :

# mke2fs /dev/hda5

mke2fs ext2 format for BackTrack 3 Final install on HDD

c/ MOUNT

We will create a folder (via mkdir) and mount (via mount) the new partition (/dev/hda5) in this new folder (mnt/backtrack).

In step II, we will use this emplacement to install BackTrack 3 Final on the HDD with the Installer which was provided with BackTrack 3 Beta.

Create your backtrack Folder and mount mnt/hd5 in it :

# cd /
# mkdir mnt/backtrack
# mount /dev/hda5 /mnt/backtrack

II - Installing BackTrack 3 Final

Now that your HDD is partitioned, you can install BT3F manually, see :
http://forums.remote-exploit.org/showthread.php?t=14751

But in this tutorial, we will install BackTrack 3 Final automatically with the Installer which was provided with BackTrack 3 Beta, since BackTrack 3 Final does not come with any installer.

a/ Download the BackTrack Installer here :
http://kin.calvin.free.fr/prgms/BT3.kmdr

b/ Launch the Installer

BackTrack 3 Beta Installer, used for BackTrack 3 Final

- Install BackTrack to : /mnt/bactrack
- Select Installation method : Real
- Do not restore Original MBR after lilo

III - Booting BT3F and configurating LILO

Now backtrack is installed on your HDD, reboot and cross your fingers. The LILO Boot menu should show up at startup but you will notice that you will be unable to boot Windows or any other OS than BackTrack.

Boot with LILO

To be able to boot Windows, you have to make changes in the etc/lilo.conf file:

# cd /
# nano /etc/lilo.conf

The main changes are indicated in green :
—————–

boot = /dev/hda
prompt
timeout = 1200

change-rules
reset
vga = 792
image = /boot/vmlinuz
root = current
label = BackTrack

read-only

#Windows Boot possibility :
other = /dev/hda1
label = Windows
table = /dev/hda

—————–

Do not forget to apply the changes :

# lilo -v

IV - EXTRA

1/ Drivers
a/ Have read/write rights over NTFS via GNU/Linux
The driver is available here :
http://www.ntfs-3g.org/

b/ Have read/write rights over ext2/ext3 via Windows
The driver in available here :
http://www.fs-driver.org/

2/ FIX for slapt-get
http://download.airdump.net/air/backtrack/fix/bt3-fix.tar.gz

Locate it and decompress it in a folder :

# cd /
# cd root
# mkdir bt3-fix
# mv bt3-fix.tar.gz ./bt3-fix
# tar -zxvf ./bt3-fix/bt3-fix.tar.gz
# cd bt3-fix

Install the softwares :

# installpkg gpgme-1.1.4-i486-1.tgz
# installpkg gnupg-1.4.7-i486-1.tgz
# installpkg libassuan-1.0.1-i486-1.tgz
# installpkg slapt-get-0.9.12c-i386-1.tgz

Update slapt-get to finish proceeding the software’s installation :
slapt-get --update

For more informations about this fix:
http://airdump.net/papers/backtrack-3-slapt-get-correcting

3/ Addons (nothing to do with a Network Security Suite)

Gslapt :
# slapt-get --install gslapt

gFTP :
# slapt-get --install gftp

ImageMagick :
# slapt-get --install imagemagick

Feel free to comment here !
Read more on this blog : http://kin.calvin.free.fr/blog

Como obter sua chave do produto do Windows (10 ou 11) com o prompt de comando

  Se quiser obter sua chave do produto do Windows, a maneira mais fácil é fazer isso com o prompt de comando do Windows. Primeiro, pressione...