Showing posts with label Commands. Show all posts
Showing posts with label Commands. Show all posts

Friday, 23 January 2015

How to add Proxy ARP in Checkpoint local.arp file?

The best way to add a proxy arp is as follows:

1) Login to the gateway(s) that requires the proxy arp.
2) Use the following command to add an arp to the local.arp file. This will append new arps for you without having to use Vi.

echo “192.168.1.2 AA:BB:CC:DD:EE” >> $FWDIR/conf/local.arp

Make sure that the mac address you use is from the physical gateway. For instance in a HA Active/Standy cluster xl setup you will need to use the MAC from each clusters’ interface respectively.

Push the policy after you add the arps.

You only need a route for the NAT address if you dont have “translate destination on client side enabled”

Thursday, 22 January 2015

Command Line Syntax for Secure Copy (scp)

Copy the file "foobar.txt" from a remote host to the local host

$ scp your_username@remotehost.edu:foobar.txt /some/local/directory

Copy the file "foobar.txt" from the local host to a remote host

$ scp foobar.txt your_username@remotehost.edu:/some/remote/directory

Copy the directory "foo" from the local host to a remote host's directory "bar"

$ scp -r foo your_username@remotehost.edu:/some/remote/directory/bar

Copy the file "foobar.txt" from remote host "rh1.edu" to remote host "rh2.edu"

$ scp your_username@rh1.edu:/some/remote/directory/foobar.txt \
your_username@rh2.edu:/some/remote/directory/

Copying the files "foo.txt" and "bar.txt" from the local host to your home directory on the remote host

$ scp foo.txt bar.txt your_username@remotehost.edu:~

Copy the file "foobar.txt" from the local host to a remote host using port 2264

$ scp -P 2264 foobar.txt your_username@remotehost.edu:/some/remote/directory

Copy multiple files from the remote host to your current directory on the local host

$ scp your_username@remotehost.edu:/some/remote/directory/\{a,b,c\} .
$ scp your_username@remotehost.edu:~/\{foo.txt,bar.txt\} .

scp Performance

By default scp uses the Triple-DES cipher to encrypt the data being sent. Using the Blowfish cipher has been shown to increase speed. This can be done by using option -c blowfish in the command line.

$ scp -c blowfish some_file your_username@remotehost.edu:~

It is often suggested that the -C option for compression should also be used to increase speed. The effect of compression, however, will only significantly increase speed if your connection is very slow. Otherwise it may just be adding extra burden to the CPU. An example of using blowfish and compression:

$ scp -c blowfish -C local_file your_username@remotehost.edu:~

How to change the Keyboard-layout in Checkpoint running on SPLAT

edit the /etc/sysconfig/keyboard file, for standard US keyboard, it should look like this:

KEYBOARDTYPE="pc"
KEYTABLE="us"

Note: If the file doesn't exist it can be created

Wednesday, 20 August 2014

A-Z Of Handy Linux Commands

apropos: Search through the Help manual pages
apt-get: Install and search for software packages
aspell: Spell checker
awk: It lets you find text and replace it

basename: Strips suffixes off files and directories
bash: GNU Bourne-Again Shell
bc: Arbitrary precision calculator language
bg: Sends to the background
break: Exit from a loop
builtin: Run a shell builtin
bzip2: Compresses or decompresses files

cal: Displays calendar
case: Perform a command conditionally
cat: Displays the content of the files after concatenation
cd: Change Directory
cfdisk: Partition table manipulator
chgrp: Changes the ownership of a group
chmod: Changes the access permissions
chown: Changes the owner and group of a file
chroot: Run a command, but with a different root directory
cksum: It displays the CRC checksum ad byte counts
clear: Clears the terminal screen
cmp: Compares two files
comm: Compares two sorted files line by line
continue: Resumes the next iteration of a particular loop
cp: Makes a copy of files to a different location
cron: Executes scheduled commands
crontab: Schedules a command that will run at a specified time
csplit: Splits a file into context-determined pieces

date: Changes the date and time
dc: Desk Calculator
ddrescue: Disk recovery tool
declare: Declares the variables and gives attributes
df: Gives the free space on your disk
diff: Prints the differences between two files
dig: Looks up the DNS
dir: Lists directory contents briefly
dirname: Changes a full pathname into just a path
dirs: Shows you the list of directories that are remembered
du: Get an estimation of the file space usage

