Difference between revisions of "DanteD Socks5 Proxy Server"

From RHS Wiki
Jump to navigation Jump to search
m (Rafahsolis moved page Proxy SOCKS5 to DanteD Socks5 Proxy Server without leaving a redirect)
m
Tag: visualeditor
Line 1: Line 1:
== Danted SOCKS5 Proxy Server ==
+
=== Install ===
 +
<syntaxhighlight lang="bash">
 +
sudo apt-get install dante-server
 +
sudo adduser proxyuser
 +
sudo passwd proxyuser
 +
sudo nano /etc/danted.conf
 +
</syntaxhighlight>
 +
 
 +
==Danted SOCKS5 Proxy Server==
 
/etc/danted.conf
 
/etc/danted.conf
 
  <nowiki>#logoutput: syslog
 
  <nowiki>#logoutput: syslog
#logoutput: stderr
+
#logoutput: stderr
logoutput: /var/log/danted.log
+
logoutput: /var/log/danted.log
internal: ens33 port = 1080
+
internal: ens33 port = 1080
#external: 192.168.1.158
+
#external: 192.168.1.158
external: 10.0.254.66
+
external: 10.0.254.66
# user.privileged: proxy
+
# user.privileged: proxy
user.notprivileged: nobody
+
user.notprivileged: nobody
# user.libwrap: nobody
+
# user.libwrap: nobody
method: username none
+
method: username none
client pass {
+
client pass {
        from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0
+
        from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0
        log: connect disconnect error
+
        log: connect disconnect error
}
+
}
 
+
pass {
+
pass {
    from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0
+
    from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0
    protocol: tcp udp
+
    protocol: tcp udp
}
+
}
 
+
#route {                                                                         
+
#route {                                                                         
#        from: 0.0.0.0/0 to: 0.0.0.0/0 via: 192.0.2.1 port = 1080             
+
#        from: 0.0.0.0/0 to: 0.0.0.0/0 via: 192.0.2.1 port = 1080             
#        proxyprotocol: socks_v4 socks_v5
+
#        proxyprotocol: socks_v4 socks_v5
#        method: none
+
#        method: none
#}
+
#}
 
+
#route {                                                                         
+
#route {                                                                         
#        from: 0.0.0.0/0 to: 8.8.8.8/32 port = domain via: direct               
+
#        from: 0.0.0.0/0 to: 8.8.8.8/32 port = domain via: direct               
#}   
+
#}   
</nowiki>
+
</nowiki>
== Open ssh SOCKS5 Proxy Server ==
+
==Open ssh SOCKS5 Proxy Server==
 
  ssh -ND 1111 ubuntu@ec2-52-57-220-220.eu-central-1.compute.amazonaws.com -i ~/.ssh/DNC-FKY.pem
 
  ssh -ND 1111 ubuntu@ec2-52-57-220-220.eu-central-1.compute.amazonaws.com -i ~/.ssh/DNC-FKY.pem
 
  ssh -D 10.28.0.81:1111 rafa@10.28.0.81
 
  ssh -D 10.28.0.81:1111 rafa@10.28.0.81
== Client ==
+
==Client==
 
Configure proxychains
 
Configure proxychains
 
  <nowiki># proxychains.conf  VER 3.1
 
  <nowiki># proxychains.conf  VER 3.1
#
+
#
#        HTTP, SOCKS4, SOCKS5 tunneling proxifier with DNS.
+
#        HTTP, SOCKS4, SOCKS5 tunneling proxifier with DNS.
#       
+
#       
 
+
# The option below identifies how the ProxyList is treated.
+
# The option below identifies how the ProxyList is treated.
# only one option should be uncommented at time,
+
# only one option should be uncommented at time,
# otherwise the last appearing option will be accepted
+
# otherwise the last appearing option will be accepted
#
+
#
#dynamic_chain
+
#dynamic_chain
#
+
#
# Dynamic - Each connection will be done via chained proxies
+
# Dynamic - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
+
# all proxies chained in the order as they appear in the list
# at least one proxy must be online to play in chain
+
# at least one proxy must be online to play in chain
# (dead proxies are skipped)
+
# (dead proxies are skipped)
# otherwise EINTR is returned to the app
+
# otherwise EINTR is returned to the app
#
+
#
strict_chain
+
strict_chain
#
+
#
# Strict - Each connection will be done via chained proxies
+
# Strict - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
+
# all proxies chained in the order as they appear in the list
# all proxies must be online to play in chain
+
# all proxies must be online to play in chain
# otherwise EINTR is returned to the app
+
# otherwise EINTR is returned to the app
#
+
#
#random_chain
+
#random_chain
#
+
#
# Random - Each connection will be done via random proxy
+
# Random - Each connection will be done via random proxy
# (or proxy chain, see  chain_len) from the list.
+
# (or proxy chain, see  chain_len) from the list.
# this option is good to test your IDS :)
+
# this option is good to test your IDS :)
 
