Senin, 28 September 2015

Membuat aplikasi yang bisa PING server Visual Studio C#

Pastikan preference di tambahkan System.Net

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;


using System.Net.NetworkInformation;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void cmdprosses_Click(object sender, EventArgs e)
        {
            Ping data = new Ping();
            PingReply sendping = data.Send(txtip.Text, 200);
            if (sendping.Status==IPStatus.Success)
            {
                lblstts.Text="server is online";

            }
            else
            {
                lblstts.Text="server is offline";

            }

        }
    }
}


Hasil Jadinya

Kamis, 24 September 2015

Switch Security Configuration (Hardening Switch…inc. DHCP Snooping, DAI, VLAN-ACL, etc.)





Basic Security Configuration (level CCNA nih)

1. Securing Access to Console (akses switch via console port…ada di belakang switch)

efeknya…ketika kita colok kabel console ke switch trus login via hyper terminal (XP) ato putty

settingan ini juga bisa di terapkan di Router

2. Securing Remote Connection (Telnet)
sebelumnya itu switch harus punya IP dulu (ip virtual alias “int vlan [nomor vlan]” untuk layer 2 switch, layer 3 switch uda bisa ip fisik)

angka 0 4 maksudnya kita mengijinkan ada 5 sesi telnet (0,1,2,3,4)
klo kita liat diatas2 tadi…line console 0, emang port console cuma ada 1…kecuali untuk switch catalyst 4000 series (ato nexus) ke atas yang udah modular (yang bisa di bongkar-pasang) yang bisa lebih dari 1 console port
kita tes ping lalu telnet


eala…lupa set password untuk priviledge
wkwkw…sekalian dah
3. Securing Priviledge Access (access to global config and to show current running config)


salah satu aja, klo di input 2-2 nya…yang paling secure yang dianggep (secret lebih secure)

Pada gambar diatas…ketikan pertama gw pake “cisco”, ketikan kedua gw pake “disco”
kog ga keliatan sih man??
emang gitu…mencegah orang ngintip, bahkan ga ada bintang2 nya dilayar pas kita ngetik
ga percaya klo secret lebih secure?!?…kita liat running config nya

noh…bahkan ketika di show run, yang “disco” di enkripsi
settingan ini (securing telnet/remote connection dan priviledge) juga bisa di terapkan di Router

eh man…bisa ga kita pake username ama password??
bisa…

keyword nya login local, JANGAN LUPA setting username password nya juga yah…
kalo mau juga kita bisa pake username [nama] secret [password-nya] biar lebih secure
efek nya seperti gambar dibawah

di line vty juga bisa login local (jadi telnet nya pake username password)
tapi masalahnya…Telnet itu plain text, alias klo ada orang yang punya software buat baca packet data (kek wireshark), kebaca itu ketikan2 kita

Gambar diatas klo pake Telnet biasa, supaya lebih secure…kita pake Secure Shell (SSH)

capture-an wireshark nya ada ga ?!? ga ada…hehehe, ude…lu percaya aja ama Cisco…hahahahah (maksa)

Yang penting adalah command transport input ssh nya
Optional:
  • Create domain name
  • Crease RSA Encryption type (crypto key generate rsa)
  • Create ssh version 2 (version 1 banyak security vulnerabilities-nya)
  • Jangan lupa create username dan password
Trus bisa ga kita kontrol ip mana aja yang bisa telnet…???
Bisa…

nah, di Cisco itu ada 16 tingkatan priviledge alias hak akses (0-15)
priviledge level 15 bisa execute all command, priviledge 1 cuma bisa di user exec mode (router> ato switch>)
sisanya….kaga tau gw…hahaha
cara settingan nya juga banyak…”user dengan priviledge level 5 bisa ketik show ip route, ato setting ip address, ato create vlan…dll” (ga gw sebutin disini…ke cover nya di CCNA/CCNP Security klo ga sala)
trus…bisa ga, username dan password nya di server tertentu, ga di switch/router…klo itu switch/router ketembus kan bahaya
bisa…nanti gw jelasin dibawah2
********************************************
Advanced Security Configuration (CCNA-to-CCNP Level)


setelah Console, Priviledge, dan Telnet kita protect…kita akan protect port2 nya
1. Protecting Port-Security (CCNA Level)