echo: Displays message on the screen
egrep: Searches for files that have lines matching an extended expression
enable: Disable/enable bulletin shell commands
ethtool: Ethernet card settings
eval: Evaluates many commands
exec: Executes a command
exit: Exiting the shell
expand: Converts all the tabs to spaces
export: Sets an environment variable
expr: Evaluates expressions

false: Do nothing, unsuccessfully
fdformat: Perform low level format of a floppy disk
fdisk: Partition table manipulator for Linux systems
fg: Sends a task to the foreground
fgrep: Searches through files for tasks that match a string
file: Determines the file type
find: Find files that match a desired criteria
fmt: Reformats paragraph text
fold: Wraps text in order to fit a certain width
format: Formats tapes/disks
free: Reveals the memory usage
fsck: Checks the consistency of the file system and repairs it
fuser: Identifies and kills the process accessing a file

gawk: Finds text within files and replaces it
getopts: Parse positional parameters
grep: Searches in files for lines matching a certain pattern
groupadd: Adds security user groups
groupdel: Deletes a certain group
groupmod: Modifies a group
groups: Prints the names of groups in which a user is located
gzip: Compresses/decompresses files

hash: Complete pathname of a name argument
head: Outputs the first part of files
history: Command History
hostname: Print/set system name

iconv: Converts the character set in files
id: Displays the group ids/user ids
if: Conditional command
ifconfig: Configures network interfaces
ifdown: Stops a network interface
ifup: Starts a network interface app
import: Captures a screen and saves image in X server
Install: Sets attributes and copies files

jobs: Lists jobs that are active
Join: Joins lines on a common field

kill: Stops a process from running
Killall: Kills processes by name

less: Displays the output on a single screen at a time
let: Performs arithmetic on shell variables
link: Creates a link to another file
ln: Creates a symbolic link to another file
local: Creates variables
locate: Finds files
logname: Print the login name being used currently
logout: Use this command to exit a login shell.
lpc: Line Printer Control
lpr: Offline print
lprint: Prints a file
lprintd: Aborts an ongoing print job
lprintq: Lists the print queue
lprm: Removes the jobs from the print queue

make: Recompiles the group of programs
man: Provides help on a command
mkdir: Creates directories
mkfifo: Makes FIFOs
mknod: Creates character special files or block files
more: Displays the output in a single screen at a time
mount: Mounts a particular filesystem
mtools: Manipulates files from MS-DOS
mtr: Network diagnostics command
mv: Moves and renames files and directories
mmv: Mass Move and Rename

netstat: Provides information on networking
nice: Sets the priority of a job or a command
nl: Writes files and number lines
nohup: Runs a command not affected by hangups
notify-send: Sends desktop notifications
nslookup: Queries internet name servers interactively

open: Opens a file in its default application
op: Provides operator access

passwd: Modifies user passwords
paste: Merges lines in files
pathchk: Checks the portability of a file name
ping: Tests network connections
pkill: Stops processes from running
popd: Restores the previous value of the directory you’re currently in
pr: Prepares your files for printing
printcap: Printer capability database
printenv: Print environment variables
printf: Formats and prints data
ps: Process Status
pushd: Changes the directory and saves it first
pwd: Print Working Directory

quota: Displays the disk usage and its limits
quotacheck: Lets you scan a file system to find its disk usage
quotactl: Sets disk quotas

ram: Ram disk device
rcp: Copies files between two devices.
read: Reads a line from standard input
readarray: Reads from stdin into an array variable
readonly: Marks the variables and functions as readonly
reboot: Reboots your system
rename: Renames files
renice: Alters the priority of the processes running
remsync: Synchronises remote files through email
rev: Reverses the lines in a file
rm: Removes particular files
rsync: Synchronises file trees

screen: Run remote shells using ssh
scp: Creates a secure copy
sdiff: Merges two files in a secure manner
sed: Stream editor
select: Accepts keyboard inputs
seq: Prints numeric sequences
set: Manipulates shell functions and variables
sftp: Runs the secure file transfer program
shift: Shifts positional parameters
shopt: Shell Options
shutdown: Shuts down Linux or restarts it
sleep: Adds a delay
slocate: Finds particular files
sort: Sorts text files
source: Runs commands from a file
split: Breaks a file into fixed sizes
ssh: Runs the remote login program
strace: Traces signals and system calls
su: Substitutes the user identity
sudo: Executes commands as a different user
suspend: Suspends the execution of the current shell
sync: Synchronises data from a disk with the memory

