본문 바로가기

Learning/└◆리눅스 서버 보안

08.2_LOIC(Low Orbit lon Cannon) 툴을 사용한 DoS Attack

[실습] LOIC(Low Orbit Ion Cannon) 툴을 사용한 DoS Attack 실습

 

저궤도 이온포(Low Orbit Ion Cannon)

네트워크 스트레스 테스트 툴이다.

이 소프트웨어는 많은 공공기관을 포함한 여러 웹사이트에 분산 서비스 공격을 편하게 사용할 수 있게 도와주며, anonymous에 의해 사용되면서 유명하게 되었다.

Window 2008에서 실습했음. ( dotnetframework -> LOIC )

 

(KaliLinux)

# apt-get update

# apt-get -y install git git-core# apt-cache search mono | grep --color '^mono'

 

mono-dmcs, mono-mcs, mono-devel, monodevelop

 

# apt-get install git git-core monodevelop mono-mcs mono-dmcs

Couldn't find any package whose name or description matched "mondodevelop"

Couldn't find any package whose name or description matched "mondodevelop"

The following NEW packages will be installed:

git-core

The following packages will be REMOVED:

libafpclient0{u} libcrypt-passwdmd5-perl{u} libmozjs24d{u} libnet-daemon-perl{u}

libplrpc-perl{u} memtest86+{u} syslinux-themes-debian{u}

syslinux-themes-debian-wheezy{u} xulrunner-24.0{u}

0 packages upgraded, 1 newly installed, 9 to remove and 39 not upgraded.

Need to get 1,336 B of archives. After unpacking 55.9 MB will be freed.

Do you want to continue? [Y/n/?] Y

Get: 1 http://http.kali.org/kali/ kali/main git-core all 1:1.7.10.4-1+wheezy1 [1,336 B]

Fetched 1,336 B in 7(180 B/s)

(데이터베이스 읽는중 ...현재 366570개의 파일과 디렉터리가 설치되어 있습니다.)

..... (중략) .....

* Installing 5 assemblies from libnunit2.6-cil into Mono

libnunit-cil-dev (2.6.0.12051+dfsg-2) 설정하는 중입니다 ...

monodoc-base (2.10.8.1-8+deb7u1) 설정하는 중입니다 ...

monodevelop (3.0.3.2+dfsg-1) 설정하는 중입니다 ...

libmono2.0-cil (2.10.8.1-8+deb7u1) 설정하는 중입니다 ...

libmono-cil-dev (2.10.8.1-8+deb7u1) 설정하는 중입니다 ...

mono-devel (2.10.8.1-8+deb7u1) 설정하는 중입니다 ...

update-alternatives: using /usr/bin/mono-csc to provide /usr/bin/cli-csc (c-sharp-compiler) in 자동 모드

update-alternatives: using /usr/bin/resgen to provide /usr/bin/cli-resgen (resource-file-generator) in 자동 모드

update-alternatives: using /usr/bin/al to provide /usr/bin/cli-al (assembly-linker) in 자동 모드

update-alternatives: using /usr/bin/sn to provide /usr/bin/cli-sn (strong-name-tool) in 자동 모드

menu에 대한 트리거를 처리하는 중입니다 ...

-> 설치 에러가 발생하면 다시 실행하면 된다.

 

# mkdir /loic

# cd /loic

# wget https://raw.github.com/nicolargo/loicinstaller/master/loic.sh

-> 출력 내용 생략

 

# vi loic.sh

#!/bin/bash

# Copyfuck © 2010 q

#

# This script installs, updates and runs LOIC on Linux.

#

# Supported distributions:

# * Ubuntu

# * Debian

# * Fedora

#

# Usage: bash ubuntu_loic.bash <install|update|run>

#

 

GIT_REPO=http://github.com/NewEraCracker/LOIC.git

GIT_BRANCH=master

 

DEB_MONO_PKG="monodevelop liblog4net-cil-dev"

