Menu

Saturday, 13 December 2014

Privacy is now the biggest issue over the internet and if we want restriction free internet access we need to use available service to make our self anonymous. in my first installment of this series is cover how we can use proxy to browser and access internet without sharing our location or access pages which is blocked by ISP Censorship or Firewall.

Monday, 20 October 2014

This First installment of my Port Forward Tutorial series, in this tutorial you get the basic knowledge about port forwarding what is use of port forward and how it almost beneficial for you, And how to configure port forward in home router for remote desktop sharing (3389) and how to access using Static IP provided by ISP (Internet Service Provider).

Basics QA.

Q: What is Port forwarding ?

Port forwarding allows remote system from internet to connect to a specific computer or network service in Local-Area network.

Like you may take remote access of your home computer from any system over the internet, or share web | ftp server from home that can be accessible any part from world, remote surveillance CCTV Camera access

In the following image we can see how to take access of the home network using port forwarding.

In This part we cover how to : -

Identify IP Address (Public and Private) in Home Ethernet network.

How to access WiFi router (internet router).

How to Configure Port Forward for Remote desktop (Port 3389) in Router.

Take Remote Desktop of Home system from Internet computer using Static IP provided by ISP.

So before we start we need to know little about IP address (Internet Protocol Address) and difference between them.

Whats difference between Public IP and Private IP?

Public IP Address.

Public IP is assign by your internet service provider.

The range and record is maintain by our ISP.

We cannot select Public IP address the range is defined by InterNIC that are guaranteed to be globally unique to the Internet.

We can connect our LAN environment on single Public IP address for Internet access.

Private IP Address.

IP Address which require the systems to communicate each other in LAN network.

We can decide the IP Address | Range as per our requirement.

Its divided in 3 class.

Class A 10.0.0.0/8

Class B 172.0.0.0/20

Class C 192.168.0.0/24

Multiple Private IP Address can access internet using an single Public IP.

When we get Internet connection from ISP we only concern about internet speed bandwidth plan for home but if we want we can ask for Static IP Address.

What is Static IP Address ?

Fixed IP Address Provided from ISP (Internet Service Provider).

Example 123.52.31.91 (Fixed static).

Whenever we access internet or browse web pages the static ip will be out.

Now days every one use wifi router in home to connect multiple devices on home network for internet access, but most of people don't know the basic setting of wifi router or the IP address and access credential as the ISP provider or the system admins configure that router.

But for this tutorial we require to take access of router and configure port forward in it i am using Dlink DIR-60SL router for this tutorial.

To access the router we require to know ip address of that router and to find the ip address see the (Image 1.0) where default gateway is our router IP Address.

Now in browser type Gateway IP Address in my case192.168.0.1Router will ask login credentials user name and password, most of time the login credentials is default provided by the vendor that can be found in user manual on the other hand we can see default username and password list on website (routerpasswords.com).

Note : Before further changes its better to take backup of current router configuration.

After login most of router will display dashboard where will see the current IPS IP Setting LAN Segment and Wi-FI SSID, for port forward settings we require to search the advance or port forwarding menu in router. in my dlink router the Port forwarding is in advance tab menu its difference on every router specify vendor just search it and the page will look like following
(Image 1.1).

Image 1.1

In name field type identification name for this tutorial Its REMOTE DESKTOP in IP Address field as we require to allow remote desktop connection from the system 192.168.0.101 type that in port number type remote desktop connection default port number which is 3389 click on the check box to enable this rule for port forward and click save settings router will be reboot to apply configuration changes and the settings will look like following (Image 1.2)

Image 1.2

Most of our hard work is done now we can take the remote desktop connection of following system from anywhere over the internet simply using following steps.

From Windows System.

From Internet enable system.

Open Run.

Type Command: mstsc(Hit Enter)

In Computer box type Public IP Address and click Connect. (Image 1.3)

Image 1.4

It will ask you to enter you PC's login details (User name and Password)

Friday, 5 September 2014

As a system administrator we always need to deal with following error.

(You do not have permission to access \\ipaddress(hostname)\Folder Contact your network administrator to request access.)

Example : The share server and client is in same domain so the share server is easily accessible from client, But there are two share folders "Inventory" and "Test" also two different domain user login account "AUSER" and "PUSER", the AUSER have rights to access Inventory folder and PUSER can only access Test folder and we currently login with AUSER in the client system.

And other folders in same share location is accessible

The issue with share permissions which doesn't allow the following domain user to access some folder in our case “Test” folder.
Let’s assume that you want to access the test folder, and the folder shared for PUSER user ID so the simple way to logoff current user and login with PUSER user to gain share access but the simple solution is to create share session.

So how we can access both folders in single domain ID?

First Solution is to provide the Test folder accessible by other user.

But if we want access the folders without changing share permission then?

Yes we can using windows “net use” Command.

net use the command is used to map network share folders and drive and create null and different users sessions with share server Wiki.

Firstly we need to check is there any session is established with the server using following command.Command:net use (Hit Enter).
In Following windows we can see the Disconnected session for Test folder that we not able to access by AUSER

Let’s disconnect this session using following command.

Command:net use * /del (Hit Enter) this will prompt for confirmation Press Y and Hit Enter.

Now if we use Command:net use the following output will show.

(There are no Entries in the list.)

Now Start the Session Hacking.

Remember whenever you want to open the share folders of any share server first create session with the network system using following.Command:net use \\192.168.15.1 /u:Domain\Puser (Hit Enter)

Tuesday, 8 July 2014

As developer i use Net Beans IDE for software, websites and web application development sometimes it's require to use MYSQL as database server, so in this tutorial this tutorial I am just going to show how to connect MySQL server with Net Beans IDE as some of my friends find difficulty’s to connect MYSQL Database server with Net Beans.
This tutorial is a part of an series where first we need to understand how to install web-server XAMPP or WAMP in windows | LAMP in Linux and Installation of Net Beans IDE with Java Web EE for Web.