tail: Outputs only the last part of a file
tar: Stores a list or extracts files in an archive
tee: Redirects output into multiple files
test: Evaluates conditional expressions
time: Measures the running time of a program
timeout: Puts a time limit on a command
times: Finds the user and system times
touch: Changes timestamps on a file
traceroute: Trace Route to a host
tr: Deletes characters, translates or squeezes them
tsort: Topological sorting

ulimit: Limits the user resources
umask: Determines the file permission for a new file
umount: Unmounts a device from the system
unalias: Removes an alias
uname: Prints the system information
unexpand: Converts the spaces in a file to tabs
uniq: Uniquify your files
units: Converts the units from one scale to another
unset: Removes the variable names or the function names
unshar: Unpacks the shell archive scripts
until: Executes a command until there is an error
uptime: Shows the uptime
usermod: Modifies a user account
users: Gives you a list of users who are currently logged in
uuencode: Encodes binary files

v: Lists the contents of a directory
vi: Text editor
vmstat: Reports on the virtual memory statistics

wait: Directs the system to wait for a process to finish
watch: Displays or executes a program periodically
wc: Prints the word, byte and line counts
while: Executes commands
who: Prints the usernames that are currently logged into the system
whoami: Prints the current name and user id
wget: Retrieves the web pages or files through HTTP, HTTPS or FTP
write: Sends messages to other users

xargs: Executes a utility and passes a constructed argument list
xdg-open: Opens a URL or a file in the user's preferred application

yes: Prints a string until it is interrupted

5 Things That You Must Know About SSH

1. SSH Tunneling
This is the processt thatallows an SSH server to become a proxy server. It then allows a local system to send information through a secure SSH server. For example, consider that you're connected to a public WiFi. You can get a lot of any prying by passing your browsing traffic through a secure SSH server.


ssh -D 9999 -C user@host

2. SCP File Transfers
The scp or secure copy command allows you to transfer files between a remote system running an SSH server and your local system.


scp /path/to/local/file user@host:/path/to/destination/file

3. Mounting Remote Directories
The SCP process for file transfers being tedious, it is often much better to just use SSH when viewing files from a remote folder. I you're using Ubuntu then the software requirded will be available by default alongside the GNOME desktop. In others you will ahve to download autilus (the software for Ubuntu) or some other.


4. Preserving Terminal Sessions
The GNU screen helps you accomplish this. What happens usually is that when you logout of an SSH sessions, you will have to set up the connection all over again. On the other hand, this utility lets you preserve a terminal session even after logging out.


ssh -t user@host screen -r

5. Visualising Key Fingerprints
When an SSH session is started, it shows a secure 'key', unless the system is known already. This key proves that the remote device you're connecting to is not an imposter. But, remembering a 16 digit key is really difficult, so you can turn on the virtual host key feature from the SSH config file.


ssh -o VisualHostKey=yes user@host

Thursday, 21 March 2013

How to upgrade the IOS version in CISO switch/Router

Let's say we have one CISCO 2950 switch having IOS version

"c2950-i6q4l2-mz.121-22.EA4.bin"


Step 1
======

Upload the updated IOS image file on TFTP server

In our case we have upload the IOS image "c2950-i6q4l2-mz.121-22.EA8.bin" on our TFTP server.


Step 2
======

Establish the connectivity between TFTP server and your Switch.

In our case switch IP is 192.168.1.2  and TFTP server IP is 192.168.1.100


Step 3
======

Take the access of switch

switch>en
switch#copy tftp: flash:
Address or name of remote host []? 192.168.1.100
Source filename []? c2950-i6q4l2-mz.121-22.EA8.bin
Destination filename [c2950-i6q4l2-mz.121-22.EA8.bin]?

Accessing tftp://192.168.1.100/c2950-i6q4l2-mz.121-22.EA8.bin...
Loading c2950-i6q4l2-mz.121-22.EA8.bin from 192.168.1.100: !!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 3117390 bytes]

3117390 bytes copied in 1.892 secs (1647669 bytes/sec)
Switch#


Step 4
======

Now check weather your new IOS image is uploaded in flash memory or not?

switch#sh flash
Directory of flash:/

    1  -rw-     3058048          <no date>  c2950-i6q4l2-mz.121-22.EA4.bin
    2  -rw-     3117390          <no date>  c2950-i6q4l2-mz.121-22.EA8.bin