FED_MONO_PKG="mono-basic mono-devel monodevelop mono-tools"

 

..... (중략) ....

 

case $1 in

install)

compile_loic

;;

update)

update_loic

;;

run)

run_loic

;;

*)

echo "Usage: $0 <install|update|run>"

;;

esac

 

 

 

 

[참고] 필요하면 명령어 수행

# apt-get update

# apt-get upgrade

# apt-get install monodevelop mono-dmcs

 

[참고] 20160627일 현재 패키지가 변경되었다.

# apt-get install mono-xbuild mono-devel mono-mcs

 

# chmod 777 loic.sh

# ./loic.sh

Usage: ./loic.sh <install|update|run>

 

# ./loic.sh install (# bash loic.sh)

/usr/bin/git

MonoDevelop Build Tool

Loading solution: /loic/LOIC/LOIC.sln

Loading solution: /loic/LOIC/LOIC.sln

Loading projects ..

Building Solution: LOIC (Debug)

Building: IRC (Debug)

Performing main compilation...

WARNING: Assembly 'log4net, Version=1.2.10.0, Culture=neutral,

PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL' not found. Make sure

that the assembly exists in disk. If the reference is required to build the project

you may get compilation errors.

/usr/bin/gmcs /noconfig "/out:/loic/LOIC/bin/Debug/IRC.dll"

"/r:/usr/lib/mono/2.0/System.dll" "/r:/usr/lib/mono/2.0/System.Core.dll" /nologo

/warn:4 /debug:full /optimize- /codepage:utf8 /platform:x86 "/define:DEBUG;TRACE"

/t:library "/loic/LOIC/IRC/Client/Channel.cs" "/loic/LOIC/IRC/Client/ChannelUser.cs"

"/loic/LOIC/IRC/Client/Delegates.cs" "/loic/LOIC/IRC/Client/EventArgs.cs"

"/loic/LOIC/IRC/Client/IrcClient.cs" "/loic/LOIC/IRC/Client/IrcMessageData.cs"

..... (중략) .....

Building: LOIC (Debug)

Performing main compilation...

Compiling resource /loic/LOIC/frmMain.resx with /usr/bin/resgen2

Compiling resource /loic/LOIC/frmWtf.resx with /usr/bin/resgen2

Compiling resource /loic/LOIC/Properties/Resources.resx with /usr/bin/resgen2

/usr/bin/gmcs /noconfig "/out:/loic/LOIC/bin/Debug/LOIC.exe"

"/r:/usr/lib/mono/2.0/System.dll" "/r:/usr/lib/mono/2.0/System.Drawing.dll"

"/r:/usr/lib/mono/2.0/System.Windows.Forms.dll" "/r:/loic/LOIC/bin/Debug/IRC.dll"

"/r:/usr/lib/mono/2.0/System.Core.dll" /nologo /warn:4 /debug:full /optimize-

"/win32icon:/loic/LOIC/LOIC.ico" /codepage:utf8 /platform:x86 /main:LOIC.Program

/t:winexe "/loic/LOIC/frmMain.cs" "/loic/LOIC/frmMain.Designer.cs"

"/loic/LOIC/frmWtf.cs" "/loic/LOIC/frmWtf.Designer.cs" "/loic/LOIC/HTTPFlooder.cs"

"/loic/LOIC/Program.cs" "/loic/LOIC/Properties/AssemblyInfo.cs"

"/res:/loic/LOIC/frmMain.resources,LOIC.frmMain.resources"

"/res:/loic/LOIC/frmWtf.resources,LOIC.frmWtf.resources"

"/res:/loic/LOIC/Properties/Resources.resources,LOIC.Properties.Resources.resources"

"/loic/LOIC/Properties/Resources.Designer.cs" "/loic/LOIC/XXPFlooder.cs"

Compilation succeeded - 1 warning(s)