Prerequisite for this tut.

Net Beans IDE better download bundled setup which include all and you should familiar with Net Beans.

MYSQL server installer or its better to use portable MYSQL which comes in XAMMP bundle, I prefer XAMPP, you should have basic knowledge about MYSQL servers table creation and query commands and for portability XAMMP is better for Windows Environment.

After installation XAMPP all you need to find MySQL mysqladmin.exe and mysqld.exe which can be found in C drive “C:\xampp\mysql\bin” folder.

So Let Start…..

Fire Net Beans select Services tab from Windows menu (Ctrl+5)

Right Click on database select register MySQL Server

In MySQL Server Properties Basic Properties tab can be customize as per requirement.

Server Host Name:“localhost” (it will be different IP if MySQL server is hosted on different system)Server Port Number:“3306” (its Default port number of MySQL but it can change in my.ini file in same bin folder)Administrator User Name:“root” (default admin of MySQL better to connect as root for full access of system)Administrator Password: (Leave IT Blank) (in XAMPP MySQL default installation password is blank but it can be change or leave it blank)

Now Go to Admin Properties tab where we require to add following.

Path/URL to admin tool:“C:\xampp\mysql\bin\mysqladmin.exe” (The Absolute path of mysqladmin.exe if using XAMPP)Arguments: (Leave IT Blank)Path to Start command:“C:\xampp\mysql\bin\mysqld.exe” (The Absolute path of mysqld.exe if using XAMPP)Arguments: (Leave IT Blank)Path to stop command:“C:\xampp\mysql\bin\mysqladmin.exe” (The Absolute path of mysqladmin.exe if using XAMPP)Arguments:“-u root –shutdown” (user is root blank password and command for shutdown)

Almost the difficult part is done now all we need to verify that our MYSQL databes is connecting and we are able to query the SQL tables via NetBeans .

Now in Services tab Expand database
Right Click on MySQL Server at localhost:3306 [root]
in case if the server is on different system the localhost will replaced by IP address.
Click on Start

Let’s create and sample database and see all is working properly.
Right Click on MySQL Server at localhost:3306 [root]
Select in Create database for this demo i use name = SQLTest & grant full access.

Click OK

Now Expand the MySQL Server at localhost:3306 [root]
Right click on SQLTest that we have created

Select Connect.

The connection will be created as following pathjdbc:mysql://localhost:3306/sqltest*
Expand the database connection & your database
Right click on Tables
Select Create new Table

Wednesday, 16 April 2014

As system admin we always need to perform backup and recovery work on server. an we aware that new windows server 2008 and above don't provide tape backup services any more and windows backup application is always create issue with multiple domain environment where those domain and not have any type of sync relationship with each other.

The idea of this post come in my mind when last week my SQL server on 2008r2 is crashed and bak files also in same servers, the windows backup is not perform last night and due to holiday of two days we get notification of this issue three days later.

So i decides we can create an script which will copy bak (even you can change for any other types of file extension for backup) on other storage server and delete files older than 7 days and also update the same via Email, what files has copied and if not the email alert will trigger something is wrong.

SMTP server address (from where we can send mail using this server in our case we have SMTP Server on 192.168.0.15 or we can use free SMTP Servers from Internet List)

Source and destination path with username and password.

Source D:\SQLBACKUP (where all bak files created)

Destination \\192.168.0.5\Backup

User name for backup access is "backup" password "Backup@14"

Let's Start

Code:del sqlbackup.log
This log file will be used for backup and diagnose status and errors if any. for to execute this batch script we need to delete previously created log file.

Open Notepad add the net use command with destination folder path in persistent

Code:net use /PRESISTENT:YES \\192.168.0.5\Backup /u:backup Backup@14 > sqlbackup.log
The following command make session with the destination server & copy the output in sqlbackup.log file which will bu usable for following command.

Code:

Find "The command completed successfully" < sqlbackup.txt > nul

The following code will find the net use session command is completed or its have any errors for session creation and the next statement will define on this output using IF command as follow.

Code:

IF NOT ERRORLEVEL 1

if the session not has any error in log file then the code which written in "( )" will trigger in our case

move is command which will move all .bak files in copied folder so next time xcopy only copy new files there are date options also available in xcopy which i am not covering in this Tut as this is an simple script for backup.

-from the mail will send from we use SQL as name but it can also the particular server address that will be better.

-to where we want to send mail every corp. has there own helpdesk Email ID.

-sub the proper subject should be mention like the backup is done.

-attach the log file will attached in email as well as the text/plain,i command will add the logfile text in email body.

The Code is Almost done but if the sessing is not created or the destination server is not responding we also get the notification for the same so the else command with "( )" will help us to get the error via email.

Code:

) Else (

mailsend.exe -smtp 192.168.0.15 -

sqlbackup@abc.com -to helpdesk@abc.com -sub "

Failed SQL Backup" -attach "sqlbackup.log,text/plain,i"

)

Those code are same only -sub is changed to show the backup is Failed.

Now the finishing touch for our script.Code: net use \\192.168.0.5\Backup /del

Simple code to disconnect the created session all is done but wait as we aware the back files which created from sql its still in copied folder and we olny cant past 7 days files should remain on sql server so the javascript in batch file will help us.

Code:D:cd SQLBACKUP\Copiedwscript "c:\path to file\DeletesOlderThan.js" 7exit
The D: and cd SQLBACKUP\Copied will change dir the bak files is stored, then wscript 7 will only leave the past 7days file in folder.

add the file in Task Scheduler with suitable time and DONE.
See how simply we can schedule our daily work using scripts.