contoh kita mo securing switchport FastEthernet 0/1 untuk accept mac-address tertentu (itu mac-address di registrasikan ke switch dulu tentunya)

Ups…untuk konfigurasi port security…mode port nya GA BOLEH AUTO (DYNAMIC) , harus di set access ato trunk

WOI INI KENAPA LAGI !?!? 
di Switch Layer 3, kita harus define manual untuk trunk encapsulation nya, mau ISL (obsolete, ga kepake lagi…bit size untuk frame header nya gede soalnya) ato dijadiin dot1q (802.1q)
ya kalo ga mau repot…jadiin mode access aja

nah…baru mau deh dia dikasi port security (rada2 emang nih switch layer 3)
settingan lengkapnya:

Penjelasan:
  • tanpa ada ketikan “switchport port-security“, konfig2an dibawahnya GA AKAN jalan
  • (1) default nya cuma 1 mac-address yang dicatat di port itu, bisa lebih dari 1
  • (2) kita define cara me-registrasikan itu mac-address ke switch
    • manual…abis kata2 “mac-address” kita input mac-address yang kita mau
    • sticky…device pertama yang kirim data dari port itu-lah yang dicatat mac-address nya (lo bisa bilang alat pertama yang kecolok di port itu, tapi harus kirim data dulu…ping kek, arp kek, download kek, apa aja de…yang penting ada aktifitas di port itu)
  • (3) kita define “hukuman” apa untuk mac-address2 (orang2) yang tidak diregister dan coba2 untuk masuk di port itu
    • protect: basic…device2 yang tidak ter-register mac-address nya akan di blok traffic nya
    • restrict: protect + ada basic log nya (di show port-security interface
      [nomor port] diliatin mac-address yang terakhir kali akses itu port)
    • (default) shutdown: restrict (basic logging) + di shutdown itu port nya…bring-up nya lagi mesti manual (di no shutdown)
    CCNP Level (untuk yang ini ampe kebawah2nya)
  • (4) kita bisa konfigur berapa lama itu mac-address dicatat (dalam menit)…0-1024 (value nya GENAP yah…soalnya klo bareng2 IP Phone nanti ada tulisan port-security violation, gw ga tau kenapa neeh bisa gitu)
  • (5) kita bisa konfigure, itu mac-address dilepas karena apa…dalam kasus ini adalah inactivity (idle), default-nya absolute (jadi bener2 60 menit, dilepas)
Verifikasi

  1. coba ganti alat yang kecolok di port Fa0/1 dengan yang lain (hasil nya pasti RTO-Request Time Out)…
  2. show port-security (untuk ngeliat port2 mana aja yang dikasi security)
  3. show port-security interface [port] (untuk ngeliat secara spesifik security disebuah port)
  4. show port-security address (untuk ngeliat mac-address apa aja yang ke-register/kecatet di switch)
  5. yang terakhir adalah…gw males kasih screenshotnya, haha
===================================================
2. Securing Switch with AAA Server (jadi username dan password di-store disono)
nah…ini dia yang kita bahas diatas tadi
kali ini gw pake packet tracer (gw ga ada AAA server dan ga bisa konfig nya T____T)

contoh PC0 mo telnet ke Switch (tapi username password di store/simpen di server)

Penjelasan:
  • command aaa new-model untuk ngasi tau si switch/router bahwa kita pake AAA server untuk urusan username password (yang terbaru adalah yang new-model)
  • aaa authentication login [nama otentikasi] group [radius apa tacacs+] untuk ngasi tau switch/router klo kita pake AAA tipe TACACS+ (ato radius)
  • tacacs-server host 10.1.1.1 key [password untuk koneksi Switch/Router ke Server] untuk ngasi tau dimana itu server berada
  • login authentication [nama otentikasi] untuk ngasi tau bahwa untuk telnet pake otentikasi yang uda dibikin

settingan server dipacket tracer nya ya kayak diatas ini
settingan ini juga bisa di terapkan di Router

settingan aslinya ya tergantung OS nya…Windows Server 2008 kah? 2008 R2 kah ? Linux Red Hat kah ?
(untung aja packet tracer bisa setting Switch/Router konek ke AAA Server)
cari aja di google…apa itu AAA server beserta tipe2 nya
ato cara setting AAA server on linux/windows/solaris
(kebanyakan klo mo jelasin disini)
berikut gambaran lengkap dari e-book Implementing Cisco Switched Networks

