Nmap Tips

Scan the UDP port: nmap -sU -p 3478 192.168.1.25   http://www.cyberciti.biz/networking/nmap-command-examples-tutorials/   Or this:   $ nc -vnzu <IP> <PORT> found 0 associations found 1 connections: 1: flags=82<CONNECTED,PREFERRED> outif (null) src <SOURCE IP> port <SOURCE PORT> dst <DEST IP> port <DEST PORT> rank info not available

Personel backup data with robocopy

Create an autobat file and add to your window schedule then let it auto run with logging: @echo off setlocal set dateStamp=%DATE:~-4%%DATE:~4,2%%DATE:~7,2% set scriptPath=C:\roboBackup set logPath=C:\roboBackup\log set backupSource=D:\Data set backupDestination=”\\backup\phong\BACKUP” @REM *** START: Turns logging on *** if “%~1” == “NOWLOGGING” goto NowLogging set SchedulesLogFile=%logPath%\%~n0 – %date:/=-%.txt %0 “NOWLOGGING” > “%SchedulesLogFile%” 2>&1 rem Disable logging […]

Adding a windows 7 computer to a domain from Powershell

http://community.spiceworks.com/topic/362643-adding-a-windows-7-computer-to-a-domain-form-cmd http://community.spiceworks.com/scripts/show/1540-join-computer-to-domain-with-powershell-one-click-method Description: This is a simple little (not super secure) Powershell script used to join computers to domains locally. Modify the $password, $username, and $domain variables to suit your needs. Source Code Important Note: This script has not been checked by Spiceworks. Please understand the risks before using it. $domain = “myDomain” $password = […]

Some command check fail2ban

Some command check fail2ban: tailf /var/log/fail2ban.log fail2ban-client status apache fail2ban-client status pure-ftpd fail2ban-client status wordpress awk ‘($(NF-1) = /Ban/){print $NF}’ /var/log/fail2ban.log | sort | uniq -c | sort -n zgrep -h “Ban ” /var/log/fail2ban.log* | awk ‘{print $NF}’ | sort | uniq -c zgrep -c 61.160. /var/log/fail2ban.log* iptables -vnL INPUT –line-numbers

System: Monitoring the fail2ban log

http://www.the-art-of-web.com/system/fail2ban-log/ 1. Format of the Logfile At the simplest logging level, entries will appear in /var/log/fail2ban.log as follows (fail2ban version 0.8.3): … 2006-02-13 15:52:30,388 fail2ban.actions: WARNING [sendmail] Ban XXX.66.82.116 2006-02-13 15:59:29,295 fail2ban.actions: WARNING [sendmail] Ban XXX.27.118.100 2006-02-13 16:07:31,183 fail2ban.actions: WARNING [sendmail] Unban XXX.66.82.116 2006-02-13 16:14:29,530 fail2ban.actions: WARNING [sendmail] Unban XXX.27.118.100 2006-02-13 16:56:27,086 fail2ban.actions: WARNING [ssh] […]

How to Migrate Your Microsoft Active Directory Users to Simple AD

http://blogs.aws.amazon.com/security/post/Tx16AWCSDUNQCES/How-to-Migrate-Your-Microsoft-Active-Directory-Users-to-Simple-AD AWS Directory Service allows you to create a standalone, highly available AWS-managed directory called Simple AD in a matter of minutes. With Simple AD, you can centrally manage user accounts and group memberships for Amazon EC2 instances joined to a domain. It also allows you to use a single set of credentials to log […]

Replace new lines with a comma delimiter with Notepad++

http://stackoverflow.com/questions/15740853/replace-new-lines-with-a-comma-delimiter-with-notepad Open the find and replace dialog (press CTRL+H). Then select Regular expression in the ‘Search Mode’ section at the bottom. In the Find what field enter this: [\r\n]+ In the Replace with: ,  There is a space after the comma. This will also replace lines like Apples Apricots Pear Avocados Bananas Where there are […]