Monday, September 22, 2008

win2003 AD cheat sheet =D


Some diags i like to run on Win2003 AD:


==== Diags Commands ====
Check -  c:\windows\NTDS  – ntds.dit / edb.xxx
c:\windows\SYSVOL\sysvol\domain.local — subfolders
share – NETLOGON -> c:\windows\SYSVOL\sysvol\domain.local\SCRIPTS
share – SYSVOL -> c:\windows\SYSVOL\sysvol
Check – DNS console – SRV records – _msdcs.domain.local
= nslookup
nslookup gc._msdcs
= DCDIAG /C /V       <————– TESTES ao DC —————- > NETDIAG /v /debug > netdiag.txt
= dcdiag /test: replications
dcdiag /test: topology, cutoffserver, netlogons, fsmocheck, DNS,  frssysvol, frsevent, kccevent, systemlog, RegisterInDNS,
= repadmin /replsum
= repadmin /showrepl
= = REPADMIN /SYNCALL /A /e /d /q
= = REPADMIN /SYNCALL /A /e /d /q /P
==  repadmin /replicate TargetDC SourceDC NamingContext /force
= repadmin /showconn
= repadmin /showreps
= netdom query FSMO                           == netdom /verify DSTBDC /domain:domain.local
= netdom query DC
= nltest /DSGETDC:domain.local
= dnslint /ad /s localhost /v
= dnslint /d domain.local /s 10.30.1.217 /v
explore
= dcdiag
= netdiag
= w32tm /config /syncfromflags:manual /manualpeerlist:10.1.1.1
= w32tm /config /update
= w32tm /dumpreg /subkey:parameters
= w32tm /monitor
—–Testar———— exchange “Service Principal Names” – LDAP ——————–
setspn -L “servername”
setspn -?
Netsh -  —– http://technet.microsoft.com/en-us/library/bb491071.aspx

Friday, July 11, 2008

Dnslint - Utility

The dnslint (windows 2003) utility tests various dns options.

To use it we can try the following:

> dnslint /d "domain.name" /s 10.1.1.1 /c

Explanation of the flags used:
- /d set's the domain to test
- /s flag it's used to bypass the Internic whois lookup, and use 10.1.1.1 dns
- /c flag is for testing mail servers

It can be used to test a lot more, with /ad flag it will do requests to active directory.

There is a lot more flags, do a simple
> dnslint /? |more

to see the options

Tuesday, July 1, 2008

Nessus commands

EXAMPLE
To perform a command-line scan against 192.168.0.0/24, do the following:
echo 192.168.0.0/24 > targets.txt


nessus -xq localhost 1241 yourLogin yourPassword targets.txt report.txt

Sql Server - Truncate Log Files

SQL Server:

“Clean LOG Files”

Examples:


backup log BizTalkMsgBoxDb with truncate_only

DBCC SHRINKFILE (BizTalkMsgBoxDb_log, 200)

Fazer também na Base de Dados “BizTalkDTADb”

backup log BizTalkDTADb with truncate_only

DBCC SHRINKFILE (BizTalkDTADb_log, 200)

Fazer também na Base de Dados “BizTalkMgmtDb”

use BizTalkMgmtDb

backup log BizTalkMgmtDb with truncate_only

DBCC SHRINKFILE (BizTalkMgmtDb_log, 100)

...

Etc


Examples of commands that can "help":

use BizTalkMgmtDb

backup log BizTalkMgmtDb with truncate_only

DBCC SHRINKFILE (BizTalkMgmtDb_log, 100)

use RNT_EXCEPTION;

backup log RNT_EXCEPTION with truncate_only

DBCC SHRINKFILE (DotNetNuke_log, 100)

use master;

select * from sysfiles;

select * from sysdatabases;

EXEC sp_databases;


EXEC sp_helpdb;