/loic/LOIC/frmMain.cs(180,59): warning CS0219: The variable `ipHost' is assigned but

its value is never used

Build complete -- 0 errors, 1 warning

:62 첫 번째 명령어# dpkg -l | grep liblog4net-cil-dev# apt-get -y install liblog4net-cil-dev:87

dpkg -l | grep mono-runtime

apt-get install mono-runtime

 

 

root@kali:/loic# ./loic.sh run

/usr/bin/git

MonoDevelop Build Tool

Project file not found.

/usr/bin/mono

Cannot open assembly 'bin/Debug/LOIC.exe': 그런 파일이나 디렉터리가 없습니다.

 

 

2017.03.14. loic.sh 수정

#!/bin/bash

# Copyfuck © 2010 q

#

# This script installs, updates and runs LOIC on Linux.

#

# Supported distributions:

# * Ubuntu

# * Debian

# * Fedora

#

# Usage: bash ubuntu_loic.bash <install|update|run>

#

 

GIT_REPO=http://github.com/NewEraCracker/LOIC.git

GIT_BRANCH=master

 

DEB_MONO_PKG="monodevelop liblog4net-cil-dev"

FED_MONO_PKG="mono-basic mono-devel monodevelop mono-tools"

 

lower() {

tr '[A-Z]' '[a-z]'

}

 

what_distro() {

if which lsb_release ; then

echo lsb_release -si | lower

elif grep -qi ubuntu /etc/*release ; then

echo "ubuntu"

elif [[ -e /etc/fedora-release ]] ; then

echo "fedora"

else

# Assume Debian-based

echo "debian"

fi

}

 

DISTRO=$(what_distro)

 

ensure_git() {

if ! which git ; then

if [[ $DISTRO = 'ubuntu' || $DISTRO = 'debian' ]] ; then

sudo apt-get install git

elif [[ $DISTRO = 'fedora' ]] ; then

sudo yum install git

elif [[ $DISTRO = 'kali' ]] ; then

sudo apt-get install git

fi

fi

}

 

is_loic() {

is_loic_git || { [[ -d LOIC ]] && cd LOIC && is_loic_git; }

}

 

is_loic_git() {

[[ -d .git ]] && grep -q LOIC .git/config

}

 

get_loic() {

ensure_git

if ! is_loic ; then

git clone $GIT_REPO -b $GIT_BRANCH

fi

}

 

compile_loic() {

get_loic

if ! is_loic ; then

echo "Error: You are not in a LOIC repository."

exit 1

fi

if [[ $DISTRO = 'ubuntu' || $DISTRO = 'debian' ]] ; then

sudo apt-get install $DEB_MONO_PKGS

elif [[ $DISTRO = 'fedora' ]] ; then

sudo yum install $FED_MONO_PKS

elif [[ $DISTRO = 'kali' ]] ; then

sudo apt-get install $DEB_MONO_PKGS

fi

mdtool build

}

 

run_loic() {

is_loic

if [[ ! -e bin/Debug/LOIC.exe ]] ; then

compile_loic

fi

if ! which mono ; then

if [[ $DISTRO = 'ubuntu' || $DISTRO = 'debian' ]] ; then

sudo apt-get install mono-runtime

elif [[ $DISTRO = 'fedora' ]] ; then

sudo yum install mono-runtime

elif [[ $DISTRO = 'kali' ]] ; then

sudo apt-get install mono-runtime

fi

fi

mono bin/Debug/LOIC.exe

}

 

update_loic() {

ensure_git

if is_loic ; then

git pull --rebase

compile_loic

else

echo "Error: You are not in a LOIC repository."

fi

}

 

case $1 in

install)

compile_loic

;;

update)

update_loic

;;

run)

run_loic

;;

*)

echo "Usage: $0 <install|update|run>"

;;

esac

 

 

 

 

# ./loic.sh update

/usr/bin/git

Current branch master is up to date.

/usr/bin/git

MonoDevelop Build Tool

Loading solution: /loic/LOIC/LOIC.sln

Loading solution: /loic/LOIC/LOIC.sln

Loading projects ..

# ./loic.sh run