+
# Make sense only if random_chain
+
# Make sense only if random_chain
#chain_len = 2
+
#chain_len = 2
 
+
# Quiet mode (no output from library)
+
# Quiet mode (no output from library)
#quiet_mode
+
#quiet_mode
 
+
# Proxy DNS requests - no leak for DNS data
+
# Proxy DNS requests - no leak for DNS data
proxy_dns  
+
proxy_dns  
 
+
# Some timeouts in milliseconds
+
# Some timeouts in milliseconds
tcp_read_time_out 15000
+
tcp_read_time_out 15000
tcp_connect_time_out 8000
+
tcp_connect_time_out 8000
 
+
# ProxyList format
+
# ProxyList format
#      type  host  port [user pass]
+
#      type  host  port [user pass]
#      (values separated by 'tab' or 'blank')
+
#      (values separated by 'tab' or 'blank')
#
+
#
#
+
#
#        Examples:
+
#        Examples:
#
+
#
#              socks5  192.168.67.78  1080    lamer  secret
+
#              socks5  192.168.67.78  1080    lamer  secret
#              http    192.168.89.3    8080    justu  hidden
+
#              http    192.168.89.3    8080    justu  hidden
#              socks4  192.168.1.49    1080
+
#              socks4  192.168.1.49    1080
#              http    192.168.39.93  8080     
+
#              http    192.168.39.93  8080     
#               
+
#               
#
+
#
#      proxy types: http, socks4, socks5
+
#      proxy types: http, socks4, socks5
#        ( auth types supported: "basic"-http  "user/pass"-socks )
+
#        ( auth types supported: "basic"-http  "user/pass"-socks )
#
+
#
[ProxyList]
+
[ProxyList]
# add proxy here ...
+
# add proxy here ...
# meanwile
+
# meanwile
# defaults set to "tor"
+
# defaults set to "tor"
# socks4        127.0.0.1 9050
+
# socks4        127.0.0.1 9050
socks5  127.0.0.1      1111
+
socks5  127.0.0.1      1111
 
+
</nowiki>
+
</nowiki>
 
Run commands with proxychains  
 
Run commands with proxychains  
 
  sudo proxychains apt-get update
 
  sudo proxychains apt-get update
 
[http://systemadmin.es/2009/04/crear-un-proxy-socks-mediante-ssh Source]
 
[http://systemadmin.es/2009/04/crear-un-proxy-socks-mediante-ssh Source]

Revision as of 09:51, 29 March 2019

Install

sudo apt-get install dante-server
sudo adduser proxyuser
sudo passwd proxyuser
sudo nano /etc/danted.conf

Danted SOCKS5 Proxy Server

/etc/danted.conf

#logoutput: syslog
 #logoutput: stderr
 logoutput: /var/log/danted.log
 internal: ens33 port = 1080
 #external: 192.168.1.158
 external: 10.0.254.66
 # user.privileged: proxy
 user.notprivileged: nobody
 # user.libwrap: nobody
 method: username none
 client pass {
         from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0
         log: connect disconnect error
 }
 
 pass {
     from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0
     protocol: tcp udp
 }
 
 #route {                                                                        
 #        from: 0.0.0.0/0 to: 0.0.0.0/0 via: 192.0.2.1 port = 1080            
 #        proxyprotocol: socks_v4 socks_v5
 #        method: none
 #}
 
 #route {                                                                        
 #        from: 0.0.0.0/0 to: 8.8.8.8/32 port = domain via: direct              
 #}  
 

Open ssh SOCKS5 Proxy Server

ssh -ND 1111 ubuntu@ec2-52-57-220-220.eu-central-1.compute.amazonaws.com -i ~/.ssh/DNC-FKY.pem
ssh -D 10.28.0.81:1111 rafa@10.28.0.81

Client

Configure proxychains

# 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 - 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 :)
 
 # Make sense only if random_chain
 #chain_len = 2
 
 # Quiet mode (no output from library)
 #quiet_mode
 
 # Proxy DNS requests - no leak for DNS data
 proxy_dns 
 
 # Some timeouts in milliseconds
 tcp_read_time_out 15000
 tcp_connect_time_out 8000
 
 # 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 ...
 # meanwile
 # defaults set to "tor"
 # socks4        127.0.0.1 9050
 socks5  127.0.0.1       1111
 
 

Run commands with proxychains

sudo proxychains apt-get update

Source