64016384 bytes total (57840946 bytes free)
Switch#


Step 5
======

Configure switch to boot with new IPS image next time

Switch#
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#boot system c2950-i6q4l2-mz.121-22.EA8.bin
Switch(config)#^Z
Switch#
%SYS-5-CONFIG_I: Configured from console by console

Switch#


Step 6
======

Reboot the switch and confirm that weather switch is booting from new image or still with old image?

Switch#reload
Proceed with reload? [confirm]
%SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.
yC2950 Boot Loader (C2950-HBOOT-M) Version 12.1(11r)EA1, RELEASE SOFTWARE (fc1)
Compiled Mon 22-Jul-02 18:57 by miwang
Cisco WS-C2950-24 (RC32300) processor (revision C0) with 21039K bytes of memory.
2950-24 starting...
Base ethernet MAC Address: 0001.9654.2413
Xmodem file system is available.
Initializing Flash...
flashfs[0]: 2 files, 0 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 64016384
flashfs[0]: Bytes used: 6175438
flashfs[0]: Bytes available: 57840946
flashfs[0]: flashfs fsck took 1 seconds.
...done Initializing Flash.

Boot Sector Filesystem (bs:) installed, fsid: 3
Parameter Block Filesystem (pb:) installed, fsid: 4


Loading "flash:/c2950-i6q4l2-mz.121-22.EA8.bin"...
########################################################################## [OK]
              Restricted Rights Legend



That's it.........

Friday, 8 March 2013

How to Break CISCO Router Password

Step 1
======

Reboot  the router.

At the time of rebooting press Ctrl + Break keys
                                             
Step 2
======

rommon 1 >confreg 0x2142
rommon 2 >reset



Step 3
======

Now router will skip the startup-confg file and reload without the password

Now you can change the password of your  router  from below commands


Change Console Password
=======================

router>en
router#conf t
router(config)#line console 0
router(config-line)#password CCNA
router(config-line)#login
router(config-line)#exit
router(config)#



Change enable mode Password
===========================
router>en
router#conf t
router(config)#enable secret CCNA



Step 4
======

Save the running-config into startup-config

router#copy running-config startup-config


Step 5
=======

Again change the configuration register value.

router#conf t
router(config)#config-register 0x2102
router(config)#exit
router#reload



That's it.

Friday, 1 March 2013

How to configure SSH access in CISCO devices

Run the below mention commands on your CISCO device.

Router>enable
Router#conf t
Router(config)#line vty 0 4
Router(config-line)#transport input ssh
Router(config-line)#exit
Router(config)#ip domain-name ms.com
Router(config)#crypto key generate rsa
Router(config)#

(Note: we assume that we have already created user account in CISCO device. And you can chose different domain name in your configuration instead of ms.com)

How to configure Static IP in Linux

With the below commands you can configure the Static IP address in a Linux machine.

Configure IP address and Subnetmask:

#sudo ifconfig eth0 192.168.1.2 netmask 255.255.255.0

Configure Default Gateway/Router:

#sudo route add default gw 192.168.1.2

Configure DNS addresses:

Under Linux / UNIX / BSD operating system, you need to edit the /etc/resolv.conf file and add the line:

#vi /etc/resolv.conf

Modify or enter nameserver as follows:

nameserver 4.2.2.2
nameserver 4.2.2.1


(Note in your network you should  use your ISP or your local DNS server addresses instead of 4.2.2.2 and 4.2.2.1)

Wednesday, 27 February 2013

How to create User Name in CISCO Devices

Create User Name and Unencrypted Password

Router>enable
Router#conf t
Router(config)#username admin password cisco
Router(config)#exit
Router#wr
Router#show running-config
Building configuration...

Current configuration : 508 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
username admin password 0 cisco
!
!
!
 --More-- 

Here your password is saved in clear text in your configuration file which is not a safer way to save password in your configuration file.


Create User Name and encrypted Password

Router>enable
Router#conf t
Router(config)#username admin secret cisco
Router(config)#exit
Router#wr
Router#show running-config
Building configuration...

Current configuration : 531 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
username admin secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0
!
!
!
 --More--

Here your password is saved in encrypted form in your configuration file which is a safer way to save password in your configuration file.

Sunday, 24 February 2013

