IT 이야기2010. 12. 8. 02:01


예전에도 설명한 적이 있는 기능인데 사용하다 보니 정말 유용한 기능인듯하여 다시 한번 소개하고자 한다.

네트웍을 탐색하다 보면 IDS에 본인의 기록이 고스란히 남게 되고 정말 잘 세팅되어있는 IT부서에서 심각한 메일을 받아보게 될 것이다. 보통의 회사들이 네트웤 스캔이 금지되어 있고 굳이 IDS뿐만 아니라 방화벽에서 조차 마구잡이적인 (NMap사용자들은 아마 마구잡이로 사용하지 않을까 생각된다 ㅋ) 포트스캔은 발각되기 쉬운 행동이다.

기본적으로 -D 옵션으로 본인의 아이피를 막을 수 있다. -D me 혹은 -D localhost 와 같은 컴멘드로 가능하다. 하지만 이러한 소스코드를 안보이게 하는거 조차 룰이 잘 짜여진 방화벽이나 IDS는 찾아내거나 차단할 수 있다. 특히나 내부에서의 스캔이라면 심각한 메일을 받고자 하지 않는다면 조심해야 할 덕목(!)이다.

그래서 사용되는 추가적인 항목이 RND가 있다. RND:<숫자> 이렇게 하면 숫자만큼의 랜덤한 아이피가 생성되므로 그대는 인비져블!

사용자 삽입 이미지


그림에서 보면 73.* 로 시작하는 랜덤한 아이피가 생성된것을 볼 수 있다. 그런데 vmware로 해서 테스트를 해서 그런지 패킷이 중복되서 날라가는데 이건 왜 그러는지 연구대상이다.

아래는 nmap.org의 원문이다. 참고하기 바란다.

-D [,][,ME][,...] (Cloak a scan with decoys)

Causes a decoy scan to be performed, which makes it appear to the remote host that the host(s) you specify as decoys are scanning the target network too. Thus their IDS might report 5–10 port scans from unique IP addresses, but they won't know which IP was scanning them and which were innocent decoys. While this can be defeated through router path tracing, response-dropping, and other active mechanisms, it is generally an effective technique for hiding your IP address.

Separate each decoy host with commas, and you can optionally use ME as one of the decoys to represent the position for your real IP address. If you put ME in the sixth position or later, some common port scan detectors (such as Solar Designer's excellent Scanlogd) are unlikely to show your IP address at all. If you don't use ME, Nmap will put you in a random position. You can also use RND to generate a random, non-reserved IP address, or RND: to generate addresses.

Note that the hosts you use as decoys should be up or you might accidentally SYN flood your targets. Also it will be pretty easy to determine which host is scanning if only one is actually up on the network. You might want to use IP addresses instead of names (so the decoy networks don't see you in their nameserver logs).

Decoys are used both in the initial ping scan (using ICMP, SYN, ACK, or whatever) and during the actual port scanning phase. Decoys are also used during remote OS detection (-O). Decoys do not work with version detection or TCP connect scan. When a scan delay is in effect, the delay is enforced between each batch of spoofed probes, not between each individual probe. Because decoys are sent as a batch all at once, they may temporarily violate congestion control limits.

It is worth noting that using too many decoys may slow your scan and potentially even make it less accurate. Also, some ISPs will filter out your spoofed packets, but many do not restrict spoofed IP packets at all.

Posted by 구텐모르겐