Tuesday, February 12, 2008

SQL Injection

Apa itu SQL Injection ?
  • Vulnerable system / internet website

  • Magic code

  • code string -> 'a or 'a' = a'

  • a' or 't'='t
    Pada username masukkan = admin
    Password “ = `1 or `1`=`1

    Atau

    Pada username masukkan = `1 or `1`=`1
    Password “ = `1 or `1`=`1

    Sistem tidak dapat detect ( ` `@ ` ` ) krn x ada username / password (user/pengguna) yg letak spt itu melainkan string shj spt 1 or 1 = 1, tidak `1 or `1`=`1.

SQL injection is a technique that exploits a security vulnerability occurring in the database layer of an application. The vulnerability is present when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and thereby unexpectedly executed. It is in fact an instance of a more general class of vulnerabilities that can occur whenever one programming or scripting language is embedded inside another.


Reference: Wikipedia, the free encyclopedia



Tujuan SQL injection :
  • DOS ( Denial of services)

  • Access / akses

  • Modify


HOW TO PROTECT FROM SQL INJECTION

  • protect di application level

  • server level

  1. if...else statement ( di bhg login )

  2. escape ' 1 ' single code

  3. parameter statement

4. Username -> email


password -> password

(Berikut adalah contoh coding SQL utk paparan interface di atas )


$ SQL = " SELECT nama_penyelia, tahap_penyelia, id_penyelia

FROM penyelia WHERE username = '$name' and

password = '$pass';



* Letakkan coding dibawah utk prevent SQL Injection : ataupun syarat dimana jika ada Hackers yg letakkan Magic Code x' or '1' = '1 maka website telah detect & akses tidak dibenarkan.

* variable name dihantar / dibaca dari belakang ke depan iaitu :

Tujuan if...else statement = utk - > (jika website sendiri)

  1. check $name contain
  2. reject- jika ada single code / reject jika true

* Server + mod security + Apache ( utk prevent injection di server jika melibatkan byk website)

* Setkn single code + SQL code (Magic string) di server utk reject sebarang cubaan hack.


Sniffer

Sniff = hidu @ menghidu data yang dihantar antara pc.

Sniffer = tools untuk hidu.

Network sniffer & Packet Sniffer.

Free useful sniffer software from internet :
  1. Cain

  2. Ethercap
Dimana kedua-duanya menggunakan konsep MITM.

Objektif :
  • untuk sniff apa yang pc orang lain buat (aktiviti)

  • alat / tools untuk hack password, poison network, email
Sniffer
  • plain -> hidu

  • MITM ( Men in the middle)


Skill set : (untuk mahir menggunakan sniffer)
  1. Ip Addressing

  2. Indentify - (target (tahu pc mana yg dikehendaki) & source

  3. Ptotokol - Tcp/Ip

  4. Filtering

htttps = guna port 443

http = port 80

Ms Outlook / email sistem = 25 & 110

Utk sniff ke google, tindakan yg perlu dilakukan :
  • Sniff ke pc D & sniff ke router shj krn laluan yang sama akan dilalui utk sniff & google menghantar semula penghantaran (jwpn)
  • Tetapi apabila aktiviti sniff dilakukan pc A @ lain2 pc tidak dapat sniff / lakukan aktiviti lain kerana kekacauan (sniff) menyebabkan network menjadi slow.

Monday, February 11, 2008

Tools yg telah dipraktikkan cara pengggunaannya.

UTP backbone cable


Serial Cable

Router back


Router back



Console Cable
Cisco router2600





Monday, February 04, 2008

Friday, February 01, 2008

4 UTP Cable


NETWORK CABLING

4 UTP CABLE :

  1. Unshielded Twisted Pair

  2. Shielded Twisted Pair

  3. Coaxial Cable

  4. Fiber Optic Cable

* kabel-kabel UTP boleh ditarik / digunakan sepjg max 100 meter.
1. Unshielded Twisted Pair

Telekomunikasi - ( Telefon, Internet, pc 2 pc, point 2 point, node 2 node)


DEFINITION: This definition closely duplicates the definition for twisted pair.

Unshielded twisted pair is the most common kind of copper telephone wiring. Twisted pair is the ordinary copper wire that connects home and many business computers to the telephone company. To reduce crosstalk or electromagnetic induction between pairs of wires, two insulated copper wires are twisted.


Reference : http://www.bitpipe.com/tlist/Unshielded-Twisted-Pair-Cable.html




2. Shielded Twisted Pair
Pengalir - ( tahan gangguan elektrik / elektronik, distance )




3. Coaxial Cable

Tv, CCTV

Coaxial Cable - Orginally used for the cable television industry coaxial cable is now widely used for computer networks. Although it is more expensive than standard telephone wires it is less susceptible to interference and can transmit more data.


Reference - http://www.24by7.ca/glossary.htm



4. Fiber Optic Cable
Terdapat gentian kaca di dalamnya. – (Mahal, Rapuh, Tahan haba & kelembapan, cahaya, noise (bunyi bising), Server, Penghantaran data (laju)

Defination :
Optical fiber (or "fiber optic") refers to the medium and the technology associated with the transmission of information as light pulses along a glass or plastic wire or fiber. Optical fiber carries much more information than conventional copper wire and is in general not subject to electromagnetic interference and the need to retransmit signals. Most telephone company long-distance lines are now of optical fiber.
Transmission on optical fiber wire requires repeaters at distance intervals. The glass fiber requires more protection within an outer cable than copper. For these reasons and because the installation of any new wiring is labor-intensive, few communities yet have optical fiber wires or cables from the phone company's branch office to local customers (known as local loops).
A type of fiber known as single mode fiber is used for longer distances; multimode fiber fiber is used for shorter distances.