Archive for the ‘Networking’ Category

Enabling File Downloads in IIS

Wednesday, August 11th, 2010

To enable directory browsing and downloading in Apache, what you only need to do is enable directory browsing and make sure that the file has read access. But in IIS, you have to do an extra task, which is to identify which file extensions are allowed.

To enable file downloads, go to IIS Management Console. Look into folder properties -> HTTP Headers. Click on MIME Types and enter the file extension you want to allow.

  • Share/Bookmark

Browsing the Internet with SSH tunneling

Tuesday, March 16th, 2010

On your server:
1. Just create an SSH account.

On your client (Linux/Mac):
1. Open a terminal and key in the following,
#ssh -fND 8080 username@remoteserver.net

2. Open Firefox and go to Preferences -> Advanced -> Network -> Proxy Settings and choose “Manual proxy configuration.”

3. Put “127.0.0.1″ for the SOCKS host field and “8080″ on the corresponding port field.

4. You can now start browsing.

Optional:

5. If you want to use the DNS server of the SSH server, open Firefox and key in “about:config” at the address bar.

6. Look for “network.proxy.socks_remote_dns.” Double-click it to change the value from “false” to “true”.

7. You can now start browsing!

  • Share/Bookmark

Hardening TPC/IP in linux

Friday, November 20th, 2009

Execute the following:

sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1
sysctl -w net.ipv4.conf.all.accept_redirects=0
sysctl -w net.ipv6.conf.all.accept_redirects=0
sysctl -w net.ipv4.conf.all.send_redirects=0
sysctl -w net.ipv6.conf.all.send_redirects=0
sysctl -w net.ipv4.conf.all.accept_source_route=0
sysctl -w net.ipv4.conf.all.forwarding=0
sysctl -w net.ipv4.conf.all.rp_filter=1
sysctl -w net.ipv4.tcp_max_syn_backlog=1280
sysctl -w net.ipv4.tcp_syncookies=1
sysctl -w net.ipv4.conf.all.log_martians=1
sysctl -w net.ipv4.conf.all.mc_forwarding=0

To make it permanent, put the same line above minus the “sysctl -w ” command  in /etc/sysctl.conf

net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.conf.all.accept_source_route=0
net.ipv4.conf.all.mc_forwarding=0
net.ipv4.conf.all.rp_filter=1
net.ipv4.tcp_max_syn_backlog=1280
net.ipv4.tcp_syncookies=1
net.ipv4.conf.all.accept_redirects=0
net.ipv6.conf.all.accept_redirects=0
net.ipv4.conf.all.send_redirects=0

  • Share/Bookmark

Useful commands for displaying Network Services/Connections

Friday, November 20th, 2009

#netstat -an|awk ‘/tcp/ {print $6}’|sort| uniq -c

#netstat -anp

#lsof|grep LISTEN

  • Share/Bookmark

Killing network connections from the MS Windows command line

Thursday, June 18th, 2009

1. Show active connections using netstat:

>netstat -anb

2. Kill connection based on process ID.

>taskkill /pid <pid>

  • Share/Bookmark

LToT+eLDI, a perfect combination

Tuesday, April 7th, 2009

Last year, I was fortunate enough to have participated in two international workshops. One was entitled,” eLDI – eLearning
Development and Implementation,” sponsored by the Federal Ministry for Economic Cooperation and Development (BMZ) on behalf of the Government of the Federal Republic of Germany, implemented and supported by common sense through Inwent. The other was, “IOSN-INWENT LINUX TRAINING OF TRAINERS (LToT),” presented by the ASEAN+3 Node of the International Open Source Network and Inwent Capacity Building International, Germany in cooperation with the Information Technology Center of the National University of Laos.

LToT participants
LToT participants