How to configure DHCP server on CISCO Router

 Below are the commands to configure the DHCP server on your CISCO router.


Router>en
Router#conf t
Router(config)#interface fa 0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#ip dhcp pool MSLAB
Router(hdcp-config)#network 192.168.1.0 255.255.255.0
Router(hdcp-config)#default-router 192.168.1.1
Router(hdcp-config)#dns-server 4.2.2.2
Router(hdcp-config)#exit
Router(config)#ip dhcp excluded-address 192.168.1.1 192.168.1.5
Router(config)#

Note: In the above configuration we exclude the range of IP address 192.168.1.1 to 192.168.1.5 for the DHCP pool. And MSLAB is our DHCP pool name you can use the different name in your configuration. We use the 4.2.2.2 DNS server just for testing purpose you can configure your live DNS server in your real configuration.

Tuesday, 19 February 2013

How to Create NAT Rule on Router for Access the Internet

Before we get started, take a look at Figure A, this offers an illustration of what our example network looks like.

Figure A

If you're wondering why using NAT is necessary, it's because we choose the IP address scheme for the LAN from the blocks of private IP addresses. Because these IP addresses aren't usable on the Internet, we must translate these IP addresses into a real Internet IP address, such as one provided by an ISP.

So, we'll use NAT to provide the IP address translation from our LAN to our WAN. While most consumer-based routers refer to NAT as a ubiquitous term, there are a few different kinds of NAT, including static NAT, pooled NAT, and NAT overload (also called port address translation, or PAT).

Consumer-based routers typically use NAT overload, which is what we'll use for this example. NAT overload involves using a single Internet IP address and multiple inside IP addresses.

Let's look at the step-by-step process for configuring NAT overload. The router needs to be in Global Configuration Mode, and the prompt should look like this: Router(config)#

Create a pool of Internet IP addresses

For this example, we're going to overload a single Internet IP address. Since this is the only IP address we have, we'll create a pool with only one IP address in it.


Router(config)# ip nat pool mypool 1.1.1.1 1.1.1.1 prefix 30

Create an access list

Next, we must determine who the router allows to use NAT to access the Internet using our NAT pool, which we can accomplish by creating an access list. For this example, we'll allow the entire internal network to use NAT to access the Internet.


Router(config)# access-list 1 permit 192.168.1.0 0.0.0.255
 
 

Create the NAT source list

Now, we must connect the pool and the list of users. We can accomplish this by telling the router that we want to use NAT from the inside (using the access list to define our possible source IP addresses) and go to the outside using the pool that contains our single Internet IP address. In addition, we want to overload this single Internet IP address using PAT.

Router(config)# ip nat inside source list 1 pool mypool overload
 
 

Define the inside and the outside NAT interfaces


Next, we need to tell the router which interface is the inside and which is the outside.
Router(config)# interface ethernet 0/0
Router(config-if)# ip nat inside
Router(config-if)# exit
Router(config)# interface serial 0/0
Router(config-if)# ip nat outside
Router(config-if)# exit 

That's it.
 

Monday, 7 January 2013

How to Know Nokia Hardware - Model - Serial Number

FW [Admin]# cat /var/etc/.nvram
Vendor Nokia
Chassis serialnum: 93063100325
Model IP390
FW [Admin]#

Saturday, 5 January 2013

Useful Netscreen Commands for Troubleshooting

Netscreen Commands for Troubleshooting:
Here is some useful Netscreen commands for troubleshooting.

get config : to get device configuration
save : to save changes to config
get system : gets system information, Netscreen mode
get session info : shows load on the firewall 85+ implies there will be some latency
get interface : shows interfaces, zones
get address trust/unturst: shows defined network objects
get Arp : shows firewall Arp entries
get route : shows firewall routes
get service : shows firewall services
get group address : network groups
get group service : service groups
get policy in/out : shows applied firewall policies
get log traffic : shows firewall logs – options: based on src/dst/IP/port
unset : to remove a config statement
get user all : shows vpn users
get log event : shows vpn logs
get MIP : shows one to one Nat’s
get VIP : shows configured port forwarding rules
get route ip x.x.x.x: finds the specific route for an ip
set policy id xx : put you in a specific policy then you can add more objects it instead of creating a group

Basic Netscreen Commands

Basic NETSCREEN Firewall Commands
If you are new to managing the Netscreen Firewall, then these commands will help you in managing the Netscreen Firewall from the Command Line Interface.