Penjelasan:
  • ketika kita ketik aaa new-model, username password local (yang di taro di startup config switch/router) ga berlaku lagi
  • konfigurasi diatas adalah konfigurasi dengan Radius AAA server, dimana kita harus nentuin port (biasanya sih 1645 port nya…kurang ada pengetahuan di AAA server gw)
sebenernya ada yang namanya 802.1X port-based authentication, tapi berhubung keterbatasan alat (server) untuk nyoba “efek” dari fitur ini…SKIP !!! haha

3. VLAN Access-list (VLAN Access-map)


gw ada pertanyaan, gimana cara PC1 agar ga bisa akses ke server…???
gw tau, pake ACL !!
mo dipasang ACL di Router?!?! lah…PC1 kan ga lewat ampe ke Router, ke switch doang kok …wong satu subnet kok ama PC0 dan Server
ohh…gw tau…pasang ACL nya di Switch (ngelirik judul diatas)
wkwkw, yap..betool, saatnya balik ke real switch (packet tracer tutup…ga ada VLAN ACL/MAP soalnya)
010213_1414_SwitchSecur28.png
klo diliat2…pola config nya mirip kek route-map di router
Penjelasan:
  • kita bikin akses list (extended ato engga itu tergantung kebutuhan)
  • create vlan access-map [nama VLAN ACL/MAP-nya] [nomor urut]
  • gw sendiri ga ngerti kenapa nomor urut mulainya dari 10…trus 20, 30 dst…don’t ask me
  • akses list nya harus PERMIT yah..klo ga permit, ya ditolak duluan sebelum di proses di VLAN ACL…haha
  • asosiasikan akses list yang kita buat ke VLAN ACL/MAP ini dengan cara match ip address [nomor ACL]
  • klo match…”tindakan” apa yang akan diambil…mo di forward ato di drop
  • baru de di “apply” ke switch nya dengan cara vlan filter [nama VLAN ACL/MAP] vlan-list [vlan2 mana aja]
  • update…gw kelupaan satu hal…di VLAN ACL/MAP ini juga terdapat implicit deny (klo lo liat gambar diatas…di drop semua tuh…termasuk yang bukan host 10.1.1.3, hahaha)
dengan VLAN ACL/MAP ini bahkan kita bisa juga filter dengan mac-address
contoh:
PC0 boleh ke Server (PC0 mac-address 00E0.B0B7.47A1, Server mac-address 0001.C7DA.A508)
revisi
Penjelasan & Kesimpulan:
  • klo di ACL biasa kita create ACL = List & Rule, trus “pasang” (apply) di interface…in ato out
  • nah, klo di VLAN ACL/MAP…List, Rule, dan Pasang nya punya definisi sendiri2
  • dalam kasus ini kita create list…siapa aja yang boleh masuk ato keluar (contoh disini mac address)
  • lalu kita buat rule untuk mac-address2 yang terdaftar di list ini tuh bisa ngapain aja
  • karena gw pengen “aturan” (rule) nya PC0 aja yang boleh ke server, berarti action nya di forwardyang laen di drop, see picture above
  • di apply/pasang de dengan vlan filter…(ini ibarat kek pasang ACL di interface…ACL uda dibuat, tapi ga dipasang ya sama aja boong)
alternatif dari VLAN ACL/MAP ini adalah kita bisa pake private-VLAN…tinggal pilih

=======================================================
4. DHCP Snooping

konfigurasi ini dimaksudkan untuk klo ada kasus kek dibawah ini

Router DHCP yang asli bertugas untuk provide IP ke “orang2 yang membutuhkan” (sedd…kek pengemis aja)

gimana klo gw ada DHCP server palsu yang kecolok ke Switch??

kan masih dapet IP dari DHCP Router yang Asli?!?

nah, sekarang gw matiin tu yang ASLI…otomatis itu device2 minta IP darimana ?!? dari DHCP Palsu donk?!?

anggeplah gw cabut colokannya dan gw ga bisa masukin DHCP palsu gw ke colokan DHCP yang asli karena uda kepasang port-security…

