75 articles Uncategorized Page 3 / 8

Linux Interview Questions

1. What is Reverse Proxy & transperent proxy? 2. What is difference between statefull firewall and stateless firewall ? 3. What is cifs? is it protocol or filesystem? explain 4. What is snort ? 5. what is difference between IPS & IDS ? 6. What is Crashdump? 7. What is clustering ? What are types…

To detect unusual or changed or higher SSH Port

Many times people change their SSH default port i.e. 22. They modify it to any other port.Then if you want to detect modified SSH port with Nmap regular options, it wont able to get that.So to detect port use below command: nmap -T Aggressive -A -v <IP of Machine to be scanned>

Setting up NGINX, PHP with CGI on Ubuntu 10.10 Linux

1. Installing apt-get install nginx php5 php5-cgi php5-cli 2. Make your site folder under document root mkdir -p /var/www/newsitechown -R www-data www-data /var/www/ 3. Create new file /etc/nginx/sites-available/newsite and put below entries in it server { listen 80; server_name newsite.com www.newsite.com; access_log /var/logs/nginx/access.log; error_log /var/logs/nginx/error.log; location / { root /var/www/newsite; index index.html index.htm index.php; }…

Encrypting & Decrypting TAR file with OpenSSL

To Encrypt TAR file with OpenSSL tar -cP <directory to archive> | openssl des3 -salt -pass pass:password  >  filename.tar      —–> Here at password please put your password To Decrypt TAR file OpenSSL cat filename.tar  | openssl des3 -salt -d -pass pass:password | tar -x -C path-to-extract Please Note: Here I have used "des3" encryption. You can…

Removing RAID1 completely with Mdadm

RAID device –> /dev/md1 –> Created of 2 Disks /dev/sda & /dev/sdb mdadm –detail /dev/md1 –> This will give detail information on /dev/md1 cat /proc/mdstat  –> This will give information of md device mdadm –stop /dev/md1  –> This will stop md1 device mdadm –zero-superblock /dev/sdamdadm –zero-superblock /dev/sdb Also Remove entry of /dev/md1 from /etc/mdadm.conf and…

Playing with awk

smbstatus -S 2>/dev/null|awk ‘BEGIN{FS=" ";OFS=" ";}{$2=""; print $0;}’|awk ‘{print $1,"         ",$2,"         ",$3,$4,$5,$6,$7}’ –> Above command will hide column 2 and will give you below output: Service           machine           Connected ——————————————————-         For hiding above lines … to just get only service name – mahine name – connected… –> smbstatus -S 2>/dev/null|awk ‘BEGIN{FS=" ";OFS="   ";}{$2=""; print $0;}’|awk ‘{print…

sending email via gmail using Python script

import smtplib fromaddr = ‘abc@gmail.com’     #—————–> Sender Address toaddrs = ‘123@xxx.com”       #—————–> Receiver address msg = ‘Email message from PYTHON Raghuram app’ username = ‘gmailUserName’ password = ‘gmailPassword’ server = smtplib.SMTP(‘smtp.gmail.com:587’) server.ehlo() server.starttls() server.ehlo() server.login(username,password) server.sendmail(fromaddr, toaddrs, msg) server.quit()

Locking host file in Windows XP without any 3rd party application

Nowdays, I noticed that many times malware attacks hosts file. They modify it and redirect antivirus sites to their IPs. To avoid this we need to lock file. Zone alarm has option to lock hosts file. But if u want it without any tool just do it as below.   Go to CMD prompt in…