NETSCREEN
Note:Always remember to use the TAB when you are not sure the syntax of the command for a Netscreen Firewall. When you press TAB on your keyboard, it would give you what the next options are, and you can chose from the same. TAB is your best friend.

Step 1: define networks & network groups
***********************************************
Set address trust int-10.1.1.0_24 10.1.1.0/24
Set address untrust ext-192.168.15.15 192.168.15.15/32
Set group address untrust Remote
Set group address untrust Remote add ext-192.168.15.15

Step 2: define services & service groups
**********************************************
Set service tcp_445 protocol tcp src-port 1024-65535 dst-port 445-445 timeout 120
Set service tcp_3399 protocol tcp src-port 1024-65535 dst-port 3390-3390 timeout 120
Set group service outsrvgroup1
Set group service outsrvgroup1 add http
Set group service outsrvgroup1 add https

Step 3: Define policies
*************************
set policy from trust to untrust int-10.1.1.0_24 any outsrvgrp1 permit log count
Note: policies are applied from zone to zone.

Step 4: define NAT
**********************
NAPT is on by default.

Step 5: define one to one NAT (MIP)
*****************************************
Set interface untrust MIP 192.168.1.15 host 10.1.1.15 netmask 255.255.255.255
Set group service insrvgroup1
Set group service insrvgroup1 add http
Set group service insrvgroup1 add https
Set policy from untrust to trust any MIP(192.168.1.15) insrvgroup1 permit log count
Set policy move 59 before 4
(Move the new policy is before the default deny policy)

Step 6: define port forwarding (VIP)
*****************************************
Set interface untrust VIP 192.168.1.55 443 https 10.1.1.55
Set policy from untrust to trust any VIP::1 https permit log count

Step 7: define routes
************************
Set route 10.1.1.0/24 gateway 192.168.1.254

Thursday, 6 December 2012

Configure Layer 3 EtherChannel between Cisco Router and Switch

Router:

interface Port-channel1
ip address 10.4.4.2 255.255.255.252
!
interface GigabitEthernet0/0/0
no ip address
channel-group 1
no shutdown
!
interface GigabitEthernet0/0/1
no ip address
channel-group 1
no shutdown

Switch:

interface Port-channel1
no switchport
ip address 10.4.4.1 255.255.255.252
!
interface GigabitEthernet1/0/3
no switchport
no ip address
channel-group 1 mode on
no shutdown
!
interface GigabitEthernet2/0/3
no switchport
no ip address
channel-group 1 mode on
no shutdown