klo ip nya uda palsu semua…uda tinggal dimaenin deh gateway-nya…arahin traffic nya ke komputer kita…BERES !!

ini yang dinamakan DHCP Spoofing
solusinya?!? gampang…port2 yang ga digunain di shutdown aja…wkwkkw
nah, klo ga di shutdown…ada fitur namanya DHCP Snooping (bukan spoofing)untuk mencegah hal diatas terjadi

Penjelasan:
  • enable dhcp snooping dengan ip dhcp snooping
  • setelah konfig itu dimasukkan, otomatis semua port menjadi UNTRUSTED…alias ga dipercaya untuk nyebarin DHCP (kecuali di setting trusted)
  • setting vlan2 mana aja yang mo di “snooping” dengan ip dhcp snooping vlan [nomor vlan]
  • (optional) information option berguna untuk menjaga informasi yang berasal dari port itu…klo2 aja di forward request DHCP nya oleh switch, contohnya ip helper-address
  • setting interface mana yang kita percayai untuk menyebarkan DHCP dengan cara ip dhcp snooping trust
  • kita bisa setting limit DHCP request dari client (untuk mencegah kehabisan IP yang dikenal dengan DHCP Starvation Attack)
  • cuma gw aga rancu…Cisco bilang sih config nya ip dhcp limit rate 50 (nge-limit ampe 50 request per detik)
  • tapi pas gw konfig…malah BISA NYA
    ip dhcp limit lease 50 (nge-limit DHCP ngasi IP ampe 50x ke sebuah interface/port)…mungkin yang gw konfig adalah yang terbaru kali yee, hahah
Verifikasinya…show ip dhcp snooping, bisa ditambah dengan [database | binding | statistic] untuk ngeliat DHCP database, ip-to-mac address binding, dan statistic nya
=====================================================
5. DAI (Dynamic ARP inspection)

DAI ini untuk mencegah ARP poisoning
apa itu ARP Poisoning??

contoh (berdasar gambar diatas):

komputer A ga tau nih mac-address Router…tapi tau IP nya (10.1.1.1), nah…jadinya dia ngirim ARP Request ke switch tuh

disaat yang sama (ato sebelum komputer A kirim), komputer B kirim ARP dia (yang uda di utak-atik) ke switch yang menyatakan bahwa IP 10.1.1.1 itu mac-address nya pake B.B.B.B (mac-address komputer B itu sendiri)


otomatis klo komputer A kirim data ke router, si switch akan kirimnya ke komputer B (inget..Switch baca mac-address, bukan IP, dan meng-asosiasikan itu mac-address dengan port2 dia…just try to remember the MAC Table/CAM table)

begitu pula di router yang mo kirim data ke komputer A

kok bisa sih kirim ARP yang udah di utak-atik?!?”
bisa…banyak malah software nya, contohnya: ethercap, dsniff, dll
ARP yang dikirim oleh komputer B disebut Unsolicited or Gratuitous ARP (gampang nya: ARP yang tidak inginkan…arp haram…anak haram !!, wkwk)
nahhh…DAI ini gunanya mencegah supaya hal ini tidak terjadi


emang ARP ga ada authentikasi nya yah?? ga ada…klo ada authentikasi nya jadi ga cepet lagi dong transfer2an data…switch kan unggul nya itu dibandingkan router (Cuma lewat layer 2, ga ke layer 3 alias pake IP…so ga ada lagi encapsulasi2 IP header yang bisa bikin tambah lama)

Penjelasan:
  • ENABLE IP DHCP SNOOPING DULU
    ,karena DAI ini juga pake metode DHCP juga…yaitu trust or untrusted (it works well too with DHCP snooping anyways)
  • konfigurasinya mirip2 ama dhcp snooping…tinggal tambah ip arp inspection trust aja
======================================
6. IP Source Guard

langsung liat gambar aja dah…dijamin ngerti langsung, hahaha















Source : http://belajarcomputernetwork.com/tag/securing-vty-access/

Rabu, 23 September 2015

Installing and Configuring Microsoft SharePoint Server 2013 and SharePoint Farm on Windows Server 2008 R2


Abstract: In this article, we will see how to install and configure Microsoft SharePoint Server 2013 on Windows Server 2008 R2 with Step-By-Step guidance
In this article, we will see how to install and configure Microsoft SharePoint Server 2013 on Windows Server 2008 R2 with Step-By-Step guidance. I am assuming that
  • You already have preconfigured Active Directory Domain Service.
  • You already have installed SQL Server 2008 R2.
