- 전체
- 보안뉴스
- 제로데이취약점
- 해킹프로그래밍
- 웹해킹
- 해킹기법
- 정보보호
- 정보보안기사 - 국가기술자격
- 악성코드분석_리버싱
- 시큐어코딩_개발보안진단원
- CISSP
- CISA
- 모의해킹_penetration-test
- deepweb / tor network
- Kali Linux
해킹기법 tor 네트워크 proxychains, : Kali Linux Tutorial: Setting Up ProxyChains + Tor For Anonymity and Security
2016.08.08 22:54
tor 네트워크 proxychains, :
Kali Linux Tutorial: Setting Up ProxyChains + Tor For Anonymity and Security
Kali Linux Tutorial: Setting Up ProxyChains + Tor For Anonymity and Security
여러 곳을 우회해서 들어가기 때문에 성능은 떨어짐
1. 소개(Overview)
Hack anonymously is one of the important aspect of Information Security, if you want to conduct penetration testing on a remote computer then active connection is required which surely reveal your identity, sometimes you need to hide your identity while doing vulnerability assessment because of your anonymity and security. Proxy Chaining is a concept which is very helpful to hide an identity on the Internet.
The worst thing that can happen to any hacker is being detected by a security admin, the security technologies (IDS, firewall, etc.), or a forensic investigator.
Every time we send a packet to our intended target, that packet contains our IP address in the IP header. When we make a TCP connection, the target system will log our IP address as it logs all connections. If we set off any security alarms or alerts, our IP address will be logged. All of these events increase the possibility of detection.
In order to hack anonymously with the least chance of detection, we need to use an intermediary machine whose IP address will be left on the target system. This can be done by using proxies.
These systems are designed to accept our traffic and then forward it on to the intended target. Of course, the proxy will likely log our traffic, but an investigator would have to get a subpoena or search warrant to obtain the logs.
If we string multiple proxies in a chain, we make it harder and harder to detect our original IP address. If one of those proxies is outside the jurisdiction of the victim, it makes it very unlikely that any traffic can be attributed to our IP address.
In Kali Linux we have an excellent tool for proxying our traffic called proxychains. In this tutorial, I will show how to use this simple, but powerful tool.
웹 프록시(Web Proxy) 용도?
- 좋은 용도: (ㄱ) 웹 성능을 높이기 위해 사용, (ㄴ) 보안 강화를 위해 사용
- 나쁜 용도: (ㄱ) 소스 IP를 숨기기 위해 사용,(ㄴ) 코드 수정/변조를 위해 사용
왜 proxychains 필요한가?
- 일반 web proxy: 웹 브라우저에서 웹 proxy 지정하여 인터넷을 한다.
- proxychains : 웹 브라우저 뿐만 아니라 일반 명령어도 proxy 지정하여 스캐닝 작업을 할 수 있다.
일반 proxy와 proxychains 차이점?
다음 문서를 참고 한다.
2. 일반 프록시/프록시 체인(Normal Proxy Vs Proxy Chaining) 비교
■ 일반 프록시(Normal Proxy)
⚫ This is the concept of simple proxy, when a user uses one proxy server to hide his/her identity. Read my previous post to know more about Proxies: Top Ten Free Proxy Websites For Anonymous Surfing
■ 프록시 체인(Proxy Chaining) user가 server1을 지정하면 server1 -> server2, server2-> server3
을 지정. 중간에 있는 사람이 마음만 먹으면 자료를 가로채기 가능
하기에 안전하지 않다.
⚫ Now the usage of multiple proxies at a time is called Proxy Chaining, it is reliable in-terms to hide the identity. In simple words Proxy Chaning is the process to use multiple proxies in chain.
3. 프록시 체인은 무엇인가?(What is Proxy Chains?)
The basic concept of proxy chaining is discussed now in this section we will discuss the practical aspect of Proxy Chaining, Proxy Chains (ProxyChains) is an open source program which allows you to make TCP and DNS connection by using proxy for example TOR.
TOR is not necessary for proxychains, you may use any SOCKS 4, SOCKS 5 and HTTPS proxy. There are so many advantages of Proxy Chains for example:
• Hide identity
• It can bypass Firewall (If you are behind a firewall or local proxy server)
• And many more
4. 프록시 체인 설정 과정
① Proxy Chains/Tor 설치
⚫ In Kali Linux proxychains is already configured but if you are using any other version of
Linux you may download it from official website. Follow the command mentioned below to get
proxychains via terminal.
⚫ 칼리리눅스에 기본설치되어 있음
⚫ 만약 설치되어 있지 않다면 apt-get 명령어를 통해 설치한다.
# apt-get install proxychains libproxychains3
- Tor 기본설치가 되어 있지 않으므로 따로 설치해야 한다.
# apt-get update
-> 출력내용 생략
# apt-get install proxychains libproxychains3
|
패키지 목록을 읽는 중입니다... 완료 의존성 트리를 만드는 중입니다 상태 정보를 읽는 중입니다... 완료 libproxychains3 패키지는 이미 최신 버전입니다. libproxychains3 패키지 수동설치로 지정합니다. proxychains 패키지는 이미 최신 버전입니다. 0개 업그레이드, 0개 새로 설치, 0개 제거 및 64개 업그레이드 안 함. |
-> KaliLinux는 proxychains 프로그램이 설치되어 있다.
# apt-get install tor
|
패키지 목록을 읽는 중입니다... 완료 의존성 트리를 만드는 중입니다 상태 정보를 읽는 중입니다... 완료 다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다: libafpclient0 libcrypt-passwdmd5-perl libmozjs24d libnet-daemon-perl libplrpc-perl memtest86+ syslinux-themes-debian syslinux-themes-debian-wheezy xulrunner-24.0 Use 'apt-get autoremove' to remove them. 다음 패키지를 더 설치할 것입니다: tor-geoipdb torsocks 제안하는 패키지: mixmaster xul-ext-torbutton tor-arm polipo privoxy apparmor-utils 다음 새 패키지를 설치할 것입니다: tor tor-geoipdb torsocks 0개 업그레이드, 3개 새로 설치, 0개 제거 및 36개 업그레이드 안 함. 2,585 k바이트 아카이브를 받아야 합니다. 이 작업 후 7,247 k바이트의 디스크 공간을 더 사용하게 됩니다. 계속 하시겠습니까 [Y/n]? Y ..... (중략) ..... Something or somebody made /var/lib/tor disappear. Creating one for you again. Something or somebody made /var/log/tor disappear. Creating one for you again. update-rc.d: We have no instructions for the tor init script. update-rc.d: It looks like a network service, we disable it. insserv: warning: current start runlevel(s) (empty) of script `tor' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `tor' overrides LSB defaults (0 1 6). torsocks (1.2-3) 설정하는 중입니다 ... tor-geoipdb (0.2.4.27-1) 설정하는 중입니다 ... |
Debian 계열 Redhat 계열
----------------------------------------------------------
(현재) # service tor start # service tor start
(부팅) # update-rc.d tor enable # chkconfig tor on
# service tor start
|
[ ok ] Starting tor daemon...done. |
# service tor status
|
● tor.service - LSB: Starts The Onion Router daemon processes Loaded: loaded (/etc/init.d/tor) Active: active (running) since 월 2016-02-01 14:58:53 KST; 6s ago Process: 2877 ExecStart=/etc/init.d/tor start (code=exited, status=0/SUCCESS) CGroup: /system.slice/tor.service └─2889 /usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc --hush
2월 01 14:58:53 kali tor[2877]: Starting tor daemon...done. |
# netstat -an | grep 9050
|
tcp 0 0 127.0.0.1:9050 0.0.0.0:* LISTEN |
# netstat -antp /* -a : all, -n : numeric, -t : tcp, -p : process */
|
Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3209/sshd tcp 0 0 127.0.0.1:9050 0.0.0.0:* LISTEN 4973/tor tcp 0 0 192.168.10.50:54874 37.235.71.102:443 ESTABLISHED 4973/tor tcp 0 0 192.168.10.50:47002 171.25.193.9:80 ESTABLISHED 4973/tor tcp 0 0 192.168.10.50:52581 188.120.243.32:9001 ESTABLISHED 4973/tor tcp 0 0 192.168.10.50:36772 131.188.40.189:443 ESTABLISHED 4973/tor tcp 0 0 192.168.10.50:51982 23.92.18.98:443 ESTABLISHED 4973/tor tcp6 0 0 :::22 :::* LISTEN 3209/sshd |
② 칼리리눅스에서 proxychains 검색하기(Finding proxychains in Kali Linux)
⚫ As we can see in the screenshot below, proxychains is in the /usr/bin directory. Since /usr/bin is in our PATH variable, we can use it from any directory. This is just as we would want since we use proxychains with other commands, which may NOT likely be in the PATH variable.
Debian 계열 Redhat 계열
------------------------------------------------------------
(목록) # dpkg -L proxychains # rpm -ql proxychains
# locate proxychains ( # dpkg -L proxychains )
|
/etc/proxychains.conf /usr/bin/proxychains /usr/lib/libproxychains.so.3 /usr/lib/libproxychains.so.3.0.0 /usr/lib/proxychains3 /usr/lib/proxychains3/proxyresolv /usr/share/applications/kali-proxychains.desktop /usr/share/doc/libproxychains3 /usr/share/doc/proxychains /usr/share/doc/libproxychains3/changelog.Debian.gz /usr/share/doc/libproxychains3/changelog.gz /usr/share/doc/libproxychains3/copyright /usr/share/doc/proxychains/AUTHORS /usr/share/doc/proxychains/README /usr/share/doc/proxychains/TODO /usr/share/doc/proxychains/changelog.Debian.gz /usr/share/doc/proxychains/changelog.gz /usr/share/doc/proxychains/copyright /usr/share/kali-menu/applications/kali-proxychains.desktop /usr/share/man/man1/proxychains.1.gz /var/cache/apt/archives/libproxychains3_3.1-3kali1_i386.deb /var/cache/apt/archives/proxychains_3.1-3kali1_all.deb /var/lib/dpkg/info/libproxychains3.conffiles /var/lib/dpkg/info/libproxychains3.list /var/lib/dpkg/info/libproxychains3.md5sums /var/lib/dpkg/info/libproxychains3.postinst /var/lib/dpkg/info/libproxychains3.postrm /var/lib/dpkg/info/libproxychains3.shlibs /var/lib/dpkg/info/proxychains.list /var/lib/dpkg/info/proxychains.md5sums |
③ proxychains 사용법 확인(Proxychains Syntax)
The syntax for the proxycahins command is simple and straightforward.
(명령어 형식)
# proxychains <the command you want proxied> <any arguments>
(예) # nmap -sS 192.168.20.200
(예) # proxychains nmap -sS 192.168.20.200
# man proxychains
|
NAME ProxyChains - redirect connections through proxy servers
SYNTAX proxychains <program>
DESCRIPTION This program forces any tcp connection made by any given tcp client to follow through proxy (or proxy chain). It is a kind of proxifier.
It acts like sockscap / premeo / eborder driver (intercepts TCP calls).
This version (2.0) supports SOCKS4, SOCKS5 and HTTP CONNECT proxy servers. Auth-types: socks - "user/pass" , http - "basic".
When to use it ?
1) When the only way to get "outside" from your LAN is through proxy server.
2) When you are behind restrictive firewall which filters outgoing connections to some ports.
3) When you want to use two (or more) proxies in chain: like: your_host <--> proxy1 <--> proxy2 <--> target_host
4) When you want to "proxify" some programs with no proxy support built-in (like telnet).
5) When you dont want to pay for eBorder / premeo socks driver :)
Some cool features: * This program can mix different proxy types in the same chain
like: your_host <-->socks5 <--> http <--> socks4 <--> http <--> target_host
* Different chaining options supported like: take random proxy from the list. or : chain proxies in exact order or : chain proxies in dynamic order (smart exclude dead proxies from chain)
* You can use it with any TCP client application, even network scanners. yes, yes - you can make portscan via proxy (or chained proxies) for example with Nmap scanner by fyodor (www.insecure.org/nmap).
proxychains nmap -sT -PO -p 80 -iR (find some webservers through proxy)
NOTE: to run suid/sgid programs(like ssh) through proxychains you have to be root
FILES proxychains looks for config file in following order:
./proxychains.conf
$(HOME)/.proxychains/proxychains.conf
/etc/proxychains.conf
see more in /etc/proxychains.conf
EXAMPLES To run this program the standard way type:
proxychains telnet targethost.com
in this example it will run telnet through proxy(or chained proxies) specified by proxychains.conf |
④ proxychains 설정 파일 세팅(Set Up the Config File)
⚫ Now it is time to configure proxychains, there are two options that can be used whether use
nano/gedit to edit config file on terminal and the other option is to use your favorite editor, both commands are mentioned below.
- gedit 편집기는 기본설치되어 있지 않다. 따라서 설치를 별도로 해야 한다.
# apt-get install gedit gedit-common
Dynamic Chain 알아서 요청(자동)
Strict Chain 직접 지정해서 요청(수동)
# nano /etc/proxychains.conf
or
# sudo gedit /etc/proxychains.conf /* gedit 기본 설치되어 있지 않다. */
|
..... (중략) ..... # ProxyList format # type host port [user pass] # (values separated by 'tab' or 'blank') # # # Examples: # # socks5 192.168.67.78 1080 lamer secret # http 192.168.89.3 8080 justu hidden # socks4 192.168.1.49 1080 # http 192.168.39.93 8080 # # # proxy types: http, socks4, socks5 # ( auth types supported: "basic"-http "user/pass"-socks ) # [ProxyList] # add proxy here ...
<---- 이 자리에 원하는 proxy 서버를 등록한다. ---->
# meanwile # defaults set to "tor" socks4 127.0.0.1 9050 /* tor 기본 설치 되어 있지 않으므로 따로 설치한다. */ |
- To get proxychains to use intermediary proxies, we simply need to add the IP addresses of the proxies we want to use here. It's important to note that proxychains defaults to use Tor.
- Notice the last line in the screenshot above. It directs proxychains to send the traffic first through our host at 127.0.0.1 on port 9050 (the default Tor configuration). If you are using Tor, leaves this as it is. If you are not using Tor, you will need to comment out this line.
⑤ proxychains 테스트(Let's Test It)
Now that we have put a proxy between us and any traffic we send, let's test it out. In this case, I am simply going to do an nmap scan mytestsite.com anonymously by sending the scan through a proxy. The command would be as follows:
# nslookup www.soldesk.com
|
Server: 168.126.63.1 Address: 168.126.63.1#53
Non-authoritative answer: Name: www.soldesk.com Address: 183.111.174.9 |
# proxychains nmap -sS 183.111.174.9
|
ProxyChains-3.1 (http://proxychains.sf.net)
Starting Nmap 6.47 ( http://nmap.org ) at 2015-06-23 10:50 KST RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 Stats: 0:02:27 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan SYN Stealth Scan Timing: About 81.76% done; ETC: 10:53 (0:00:33 remaining) Nmap scan report for 183.111.174.9 Host is up (0.98s latency). Not shown: 976 closed ports PORT STATE SERVICE 21/tcp open ftp 22/tcp open ssh 23/tcp open telnet 25/tcp open smtp 80/tcp open http 81/tcp filtered hosts2-ns 82/tcp open xfer 83/tcp open mit-ml-dev 110/tcp open pop3 113/tcp filtered ident 135/tcp filtered msrpc 139/tcp filtered netbios-ssn 445/tcp filtered microsoft-ds 514/tcp filtered shell 587/tcp open submission 873/tcp filtered rsync 888/tcp filtered accessbuilder 1311/tcp filtered rxmon 3128/tcp filtered squid-http 3306/tcp open mysql 4444/tcp filtered krb524 5000/tcp filtered upnp 5432/tcp filtered postgresql 6667/tcp filtered irc
Nmap done: 1 IP address (1 host up) scanned in 171.50 seconds |
- As you can see in the screenshot above, I have successfully scanned mytestsite.com through my chosen proxy and returned the results back to me. In this way, it appears that my proxy scanned mytestsite.com and not my IP address.
⑥ 추가 사항(Add More Proxies)
First, let's add some more proxies to our list.
# sudo gedit /etc/proxychains.conf
|
..... (중략) ..... # ProxyList format # type host port [user pass] # (values separated by 'tab' or 'blank') # # # Examples: # # socks5 192.168.67.78 1080 lamer secret # http 192.168.89.3 8080 justu hidden # socks4 192.168.1.49 1080 # http 192.168.39.93 8080 # # # proxy types: http, socks4, socks5 # ( auth types supported: "basic"-http "user/pass"-socks ) # [ProxyList] # add proxy here ... #------------------------------------------------------------------------------------- # Proxy List # EX: <Protocol> <Proxy Server IP> <Proxy Server Port> <Proxy User Name> <Proxy User Pass> # EX: http 211.181.34.74 82 user01 user01 sock4 5.9.212.53 9559 sock4 89.169.1.81 80 http 211.181.34.74 82 socks4 61.147.67.2 #-------------------------------------------------------------------------------------
# meanwile # defaults set to "tor" socks4 127.0.0.1 9050 socks5 127.0.0.1 9050 |
# proxychains firefox http://www.daum.net
여러 곳을 거쳐서 접속하기 때문에 굉장히 느리다.
dnsleaktest.com 으로 확인하면 다른 나라에서 접속했다고 나온다.
# firefox http://www.dnsleaktest.com
⑦ 프록시 체인 주설정 파일 설정(Proxychaining)
- Now that we have multiple IPs in our proxychain.conf we can set up dynamic chaining. Dynamic chaining will enable us to run our traffic through every proxy on our list, and if one of the proxies is down or not responding, it will automatically go to the next proxy in the list without throwing an error.
To do so, let's first open the proxychains configuration file again.
# sudo gedit /etc/proxychains.conf
|
# proxychains.conf VER 3.1 # # HTTP, SOCKS4, SOCKS5 tunneling proxifier with DNS. #
# The option below identifies how the ProxyList is treated. # only one option should be uncommented at time, # otherwise the last appearing option will be accepted # [수정전] #dynamic_chain [수정후] dynamic_chain # # Dynamic - Each connection will be done via chained proxies # all proxies chained in the order as they appear in the list # at least one proxy must be online to play in chain # (dead proxies are skipped) # otherwise EINTR is returned to the app # strict_chain # # Strict - Each connection will be done via chained proxies # all proxies chained in the order as they appear in the list # all proxies must be online to play in chain # otherwise EINTR is returned to the app # #random_chain # # Random - Each connection will be done via random proxy # (or proxy chain, see chain_len) from the list. # this option is good to test your IDS :) ..... (중략) ..... |
- With this file open, uncomment out the "dynamic_chains" line. This will enable dynamic chaining of our proxies allowing for greater anonymity and trouble-free hacking.
⑧ 랜덤 체인 구성(Random Chaining)
⚫ Finally, we can also use "random chaining". With this option, proxychains will randomly choose IP addresses from our list and use them for creating our proxychain. This means that each time we use proxychains, the chain of proxy will look different to the target, making it harder to track our traffic from its source.
- To do so, open the /etc/proxychains.conf file and comment out "dynamic chains" and uncomment "random chain". Since we can only use one of these options at a time, make certain that you comment out the other options in this section before using proxychains.
In addition; you may want to uncomment the line with "chain_len". This will determine how many of the IP addresses in your chain will be used in creating your random proxy chain.
# sudo gedit /etc/proxychains.conf
|
# proxychains.conf VER 3.1 # # HTTP, SOCKS4, SOCKS5 tunneling proxifier with DNS. #
# The option below identifies how the ProxyList is treated. # only one option should be uncommented at time, # otherwise the last appearing option will be accepted # [수정전] #dynamic_chain [수정후] dynamic_chain # # Dynamic - Each connection will be done via chained proxies # all proxies chained in the order as they appear in the list # at least one proxy must be online to play in chain # (dead proxies are skipped) # otherwise EINTR is returned to the app # strict_chain # # Strict - Each connection will be done via chained proxies # all proxies chained in the order as they appear in the list # all proxies must be online to play in chain # otherwise EINTR is returned to the app # [수정전] #random_chain [수정후] random_chain # # Random - Each connection will be done via random proxy # (or proxy chain, see chain_len) from the list. # this option is good to test your IDS :) ..... (중략) ..... |
⚫ Now that you know how to use proxychains, you can do your hacking with relative anonymity. I say relative, because there is no surefire way to remain anonymous with the NSA spying on all our activity. All we can do is make detection MUCH harder, and proxychains can help do this for us.
(정리) KaliLinux에서의 설정
용어 정리: proxy chains -> tor network
설정 방법:
# apt-get install proxychains libproxychains3
# apt-get install tor
# service tor restart
# proxychains CMD
5. 참고사이트
- http://proxychains.sf.net
- http://picateshackz.blogspot.kr/2015/05/kali-linux-tutorial-setting-up.html
■ How to Install the New Tor Browser in Kali Linux
https://www.youtube.com/watch?v=ASevV1QQIag
■ Installing And Configuring ToR with Proxychains on Kali Linux + Usage Examples
https://www.youtube.com/watch?v=d91w9D1FPIk
■ Tor Installation Configuration with Proxychains in Kali Linux
https://www.youtube.com/watch?v=NlzMOwmEmVM
■ How To Anonymise Your Self in Kali Linux using ProxyChains - Lecture 06
https://www.youtube.com/watch?v=l_5OyoIATX0
[출처] tor 네트워크 proxychains|작성자 ksp7891
[출처] http://blog.naver.com/PostView.nhn?blogId=ksp7891&logNo=220615167253
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 공지 | 침투테스트(취약점검점검, 모의해킹) 문의 / 답변 | 졸리운_곰 | 2017.12.10 | 28360 |
| 1 |
[Kali Linux] 칼리 리눅스 - 한글 깨짐 현상 해결방법
| 졸리운_곰 | 2024.12.21 | 150 |