The eLDI workshop started from May 24, 2008 until February 6, 2009 with a total of 300 hours,  which includes 100 hours face to face and 200 hours online. The program consists of the following basic modules: Instructional Design, Content Development, Interactivitym eLearning Technology, eLearning Management, Tutoring and Support of Virtual Learning Communities. Both face to face workshops were held in the UPOU campus, in Laguna, Philippines.

eldi
eLDI participants

The LtoT workshop was held at the Information Techonology Center of the National University of Laos in Vientiane Capital, Lao PDR from the 8th to the 19th of September 2008. The workshop was for preapringparticipants for the Linux Professional Institute Certification Level 1 (LPIC-1).  The first week covered topics on LPI 101 which are the following: Hardware and Architecture; Linux Installation and Package Management; GNU and Unix Commands; Devices; Linux Filesystems; Filesystem Hierarchy Standard; and The X Window System. The second week covered topics on LPI 102 which are the following: Kernel; Boot, Initialization, Shutdown and Runlevels; Printing; Documentation; Shells, Scripting, Programming and Compiling; Administrative Tasks; Networking Fundamentals; Networking Services;  and Security.

With the knowledge and skills I have gained from both seminars, I was able to incorporate LPI topics with my courses in a blended learning approach. Recently, I also conducted a workshop on distance learningand will hold another one this April 2009 followed by another on LPI and open source solutions.  Since I got certified with LPIC-1, there
has  been a steady demand from our students and faculty for me to hold seminars on Linux and FOSS.

Now, I’m busier and happier than ever!

  • Share/Bookmark

TCPView

Tuesday, February 17th, 2009

TCPView is a tool from Microsoft that lets you view what process owns what port. You can download it for free from http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx

  • Share/Bookmark

Automatically deny hosts from SSH brute force attacks

Friday, August 15th, 2008

1. Download denyhosts from:

http://denyhosts.sourceforge.net/

2. Extract file and follow README.txt

  • Share/Bookmark

Rsync Basic Config

Friday, August 15th, 2008

##On rsync source computer:

#vi /etc/rsyncd.conf

max connections = 2
log file = /var/log/rsync.log
timeout = 300

[pub]
comment = Squid Blocked Sites
path = /etc/squid/blockedsites
read only = yes
list = yes
uid = nobody
gid = nobody
auth users = pub
secrets file = /etc/rsyncd.secrets
hosts allow = 192.168.1.2

#vi /etc/rsyncd.secrets
pub:pub

#chmod 600 /etc/rsyncd.secrets

#vi /etc/xinetd.d/rsync
service rsync
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = –daemon
log_on_failure += USERID
}

##On Client PC:

#vi /root/rsync.password
pub

#rsync -avz -e ssh rsync://pub@192.168.1.1/pub/sites.txt /etc/squid/blockedsites/sites.txt –password-file /root/rsync.password

## Sources:

http://transamrit.net/docs/rsync/

http://www.freebsddiary.org/rsync.php

  • Share/Bookmark

Cisco NAT DHCP config

Wednesday, August 13th, 2008

Router#sh run
Building configuration…

Current configuration : 896 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router
!
!
ip subnet-zero
!
!
ip dhcp excluded-address 10.0.0.1 10.0.0.100
!
ip dhcp pool 10.0.0.0/24
network 10.0.0.0 255.255.255.0
dns-server 10.0.0.99
default-router 10.0.0.99
!
!
!
!
interface FastEthernet0/0
ip address 192.168.3.150 255.255.255.0
ip nat outside
duplex auto
speed auto
!
interface Serial0/0
no ip address
shutdown
no fair-queue
!
interface FastEthernet0/1
ip address 10.0.0.254 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface Serial0/1
no ip address
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
!
ip nat inside source list 1 interface FastEthernet0/0 overload
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.3.1
ip http server
ip pim bidir-enable
!
access-list 1 permit 10.0.0.0 0.0.0.255
!
line con 0
line aux 0
line vty 0 4
!
no scheduler allocate
end

  • Share/Bookmark