(Note: Reference of this post is http://firewalltipss.blogspot.in/2011/07/configure-layer-3-port-channel.html )

Linux Cheat Sheet

COMMAND INPUT

The colors designate the actual Linux command in blue, while the user input (file, numeric value, etc) is red. 

Basic Operation

#hostame - Displays the hostname and/or FQDN of the system 

#uname -a - Displays the hostname and detailed kernel version 

#cat /etc/redhat-release - Displays the version of Linux installed Example: 

#cat /proc/cpuinfo - Displays information about the CPU(s) 

#df -h - Displays the partitions, their sizes details, and mount points 

#free - Displays detail about the system memory and usage 

#lsof - Displays all open files 

#lsof -nPi:22 - Displays any open files which use port 22 

#locate httpd.conf - Displays the full path to any file named httpd.conf 

#updatedb - Rebuilds index of files for search using the locate utility 

Copy, Move, Delete
#cp file1.txt file2.txt - Copies file1.txt to file2.txt 

#mv old.txt new.txt - Renames a file called old.txt to new.txt 

#rm file1.txt - Deletes file1.txt 

#mkdir httpds - Creates a new directory called httpds 

#cp -R httpd httpds - Recursively copies all files from directory httpd to httpds 

#cp -PR httpd httpds - Recursively copies all files from directory httpd to httpds and retains all permission settings 

#rm -rf httpd - Recursively deletes folder httpd and all contents 

#chkconfig --list - Displays all services and their state (start or stop) at each runlevel 

#chkconfig --level 35 httpd on - Sets httpd to start on runlevels 35 when machine is booted 

#service httpd start - Immediately starts Apache 

File Attributes
#chown apache virtualhosts.txt - Changes ownership of the virtualhosts.txt file to user apache 

#chgrp apache virtualhosts.txt - Changes membership of the virtualhosts.txt file to group apache 

#chmod a+x sniffer.pl - Allows the sniffer.pl file to be executed 

CHMOD
7 rwx read, write, execute 
6 rw- read, write 
5 r-x read, execute 
4 r-- read 
3 -wx write, execute 
2 -w- write 
1 --x execute 
0 --- no permissions
 

#chmod 777 passwords.txt - Allows read, write, and execute on the file passwords.txt to anyone 

#chmod 000 passwords.txt - Blocks read, write, and execute on the file passwords.txt to anyone 

Yum
#yum update -y - Updates all packages without prompting 

#yum install iptraf - Installs a package named iptraf 

#yum whatprovides */iostat - Searches all repositories and returns RPMs that provide the program iostat 

#yum update samba - updates a package named samba 

RPM
#rpm -q http - Displays the version of daemon http (apache) 

#rpm -qa | grep bind - Displays all packages installed with the word bind. Example: 


#rpm -qa | grep bind 
bind-chroot-9.3.6-16.P1.el5 
system-config-bind-4.0.3-4.el5.centos 
bind-utils-9.3.6-16.P1.el5 
bind-9.3.6-16.P1.el5 
bind-libs-9.3.6-16.P1.el5 
ypbind-1.19-12.el5
 

#rpm -ivh proftpd - Interactively installs proftpd 

#rpm -Uvh proftpd - Interactive upgrades named proftpd 

#rpm -e proftpd - Removes package proftpd 

#rpm --rebuilddb - Rebuilds a corrupt RPM database 

Compressed files
#unzip package.zip - Unzips the file package.zip 

#tar -zvxf stunnel.tar.gz - Decompressed a gzip file named stunnel.tar.gz 

Networking

#ifup eth0 - Enables network interface eth0 

#ifdown eth0 - Disables network interface eth0 

#vi /etc/sysconfig/network-scripts/ifcfg-eth0 - Uses vi to edit network settings on eth0 

IP tables
#service iptables status - Displays status of iptables (running or not) 

#iptables -L - Displays ruleset of iptables 

#iptables -I INPUT -p tcp -m tcp -s 192.168.15.254/26 --dport 22 -j ACCEPT - Accepts incoming SSH connections from IP range 192.168.15.254/26 
#iptables -I INPUT -p tcp -m tcp -s 0.0.0.0/0 --dport 22 -j DROP - Blocks SSH connections from everywhere else 

#iptables -I INPUT -s "192.168.10.121" -j DROP - Drops all traffic from IP 192.168.10.121 

#iptables -D INPUT -s "192.168.10.121" -j DROP - Removes previously allied drop all from IP 192.168.10.121 

#iptables -I INPUT -s "192.168.10.0/24" -j DROP - Drops all traffic from IP range 192.168.10.0/24 

#iptables -A INPUT -p tcp --dport 25 -j DROP - Blocks all traffic to TCP port 25 

#iptables -A INPUT -p tcp --dport 25 -j ACCEPT - Allows all traffic to TCP port 25 

#iptables -A INPUT -p udp --dport 53 -j DROP - Blocks all traffic to UDP port 53 

#/etc/init.d/iptables save - Saves all IPtables rules and re-applies them after a reboot


Processes
#ps ax - Displays all running processes 

#ps aux - Displays all running processes including CPU and memory usage of each 

#ps ax | wc -l - Displays the total number of processes 

#top - Interactive process manager which allows sorting by criteria
Logs
#tail -f /var/log/messages - Displays the most current entries to the messages log in real-time 

#tail -50 /var/log/messages - Displays the last 50 lines of the messages log 

#head -50 /var/log/messages - Displays the first 50 lines of the messages log 

#cat /var/log/messages - Displays the entire messages log 

#cat /var/log/messages | grep "FTP session opened" - Displays any entries in the messages log that contain the ext FTP session opened 

#cat /var/log/messages | grep "FTP session opened" > log2.txt - Writes any entries in the messages log that contain the ext FTP session opened to a file named log2.txt 

Paths to Common Files

Bind (named)
/var/named - Bind zone files (non chrooted) 
/etc/named.conf - Bind configuration file (non chrooted) 
/var/named/chroot/var/named - Bind zone files (chrooted) 
/var/named/chroot/etc/named.conf - Bind configuration file (chrooted) 

Apache (httpd)
/etc/httpd/conf/httpd.conf - Main apache configuration file 
/var/www/html - Default directory for serving pages 
/var/log/httpd/ - Default location for logs (access and error) 

Networking
/etc/hosts - System hosts file 
/etc/resolv.conf - DNS lookup configuration file 
/etc/sysconfig/network - Network/hostname configuration file 
/etc/selinux - SELinux configuration file 
/etc/sysconfig/network-scripts/ - Default location of a network setting file 
/etc/sysconfig/iptables - Default iptables policy configuration file 
/etc/sysconfig/iptables-config - Default iptables daemon configuration file


(Note: Reference of the above post is http://firewalltipss.blogspot.in/search/label/Cheat%20Sheets )

Tuesday, 20 November 2012

How to Find UTM-1 Check Point Appliance Model from CLI

How to Find UTM-1 Check Point Appliance Model from CLI

Run the following command:

[Expert@yourfirewall]# /usr/sbin/dmidecode | grep "Product Name"
Product Name: P-10-00
 
Here is a list of the dmidecode information that I’ve found for various UTM/Power-1 appliances, and the hardware that you can expect to require if you run an open server.

Check Point 2012 Appliance series

DMIDecode Model SPU FW VPN IPS CPU MHz RAM
? 21400 2003 50 7 21 2x Intel Xeon E5645 (6 cores) 2.40GHz 6
P-230-00 12600 1861 30 7 17 2x Intel Xeon E5645 (6 cores) 2.40GHz ?
P-220-00 12400 ? ? ? ? ? ? ?
P-210-00 12200 738 15 2.5 8 Intel Core i5 750 (4 cores) 2.67GHz 4

Check Point Power-1 Appliance series

DMIDecode Model SPU FW VPN IPS CPU MHz RAM
? 11075 up to 1222 20 4 12 2x Intel Xeon E5530 (QC) 2.40Ghz 6
? 9075 1006 16 3.7 10 2x Intel Xeon E5410 (QC) 2.33Ghz 4
P-20-00 9070 ? ? ? ? ? ? ?
P-1?-?? 5075 596 9 2.4 7.5 Intel Xeon E5410 (QC) 2.33Ghz 2
P-10-00 5070 ? ? ? ? ? ? ?

Check Point ??? series

DMIDecode Model SPU FW VPN IPS CPU MHz RAM
T-180-00 4800 623 11 2 6 Intel Core2 Quad CPU Q9400 2.66GHz 4
? 4600 374 9 1.5 4 Pentium Dual-Core E6500 2.93GHz 4
? 4400 223 5 1.2 3.5 Intel Celeron Dual-Core E3400 2.6 GHz 4
? 4200 114 3 0.4 2 Intel Atom D525 Dual-Core 1.80GHz 4
? 2200 114 3 0.4 2 Intel Atom D525 Dual-Core 1.80GHz 2
C6P_UTM 2050 ? ? ? ? ? ? ?
C6_UTM 1050 ? ? ? ? ? ? ?
C2_UTM 450 ? ? ? ? ? ? ?

Check Point UTM-1 Appliance series

DMIDecode Model SPU FW VPN IPS CPU MHz RAM
U-40-00 3070 298 4.5 1.1 4 Intel Core2 Duo E6400 2.13GHz 3
U-30-00 2070 101 3.5 0.45 2.7 Intel Celeron 440 2GHz 2
U-20-00 1070 101 3 0.35 2.2 Intel Celeron M 1.5 GHz 1
U-15-00 570 101 2.5 0.3 1.7 Intel Celeron M 1.5 GHz 1
U-10-00 270 50 1.5 0.12 1 Intel Celeron M 600 MHz 1
? 130 50 1.5 0.12 1 Intel Celeron M 600 MHz 1

Check Point Smart-1 Appliance series

DMIDecode Model CPU RAM HDD
? Smart-1 5 Intel Celeron M 1.50GHz 2 500 GB
? Smart-1 25b Intel Core2 Duo Processor E7400 2.80 GHz 4 2 TB
? Smart-1 50 Intel Xeon E5410 2.33GHz (DualCore) 4 2 TB

 Reference of  this post is http://digitalcrunch.com/check-point-firewall/find-utm-1-check-point-appliance-model-from-cli/


Thursday, 8 November 2012

How to Change admin password for Nokia using cli

How to Change admin password for Nokia using cli

clish
> set user admin newpass xxxxx
> save config