To install Microsoft SharePoint Server 2013 on Windows Server 2008 R2, you must first install Windows Server 2008 R2 Service Pack 1. You can download this Service Pack from here.
Once you have downloaded the Windows Server 2008 R2 Service Pack 1, start installing the same on your server which has Windows Server 2008 R2  -
installsrvpack
Once you have finished the installation of Service Pack 1, reboot your machine. Now open SharePoint Server 2013 setup folder and click on the Splash file in your setup, which will look similar to the following -
splash
Once the Splash screen opens, you will find an "Install Software prerequisites" link. Clicking on that link brings up a list of all software to be installed as prerequisites -
prerequisit
Click on "Next" button and accept the agreement. This will start installing the prerequisites. You will get the following confirmation screen once you finish installing all the prerequisites -
prerequisitinstallcomplete
Now restart your server. After this, go to the Installation folder of SharePoint Server 2013 and rerun the Splash screen. Click on "Install SharePoint Server" as shown below -
installsps2013
The installer now asks you enter the Product key. Enter the product key and click on continue as shown below -
enterprodkey
Now accept the agreement and go to the next step. Here the setup asks you if you want to do a -
1. Complete Installation.
2. Stand-alone Installation.
I have chosen a "Complete" installation. Now click on "Install" button which will start the installation.
installstandalone
Once the installation is complete, you will now need to run the SharePoint Products Configuration Wizard.  Make sure you have the check box "Run the SharePoint Products Configuration Wizard now" checked and click on the "Close" button as shown below -
runwizard
As soon as you click on "Close" button, SharePoint Product configuration wizard will show the welcome page as shown below -
welcomeconfigwizard
Click on the "Next" button and a warning dialog box appears as shown below -
warningbox
Click on "Yes" again.
Now it is asking you to "Connect to an existing Server farm" or "Create a new server farm". Let's make a choice of "Create a new server farm" and click Next as shown below -
newsrvfarm
The Wizard will ask for the database server name and it will provide the default configuration database name. It will also ask you to specify the database access account. Provide the appropriate information by keeping the database name default "SharePoint_Config" as shown below -
configsettings
Click on the "Next" button. If SQL Server 2008 SP1 is not installed, you will see a dialog box with an error -
configerror
To resolve this error, we need to install "SQL Server 2008 R2 SP1". To download SP1, use the following link -
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=26727
After downloading SP1, start the installation process.
sqlr2sp1
Click on the "Next" button and accept the agreement. I have already made a choice of the instance on which I would like to apply SP1 -
applysp1
In the next step, the wizard will check whether files are in use. Once the installation is completed, click on the "Next" button which brings up a complete "Summary". Let's click on "Update" button and start the update process.
Once the installation is successful, you will see the following message -
spcompleted
Let's start the "SharePoint 2013 Products Configuration Wizard" and run the same with the following specifications -
configsettings
In our next step, we will have to specify farm security. Enter the password and click on "Button" as shown below -
farmsecurity
Now provide the configuration settings for "SharePoint Central Administration Web Application" as shown below - [I am using the default settings]
configureca
The next step shows details of our configuration which we did so far  -
finalconfigdetails
Now click on "Next" button to apply the configuration setting. Once the configuration is completed, your will get a message as shown below -
configurationcompleted
Click on "Finish" button and it will start the SharePoint Central Administration website as shown below -
ca
 

Configure SharePoint 2013 Farm

Now it's time to configure our SharePoint 2013 Farm. Start the "Farm configuring Wizard" as shown below -
startwizard
Launch the Farm Configuration Wizard and click on "Start the Wizard" button. The first step is to configure the services needed to use in the farm. Enter the User Name and Password. Also make the choice of services which you want include, as shown below, and click on "Next" button -
step1
The second step is to create a site collection. I am planning to create a site collection with "Business Intelligence" template as shown below -
step2
Now click on the "OK" button. That's it! The configuration wizard will complete by creating a site. Click on "Finish" button to complete the wizard.

Source: http://www.dotnetcurry.com/sharepoint/851/install-sharepoint-server-farm-windows-server-2008