[hide=2]บทความเสมือนจริง ที่แสดงถึงการบุกรุกเครือข่ายคอมพิวเตอร์ จากการสมุมติจากตัวละคร
จุดประสงค์การเขียนบทความนี้ ก็เพื่อสร้างจิตสำนักให้บุคคลทั่วไปตะหนักถึงภัยคุกคามจากการใช้อินเตอร์เน็ท
ทีมงานประพันธ์โดย SRAN Dev Team
ตอนที่ 1 : ภัยคุกคามจากการสุ่ม password (Dictionary & brute force attack)
บทความนี้ขอสงวนสิทธิในการเผยแพร่ หากทำการคัดลอกโปรดติดต่อทีมงานพัฒนาผลิตภัณฑ์ SRAN (SRAN-Dev)
Dictionary & brute force attack
Fact : dictionary attack เป็นเทคนิคในการพยายามเดารหัสผ่าน โดยการเดาสุ่มผ่านทางรายชื่อของรหัสผ่านที่เป็นไปได้ ซึ่งมักจะเป็น dictionary ตรงข้ามกับวิธี brute force attack ซึ่งพยายามเดา โดยใช้รหัสผ่านที่เป็นไปได้ทั้งหมด การโจมตีเช่นนี้ได้ผลเนื่องจากผู้ใช้มักเลือกรหัสผ่านที่ง่ายต่อการคาดเดา
dictionary และ brute force attack อาจถูกใช้ในสองสถานการณ์หลัก ๆ คือ
ในด้าน cryptoanalysis ในความพยายามที่จะค้นหาคีย์ที่ใช้เพื่อถอดรหัสข้อมูลที่เข้ารหัสอยู่
ในด้าน computer security ในความพยายามที่จะบุกรุกเข้าสู่ระบบคอมพิวเตอร์โดยการเดารหัสผ่าน และ username เช่นเดียวกัน
Fiction : ผมเป็นนักเรียนชั้นมัธยมปลายที่สนใจในเรื่อง hacking มาก แต่ยังเพิ่มเริ่มต้น ผมจึงเริ่มต้นจากการหาข้อมูลใน IRC (Internet Relay Chat) ผมจึงเริ่มต้นโดยการเข้าไปที่ห้องที่บ่งบอกถึงเรื่องเหล่านี้การเข้าไปที่ห้องที่เป็นที่รวมของ hacker ที่ irc server แห่งหนึ่ง เข้าไปพบกับ hacker คนหนึ่งที่ใช้ชื่อว่า virtualcat เขาแนะนำให้ผมเริ่มต้นการ hack แบบง่าย ๆ โดยการใช้เทคนิคที่เรียกว่า dictionary/brute force ก่อน โปรแกรมที่ virtualcat แนะนำคือ hydra จาก http://www.thc.org
ก่อนหน้าที่ virtualcat แนะนำ hydra เขาได้แนะนำให้ผมรู้จักใช้ Linux ให้เป็นเสียก่อน โดยเขาแนะนำให้ผม ใช้ fedora ที่สามารถดาวน์โหลดได้ฟรีจาก fedora.redhat.com ผมใช้เวลาเกือบหกเดือนในการทำความคุ้นเคยกับลีนุกซ์ จนสามารถเรียนรู้ลีนุกซ์ และจดจำคำสั่งต่าง ๆ ได้อย่างดี
virtualcat แนะนำให้ผม ใช้ hydra ที่ดาวน์โหลดได้จาก url http://thc.org/releases/hydra-4.7-src.tar.gz ถึงแม้ hydra เวอร์ชั่น 5.0 จะออกมาในขณะนี้แล้วก็ตาม แต่จากที่ virtualcat ได้ใช้งานพบว่า hydra 4.7 สามารถทำงานได้เสถียรกว่า
ผมจึงได้ใช้คอมพิวเตอร์ที่บ้านที่ได้ติดตั้งลีนุกซ์แล้วเพื่อดาวน์โหลด hydra และทำการติดตั้งดังต่อไปนี้
# wget http://thc.org/releases/hydra- 4.7- src.tar.gz
–15:07:50– http://thc.org/releases/hydra- 4.7- src.tar.gz
= > `hydra- 4.7- src.tar.gz’
Resolving thc.org… 82.165.25.125
Connecting to thc.org| 82.165.25.125 |: 80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 180,964 (177 K) [application/x-tar]
100%[=========================================== >] 180,964 22.77 K/s ETA 00:00
15:07:59 (22.74 KB/s) - `hydra- 4.7- src.tar.gz’ saved [ 180964/180964]
# wget http://0xbadc0de.be/libssh/libssh-0.11.tgz
–15:10:01– http://0xbadc0de.be/libssh/libssh-0.11.tgz
=> `libssh-0.11.tgz’
Resolving 0xbadc0de.be… 213.186.57.156
Connecting to 0xbadc0de.be|213.186.57.156|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 303,761 (297K) [application/x-tar]
100%[=========================================>] 303,761 11.09K/s ETA 00:00
15:10:29 (13.79 KB/s) - `libssh-0.11.tgz’ saved [303761/303761]
จากนั้นผมจึงเซ็ตอัพ libssh ดังตัวอย่างต่อไปนี้
# tar -zxvf libssh-0.11.tgz
libssh-0.11/
libssh-0.11/Makefile.in
libssh-0.11/configure.in
libssh-0.11/configure
libssh-0.11/config.h.in
libssh-0.11/install-sh
libssh-0.11/mkinstalldirs
libssh-0.11/config.sub
libssh-0.11/config.guess
…
libssh-0.11/doc/style.css
libssh-0.11/sample.c
libssh-0.11/samplesshd.c
libssh-0.11/COPYING
libssh-0.11/README
libssh-0.11/AUTHORS
libssh-0.11/CHANGELOG
ขั้นตอน configure
# cd libssh-0.11
[root@bee libssh-0.11]# ./configure
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
…
checking for memmove… yes
checking for memset… yes
checking for select… yes
checking for socket… yes
checking for strchr… yes
checking for strdup… yes
checking for strerror… yes
checking for strstr… yes
checking for poll… yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libssh/Makefile
config.status: creating config.h
ขั้นตอน make
# make
ln -s -f ../../config.h include/libssh/config.h
gcc -g -O2 -Iinclude/ -Wall -g -c -o sample.o sample.c
gcc -g -O2 -Iinclude/ -Wall -g -c -o samplesshd.o samplesshd.c
make[1]: Entering directory `/home/pom/hack/libssh-0.11/libssh’
gcc -g -O2 -Wall -g -I../include/ -fPIC -c -o client.o client.c
gcc -g -O2 -Wall -g -I../include/ -fPIC -c -o packet.o packet.c
gcc -g -O2 -Wall -g -I../include/ -fPIC -c -o dh.o dh.c
gcc -g -O2 -Wall -g -I../include/ -fPIC -c -o crypt.o crypt.c
gcc -g -O2 -Wall -g -I../include/ -fPIC -c -o connect.o connect.c
…
make[1]: Leaving directory `/home/pom/hack/libssh-0.11/libssh’
gcc -o samplessh sample.o -lssh -Llibssh/
ln -s -sf samplessh samplesftp
gcc -o samplesshd samplesshd.o -lssh -Llibssh/
ขั้นตอน make install
# make install
make[1]: Entering directory `/home/pom/hack/libssh-0.11/libssh’
make[1]: Nothing to be done for `all’.
make[1]: Leaving directory `/home/pom/hack/libssh-0.11/libssh’
gcc -o samplessh sample.o -lssh -Llibssh/
ln -s -sf samplessh samplesftp
gcc -o samplesshd samplesshd.o -lssh -Llibssh/
make[1]: Entering directory `/home/pom/hack/libssh-0.11/libssh’
../mkinstalldirs /usr/local/include
../mkinstalldirs /usr/local/lib/
/usr/bin/install -c libssh.so /usr/local/lib/
make[1]: Leaving directory `/home/pom/hack/libssh-0.11/libssh’
./mkinstalldirs /usr/local/include/libssh
/usr/bin/install -c include/libssh/libssh.h /usr/local/include/libssh/
/usr/bin/install -c include/libssh/config.h /usr/local/include/libssh/
/usr/bin/install -c include/libssh/sftp.h /usr/local/include/libssh/
/usr/bin/install -c include/libssh/crypto.h /usr/local/include/libssh/
/usr/bin/install -c include/libssh/server.h /usr/local/include/libssh/
การเซ็ตอัพ hydra
# tar -zxvf hydra-4.7-src.tar.gz
hydra-4.7-src/
hydra-4.7-src/arm/
hydra-4.7-src/arm/gcc-arm-env.sh
hydra-4.7-src/arm/ipkg/
hydra-4.7-src/arm/ipkg/CONTROL/
hydra-4.7-src/arm/ipkg/CONTROL/control
hydra-4.7-src/arm/ipkg/usr/
hydra-4.7-src/arm/ipkg/usr/bin/
hydra-4.7-src/arm/ipkg-build
…
hydra-4.7-src/postgres_ext.h
hydra-4.7-src/pw-inspector.c
hydra-4.7-src/README
hydra-4.7-src/README.arm
hydra-4.7-src/README.palm
hydra-4.7-src/TODO
# cd hydra-4.7-src
[root@bee hydra-4.7-src]# ./configure
Starting hydra auto configuration …
Checking for openssl (libssl/ssl.h) …
… found
Checking for Postgres (libpq) …
… NOT found, module postgres disabled
Checking for SAP/R3 (librfc/saprfc.h) …
… NOT found, module sapr3 disabled
Get it from http://www.sap.com/solutions/netweav...eval/index.asp
Checking for libssh (libssh/libssh.h) …
… found
NOTE: ensure that you have libssh v0.11 installed!! Get it from http://0xbadc0de.be !
Hydra will be installed into …/bin of: /usr/local
(change this by running ./configure –prefix=path)
Writing Makefile.in …
NOTES NOTES NOTES NOTES NOTES NOTES NOTES NOTES NOTES NOTES NOTES NOTES
===============================================
ARM/PalmPilot users: please run ./configure-arm or ./configure-palm respectivly
now type “make”
ขั้นตอน make
# make
gcc - I. -Wall -O2 -o pw-inspector pw-inspector.c
gcc - I. -Wall -O2 -c hydra-vnc.c -DLIBOPENSSL -DLIBSSH -I/usr/local/include
gcc - I. -Wall -O2 -c hydra-pcnfs.c -DLIBOPENSSL -DLIBSSH -I/usr/local/include
gcc - I. -Wall -O2 -c hydra-rexec.c -DLIBOPENSSL -DLIBSSH -I/usr/local/include
gcc - I. -Wall -O2 -c hydra-nntp.c -DLIBOPENSSL -DLIBSSH -I/usr/local/include
gcc - I. -Wall -O2 -c hydra-socks5.c -DLIBOPENSSL -DLIBSSH -I/usr/local/include
gcc - I. -Wall -O2 -c hydra-telnet.c -DLIBOPENSSL -DLIBSSH -I/usr/local/include
gcc - I. -Wall -O2 -c hydra-cisco.c -DLIBOPENSSL -DLIBSSH -I/usr/local/include
….
our libraries are in a nonstandard prefix so pkg-config can find them.
make: [xhydra] Error 1 (ignored)
Now type make install
ขั้นตอน make install
# make install
test -e hydra.exe && touch Makefile || strip hydra pw-inspector
test -e hydra.exe && strip hydra.exe pw-inspector.exe || touch hydra
test -e xhydra && strip xhydra || touch Makefile
test -e hydra.exe && touch Makefile || cp hydra pw-inspector /usr/local/bin && cd /usr/local/bin && chmod 755 hydra pw-inspector
cp: cannot create regular file `/usr/local/bin/hydra’: Text file busy
make: [install] Error 1 (ignored)
test -e hydra.exe && cp hydra.exe pw-inspector.exe /usr/local/bin && cd /usr/local/bin && chmod 755 hydra.exe pw-inspector.exe || touch Makefile
test -e xhydra && cp xhydra /usr/local/bin && cd /usr/local/bin && chmod 755 xhydra
make: [install] Error 1 (ignored)
ลองดู option ของ hydra
# hydra
Hydra v4.7 [http://www.thc.org]