August 27th, 2007
What do you do if you want an user in your organization with the ability to change the system time and not using an administrator account.
In an Active Directory environment it can be done with a Group Policy.
Computer Configuration –> Windows Settings –> Local Policies/User Rights Assignment –> Change System Time.
You can specify specific users and or groups.
August 26th, 2007
Show your IP and network information.
‘;
echo ‘
‘;
echo $ip;
?>
August 19th, 2007
Compress a folder to a file with timestamp
tar cfvz /fil-$TIMESTAMP.tgz /etc
Postfix
If changed mail.cf, do a /etc/init.d/postfix reload
If changed /etc/postfix/virtual run this command: postmap hash:/etc/postfix/virtual
postmap /etc/postfix/transport
Copy a hard-drive
dd if=/dev/hd_originaldisk-partition of=/dev/hd_nydisk-partition
MySQL Backup
/usr/bin/mysqldump -A -uroot -p[myCode] > /andet/backup.sql
Delete a folder containing files
rm -rf /remove/this
Create an empty file
touch file-name
Disk-use of an folder
du -sh folder
Format disk
cfdisk /dev/hda
Extract tar.bz2 to a folder
tar xzf file.tar.bz2
NMAP scan to a file
nmap -sS -PT -PI -O -T 3 10.0.0.*>file.txt
Change file and folder rights
chown martin filename
chown -R martin:martin FileAndSubFolders
chmod
– user group other
– 4 2 1 4 2 1 4 2 1
– r w x r w x r w x
Boot script in Debian
/etc/rc.boot/
Remember: #!/bin/bash
on top of the text files.
Set date and time
ntpdate
Search inside files
find /www/test.local/www/ -name * | grep -lir VALID_AZ09 *
Create sources.list
http://debgen.simplylinux.ch/index.php
Show 30 largest folders
du -m /FOLDER | sort -nr | head -n 30
Size is in Megabyte
August 18th, 2007
Example 1Â – Static IP
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 10.0.0.40
netmask 255.255.255.0
gateway 10.0.0.1
Example 2 – DHCP
auto eth0 iface eth0 inet dhcp
Remember the DNS configuration in /etc/resolv.conf
nameserver 195.184.96.2
nameserver 213.173.225.86
Tips
Change (spoof) the MAC
ifconfig eth0 hw ether 01:23:45:67:89:AB
August 18th, 2007
TDC
194.239.134.83
193.162.153.164
Open DNS
208.67.222.222
208.67.220.220
—
asmtp.mail.dk
smtp.mail.dk
pasmtp.tele.dk
Cybercity
212.242.40.3
212.242.40.51
—
vip.cybercity.dk
smtp.cybercity.dk
Tiscali
212.54.64.170
212.54.64.171
—
smtp.tiscali.dk
Ventelo/Webpartner
195.184.96.2
213.173.225.86
—
smtp.ventelo.dk
August 2nd, 2007
Ever tested network speed by downloading a big file?
It could be nice to have a fast FTP server containing files in many different sizes.
On this FTP server ftptest1.tele.dk files from 0 b to 100 MB
August 2nd, 2007
By default there are two time servers in windows XP. But it is possible to use our own prefered one. Just use this command:
w32tm /config /syncfromflags:manual /manualpeerlist:ntp.webpartner.dk
(ntp.webpartner.dk) is one example of an time server.
w32tm /config /update
Activities the changes.
net stop w32time
net start w32time
w32tm /resync
This works on Windows XP and 2003.
 more info
August 2nd, 2007
One of the most common tasks is to configure a router to deliver trafic from the outside Internet to the inside LAN. How is that done on a PIX or ASA?
1.
Add the basic NAT rule that makes NAT from the outside works.
static (inside,outside) tcp interface 3389 192.168.0.10 3389 255.255.255.255 0 0
In this example Remote Desktop (port 3389) is NAT’ed to 192.168.0.10
If you want to use a different port from the outside just change the line to
static (inside, outside) tcp interface 3390 192.168.0.10 3389 255.255.255.255 0 0
port 3390 is delivered to 192.168.0.10:3389
2.
Now add an access rule that describes who has access. If everyone should have access use this line
access-list allow_inbound permit tcp any interface outside eq 3389
3.
Finally, activate the new access-list to the outside interface.Â
access-group allow_inbound in interface outside
clear xlate