├── ChangeLog ├── INSTALL ├── License ├── Makefile.in ├── SOLARIS.NOTES ├── TODO ├── admin └── login │ ├── Copia di login2.html │ ├── OK.html │ ├── answer.php │ ├── bg.png │ ├── bottone.png │ ├── bottone2.png │ ├── button.png │ ├── button_blue_left.png │ ├── button_blue_right.png │ ├── constring.php │ ├── getuser.php │ ├── header_bg.png │ ├── index.php │ ├── index.php.ORIG │ ├── input_left.png │ ├── input_right.png │ ├── lock_icon.gif │ ├── login.css.OLD │ ├── login.php │ ├── login.php.ORIG │ ├── login2.html │ ├── login_new.css │ ├── login_table.sql │ ├── loginerror.php │ ├── password.jpg │ ├── password.png │ ├── selectuser.js │ ├── username.png │ └── whoyou.php ├── build ├── README.build ├── mod_bot.mk ├── mod_bot2.mk ├── mod_top.mk └── mod_top2.mk ├── common ├── Makefile ├── Makefile.in ├── SS5MySql.c ├── SS5OpenLdap.c └── SS5Radius.c ├── conf ├── examples │ ├── admin │ ├── ss5.conf │ ├── ss5.ha │ └── ss5.passwd ├── ss5.conf ├── ss5.ha ├── ss5.init ├── ss5.passwd └── ss5.sysconfig ├── configure ├── configure.ac ├── doc ├── README.BALANCE ├── README.CONSOLE ├── README.EPOLL ├── README.MODULES ├── README.SS5SRV ├── ldap │ ├── README.ldap │ └── examples │ │ ├── entries.ldif │ │ └── slapd.conf └── pam │ ├── README.pam │ └── examples │ └── ss5.pam ├── include ├── SS5Basic.h ├── SS5Core.h ├── SS5Debug.h ├── SS5Defs.h ├── SS5ExternalProgram.h ├── SS5GSSApi.h ├── SS5Main.h ├── SS5Mod_authentication.h ├── SS5Mod_authorization.h ├── SS5Mod_balance.h ├── SS5Mod_bandwidth.h ├── SS5Mod_dump.h ├── SS5Mod_filter.h ├── SS5Mod_log.h ├── SS5Mod_proxy.h ├── SS5Mod_socks4.h ├── SS5Mod_socks5.h ├── SS5Mod_statistics.h ├── SS5Modules.h ├── SS5MySql.h ├── SS5OpenLdap.h ├── SS5Pam.h ├── SS5Radius.h ├── SS5Server.h ├── SS5Srv.h ├── SS5Supa.h ├── SS5Thread.h ├── SS5Utils.h ├── SockAddr ├── config.h └── config.h.in ├── install-sh ├── man ├── FreeBSD │ ├── ss5.1.gz │ ├── ss5.conf.5.gz │ ├── ss5.ha.5.gz │ ├── ss5.pam.5.gz │ ├── ss5.passwd.5.gz │ ├── ss5_gss.5.gz │ ├── ss5_supa.5.gz │ └── ss5srv.1.gz ├── Linux │ ├── ss5.1.bz2 │ ├── ss5.1.gz │ ├── ss5.conf.5.bz2 │ ├── ss5.conf.5.gz │ ├── ss5.ha.5.bz2 │ ├── ss5.ha.5.gz │ ├── ss5.pam.5.bz2 │ ├── ss5.pam.5.gz │ ├── ss5.passwd.5.bz2 │ ├── ss5.passwd.5.gz │ ├── ss5_gss.5.bz2 │ ├── ss5_gss.5.gz │ ├── ss5_supa.5.bz2 │ ├── ss5_supa.5.gz │ ├── ss5srv.1.bz2 │ └── ss5srv.1.gz └── SunOS │ ├── ss5.1 │ ├── ss5.conf.5 │ ├── ss5.ha.5 │ ├── ss5.pam.5 │ ├── ss5.passwd.5 │ ├── ss5_gss.5 │ ├── ss5_supa.5 │ └── ss5srv.1 ├── modules ├── Makefile.in ├── mod_authen │ ├── Makefile.in │ ├── SS5Basic.c │ ├── SS5ExternalProgram.c │ ├── SS5Mod_authentication.c │ ├── SS5Pam.c │ └── SS5Supa.c ├── mod_author │ ├── Makefile.in │ └── SS5Mod_authorization.c ├── mod_balance │ ├── Makefile.in │ ├── README.balamgr │ ├── SS5Logo.jpg │ ├── SS5Mod_balance.c │ └── balamgr.c ├── mod_bandwidth │ ├── Makefile.in │ └── SS5Mod_bandwidth.c ├── mod_dump │ ├── Makefile.in │ └── SS5Mod_dump.c ├── mod_filter │ ├── Makefile.in │ └── SS5Mod_filter.c ├── mod_log │ ├── Makefile.in │ └── SS5Mod_log.c ├── mod_proxy │ ├── Makefile.in │ └── SS5Mod_proxy.c ├── mod_socks4 │ ├── Makefile.in │ └── SS5Mod_socks4.c ├── mod_socks5 │ ├── Makefile.in │ └── SS5Mod_socks5.c ├── mod_statistics │ ├── Makefile.in │ ├── README.statmgr │ ├── SS5Logo.jpg │ ├── SS5Mod_statistics.c │ └── statmgr.c └── module.install └── src ├── Makefile.in ├── SS5Core.c ├── SS5Debug.c ├── SS5GSSApi.c ├── SS5Main.c ├── SS5Modules.c ├── SS5Server.c ├── SS5Srv.c ├── SS5Thread.c └── SS5Utils.c /INSTALL: -------------------------------------------------------------------------------- 1 | Linux installation using source RPM 2 | ================================== 3 | 4 | 1. To compile ss5, type: 5 | 6 | rpmbuild --rebuild ss5-X.Y-mrZ.src.rpm 7 | 8 | 2. To install ss5, type: 9 | 10 | rpm -ivh ss5-X.Y-mrZ.i386.rpm 11 | 12 | 3. To remove ss5, type: 13 | 14 | rpm -e ss5-X.Y-mrZ.i386.rpm 15 | 16 | 17 | Linux installation using tar.gz 18 | ================================== 19 | 20 | 1. cd to the directory containing the ss5 source code 21 | and type: 22 | 23 | ./configure 24 | 25 | 2. To compile ss5, type: 26 | 27 | make 28 | 29 | 3. To install ss5, type: 30 | 31 | make install 32 | 33 | 4. To remove ss5, type: 34 | 35 | make uninstall 36 | 37 | To remove the program binaries and object files from the source code 38 | directory, type: 39 | 40 | make clean 41 | 42 | To remove the files that configure created before recompiling or before 43 | compiling ss5 for a different kind of computer, type: 44 | 45 | make distclean 46 | 47 | 48 | Solaris installation using tar.gz 49 | ================================= 50 | 51 | 1. cd to the directory containing the ss5 source code 52 | and type: 53 | 54 | ./configure 55 | 56 | 2. To compile ss5, type: 57 | 58 | make 59 | 60 | 3. To install ss5, type: 61 | 62 | make install 63 | 64 | 4. Copy the content of doc/pam/examples/pam file into /etc/pam.conf 65 | 66 | 5. To remove ss5 from your system, type: 67 | 68 | make uninstall 69 | 70 | To remove the program binaries and object files from the source code 71 | directory, type: 72 | 73 | make clean 74 | 75 | To remove the files that configure created before recompiling or before 76 | compiling ss5 for a different kind of computer, type: 77 | 78 | make distclean 79 | 80 | 81 | Configuring package 82 | =================== 83 | 84 | configure recognizes options that control the compilation process: 85 | 86 | --with-debug 87 | Turn on debugging flags 88 | 89 | --with-gssapi 90 | Turn on gssapi support 91 | 92 | --with-configfile=FILE 93 | Set the location of config file, i.e. /usr/local/etc/ss5.conf (default /etc/opt/ss5/ss5.conf) 94 | 95 | --with-passwordfile=FILE 96 | Set the location of password file, i.e. /usr/local/etc/ss5.passwd (default /etc/opt/ss5/ss5.passwd) 97 | 98 | --with-logfile=FILE 99 | Set the location of log file, i.e. /usr/local/log/ss5.log (default /var/log/ss5/ss5.log) 100 | 101 | --with-profilepath=PATH 102 | Set the location of profile path, i.e. /usr/local/etc (default /etc/opt/ss5) 103 | 104 | --with-libpath=PATH 105 | Set the location of ss5 modules, i.e. /usr/local/lib/ss5 (default /usr/lib/ss5) 106 | 107 | --with-tracepath=PATH 108 | Set the location of ss5 trace files, i.e. /usr/local/trc/ss5 (default /var/log/ss5) 109 | 110 | --with-defaultaddr=ADDR 111 | Set default bind address, i.e. 10.10.10.1 (default 0.0.0.0, all addresses) 112 | 113 | --with-defaultport=PORT 114 | Set default bind port, i.e. 8080 (default 1080) 115 | 116 | --with-defaultuser=USERNAME 117 | Set default user process, i.e. socksuser (default nobody) 118 | 119 | Configuring installation 120 | =================== 121 | 122 | configure recognizes options that control the installation process: 123 | 124 | --with-confpathbase=PATH 125 | Set install location of ss5 config files (default /etc/opt) 126 | 127 | --with-binpathbase=PATH 128 | Set install location of ss5 binary files (default /opt) 129 | 130 | --with-docpathbase=PATH 131 | Set install location of ss5 doc files (default /usr/share/doc) 132 | 133 | --with-manpathbase=PATH 134 | Set install location of ss5 man files (default /usr/share/man) 135 | 136 | --with-tracepathbase=PATH 137 | Set install location of ss5 trace files (default /var/log/ss5) 138 | 139 | --with-logpathbase=PATH 140 | Set install location of ss5 log file (default /var/log/ss5) 141 | 142 | -------------------------------------------------------------------------------- /SOLARIS.NOTES: -------------------------------------------------------------------------------- 1 | With Solaris 8, you should create a symbolic link under modules directory (i.e. /usr/lib/ss5/) as follow: 2 | 3 | ln -s /usr/local/lib/libgcc_s.so.1 /usr/lib/ss5/libgcc_s.so.1 4 | 5 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | 1) fix log during udp stream 2 | 2) ftp fixup 3 | 3) admin console 4 | 5 | -------------------------------------------------------------------------------- /admin/login/Copia di login2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Area riservata | Accesso utente business 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 |
22 |
23 |
24 | 25 | 26 | 27 |
28 |
29 |
30 | 31 |
32 | 33 | Accesso utenti 34 | 35 |
36 | 37 |
38 | Usa questa pagina per accedere all'area riservata per gli utenti business. 39 |
40 | 41 | 42 | 43 |
44 | 45 | 46 |
47 | 48 |
49 | 50 | 51 |
52 | 53 | 54 | 55 | 56 |
57 |
Accedi
58 | 59 |
60 | 61 | 62 |
Problemi di accesso? 63 | 64 |
65 | 66 | 67 | 68 | 69 | 70 |
71 |
72 | 73 | 74 | 75 | 76 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /admin/login/OK.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | OK 4 | 5 | 6 | -------------------------------------------------------------------------------- /admin/login/answer.php: -------------------------------------------------------------------------------- 1 | (ò) Result ù:

"; 5 | 6 | 7 | echo "

Richiesta < "; 8 | echo $q ; 9 | echo " > inserita correttamente.

"; 10 | ?> 11 | -------------------------------------------------------------------------------- /admin/login/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/admin/login/bg.png -------------------------------------------------------------------------------- /admin/login/bottone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/admin/login/bottone.png -------------------------------------------------------------------------------- /admin/login/bottone2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/admin/login/bottone2.png -------------------------------------------------------------------------------- /admin/login/button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/admin/login/button.png -------------------------------------------------------------------------------- /admin/login/button_blue_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/admin/login/button_blue_left.png -------------------------------------------------------------------------------- /admin/login/button_blue_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/admin/login/button_blue_right.png -------------------------------------------------------------------------------- /admin/login/constring.php: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /admin/login/getuser.php: -------------------------------------------------------------------------------- 1 | "; 26 | while($row = mysql_fetch_array($result)) 27 | { 28 | echo " "; 29 | } 30 | echo " "; 31 | 32 | 33 | } 34 | 35 | mysql_close($con); 36 | } 37 | ?> 38 | -------------------------------------------------------------------------------- /admin/login/header_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/admin/login/header_bg.png -------------------------------------------------------------------------------- /admin/login/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Area riservata | Supporto utenti business 9 | 10 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 | 28 | 29 | 30 |
31 | 32 |
33 | 34 |
35 | 36 | Richiedi supporto 37 | 38 |
39 | 40 |
41 | Usa questa pagina per richiedere supporto. 42 |
43 | 44 |
45 | 46 | 47 | 48 | 49 | 50 |
51 | 52 | 53 | 54 | 55 |
56 | 57 | 58 | 59 | 60 | 61 | 62 |
63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /admin/login/index.php.ORIG: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Untitled Document 7 | 8 | 9 | 10 |

This Is The Content it is protected with who you php script.

11 | Log out 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /admin/login/input_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/admin/login/input_left.png -------------------------------------------------------------------------------- /admin/login/input_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/admin/login/input_right.png -------------------------------------------------------------------------------- /admin/login/lock_icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/admin/login/lock_icon.gif -------------------------------------------------------------------------------- /admin/login/login.css.OLD: -------------------------------------------------------------------------------- 1 | * {padding: 0; margin: 0; outline: none} 2 | html {height: 100%} 3 | body {font: 14px arial, sans-serif; color: #103D4A; line-height: 18px; height: 100%} 4 | p {margin-top:10px} 5 | a {text-decoration: none; color: #984121} 6 | em {font-family: "Trebuchet MS", arial, sans-serif; font-weight: bold} 7 | img, fieldset {padding-bottom: 1px; border-top-style: solid; border-top-width: 1px; border-top-color: #ccc; border-right-style: none;border-left-style: none;border-bottom-style: none;} 8 | legend { font-weight: bold; margin-top: 5px; color: black;} 9 | table {border-collapse: collapse; border-spacing: 0} 10 | textarea {border: none; font: 12px arial, helvetica, sans-serif; color: #222} 11 | h1 {font: bold 18px 'Trebuchet MS', Arial, Helvetica, sans-serif} 12 | h2 {font: bold 16px 'Trebuchet MS', Arial, Helvetica, sans-serif} 13 | h3 {font-size: 14px} 14 | h4 {font: bold italic 12px 'Trebuchet MS', Arial, Helvetica, sans-serif} 15 | h5 {font-size: 12px} 16 | 17 | .graphic_text {display: block; text-indent: -5000px; overflow: hidden; background-repeat: no-repeat} 18 | 19 | .form dt {width: 70px} 20 | .form dd {margin: -19px 0 10px 80px} 21 | .form input {font-size: 11px} 22 | .form_list dt {width: 70px; padding-bottom: 17px} 23 | .form_list dd {position: absolute; margin: -37px 0 0 80px; line-height: 26px} 24 | 25 | .input_text {line-height: 14px; background: url("input_right.png") top right no-repeat; display: -moz-inline-stack; display: inline-block; zoom: 1; *display: inline} 26 | .input_text > span {background: url("input_left.png") no-repeat; padding: 4px 2px 4px 5px; margin-right: 3px; display: block} 27 | .input_text input {border: none; border-width: 0; height: 16px; font-size: 12px; color: #222} 28 | 29 | 30 | * + html .input_text input {margin-top: -1px} 31 | 32 | .input_text input.default_value {font-family: "Trebuchet MS", Arial, sans-serif; font-style: italic; color: #999} 33 | 34 | .ibutton {background-position: 0 0; background-repeat: no-repeat; padding: 0 0 0 5px; line-height: 33px; float: left; cursor: pointer} 35 | .ibutton.blue {background: url("button_blue_left.png") 0 0 no-repeat} 36 | .ibutton.blue:hover {background-position: 0px -50px} 37 | .ibutton.blue:active {background-position: 0px -100px} 38 | 39 | .ibutton > span {display: block; padding-right: 10px; padding-left: 5px; text-align: center; font: normal 15px/33px "Trebuchet MS", Arial, sans-serif; color: #455a2c; background-position: right 0; background-repeat: no-repeat} 40 | .ibutton.blue > span {color: #165667; background-image: url("button_blue_right.png")} 41 | .ibutton.blue:hover > span {background-position: right -50px} 42 | .ibutton.blue:active > span {background-position: right -100px} 43 | 44 | .ibutton span.graphic_text {background-position: center 9px; background-repeat: no-repeat} 45 | 46 | 47 | body > .container {height: auto; min-height: 100%; position: relative} 48 | body > .container > .content {background: white; padding: 0 10px 0 10px} 49 | body > .container > .content > .content_inner {width: 880px; margin: 0 auto; padding: 25px 0 0 0} 50 | 51 | 52 | .header {background: url("header_bg.png") repeat-x; border-bottom: 1px solid #a8c7ce; padding: 0 10px 0 10px} 53 | .header_content {padding: 15px 0px 0 0px; height: 57px; width: 880px; margin: 0 auto; position: relative} 54 | 55 | 56 | body.top #go_home {display:none} 57 | body h2.graphic_text {height: 25px} 58 | 59 | body.login #footer .go_home {display: none} 60 | 61 | body.login > .container > .content > .content_inner {padding: 35px 0 30px 25px} 62 | body.login .footer_content {padding: 10px 0 25px 50px; width: 805px} 63 | body.login .header_content {left: 0} 64 | body.login #login_block {padding: 10px 0 10px 0px; position: relative; width: 350px; margin-left: 48px} 65 | 66 | body.login .explanation {position: absolute; width: 200px; top: 6px; left: 532px} 67 | body.login .explanation.subtext {font-size: 13px; line-height: 20px} 68 | 69 | body.login div.line {margin-bottom: 20px} 70 | body.login div.line > label {display: block; width: 100px; height: 24px; float: left} 71 | 72 | body.login #login_label {background: url("username.png") no-repeat left center; } 73 | body.login #password_label {background: url("password.png") no-repeat left center} 74 | 75 | body.login #login_block .input_text input {width: 240px} 76 | body.login #login_button {float: right} 77 | body.login #forgot_your_password {font: normal 12px Arial; display: block; margin: 30px 0 0 100px} 78 | 79 | .mytest { 80 | position:relative; 81 | width:240px; 82 | height:180px; 83 | top:-200px; 84 | left:200px; 85 | cursor: pointer; 86 | background-color: #3A0000; 87 | background:#f2f2f2; 88 | border:1px solid #c3c3c3; 89 | display:inline-block; 90 | } 91 | 92 | 93 | -------------------------------------------------------------------------------- /admin/login/login.php: -------------------------------------------------------------------------------- 1 | 2 | 32 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | Area riservata | Accesso utente business 82 | 83 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 |
98 |
99 | 100 | 101 | 102 |
103 | 104 |
105 | 106 |
107 | 108 | Accesso utenti 109 | 110 |
111 | 112 |
113 | Usa questa pagina per accedere all'area riservata per gli utenti business. 114 |
115 | 116 |
117 | 118 | 119 |
120 | 121 |
122 | 123 | 124 |
125 | 126 |
127 | 128 |
129 | 130 | Problemi di accesso? 131 | 132 | 133 |
134 | 135 | 136 | 137 | 138 | 139 | 140 |
141 | 142 | 143 | 144 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /admin/login/login.php.ORIG: -------------------------------------------------------------------------------- 1 | 2 | 32 | 74 | 75 | 76 | 77 | 78 | Untitled Document 79 | 87 | 88 | 89 | 90 |
91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 |
Username
Passoword
 
105 |
106 | 107 | 108 | -------------------------------------------------------------------------------- /admin/login/login2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Area riservata | Accesso utente business 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 |
22 |
23 |
24 | 25 | 26 | 27 |
28 |
29 |
30 | 31 |
32 | 33 | Accesso utenti 34 | 35 |
36 | 37 |
38 | Usa questa pagina per accedere all'area riservata per gli utenti business. 39 |
40 | 41 | 42 | 43 |
44 | 45 | 46 |
47 | 48 |
49 | 50 | 51 |
52 | 53 | 54 | 55 | 56 |
57 |
Inserisci
58 | 59 |
60 | 61 | 62 |
Problemi di accesso? 63 | 64 |
65 | 66 | 67 | 68 | 69 | 70 |
71 |
72 | 73 | 74 | 75 | 76 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /admin/login/login_new.css: -------------------------------------------------------------------------------- 1 | * {padding: 0; margin: 0; outline: none} 2 | html {height: 100%} 3 | body {font: 14px arial, sans-serif; color: #103D4A; line-height: 18px; height: 100%} 4 | p {margin-top:10px} 5 | a {text-decoration: none; color: #984121} 6 | em {font-family: "Trebuchet MS", arial, sans-serif; font-weight: bold} 7 | img, fieldset {padding-bottom: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #ccc; border-right-style: none;border-left-style: none;border-bottom-style: none} 8 | legend { font-weight: bold; margin-top: 5px; color: black;} 9 | table {border-collapse: collapse; border-spacing: 0} 10 | textarea {border: none; font: 12px arial, helvetica, sans-serif; color: #222} 11 | h1 {font: bold 18px 'Trebuchet MS', Arial, Helvetica, sans-serif} 12 | h2 {font: bold 16px 'Trebuchet MS', Arial, Helvetica, sans-serif} 13 | h3 {font-size: 14px} 14 | h4 {font: bold italic 12px 'Trebuchet MS', Arial, Helvetica, sans-serif} 15 | h5 {font-size: 12px} 16 | 17 | .header {background: url("header_bg.png") repeat-x; border-bottom: 1px solid #a8c7ce; padding: 15 0 0 0; height: 70px; margin: 0 auto; position: relative} 18 | 19 | .content { margin: 0 auto; background: white; padding: 35px 0 30px 25px; height: auto; min-height: 70%; position: relative} 20 | 21 | .login {padding: 35px 0 30px 25px} 22 | 23 | .login_block {padding: 10px 0 10px 0px; position: relative; width: 350px; margin-left: 48px} 24 | 25 | #login_label {background: url("username.png") no-repeat left center; } 26 | #password_label {background: url("password.png") no-repeat left center} 27 | 28 | .input_text {line-height: 14px; background: url("input_right.png") top right no-repeat; display: -moz-inline-stack; display: inline-block; zoom: 1; *display: inline} 29 | .input_text > span {background: url("input_left.png") no-repeat; padding: 4px 2px 4px 5px; margin-right: 3px; display: block} 30 | .input_text input {width: 240px; border: none; border-width: 0; height: 16px; font-size: 12px; color: #222} 31 | 32 | .input_text input.default_value {font-family: "Trebuchet MS", Arial, sans-serif; font-style: italic; color: #999} 33 | 34 | .graphic_text {display: block; text-indent: -5000px; overflow: hidden; background-repeat: no-repeat} 35 | 36 | .line {margin-bottom: 20px} 37 | .line > label {display: block; width: 100px; height: 24px; float: left} 38 | 39 | .explanation {position: absolute; width: 200px; top: 6px; left: 532px} 40 | .explanation.subtext {font-size: 13px; line-height: 20px} 41 | 42 | 43 | #login_button {float: right} 44 | #forgot_your_password {font: normal 12px Arial; display: block; margin: 30px 0 0 100px} 45 | 46 | .style1 { color: #984121; font-weight: bold; font: normal 12px Arial; } 47 | 48 | .mytest { 49 | position:absolute; 50 | overflow: hidden; 51 | top: 240px; left: 72px; 52 | width:350px; 53 | height:180px; 54 | float: left; 55 | cursor: pointer; 56 | background-color: #3A0000; 57 | background:#f2f2f2; 58 | border:1px solid #c3c3c3; 59 | 60 | display:block; 61 | } 62 | 63 | 64 | -------------------------------------------------------------------------------- /admin/login/login_table.sql: -------------------------------------------------------------------------------- 1 | create table `login` ( 2 | `ID` double , 3 | `username` varchar (765), 4 | `password` varchar (765) 5 | ); 6 | insert into `login` (`ID`, `username`, `password`) values('1','admin','test'); 7 | -------------------------------------------------------------------------------- /admin/login/loginerror.php: -------------------------------------------------------------------------------- 1 | 2 | 32 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | Area riservata | Accesso utente business 82 | 83 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 |
98 |
99 | 100 | 101 | 102 |
103 | 104 |
105 | 106 |
107 | 108 | Accesso utenti 109 | 110 |
111 | 112 |
113 | Usa questa pagina per accedere all'area riservata per gli utenti business. 114 |
115 | 116 |
Password non corretta.
117 | 118 |
119 | 120 | 121 |
122 | 123 |
124 | 125 | 126 |
127 | 128 |
129 | 130 |
131 | 132 | Problemi di accesso? 133 | 134 | 135 |
136 | 137 | 138 | 139 | 140 | 141 | 142 |
143 | 144 | 145 | 146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /admin/login/password.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/admin/login/password.jpg -------------------------------------------------------------------------------- /admin/login/password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/admin/login/password.png -------------------------------------------------------------------------------- /admin/login/selectuser.js: -------------------------------------------------------------------------------- 1 | var xmlhttp; 2 | 3 | function showUser(str) 4 | { 5 | xmlhttp=GetXmlHttpObject(); 6 | if (xmlhttp==null) 7 | { 8 | alert ("Browser does not support HTTP Request"); 9 | return; 10 | } 11 | var url="getuser.php"; 12 | url=url+"?q="+str; 13 | url=url+"&sid="+Math.random(); 14 | xmlhttp.onreadystatechange=stateChanged; 15 | xmlhttp.open("GET",url,true); 16 | xmlhttp.send(null); 17 | 18 | } 19 | 20 | function stateChanged() 21 | { 22 | if (xmlhttp.readyState==4) 23 | { 24 | document.getElementById("txtHint").innerHTML=xmlhttp.responseText; 25 | } 26 | } 27 | 28 | function GetXmlHttpObject() 29 | { 30 | if (window.XMLHttpRequest) 31 | { 32 | // code for IE7+, Firefox, Chrome, Opera, Safari 33 | return new XMLHttpRequest(); 34 | } 35 | if (window.ActiveXObject) 36 | { 37 | // code for IE6, IE5 38 | return new ActiveXObject("Microsoft.XMLHTTP"); 39 | } 40 | return null; 41 | } 42 | 43 | function test(value) { 44 | var idx = value.selectedIndex; 45 | var sel = document.getElementById('users'); 46 | sel.value=value.options[idx].text; 47 | //sel.focus(); 48 | } 49 | 50 | function testl(value) { 51 | //var idx = value.selectedIndex; 52 | var sel = document.getElementById('users'); 53 | //sel.value=value.options[idx].text; 54 | sel.focus(); 55 | } 56 | 57 | function CursorKeyDown(e) { 58 | if (!e) e=window.event; 59 | var selectName; 60 | switch(e.keyCode) 61 | { 62 | case 40: 63 | // Key down. 64 | var controls = document.getElementsByName('siti'); 65 | if (!controls) return; 66 | if (controls.length != 1) return; 67 | controls[0].focus(); 68 | break; 69 | case 13: 70 | // Key enter 71 | var controls = document.getElementsByName('button'); 72 | if (!controls) return; 73 | if (controls.length != 1) return; 74 | controls[0].focus(); 75 | break; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /admin/login/username.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/admin/login/username.png -------------------------------------------------------------------------------- /admin/login/whoyou.php: -------------------------------------------------------------------------------- 1 | 29 | 0) 68 | $MM_referrer .= "?" . $QUERY_STRING; 69 | $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer); 70 | header("Location: ". $MM_restrictGoTo); 71 | exit; 72 | } 73 | ?> 74 | -------------------------------------------------------------------------------- /build/README.build: -------------------------------------------------------------------------------- 1 | ----------------------------------------------------------------- 2 | LINUX: 3 | 4 | Dependencies: 5 | 6 | PAM devel 7 | Open ldap devel 8 | Posix Thread 9 | 10 | 11 | 1) Type configure 12 | 13 | 2) Type "Make" 14 | 15 | 3) Type "Make install" 16 | 17 | ----------------------------------------------------------------- 18 | SOLARIS 8: 19 | 20 | 1) Type configure 21 | 22 | 2) Type "Make" 23 | 24 | 3) Type "Make install" 25 | 26 | 4) Create symbolic link under /usr/lib/ss5/ as follow: 27 | 28 | ln -s /usr/local/lib/libgcc_s.so.1 /usr/lib/ss5/libgcc_s.so.1 29 | -------------------------------------------------------------------------------- /build/mod_bot.mk: -------------------------------------------------------------------------------- 1 | 2 | all: $(MODULE) 3 | 4 | $(MODULE) : $(MODULEOBJ) 5 | $(CC) $(CFLAGS) -o $(MODULE) $(MODULEOBJ) $(LIBS) 6 | 7 | clean: 8 | rm -f $(MODULEOBJ) 9 | rm -f $(MODULE) 10 | 11 | distclean: clean 12 | rm -f Makefile 13 | -------------------------------------------------------------------------------- /build/mod_bot2.mk: -------------------------------------------------------------------------------- 1 | 2 | all: $(MODULE) $(MGR) 3 | 4 | $(MODULE) : $(MODULEOBJ) 5 | $(CC) $(CFLAGS) -o $(MODULE) $(MODULEOBJ) $(LIBS) 6 | 7 | $(MGR) : $(MGROBJ) 8 | $(CC) $(MGECFLAGS) -o $(MGR) $(MGROBJ) $(LIBS2) 9 | 10 | clean: 11 | rm -f $(MODULEOBJ) 12 | rm -f $(MODULE) 13 | rm -f $(MGROBJ) 14 | rm -f $(MGR) 15 | 16 | distclean: clean 17 | rm -f Makefile 18 | -------------------------------------------------------------------------------- /build/mod_top.mk: -------------------------------------------------------------------------------- 1 | # 2 | # ss5 - The "ss5" program. 3 | # Copyright (C) 2006 Matteo Ricchetti 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. 18 | # 19 | # build/module_top.mk 20 | # 21 | 22 | SHELL=/bin/sh 23 | srcdir=@srcdir@ 24 | top_srcdir=@top_srcdir@ 25 | top_builddir=@top_builddir@ 26 | 27 | CFLAGS=@CFLAGS@ -I . -I $(top_srcdir)/include -shared -fPIC @EXTRA_CFLAGS@ 28 | 29 | LIBS = -lpthread 30 | 31 | CC = @CC@ 32 | -------------------------------------------------------------------------------- /build/mod_top2.mk: -------------------------------------------------------------------------------- 1 | # 2 | # ss5 - The "ss5" program. 3 | # Copyright (C) 2006 Matteo Ricchetti 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. 18 | # 19 | # build/module_top.mk 20 | # 21 | 22 | SHELL=/bin/sh 23 | srcdir=@srcdir@ 24 | top_srcdir=@top_srcdir@ 25 | top_builddir=@top_builddir@ 26 | 27 | CFLAGS=@CFLAGS@ -I . -I $(top_srcdir)/include -shared -fPIC @EXTRA_CFLAGS@ 28 | MGRCFLAGS=@CFLAGS@ -I . -I $(top_srcdir)/include @EXTRA_CFLAGS@ 29 | 30 | LIBS = -lpthread 31 | LIBS2 = -lpthread @LIBS@ 32 | 33 | CC = @CC@ 34 | -------------------------------------------------------------------------------- /common/Makefile: -------------------------------------------------------------------------------- 1 | srcdir=. 2 | top_srcdir=.. 3 | top_builddir=.. 4 | 5 | COMMONOBJ = SS5OpenLdap.o SS5Radius.o SS5MySql.o 6 | 7 | 8 | CFLAGS=-g -O2 -DLINUX -D_FILE_OFFSET_BITS=64 -I . -I ../include -fPIC 9 | SRVCFLAGS=-g -O2 -DLINUX -D_FILE_OFFSET_BITS=64 -I . -I ../include 10 | 11 | LIBS = -lpthread -rdynamic -ldl -lssl -lldap -lpam -lpam_misc 12 | 13 | CC = gcc 14 | 15 | all: $(COMMONOBJ) 16 | 17 | 18 | clean: 19 | rm -f $(COMMONOBJ) 20 | 21 | distclean: clean 22 | rm -f Makefile 23 | -------------------------------------------------------------------------------- /common/Makefile.in: -------------------------------------------------------------------------------- 1 | srcdir=@srcdir@ 2 | top_srcdir=@top_srcdir@ 3 | top_builddir=@top_builddir@ 4 | 5 | COMMONOBJ = SS5OpenLdap.o SS5Radius.o SS5MySql.o 6 | 7 | 8 | CFLAGS=@CFLAGS@ -I . -I ../include @EXTRA_CFLAGS@ -fPIC 9 | SRVCFLAGS=@CFLAGS@ -I . -I ../include @EXTRA_CFLAGS@ 10 | 11 | LIBS = -lpthread @LIBS@ @EXTRA_LIBS@ 12 | 13 | CC = gcc 14 | 15 | all: $(COMMONOBJ) 16 | 17 | 18 | clean: 19 | rm -f $(COMMONOBJ) 20 | 21 | distclean: clean 22 | rm -f Makefile 23 | -------------------------------------------------------------------------------- /common/SS5MySql.c: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2002 - 2010 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifdef SS5_USE_MYSQL 20 | 21 | #include"SS5Main.h" 22 | #include"SS5Mod_authorization.h" 23 | #include"SS5MySql.h" 24 | #include"SS5Mod_log.h" 25 | #include 26 | 27 | /*#ifdef SOLARIS 28 | #include 29 | #define LDAP_DEPRECATED 30 | #endif 31 | */ 32 | 33 | 34 | UINT MySqlCheck( char *group, char *user ) 35 | { 36 | register UINT idx1; 37 | register UINT idx2; 38 | 39 | char ntbdomain[64]; 40 | char ntbuser[64]; 41 | char swap[64]; 42 | 43 | UINT count; 44 | 45 | int err = ERR; 46 | int pos = 0, 47 | gss = 0; 48 | 49 | pid_t pid; 50 | 51 | /* 52 | * Get child/thread pid 53 | */ 54 | if( NOTTHREADED() ) 55 | pid = getpid(); 56 | else 57 | pid = (UINT)pthread_self(); 58 | 59 | /* 60 | * Get netbios domain from username 61 | */ 62 | ntbdomain[0]='\0'; 63 | ntbuser[0] ='\0'; 64 | swap[0] ='\0'; 65 | 66 | for(idx1 = 0, idx2 = 0; user[idx1] && (idx1 < (sizeof(ntbuser) - 1)); idx1++ ) { 67 | if( user[idx1] == '\\' || user[idx1] == '@' ) { 68 | ntbdomain[idx1] = '\0'; 69 | pos = 1; 70 | gss++; 71 | idx1++; 72 | } 73 | 74 | if( pos == 0 ) { 75 | ntbdomain[idx1] = user[idx1]; 76 | ntbuser[idx1] = user[idx1]; 77 | ntbuser[idx1 + 1] = '\0'; 78 | } 79 | else if( pos == 1 ) { 80 | ntbuser[idx2++] = user[idx1]; 81 | ntbuser[idx2] = '\0'; 82 | } 83 | } 84 | 85 | /* 86 | * If username in the form user@domain.dom ss5 supposes 87 | * a GSS authentication request 88 | */ 89 | if( gss ) { 90 | strncpy(swap,ntbuser,sizeof(swap)); 91 | strncpy(ntbuser,ntbdomain,sizeof(ntbuser)); 92 | strncpy(ntbdomain,swap,sizeof(ntbdomain)); 93 | } 94 | /* 95 | * Look for user into MYSQL UserStore 96 | */ 97 | err = MySqlQuery( pid, group, ntbuser, count); 98 | 99 | return err; 100 | } 101 | 102 | UINT MySqlQuery( pid_t pid, char *group, char *user, int dirid ) 103 | { 104 | MYSQL *conn; 105 | MYSQL_RES *res; 106 | MYSQL_ROW row; 107 | 108 | char query[128], 109 | logString[256]; 110 | 111 | snprintf(query,sizeof(query) - 1,"%s '%s'",S5Mysql.SqlString,group); 112 | 113 | conn = mysql_init(NULL); 114 | 115 | /* Connect to database */ 116 | if (!mysql_real_connect(conn, S5Mysql.IP, 117 | S5Mysql.User, S5Mysql.Pass, S5Mysql.DB, 0, NULL, 0)) { 118 | snprintf(logString, sizeof(logString) - 1,"[%u] [DEBU] %s\n", mysql_error(conn)); 119 | LOGUPDATE() 120 | return ERR; 121 | } 122 | 123 | /* send SQL query */ 124 | if (mysql_query(conn, query)) { 125 | fprintf(stderr, "%s\n", mysql_error(conn)); 126 | mysql_close(conn); 127 | snprintf(logString, sizeof(logString) - 1,"[%u] [DEBU] %s\n", mysql_error(conn)); 128 | LOGUPDATE() 129 | return ERR; 130 | } 131 | 132 | res = mysql_use_result(conn); 133 | 134 | /* output fields 1 and 2 of each row */ 135 | while ((row = mysql_fetch_row(res)) != NULL) { 136 | if( STRCASEEQ(user,row[0],64) ) { 137 | mysql_free_result(res); 138 | mysql_close(conn); 139 | return OK; 140 | } 141 | } 142 | 143 | /* Release memory used to store results and close connection */ 144 | mysql_free_result(res); 145 | mysql_close(conn); 146 | 147 | return ERR; 148 | } 149 | #endif 150 | -------------------------------------------------------------------------------- /common/SS5OpenLdap.c: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2002 - 2010 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #include"SS5Main.h" 20 | #include"SS5Mod_authorization.h" 21 | #include"SS5OpenLdap.h" 22 | #include"SS5Mod_log.h" 23 | 24 | #ifdef SOLARIS 25 | #include 26 | #define LDAP_DEPRECATED 27 | #endif 28 | 29 | #include 30 | 31 | 32 | UINT DirectoryCheck( char *group, char *user ) 33 | { 34 | register UINT idx1; 35 | register UINT idx2; 36 | 37 | char ntbdomain[64]; 38 | char ntbuser[64]; 39 | char swap[64]; 40 | 41 | UINT count; 42 | 43 | int err = ERR; 44 | int pos = 0, 45 | gss = 0; 46 | 47 | pid_t pid; 48 | 49 | /* 50 | * Get child/thread pid 51 | */ 52 | if( NOTTHREADED() ) 53 | pid = getpid(); 54 | else 55 | pid = (UINT)pthread_self(); 56 | 57 | /* 58 | * Get netbios domain from username 59 | */ 60 | ntbdomain[0]='\0'; 61 | ntbuser[0] ='\0'; 62 | swap[0] ='\0'; 63 | 64 | for(idx1 = 0, idx2 = 0; user[idx1] && (idx1 < (sizeof(ntbuser) - 1)); idx1++ ) { 65 | if( user[idx1] == '\\' || user[idx1] == '@' ) { 66 | ntbdomain[idx1] = '\0'; 67 | pos = 1; 68 | gss++; 69 | idx1++; 70 | } 71 | 72 | if( pos == 0 ) { 73 | ntbdomain[idx1] = user[idx1]; 74 | ntbuser[idx1] = user[idx1]; 75 | ntbuser[idx1 + 1] = '\0'; 76 | } 77 | else if( pos == 1 ) { 78 | ntbuser[idx2++] = user[idx1]; 79 | ntbuser[idx2] = '\0'; 80 | } 81 | } 82 | 83 | /* 84 | * If username in the form user@domain.dom ss5 supposes 85 | * a GSS authentication request 86 | */ 87 | if( gss ) { 88 | strncpy(swap,ntbuser,sizeof(swap)); 89 | strncpy(ntbuser,ntbdomain,sizeof(ntbuser)); 90 | strncpy(ntbdomain,swap,sizeof(ntbdomain)); 91 | } 92 | /* 93 | * Look for user into all UserStore 94 | */ 95 | for( count = 0; (err == ERR) && (count < NLdapStore); count++ ) { 96 | if( SS5SocksOpt.LdapNetbiosDomain ) { 97 | /* 98 | * Look for only if user netbios domain and directory netbios domain match 99 | */ 100 | if( STREQ(S5Ldap[count].NtbDomain,"DEF",sizeof("DEF") -1) ) { 101 | err = DirectoryQuery(pid, group, ntbuser, count); 102 | } 103 | else if( STRCASEEQ(S5Ldap[count].NtbDomain,ntbdomain,sizeof(ntbdomain) -1) ) 104 | err = DirectoryQuery(pid, group, ntbuser, count); 105 | } 106 | /* 107 | * Look for in order of configuration 108 | */ 109 | else { 110 | err = DirectoryQuery( pid, group, ntbuser, count); 111 | } 112 | } 113 | return err; 114 | } 115 | 116 | UINT DirectoryQuery( pid_t pid, char *group, char *user, int dirid ) 117 | { 118 | register UINT idx1,idx2; 119 | 120 | UINT i,l; 121 | 122 | struct timeval oldapTimeout; 123 | 124 | char searchFilter[128]="\0"; 125 | char baseDn[128] ="\0"; 126 | char baseTmp[128] ="\0"; 127 | char ldap_uri[128] ="\0"; 128 | 129 | char *attrsList[] = {"dn", NULL }; 130 | 131 | LDAP *ld = NULL; 132 | 133 | LDAPMessage *result; 134 | 135 | int rc; 136 | int protocolVersion = LDAP_VERSION3; 137 | 138 | char logString[256]="\0"; 139 | 140 | /* 141 | * Set timeout for ldap query 142 | */ 143 | oldapTimeout.tv_sec = SS5SocksOpt.LdapTimeout; 144 | oldapTimeout.tv_usec = 0; 145 | 146 | /* 147 | * build "searchFilter" for ldap query 148 | */ 149 | if( LDAPBASE() ) { 150 | strncpy(searchFilter,S5Ldap[dirid].Filter,sizeof(searchFilter)); 151 | STRSCAT(searchFilter,"="); 152 | STRSCAT(searchFilter,user); 153 | } 154 | else if( LDAPFILTER() ) { 155 | strncpy(searchFilter,"(&(",sizeof(searchFilter)); 156 | STRSCAT(searchFilter,S5Ldap[dirid].Filter); 157 | STRSCAT(searchFilter,"="); 158 | STRSCAT(searchFilter,user); 159 | STRSCAT(searchFilter,")("); 160 | STRSCAT(searchFilter,S5Ldap[dirid].Attribute); 161 | STRSCAT(searchFilter,"="); 162 | STRSCAT(searchFilter,group); 163 | STRSCAT(searchFilter,"))"); 164 | } 165 | /* 166 | * build "base" for ldap query 167 | */ 168 | for(idx1 = 0; (baseDn[idx1] = S5Ldap[dirid].Base[idx1]) != '%' && idx1 < strlen(S5Ldap[dirid].Base); idx1++); 169 | baseDn[idx1] = '\0'; 170 | if( (idx1++) < strlen(S5Ldap[dirid].Base) ) { 171 | for(idx2 = 0; (baseTmp[idx2] = S5Ldap[dirid].Base[idx1]) != '\0' && idx1 < strlen(S5Ldap[dirid].Base); idx2++, idx1++); 172 | baseTmp[idx2] = '\0'; 173 | 174 | STRSCAT(baseDn,group); 175 | STRSCAT(baseDn,baseTmp); 176 | } 177 | 178 | /* 179 | * Initialize ldap environment 180 | */ 181 | #ifdef LDAP_DEPRECATED 182 | ld = (LDAP *)ldap_init( S5Ldap[dirid].IP, atoi(S5Ldap[dirid].Port) ); 183 | if ( ld == NULL ) { 184 | ERRNO(pid) 185 | 186 | return ERR; 187 | } 188 | #else 189 | sprintf(ldap_uri,"ldap://%s:%d/",S5Ldap[dirid].IP,atoi(S5Ldap[dirid].Port)); 190 | if( ldap_initialize( &ld, ldap_uri) != LDAP_SUCCESS ) { 191 | ERRNO(pid) 192 | 193 | return ERR; 194 | } 195 | #endif 196 | 197 | ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &protocolVersion ); 198 | ldap_set_option( ld, LDAP_OPT_REFERRALS, LDAP_OPT_OFF ); 199 | /* 200 | * Try to bind into directory 201 | */ 202 | if (( rc = ldap_bind_s( ld, S5Ldap[dirid].Dn, S5Ldap[dirid].Pass, LDAP_AUTH_SIMPLE )) != LDAP_SUCCESS ) { 203 | ERRNOLDAP(pid,rc) 204 | 205 | ldap_unbind( ld ); 206 | return ERR; 207 | } 208 | /* 209 | * Search for username into directory 210 | */ 211 | if (( rc = ldap_search_st( ld, baseDn, LDAP_SCOPE_SUBTREE, searchFilter, attrsList, 0, &oldapTimeout, &result )) != LDAP_SUCCESS ) { 212 | ERRNOLDAP(pid,rc) 213 | 214 | ldap_msgfree( result ); 215 | ldap_unbind( ld ); 216 | 217 | return ERR; 218 | } 219 | else { 220 | /* 221 | * Count entries, if zero NOT FOUND! 222 | */ 223 | if( ldap_count_entries( ld, result ) ) { 224 | ldap_msgfree( result ); 225 | ldap_unbind( ld ); 226 | 227 | return OK; 228 | } 229 | } 230 | 231 | ldap_msgfree( result ); 232 | ldap_unbind( ld ); 233 | 234 | return ERR; 235 | } 236 | 237 | -------------------------------------------------------------------------------- /conf/examples/admin: -------------------------------------------------------------------------------- 1 | root 2 | -------------------------------------------------------------------------------- /conf/examples/ss5.conf: -------------------------------------------------------------------------------- 1 | # Enable basic authentication for all sources ips 2 | # 3 | # SHost SPort Authentication 4 | auth 0.0.0.0/0 - u 5 | 6 | # Enable PAM authentication 7 | set SS5_PAM_AUTH 8 | 9 | set SS5_STIMEOUT 3600 10 | 11 | # Enable cache for authentication 12 | set SS5_AUTHCACHEAGE 3600 13 | 14 | #Enable verbose output into ss5.log file 15 | set SS5_VERBOSE 16 | 17 | 18 | # Enable ldap profiling 19 | set SS5_LDAP_FILTER 20 | 21 | # Dump SQL traffic into file 22 | dump 172.30.1.1/32 1433 1 23 | 24 | # Send connection destinated to 172.30.10 network through a socks upstream server 25 | # 26 | # DHost/Net DPort DProxyip DProxyPort 27 | proxy 172.30.10.0/24 - 10.2.2.240 1080 - 28 | 29 | # Enable authenticated users belong windows group CN=Users,DC=main,DC=it to use ssh and sql through 172.30 network 30 | # 31 | #Auth SHost SPort DHost DPort Fixup Group Band 32 | permit u 0.0.0.0/0 - 172.30.0.0/16 22 - CN=LOGON-GRP01,CN=Users,DC=main,DC=it - - 33 | permit u 0.0.0.0/0 - 172.30.0.0/16 1433 - CN=LOGON-GRP02,CN=Users,DC=main,DC=it - - 34 | 35 | 36 | # Configure ldap container (in this case windows DController) 37 | ldap_profile_ip 10.2.2.1 38 | ldap_profile_port 389 39 | ldap_profile_base DC=main,DC=it 40 | ldap_profile_filter cn 41 | ldap_profile_attribute MemberOf 42 | ldap_profile_dn CN=USER01,OU=ORG01,DC=main,DC=it 43 | ldap_profile_pass passwd 44 | 45 | 46 | -------------------------------------------------------------------------------- /conf/examples/ss5.ha: -------------------------------------------------------------------------------- 1 | # Define slave ss5 istances 2 | # 3 | peer 192.168.1.1 4 | 5 | # Connections to 10.2.2 network are made using 192.168.1.100 as source ip 6 | # 7 | # Host/Net SrcIf Group s/d (s= source e' la /destination) 8 | route 10.2.2.0/24 192.168.1.100 sysadmin d 9 | 10 | -------------------------------------------------------------------------------- /conf/examples/ss5.passwd: -------------------------------------------------------------------------------- 1 | matthew secret 2 | -------------------------------------------------------------------------------- /conf/ss5.ha: -------------------------------------------------------------------------------- 1 | # Define slave ss5 istances 2 | 3 | 4 | 5 | 6 | # Host/Net SrcIf Group s/d (s= source e' la /destination) 7 | # 8 | 9 | -------------------------------------------------------------------------------- /conf/ss5.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # chkconfig: 345 20 80 4 | # description: This script takes care of starting \ 5 | # and stopping ss5 6 | # 7 | 8 | OS=`uname -s` 9 | if [ $OS = "Linux" ] || [ $OS = "SunOS" ]; then 10 | 11 | # Source function library. 12 | . /etc/rc.d/init.d/functions 13 | 14 | # Source networking configuration. 15 | . /etc/sysconfig/network 16 | 17 | # Check that networking is up. 18 | [ ${NETWORKING} = "no" ] && exit 0 19 | 20 | [ -f /usr/sbin/ss5 ] || exit 0 21 | fi 22 | 23 | # Test custom variables 24 | test -f /etc/sysconfig/ss5 && . /etc/sysconfig/ss5 25 | 26 | # See how we were called. 27 | case "$1" in 28 | start) 29 | # Start daemon. 30 | echo -n "Starting ss5... " 31 | if [ $OS = "Linux" ]; then 32 | daemon /usr/sbin/ss5 -t $SS5_OPTS 33 | touch /var/lock/subsys/ss5 34 | else 35 | if [ $OS = "SunOS" ]; then 36 | /usr/sbin/ss5 -t 37 | touch /var/lock/subsys/ss5 38 | else 39 | /usr/local/sbin/ss5 -t 40 | fi 41 | fi 42 | echo "done" 43 | ;; 44 | stop) 45 | # Stop daemon. 46 | echo "Shutting down ss5... " 47 | if [ $OS = "Linux" ] || [ $OS = "SunOS" ]; then 48 | killproc ss5 49 | rm -f /var/lock/subsys/ss5 50 | else 51 | killall ss5 52 | fi 53 | rm -f /var/run/ss5/ss5.pid 54 | echo "done" 55 | ;; 56 | reload) 57 | # Reload configuration 58 | if [ $OS = "Linux" ] || [ $OS = "SunOS" ]; then 59 | echo -n "Reloading ss5... " 60 | killproc ss5 -1 61 | else 62 | pkill -HUP ss5 63 | fi 64 | echo "done reload" 65 | ;; 66 | restart) 67 | # Restart daemon 68 | echo -n "Restarting ss5... " 69 | $0 stop 70 | $0 start 71 | ;; 72 | status) 73 | if [ $OS = "Linux" ] || [ $OS = "SunOS" ]; then 74 | status ss5 75 | fi 76 | ;; 77 | *) 78 | echo "Usage: ss5 {start|stop|status|restart|reload}" 79 | exit 1 80 | ;; 81 | esac 82 | 83 | exit 0 84 | -------------------------------------------------------------------------------- /conf/ss5.passwd: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /conf/ss5.sysconfig: -------------------------------------------------------------------------------- 1 | # Add startup option here 2 | #SS5_OPTS=" -u root" 3 | -------------------------------------------------------------------------------- /doc/README.BALANCE: -------------------------------------------------------------------------------- 1 | Balance feature is available only: 2 | 3 | a) thread execution (ss5 -t) 4 | 5 | b) socks4/5 CONNECT request 6 | 7 | c) without upstream socks 8 | 9 | To build with Server Balance feature, make sure to define SLB into Makefile. 10 | 11 | In order to monitor the balanced table of the connections, you have to 12 | connect via browser to http://socks-ip:1080/ and you can viewan output like this: 13 | 14 | Socks Server 5 15 | Balanced table of the connections 16 | 17 | Real Vid Connections 18 | 172.30.1.2 1 0 19 | 172.30.1.1 1 0 20 | 172.30.1.3 1 0 21 | 172.30.1.4 1 0 22 | 23 | -------------------------------------------------------------------------------- /doc/README.CONSOLE: -------------------------------------------------------------------------------- 1 | SS5 shows statistics, balanced connections and affinity table via web: 2 | 3 | http://socksserver:1080/statistics 4 | http://socksserver:1080/balancing 5 | -------------------------------------------------------------------------------- /doc/README.EPOLL: -------------------------------------------------------------------------------- 1 | To enable Epoll syscall, you must edit src/Makefile, 2 | modules/mod_proxy/Makefile and add -DEPOLL_IO definition. 3 | 4 | -------------------------------------------------------------------------------- /doc/README.MODULES: -------------------------------------------------------------------------------- 1 | TODO 2 | -------------------------------------------------------------------------------- /doc/README.SS5SRV: -------------------------------------------------------------------------------- 1 | Since 3.7.1 release a new tool is available for ss5 management: ss5srv is a command line tool 2 | to query o modifying ss5 online configuration. 3 | 4 | Changes to ss5 online configuration are immediately effective and don't require reload. Ss5srv 5 | can write online config to an output file and then used instead of the orginal. 6 | 7 | 8 | -------------------------------------------------------------------------------- /doc/ldap/README.ldap: -------------------------------------------------------------------------------- 1 | Directory configuration example: 2 | 3 | 1) Configure slapd.conf 4 | 5 | 2) Start directory 6 | 7 | slapd -d 256 -u ldap -f /etc/openldap/slapd.conf 8 | 9 | 3) Create your entries.ldif 10 | 11 | 4) Add entries to directory 12 | 13 | ldapadd -f entries.ldif -x -D "cn=root,dc=example,dc=com" -w secret 14 | 15 | 5) Test search operation 16 | 17 | ldapsearch -x -b 'ou=Systems,dc=example,dc=com' -D 'cn=root,dc=example,dc=com' -w secret uid=sys1 18 | 19 | -------------------------------------------------------------------------------- /doc/ldap/examples/entries.ldif: -------------------------------------------------------------------------------- 1 | ## extended LDIF 2 | ## 3 | ## LDAPv3 4 | ## base with scope sub 5 | ## filter: (objectclass=*) 6 | ## requesting: ALL 7 | ## 8 | # 9 | ## example.com 10 | #dn: dc=example,dc=com 11 | #dc: example 12 | #objectClass: top 13 | #objectClass: domain 14 | # 15 | ## Developers, example.com 16 | #dn: ou=Developers,dc=example,dc=com 17 | #ou: Developers 18 | #objectClass: top 19 | #objectClass: organizationalUnit 20 | # 21 | ## Systems, example.com 22 | #dn: ou=Systems,dc=example,dc=com 23 | #ou: Systems 24 | #objectClass: top 25 | #objectClass: organizationalUnit 26 | # 27 | ## Users, example.com 28 | #dn: ou=Users,dc=example,dc=com 29 | #ou: Users 30 | #objectClass: top 31 | #objectClass: organizationalUnit 32 | # 33 | ## dev1, Developers, example.com 34 | #dn: uid=dev1,ou=Developers,dc=example,dc=com 35 | #uid: dev1 36 | #cn: dev1 37 | #objectClass: account 38 | #objectClass: posixAccount 39 | #objectClass: top 40 | #userPassword: dev1 41 | #loginShell: /bin/bash 42 | #homeDirectory: /home/dev1 43 | #uidNumber: 0 44 | #gidNumber: 0 45 | #gecos: Developers 46 | # 47 | ## sys1, Systems, example.com 48 | #dn: uid=sys1,ou=Systems,dc=example,dc=com 49 | #uid: sys1 50 | #cn: sys1 51 | #objectClass: account 52 | #objectClass: posixAccount 53 | #objectClass: top 54 | #userPassword: sys1 55 | #loginShell: /bin/bash 56 | #homeDirectory: /home/sys1 57 | #uidNumber: 1 58 | #gidNumber: 1 59 | #gecos: Systems 60 | # 61 | ## usr1, Users, example.com 62 | #dn: uid=usr1,ou=Users,dc=example,dc=com 63 | #uid: usr1 64 | #cn: usr1 65 | #objectClass: account 66 | #objectClass: posixAccount 67 | #objectClass: top 68 | #userPassword: usr1 69 | #loginShell: /bin/bash 70 | #homeDirectory: /home/usr1 71 | #uidNumber: 1 72 | #gidNumber: 1 73 | #gecos: Users 74 | # 75 | # pam_ldap 76 | 77 | #dn:ou=groups, dc=example, dc=com 78 | #objectclass: top 79 | #objectclass: organizationalUnit 80 | #ou: groups 81 | 82 | #dn:ou=people, dc=example, dc=com 83 | #objectclass: top 84 | #objectclass: organizationalUnit 85 | #ou: people 86 | 87 | dn: cn=user, ou=people, dc=example, dc=com 88 | cn: user 89 | sn: test 90 | objectclass: top 91 | objectclass: person 92 | objectclass: posixAccount 93 | objectclass: shadowAccount 94 | uid:user 95 | userpassword:password 96 | uidnumber:104 97 | gidnumber:100 98 | gecos:user test 99 | loginShell:/bin/ksh 100 | homeDirectory: /home/user 101 | shadowLastChange:10877 102 | shadowMin: 0 103 | shadowMax: 999999 104 | shadowWarning: 7 105 | shadowInactive: -1 106 | shadowExpire: -1 107 | shadowFlag: 0 108 | 109 | 110 | -------------------------------------------------------------------------------- /doc/ldap/examples/slapd.conf: -------------------------------------------------------------------------------- 1 | include /etc/openldap/schema/core.schema 2 | include /etc/openldap/schema/cosine.schema 3 | include /etc/openldap/schema/inetorgperson.schema 4 | include /etc/openldap/schema/nis.schema 5 | 6 | database ldbm 7 | suffix "dc=example,dc=com" 8 | rootdn "cn=root,dc=example,dc=com" 9 | rootpw secret 10 | directory /var/lib/ldap 11 | -------------------------------------------------------------------------------- /doc/pam/README.pam: -------------------------------------------------------------------------------- 1 | PAM Configuration: 2 | 3 | 1) Configure ss5.pam file; 4 | 5 | 2) Linux: 6 | Copy ss5.pam into /etc/pam.d/ directory; 7 | Solaris: 8 | Copy ss5.pam content into /etc/pam.confi; 9 | 10 | 3) Set SS5_PAM_AUTH options in /etc/ss5/ss5.conf file. 11 | 12 | NOTE: if using /etc/passwd like PAM authentication, you must start ss5 with "-u root" option! 13 | -------------------------------------------------------------------------------- /doc/pam/examples/ss5.pam: -------------------------------------------------------------------------------- 1 | # SS5 Pam configuration file 2 | # 3 | # Authentication using passwd 4 | # NOTE: in this case, you must start ss5 with "-u root" option! 5 | # 6 | #auth required /lib/security/pam_unix.so 7 | # 8 | # Authentication using ldap 9 | #auth required /lib/security/pam_ldap.so 10 | 11 | -------------------------------------------------------------------------------- /include/SS5Basic.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5BASIC_H 20 | #define SS5BASIC_H 1 21 | 22 | /* 23 | * Functions for Basic authentication 24 | */ 25 | UINT 26 | S5PwdFileOpen( pid_t pid 27 | ); 28 | 29 | UINT 30 | S5PwdFileCheck( struct _SS5ClientInfo *ci 31 | ); 32 | 33 | UINT 34 | S5PwdFileClose( pid_t pid 35 | ); 36 | #endif 37 | -------------------------------------------------------------------------------- /include/SS5Core.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5CORE_H 20 | #define SS5CORE_H 1 21 | 22 | #define SS5CCLOSE(n) S5ChildClose(CONTINUE,n,&SS5ClientInfo); 23 | 24 | #define GETPROXYBYNAME() { modErr = SS5Modules.mod_socks5.GetProxy(S5StrHash(SS5RequestInfo.DstAddr),SS5RequestInfo.DstPort,&SS5RequestInfo);} 25 | #define GETPROXYBYADDRESS() { modErr = SS5Modules.mod_socks5.GetProxy(inet_network(SS5RequestInfo.DstAddr),SS5RequestInfo.DstPort,&SS5RequestInfo);} 26 | 27 | #define THREADEXIT() { if(SS5ProxyData.UdpSend) free(SS5ProxyData.UdpSend); if(SS5ProxyData.UdpRecv) free(SS5ProxyData.UdpRecv); if(SS5ProxyData.Send) free(SS5ProxyData.Send); if(SS5ProxyData.Recv) free(SS5ProxyData.Recv); S5ChildClose(CONTINUE,SS5ClientInfo.Socket,&SS5ClientInfo); pthread_exit(THREAD_EXIT); } 28 | 29 | #define PROCESSCLOSE() { S5ChildClose(CONTINUE,SS5ClientInfo.Socket,&SS5ClientInfo); return ERR; } 30 | #define PROCESSEXIT() S5ChildClose(EXIT,SS5ClientInfo.Socket,&SS5ClientInfo); 31 | #define SS5PCLOSE() { if( AUTHENRADIUS() && SS5ClientInfo.sid ) { SS5ClientInfo.iPacket=tBR; SS5ClientInfo.oPacket=tBS; S5RadiusAcct(&SS5ClientInfo, 2, pid); }; if( NOTTHREADED() ) { if( preforkMode ) { PROCESSCLOSE() } else PROCESSEXIT() } else { THREADEXIT() } } 32 | 33 | #define UPDATESTAT() SS5Modules.mod_statistics.Summary(autheErr,authoErr,cmdErr); 34 | #define UPDATEBANDT(n) LOCKMUTEXCS();SS5Modules.mod_bandwidth.UpdateBandTable(SS5ClientInfo.Username,n);UNLOCKMUTEXCS() 35 | 36 | 37 | /* 38 | * Main function: it works to serv client requests 39 | */ 40 | UINT 41 | S5Core( int cSocket ); 42 | 43 | UINT 44 | SrvCore( struct _SS5ClientInfo *ci, struct _SS5Socks5Data *sd ); 45 | 46 | UINT 47 | ListOption( UINT s); 48 | 49 | UINT 50 | ListPeer( UINT s); 51 | 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /include/SS5Debug.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5DEBUG_H 20 | #define SS5DEBUG_H 1 21 | 22 | inline void 23 | S5DebugMethodInfo( pid_t pid, 24 | struct _SS5ClientInfo ci 25 | ); 26 | 27 | inline void 28 | S5DebugAuthInfo( pid_t pid, 29 | struct _SS5ClientInfo ci 30 | ); 31 | 32 | inline void 33 | S5DebugRequestInfo( pid_t pid, 34 | struct _SS5RequestInfo ri 35 | ); 36 | 37 | inline void 38 | S5DebugUdpRequestInfo( pid_t pid, 39 | struct _SS5RequestInfo ri 40 | ); 41 | 42 | inline void 43 | S5DebugUpstreamInfo( pid_t pid, 44 | struct _SS5RequestInfo ri 45 | ); 46 | 47 | inline void 48 | S5DebugFacilities( pid_t pid, 49 | struct _SS5Facilities fa 50 | ); 51 | 52 | inline void 53 | S5DebugStatistics( pid_t pid 54 | ); 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /include/SS5Defs.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5DEFS_H 20 | #define SS5DEFS_H 1 21 | 22 | enum S4RT { 23 | S4REQUEST_GRANTED=90, 24 | S4REQUEST_REJECTED, 25 | S4REQUEST_IDENTD, 26 | S4REQUEST_USER_IDSIDENTD}; 27 | 28 | char *MSGS4RT[]={ 29 | "GRANTED", 30 | "REJECTED", 31 | "IDENTD", 32 | "USER IDSIDENTD"}; 33 | 34 | enum S5RT { 35 | S5REQUEST_SUCCEDED, 36 | S5REQUEST_ISERROR, 37 | S5REQUEST_ACLDENY, 38 | S5REQUEST_NETUNREACH, 39 | S5REQUEST_HOSTUNREACH, 40 | S5REQUEST_CONNREFUSED, 41 | S5REQUEST_TTLEXPIRED, 42 | S5REQUEST_CMDNOTSUPPORT, 43 | S5REQUEST_ADDNOTSUPPORT, 44 | S5REQUEST_STARTED, 45 | S5REQUEST_TERMINATED}; 46 | 47 | char *MSGS5RT[]={ 48 | "SUCCEDED", 49 | "ISERROR", 50 | "ACLDENY", 51 | "NETUNREACH", 52 | "HOSTUNREACH", 53 | "CONNREFUSED", 54 | "TTLEXPIRED", 55 | "CMDNOTSUPPORT", 56 | "ADDNOTSUPPORT", 57 | "STARTED", 58 | "TERMINATED"}; 59 | 60 | enum S5OP { 61 | CONNECT_NORMAL, 62 | BIND_NORMAL, 63 | UDP_ASSOCIATE_NORMAL, 64 | CONNECT_FAILED, 65 | BIND_FAILED, 66 | UDP_ASSOCIATE_FAILED, 67 | UNKNOWN}; 68 | 69 | char *MSGS5OP[]={ 70 | "CONNECT", 71 | "BIND", 72 | "UDP ASSOCIATE", 73 | "CONNECT FAILED", 74 | "BIND FAILED", 75 | "UDP ASSOCIATE FAILED", 76 | "UNKNOWN"}; 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /include/SS5ExternalProgram.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5EXTERNALPROGRAM_H 20 | #define SS5EXTERNALPROGRAM_H 1 21 | 22 | /* 23 | * Functions for Basic authentication 24 | */ 25 | UINT 26 | S5AuthProgramCheck( struct _SS5ClientInfo *ci, 27 | pid_t pid 28 | ); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/SS5GSSApi.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2002 - 2010 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5GSSAPI_H 20 | #define SS5GSSAPI_H 1 21 | 22 | 23 | #define GSS_OFFSET_HVER 0 24 | #define GSS_OFFSET_HMTYPE 1 25 | #define GSS_OFFSET_HLEN 2 26 | 27 | #define GSS_NO_ENC 100 28 | #define GSS_ENC_NOINT 0 29 | #define GSS_ENC_INTEG 1 30 | #define GSS_ENC_CONFI 2 31 | 32 | #define MAX_GSSTOKEN_SIZE 16192 33 | 34 | 35 | #define GET_GSSHEADER_LEN(x,y,z) y=0; for(i=0;i<2;i++) { y += ((unsigned short)x[1-i+z] << ((i)*8)); }; 36 | #define SET_GSSHEADER_LEN(x,y,z) for(i=0;i<2;i++) { x[1-i+z]=(y & (0x00FF << (i*8))) >> (i*8); }; 37 | 38 | char *MSGGSS[]={ 39 | "0 = AUTHENTICATION", 40 | "1 = INTEGRITY", 41 | "2 = CONFIDENTIALITY"}; 42 | 43 | 44 | UINT 45 | S5GSSApiSetup( struct _SS5ClientInfo *ci ); 46 | 47 | UINT 48 | S5GSSApiEncode( gss_ctx_id_t ctx, 49 | UINT enc, 50 | unsigned char *inbuf, 51 | unsigned char **oubuf, 52 | int *len 53 | ); 54 | 55 | UINT 56 | S5GSSApiDecode( gss_ctx_id_t ctx, 57 | UINT enc, 58 | unsigned char *inbuf, 59 | unsigned char **oubuf, 60 | int *len 61 | ); 62 | 63 | UINT 64 | S5LogGssSCode( pid_t p, 65 | int ma, 66 | int mi 67 | ); 68 | 69 | #endif 70 | 71 | -------------------------------------------------------------------------------- /include/SS5Mod_authentication.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5MOD_AUTHENTICATION_H 20 | #define SS5MOD_AUTHENTICATION_H 1 21 | 22 | 23 | #define FILE_AUTHENTICATION 0 24 | #define PAM_AUTHENTICATION 2 25 | #define EAP_AUTHENTICATION 3 26 | #define RADIUS_AUTHENTICATION 4 27 | 28 | 29 | enum ERR_AUTHENTICATION { 30 | ERR_AUTHECACHE_EXPIRED= -1, 31 | ERR_NOAUTH= 2 32 | }; 33 | 34 | /* 35 | * SS5: Authetication program buffer 36 | */ 37 | struct _S5AuthCmd { 38 | char ProgName[128]; 39 | } *S5AuthCmd; 40 | 41 | pthread_mutex_t PAMMutex; 42 | 43 | pthread_mutex_t AECMutex; 44 | 45 | FILE *S5PwdFile; /* Password file pointer /var/log/ss5.passwd */ 46 | 47 | 48 | 49 | /* 50 | * Initialize module context 51 | */ 52 | UINT 53 | InitModule( struct _module *m 54 | ); 55 | 56 | /* 57 | * Master function: does authentication process 58 | */ 59 | UINT 60 | Authentication( struct _SS5ClientInfo *ci ); 61 | 62 | UINT 63 | SrvAuthentication( struct _SS5ClientInfo *ci, 64 | struct _SS5Socks5Data *sd 65 | ); 66 | 67 | /* 68 | * Slave functions: manage authentication cache feature 69 | */ 70 | inline UINT 71 | S5AuthCacheHash( char *u, 72 | char *p 73 | ); 74 | 75 | UINT 76 | GetAuthCache( char *u, 77 | char *p 78 | ); 79 | 80 | UINT 81 | UpdateAuthCache( char *u, 82 | char *p 83 | ); 84 | 85 | UINT 86 | AddAuthCache( char *u, 87 | char *p 88 | ); 89 | 90 | UINT 91 | FreeAuthCache( struct _S5AuthCacheNode **node 92 | ); 93 | 94 | UINT 95 | S5BrowseAuthCacheList( char *buf, 96 | struct _S5AuthCacheNode *node 97 | ); 98 | 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /include/SS5Mod_authorization.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5MOD_AUTHORIZATION_H 20 | #define SS5MOD_AUTHORIZATION_H 1 21 | 22 | #define LDAP_BASE 0 23 | #define LDAP_FILTER 1 24 | 25 | #define PERMIT 0 26 | #define DENY 1 27 | 28 | #define PROXY 0 29 | #define NOPROXY 1 30 | 31 | #define FILE_PROFILING 0 32 | #define LDAP_PROFILING 1 33 | #define MYSQL_PROFILING 2 34 | 35 | UINT NAclList, 36 | _tmp_NAclList; 37 | 38 | UINT NLdapStore; 39 | UINT NMysqlStore; 40 | 41 | 42 | enum ERR_AUTHORIZATION { 43 | ERR_NOACLFOUND= -1, 44 | ERR_DENY= -2, 45 | ERR_AUTHOCACHE_EXPIRED= -3 46 | }; 47 | 48 | pthread_mutex_t ACMutex; 49 | 50 | /* 51 | * Initialize module context 52 | */ 53 | UINT 54 | InitModule( struct _module *m 55 | ); 56 | 57 | /* 58 | * Master function: does authorization for connect/bind (Pre) and 59 | * udp associate (Post) commands 60 | */ 61 | UINT 62 | PreAuthorization( struct _SS5ClientInfo *ci, 63 | struct _SS5RequestInfo *ri, 64 | struct _SS5Facilities *fa 65 | ); 66 | 67 | UINT 68 | PostAuthorization( struct _SS5ClientInfo *ci, 69 | struct _SS5RequestInfo *ri, 70 | struct _SS5Facilities *fa 71 | ); 72 | 73 | UINT 74 | SrvAuthorization( struct _SS5ClientInfo *ci, 75 | struct _SS5Socks5Data *sd 76 | ); 77 | 78 | /* 79 | * Slave functions: manage access lists 80 | */ 81 | UINT 82 | AddAcl( UINT ctx, 83 | UINT type, 84 | ULINT sa, 85 | char sfqdn[64], 86 | ULINT sp, 87 | ULINT da, 88 | char dfqdn[64], 89 | ULINT dp, 90 | UINT srcmask, 91 | UINT dstmask, 92 | UINT method, 93 | struct _SS5Facilities *fa 94 | ); 95 | 96 | UINT 97 | DelAcl( UINT type, 98 | ULINT sa, 99 | char sfqdn[64], 100 | ULINT sp, 101 | ULINT da, 102 | char dfqdn[64], 103 | ULINT dp, 104 | UINT srcmask, 105 | UINT dstmask, 106 | UINT method, 107 | struct _SS5Facilities *fa); 108 | 109 | 110 | INT 111 | GetAcl( ULINT sa, 112 | UINT sp, 113 | ULINT da, 114 | UINT dp, 115 | struct _SS5Facilities *fa, 116 | UINT *acl 117 | ); 118 | 119 | UINT 120 | FreeAcl( struct _S5AclNode **node 121 | ); 122 | 123 | UINT 124 | BrowseAclList( char *buf,struct _S5AclNode *node 125 | ); 126 | 127 | UINT 128 | S5CheckPort( char *port, 129 | UINT s5port 130 | ); 131 | 132 | UINT 133 | S5BrowseAclList( char *buf, 134 | struct _S5AclNode *node 135 | ); 136 | 137 | UINT 138 | S5BrowseAuthoCacheList( char *buf, 139 | struct _S5AuthoCacheNode *node 140 | ); 141 | 142 | UINT 143 | S5CheckexpDate( char *expdate 144 | ); 145 | 146 | ULINT 147 | FqdnHash( char *s 148 | ); 149 | 150 | /* 151 | * Look for username into group file or group into directory 152 | */ 153 | inline UINT 154 | FileCheck( char *group, 155 | char *user 156 | ); 157 | 158 | /* 159 | * Slave functions: manage authorization cache feature 160 | */ 161 | inline UINT 162 | S5AuthoCacheHash( char *sa, 163 | char *da, 164 | UINT dp, 165 | char *u 166 | ); 167 | 168 | UINT 169 | GetAuthoCache( char *sa, 170 | char *da, 171 | UINT dp, 172 | char *u, 173 | struct _SS5Facilities *fa, 174 | UINT f 175 | ); 176 | 177 | UINT 178 | UpdateAuthoCache( char *sa, 179 | char *da, 180 | UINT dp, 181 | char *u, 182 | UINT f 183 | ); 184 | 185 | UINT 186 | AddAuthoCache( char *sa, 187 | char *da, 188 | UINT dp, 189 | char *u, 190 | struct _SS5Facilities *fa 191 | ); 192 | 193 | UINT 194 | FreeAuthoCache( struct _S5AuthoCacheNode **node 195 | ); 196 | 197 | #endif 198 | -------------------------------------------------------------------------------- /include/SS5Mod_balance.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5MOD_BALANCE_H 20 | #define SS5MOD_BALANCE_H 1 21 | 22 | /* 23 | * Functions definition 24 | */ 25 | 26 | UINT 27 | InitModule( struct _module *m 28 | ); 29 | 30 | UINT 31 | AddVip( char *real, 32 | UINT vid, 33 | UINT index 34 | ); 35 | 36 | UINT 37 | FreeConnectionTable ( struct _S5ConnectionEntry *ce 38 | ); 39 | 40 | UINT 41 | FreeAffinity( struct _S5StickyNode **node 42 | ); 43 | 44 | UINT 45 | LoadBalancing( struct _SS5ClientInfo *ci, 46 | struct _SS5RequestInfo *ri 47 | ); 48 | 49 | UINT 50 | SrvBalancing( struct _SS5ClientInfo *ci, 51 | struct _SS5Socks5Data *sd 52 | ); 53 | 54 | UINT 55 | S5LeastConnectionReal( char *s5application 56 | ); 57 | 58 | UINT 59 | S5GetRealVid( char *real 60 | ); 61 | 62 | UINT 63 | S5AddConn2Real( char *real 64 | ); 65 | 66 | UINT 67 | S5RemoveConn2Real( char *real 68 | ); 69 | 70 | UINT 71 | S5AddReal2ConnectionTable( char *real, 72 | UINT vid, 73 | UINT index 74 | ); 75 | 76 | inline UINT 77 | S5StickyHash( ULINT srcip 78 | ); 79 | 80 | ULINT 81 | S5GetAffinity( ULINT srcip, 82 | UINT *ttl_status, 83 | UINT vid 84 | ); 85 | 86 | UINT 87 | S5SetAffinity( ULINT srcip, 88 | ULINT dstip, 89 | UINT vid 90 | ); 91 | 92 | UINT 93 | S5RemoveAffinity( ULINT srcip, 94 | UINT vid 95 | ); 96 | 97 | UINT 98 | Balancing( struct _SS5ClientInfo *ci, 99 | struct _SS5Socks5Data *sd 100 | ); 101 | 102 | #endif 103 | -------------------------------------------------------------------------------- /include/SS5Mod_bandwidth.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5MOD_BANDWIDTH 20 | #define SS5MOD_BANDWIDTH 1 21 | 22 | /* 23 | * Evaluate bandwidth utilization 24 | */ 25 | UINT 26 | Bandwidth( struct timeval tv, 27 | struct _SS5ProxyData *pd, 28 | struct _SS5Facilities *fa 29 | ); 30 | 31 | /* 32 | * Slave functions: manage bandwidth table feature 33 | */ 34 | inline UINT 35 | S5BandTableHash( char *u 36 | ); 37 | 38 | UINT 39 | GetBandTableC( char *u 40 | ); 41 | 42 | UINT 43 | CheckBandTableC( char *u 44 | ); 45 | 46 | ULINT 47 | GetBandTableB( char *u 48 | ); 49 | 50 | UINT 51 | UpdateBandTable( char *u, 52 | int n 53 | ); 54 | 55 | UINT 56 | AddBandTable( UINT ctx, 57 | char *u, 58 | int ln, 59 | ULINT lb 60 | ); 61 | 62 | UINT 63 | DelBandTable( char *u); 64 | 65 | UINT 66 | TransfBandTable( struct _S5BandTableNode *node 67 | ); 68 | 69 | UINT 70 | FreeBandTable( struct _S5BandTableNode **node 71 | ); 72 | 73 | UINT 74 | SrvBandwidth( struct _SS5ClientInfo *ci, 75 | struct _SS5Socks5Data *sd 76 | ); 77 | 78 | UINT 79 | S5BrowseBandTable( char *buf, 80 | struct _S5BandTableNode *node 81 | ); 82 | 83 | UINT 84 | CopyBandTable( char *u, 85 | int n 86 | ); 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /include/SS5Mod_dump.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5MOD_DUMP_H 20 | #define SS5MOD_DUMP_H 1 21 | 22 | #define RX 0 23 | #define TX 1 24 | #define RTX 2 25 | 26 | #define MAXDUMPLIST 997 /* Max dump list loadable */ 27 | 28 | 29 | enum ERR_DUMP { 30 | ERR_NODUMPFOUND= -1 31 | }; 32 | 33 | UINT NDumpList, 34 | _tmp_NDumpList; 35 | 36 | 37 | 38 | UINT 39 | InitModule( struct _module *m 40 | ); 41 | 42 | UINT 43 | WritingDump( FILE *df, 44 | struct _SS5ProxyData *pd, 45 | UINT dm 46 | ); 47 | 48 | UINT 49 | OpenDump( FILE **df, 50 | struct _SS5ClientInfo *ci 51 | ); 52 | 53 | UINT 54 | CloseDump( FILE *df 55 | ); 56 | 57 | inline UINT 58 | S5DumpHash( ULINT da, 59 | UINT dp 60 | ); 61 | 62 | UINT 63 | GetDump( ULINT da, 64 | UINT dp, 65 | struct _SS5DumpInfo *di 66 | ); 67 | 68 | UINT 69 | AddDump( UINT ctx, 70 | ULINT da, 71 | ULINT dp, 72 | UINT dm, 73 | UINT mask 74 | ); 75 | 76 | UINT 77 | DelDump( ULINT da, 78 | ULINT dp, 79 | UINT mask 80 | ); 81 | 82 | UINT 83 | FreeDump( struct _S5DumpNode **node 84 | ); 85 | 86 | UINT 87 | S5BrowseDumpList( char *buf, 88 | struct _S5DumpNode *node 89 | ); 90 | 91 | UINT 92 | SrvDump( struct _SS5ClientInfo *ci, 93 | struct _SS5Socks5Data *sd 94 | ); 95 | 96 | UINT 97 | ListDump( UINT s 98 | ); 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /include/SS5Mod_filter.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5MOD_FILTER_H 20 | #define SS5MOD_FILTER_H 1 21 | 22 | #define CLIENT_HELLO 0x01 23 | #define HANDSHAKE 0x16 24 | #define ICP_HIT 0x02 25 | 26 | #define ICP_QUERY_TIMEOUT 10 27 | #define MAX_HEADERS 32 28 | 29 | #define SETICPREQ_R(x,y,z) for(i=0;i<4;i++) { x[3-i+z]=(y & (0x000000FF << (i*8))) >> (i*8); }; 30 | #define SETICPLEN_R(x,y,z) for(i=0;i<2;i++) { x[1-i+z]=(y & (0x00FF << (i*8))) >> (i*8); }; 31 | 32 | char *ss5ver=SS5_VERSION; 33 | 34 | enum ERR_FILTER { 35 | ERR_ICACHE= -6, 36 | ERR_HTTP= -5, 37 | ERR_HTTPS= -4, 38 | ERR_SMTP= -3, 39 | ERR_POP3= -2, 40 | ERR_IMAP4= -1 41 | }; 42 | 43 | struct _S5Fixup { 44 | UINT Status; 45 | UINT Http; 46 | UINT Https; 47 | UINT Smtp; 48 | UINT Pop3; 49 | UINT Imap; 50 | UINT ICache; 51 | }; 52 | 53 | 54 | struct _http_request { 55 | char cmd[8]; 56 | char url[256]; 57 | char proto[16]; 58 | char icpUrl[256]; 59 | char proxyUrl[256]; 60 | }; 61 | 62 | struct _http_header { 63 | char *hn; /* Header name */ 64 | char *hv; /* Header value */ 65 | }; 66 | 67 | /* 68 | * Initialize module context 69 | */ 70 | UINT 71 | InitModule( struct _module *m 72 | ); 73 | 74 | /* 75 | * Master function: does filtering work 76 | */ 77 | UINT 78 | Filtering( struct _SS5ClientInfo *ci, char *s, struct _SS5ProxyData *pd 79 | ); 80 | 81 | 82 | /* 83 | * Slave functions: manage fixup features: 84 | * 85 | * Htto 86 | * Httos 87 | * Smtp 88 | * Pop3 89 | * Imap 90 | */ 91 | UINT 92 | S5FixupHttp( struct _SS5ProxyData *pd ); 93 | 94 | UINT 95 | S5FixupHttps( struct _SS5ProxyData *pd ); 96 | 97 | UINT 98 | S5FixupSmtp ( struct _SS5ProxyData *pd ); 99 | 100 | UINT 101 | S5FixupPop3 ( struct _SS5ProxyData *pd ); 102 | 103 | UINT 104 | S5FixupImap ( struct _SS5ProxyData *pd ); 105 | 106 | UINT 107 | S5FixupiCache( struct _SS5ProxyData *pd, struct _SS5ClientInfo *ci ); 108 | 109 | UINT 110 | S5ParseHttpReq( struct _SS5ProxyData *pd, struct _http_request *hr ); 111 | 112 | UINT 113 | S5ParseHttpHeader( struct _SS5ProxyData *pd, struct _http_request *hr, struct _http_header *hh ); 114 | #endif 115 | -------------------------------------------------------------------------------- /include/SS5Mod_log.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5MOD_LOG_H 20 | #define SS5MOD_LOG_H 1 21 | 22 | /* 23 | * Initialize module context 24 | */ 25 | UINT 26 | InitModule( struct _module *m 27 | ); 28 | 29 | /* 30 | * Master function: logs socks server activities 31 | */ 32 | UINT 33 | Logging( char *s5logstring 34 | ); 35 | 36 | /* 37 | * Slave functions: close log file and verbose 38 | */ 39 | UINT 40 | S5LogFileClose( void 41 | ); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /include/SS5Mod_proxy.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * B 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef SS5MOD_PROXY_H 21 | #define SS5MOD_PROXY_H 1 22 | 23 | //#define BIND_TIMEOUT 120 /* Seconds */ 24 | #define UDP_TIMEOUT 60 /* Seconds */ 25 | 26 | 27 | /* 28 | * Initialize module context 29 | */ 30 | UINT 31 | InitModule( struct _module *m 32 | ); 33 | 34 | /* 35 | * Master function: receive and send data tcp/udp 36 | */ 37 | UINT 38 | ReceivingData( struct _SS5ClientInfo *ci, 39 | struct _SS5ProxyData *pd, 40 | #ifdef EPOLL_IO 41 | struct epoll_event *events 42 | #else 43 | fd_set *s5array 44 | #endif 45 | ); 46 | 47 | UINT 48 | SendingData( struct _SS5ClientInfo *ci, 49 | struct _SS5ProxyData *pd 50 | ); 51 | 52 | UINT 53 | UdpReceivingData( int applicationbindSocket, 54 | struct _SS5ProxyData *pd 55 | ); 56 | 57 | UINT 58 | UdpSendingData( int applicationSocket, 59 | struct _SS5RequestInfo *ri, 60 | struct _SS5ProxyData *pd 61 | ); 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /include/SS5Mod_socks4.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5MOD_SOCKS4_H 20 | #define SS5MOD_SOCKS4_H 1 21 | 22 | #define BIND_TIMEOUT 120 /* Seconds */ 23 | 24 | struct _SS5Socks4Data { 25 | char Requ[32]; 26 | char Resp[8]; 27 | }; 28 | 29 | 30 | UINT 31 | InitModule( struct _module *m 32 | ); 33 | 34 | UINT 35 | RequestParsing( struct _SS5ClientInfo *ci, 36 | struct _SS5Socks5Data *sd, 37 | struct _SS5RequestInfo *ri 38 | ); 39 | 40 | UINT 41 | UpstreamServing( struct _SS5ClientInfo *ci, 42 | struct _SS5RequestInfo *ri, 43 | struct _SS5Socks5Data *sd 44 | ); 45 | 46 | UINT 47 | ConnectServing( struct _SS5ClientInfo *ci, 48 | struct _SS5RequestInfo *ri, 49 | struct _SS5Socks5Data *sd 50 | ); 51 | 52 | UINT 53 | BindServing( struct _SS5ClientInfo *ci, 54 | struct _SS5RequestInfo *ri, 55 | struct _SS5Socks5Data *sd 56 | ); 57 | 58 | UINT 59 | AddRoute( ULINT sa, 60 | ULINT si, 61 | char *group, 62 | UINT mask, 63 | UINT sd 64 | ); 65 | 66 | UINT 67 | FreeRoute( struct _S5RouteNode **node 68 | ); 69 | 70 | ULINT 71 | GetRoute( ULINT sa, 72 | ULINT da, 73 | char uname[64] 74 | ); 75 | 76 | UINT 77 | S5ResolvHostName( struct _SS5RequestInfo *ri, 78 | struct _S5HostList *s5hostlist, 79 | UINT *s5resolvedhosts 80 | ); 81 | 82 | UINT 83 | S5Check_AuthAcl( struct _SS5ClientInfo *ci 84 | ); 85 | 86 | UINT 87 | S5OrderIP( struct _S5HostList *s5hostlist, 88 | UINT *s5resolvedhosts 89 | ); 90 | 91 | UINT 92 | S5CompIP( char src[16], 93 | char dst[16] 94 | ); 95 | 96 | UINT 97 | S5GetBindIf( char *s5application, 98 | char *s5clientbind 99 | ); 100 | 101 | UINT 102 | S5VerifyBind( struct _SS5ClientInfo *ci, 103 | struct _SS5RequestInfo *ri 104 | ); 105 | 106 | inline UINT 107 | S5IfMatch( char ip[16] 108 | ); 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /include/SS5Mod_socks5.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5MOD_SOCKS5_H 20 | #define SS5MOD_SOCKS5_H 1 21 | 22 | #define BIND_TIMEOUT 120 /* Seconds */ 23 | #define UDP_TIMEOUT 60 /* Seconds */ 24 | #define BEGIN_STREAM 0 25 | #define CONTINUE_STREAM 1 26 | #define END_STREAM 2 27 | 28 | enum ERR_PROXY { 29 | ERR_NOPROXY = 0 30 | }; 31 | 32 | enum ERR_SOCKS5 { 33 | ERR_DUPLINES= -1 34 | }; 35 | 36 | UINT NMethodList, 37 | _tmp_NMethodList, 38 | NRouteList, 39 | _tmp_NRouteList, 40 | NProxyList, 41 | _tmp_NProxyList; 42 | 43 | 44 | 45 | UINT 46 | InitModule( struct _module *m 47 | ); 48 | 49 | UINT 50 | MethodParsing( struct _SS5ClientInfo *ci, 51 | struct _SS5Socks5Data *sd 52 | ); 53 | 54 | UINT 55 | RequestParsing( struct _SS5ClientInfo *ci, 56 | struct _SS5Socks5Data *sd, 57 | struct _SS5RequestInfo *ri 58 | ); 59 | 60 | UINT 61 | UpstreamServing( struct _SS5ClientInfo *ci, 62 | struct _SS5RequestInfo *ri, 63 | struct _SS5Socks5Data *sd 64 | ); 65 | 66 | UINT 67 | ConnectServing( struct _SS5ClientInfo *ci, 68 | struct _SS5RequestInfo *ri, 69 | struct _SS5Socks5Data *sd 70 | ); 71 | 72 | UINT 73 | BindServing( struct _SS5ClientInfo *ci, 74 | struct _SS5RequestInfo *ri, 75 | struct _SS5Socks5Data *sd 76 | ); 77 | 78 | UINT 79 | UdpAssociateServing( struct _SS5ClientInfo *ci, 80 | struct _SS5RequestInfo *ri, 81 | struct _SS5Socks5Data *sd, 82 | struct _SS5ProxyData *pd 83 | ); 84 | 85 | UINT 86 | UdpAssociateResponse( struct _SS5ClientInfo *ci, 87 | struct _SS5RequestInfo *ri, 88 | struct _SS5Socks5Data *sd, 89 | struct _SS5ProxyData *pd 90 | ); 91 | 92 | UINT 93 | SrvSocks5 ( struct _SS5ClientInfo *ci, 94 | struct _SS5Socks5Data *sd 95 | ); 96 | 97 | UINT 98 | V52V4Request( struct _SS5Socks5Data *sd, 99 | struct _SS5RequestInfo *ri, 100 | struct _SS5ClientInfo *ci); 101 | 102 | UINT 103 | V42V5Response( struct _SS5Socks5Data *sd, 104 | struct _SS5RequestInfo *ri, 105 | struct _SS5ClientInfo *ci); 106 | 107 | UINT 108 | FileCheck( char *group, 109 | char *user 110 | ); 111 | 112 | UINT 113 | AddMethod( UINT ctx, 114 | ULINT sa, 115 | ULINT sp, 116 | UINT me, 117 | UINT mask 118 | ); 119 | 120 | UINT 121 | DelMethod(ULINT sa, ULINT sp, UINT me, UINT mask); 122 | 123 | 124 | 125 | UINT 126 | FreeMethod( struct _S5MethodNode **node 127 | ); 128 | 129 | unsigned char 130 | GetMethod( ULINT sa, 131 | UINT sp 132 | ); 133 | 134 | UINT 135 | AddRoute( UINT ctx, 136 | ULINT sa, 137 | ULINT si, 138 | char *group, 139 | UINT mask, 140 | UINT sd ); 141 | 142 | UINT 143 | DelRoute(ULINT sa, ULINT si, char *group, UINT mask, UINT sd ); 144 | 145 | UINT 146 | FreeRoute( struct _S5RouteNode **node 147 | ); 148 | 149 | ULINT 150 | GetRoute( ULINT sa, 151 | ULINT da, 152 | char *uname 153 | ); 154 | 155 | UINT 156 | AddProxy( UINT ctx, 157 | UINT type, 158 | ULINT da, 159 | ULINT dp, 160 | ULINT pa, 161 | UINT pp, 162 | UINT mask, 163 | UINT socksver ); 164 | UINT 165 | DelProxy(UINT type, ULINT da, ULINT dp, ULINT pa, UINT pp, UINT mask, UINT socksver); 166 | 167 | UINT 168 | FreeProxy( struct _S5ProxyNode **node 169 | ); 170 | 171 | UINT 172 | GetProxy( ULINT da, 173 | UINT dp, 174 | struct _SS5RequestInfo *ri 175 | ); 176 | 177 | 178 | UINT 179 | S5ResolvHostName( struct _SS5RequestInfo *ri, 180 | struct _S5HostList *s5hostlist, 181 | UINT *s5resolvedhosts 182 | ); 183 | 184 | UINT 185 | S5OrderIP( struct _S5HostList *s5hostlist, 186 | UINT *s5resolvedhosts 187 | ); 188 | 189 | UINT 190 | S5CompIP( char src[16], 191 | char dst[16] 192 | ); 193 | 194 | UINT 195 | S5GetBindIf( char *s5application, 196 | char *s5clientbind 197 | ); 198 | 199 | UINT 200 | S5VerifyBind( struct _SS5ClientInfo *ci, 201 | struct _SS5RequestInfo *ri 202 | ); 203 | 204 | inline UINT 205 | S5IfMatch( char ip[16] 206 | ); 207 | 208 | UINT 209 | S5BrowseMethodList( char *buf, 210 | struct _S5MethodNode *node 211 | ); 212 | 213 | UINT 214 | S5BrowseRouteList( char *buf, 215 | struct _S5RouteNode *node 216 | ); 217 | 218 | UINT 219 | S5BrowseProxyList( char *buf, 220 | struct _S5ProxyNode *node 221 | ); 222 | 223 | #endif 224 | -------------------------------------------------------------------------------- /include/SS5Mod_statistics.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5MOD_STATISTICS_H 20 | #define SS5MOD_STATISTICS_H 1 21 | 22 | /* 23 | * Initialize module context 24 | */ 25 | UINT 26 | InitModule( struct _module *m 27 | ); 28 | 29 | /* 30 | * Master function: browse statistics information 31 | */ 32 | UINT 33 | Statistics( struct _SS5ClientInfo *ci, 34 | struct _SS5Socks5Data *sd 35 | ); 36 | 37 | UINT 38 | Summary( UINT autheerr, 39 | UINT authoerr, 40 | UINT cmderr 41 | ); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /include/SS5Modules.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5MODULES_H 20 | #define SS5MODULES_H 1 21 | 22 | /* 23 | * Load and unload modules: 24 | * Modules must be found in /usr/lib/ss5/ *.so 25 | * If you want to disable a module, rename it (i.e. mv mod_authentication.so mod_authentication.so.NO) 26 | * and ss5 won't load it 27 | */ 28 | UINT 29 | S5LoadModules( void 30 | ); 31 | 32 | UINT 33 | S5UnLoadModules( void 34 | ); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/SS5MySql.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5MYSQL_H 20 | #define SS5MYSQL_H 1 21 | 22 | #define SQLSTRING "SELECT uname FROM grp WHERE gname like" 23 | /* 24 | * * SS5: Mysql configuration parameters 25 | * */ 26 | struct _S5Mysql { 27 | char IP[16]; /* Mysql ip */ 28 | char DB[64]; /* Mysql db */ 29 | char User[64]; /* Mysql user */ 30 | char Pass[64]; /* Mysql password */ 31 | char SqlString[128]; /* Mysql SQL query base string */ 32 | } S5Mysql; 33 | 34 | 35 | UINT 36 | MySqlCheck( char *group, 37 | char *s5username 38 | ); 39 | 40 | UINT 41 | MySqlQuery( pid_t pid, 42 | char *group, 43 | char *user, 44 | int dirid 45 | ); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /include/SS5OpenLdap.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5OPENLDAP_H 20 | #define SS5OPENLDAP_H 1 21 | 22 | /* 23 | * SS5: Directory configuration parameters 24 | */ 25 | struct _S5Ldap { 26 | char IP[16]; /* Directory ip */ 27 | char Port[6]; /* Directory port */ 28 | char Base[64]; /* Directory base */ 29 | char Filter[128]; /* Directory filter */ 30 | char Attribute[32]; /* Directory attribute for FILTER mode */ 31 | char Dn[64]; /* Directory dn */ 32 | char Pass[16]; /* Directory password */ 33 | char NtbDomain[16]; /* Windows netbios domain associated to directory */ 34 | } S5Ldap[MAXLDAPSTORE]; 35 | 36 | 37 | UINT 38 | DirectoryCheck( char *group, 39 | char *s5username 40 | ); 41 | 42 | UINT 43 | DirectoryQuery( pid_t pid, 44 | char *group, 45 | char *user, 46 | int dirid 47 | ); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /include/SS5Pam.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5PAM_H 20 | #define SS5PAM_H 1 21 | 22 | #ifdef LINUX 23 | #include 24 | #endif 25 | 26 | #include 27 | 28 | /* 29 | * * * SS5: PAM buffers 30 | * * */ 31 | struct _S5PamData { 32 | const char *user; 33 | const char *password; 34 | }; 35 | 36 | 37 | UINT 38 | S5PamCheck( struct _SS5ClientInfo *ci 39 | ); 40 | 41 | /*static int 42 | S5PAMConversation( int nmsg, 43 | const struct pam_message **pam_msg, 44 | struct pam_response **resp, 45 | void *s5data 46 | );*/ 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /include/SS5Radius.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5RADIUS_H 20 | #define SS5RADIUS_H 1 21 | 22 | #include 23 | 24 | #define Access_Request 1 25 | #define Access_Accept 2 26 | #define Access_Reject 3 27 | #define Accounting_Request 4 28 | #define Accounting_Response 5 29 | 30 | #define ST_Start 1 31 | #define ST_Stop 2 32 | #define ST_Interim_Update 3 33 | 34 | #define ATT_User_Name 1 35 | #define ATT_User_Password 2 36 | #define ATT_NAS_Port 5 37 | #define ATT_Framed_IP_Address 8 38 | #define ATT_Framed_Route 22 39 | #define ATT_Session_Timeout 27 40 | #define ATT_Idle_Timeout 28 41 | #define ATT_Reply_Message 18 42 | #define ATT_Acct_Status_Type 40 43 | #define ATT_Acct_Session_Id 44 44 | #define ATT_Acct_Input_Octets 42 45 | #define ATT_Acct_Output_Octets 43 46 | #define ATT_Acct_Session_Time 46 47 | #define ATT_Acct_Delay_Time 41 48 | #define ATT_Calling_Station_Id 31 49 | #define ATT_Acct_Interim_Interval 85 50 | 51 | #define RADIUS_AUTH_PORT 1812 52 | #define RADIUS_ACCT_PORT 1813 53 | 54 | #define OFF_CODE 0 55 | #define OFF_PACKET_ID 1 56 | #define OFF_PACKET_LEN 2 57 | #define OFF_VECTOR 4 58 | 59 | #define HEADER_LEN 20 60 | #define VECTOR_LEN 16 61 | #define MAX_PACKET_LEN 4096 62 | #define RADIUS_TIMEOUT 10 63 | 64 | #define GETADDR_R(x,y,z) y=0; for(i=0;i<4;i++) { y += ((ULINT)x[i+z] << (i*8)); }; 65 | #define GETXVAL(x,y,z) y=0; for(i=0;i<4;i++) { y += ((ULINT)x[3-i+z] << (i*8)); }; 66 | #define SETPLEN_R(x,y,z) for(i=0;i<2;i++) { x[1-i+z]=(y & (0x00FF << (i*8))) >> (i*8); }; 67 | #define SETXVAL_R(x,y,z) for(i=0;i<4;i++) { x[3-i+z]=(y & (0x000000FF << (i*8))) >> (i*8); }; 68 | 69 | /* 70 | * * SS5: Radius configuration parameters 71 | * */ 72 | struct _S5Radius { 73 | char IP[16]; /* Radius server IP */ 74 | char IPBck[16]; /* Radius server secondary IP */ 75 | UINT AuthPort; /* Radius auth service port */ 76 | UINT AcctPort; /* Radius acct service port */ 77 | char Secret[32]; /* Radius secret */ 78 | } S5Radius; 79 | 80 | 81 | /* 82 | * Functions for Basic authentication 83 | */ 84 | 85 | UINT 86 | S5RadiusAuth( struct _SS5ClientInfo *ci, 87 | pid_t pid 88 | ); 89 | 90 | UINT 91 | S5RadiusAcct( struct _SS5ClientInfo *ci, 92 | unsigned long cmd, 93 | pid_t pid 94 | ); 95 | 96 | #endif 97 | -------------------------------------------------------------------------------- /include/SS5Server.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5SERVER_H 20 | #define SS5SERVER_H 1 21 | 22 | void 23 | S5SetStatic( void 24 | ); 25 | 26 | void 27 | S5SetDynamic( void 28 | ); 29 | 30 | UINT 31 | S5ServerClose( int exitcode 32 | ); 33 | 34 | inline UINT 35 | S5ChildClose( int exitcode, 36 | UINT childSocket, 37 | struct _SS5ClientInfo *ci 38 | ); 39 | 40 | UINT 41 | S5UIDSet( char *username 42 | ); 43 | 44 | UINT 45 | S5MakeDaemon( void 46 | ); 47 | 48 | UINT 49 | S5ServerMake( char *addr, 50 | UINT port 51 | ); 52 | 53 | UINT 54 | S5ServerAccept( struct sockaddr_in *s5client_ssin, 55 | int *s5client_socket 56 | ); 57 | 58 | /* 59 | * Get network client information from socket after accept syscall 60 | */ 61 | UINT 62 | S5GetClientInfo( struct _SS5ClientInfo *ci, 63 | UINT s, 64 | pid_t pid 65 | ); 66 | 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /include/SS5Srv.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5SRV_H 20 | #define SS5SRV_H 1 21 | 22 | UINT ConnectConsole (char *addr,UINT port ); 23 | 24 | void 25 | Usage( void 26 | ); 27 | 28 | int Stat_Conn( char *addr,UINT port ); 29 | int Stat_Bind( char *addr,UINT port ); 30 | int Stat_Udp( char *addr,UINT port ); 31 | int Stat_Authen( char *addr,UINT port ); 32 | int Stat_Author( char *addr,UINT port ); 33 | 34 | int List_Option( char *addr,UINT port, FILE *ou ); 35 | int List_Peer( char *addr,UINT port, FILE *ou ); 36 | int List_Bandwidth( char *addr,UINT port, FILE *ou ); 37 | int List_Authorization( char *addr,UINT port, FILE *ou ); 38 | int List_Authcache( char *addr,UINT port ); 39 | int List_Route( char *addr,UINT port, FILE *ou ); 40 | int List_Proxy( char *addr,UINT port, FILE *ou ); 41 | int List_Dump( char *addr,UINT port, FILE *ou ); 42 | int List_Method( char *addr,UINT port, FILE *ou ); 43 | int List_Virtual( char *addr,UINT port, FILE *ou ); 44 | 45 | int Disp_Authcache( char *addr,UINT port ); 46 | int Disp_Authocache( char *addr,UINT port ); 47 | int Disp_Virtualcache( char *addr,UINT port ); 48 | 49 | int Show_Conn( char *addr,UINT port ); 50 | int Show_Bind( char *addr,UINT port ); 51 | int Show_Udp( char *addr,UINT port ); 52 | int Show_Authen( char *addr,UINT port ); 53 | int Show_Author( char *addr,UINT port ); 54 | 55 | 56 | int Del_Bandwidth( char *addr, UINT port, char *user, char *lncon, char *lband ); 57 | int Add_Bandwidth( char *addr, UINT port,char *user, char *lncon, char *lband ); 58 | 59 | int Add_Method( char *addr, UINT port,char *sa, char *sp, char *me ); 60 | int Del_Method( char *addr, UINT port,char *sa, char *sp, char *me ); 61 | 62 | int Add_Route( char *addr, UINT port,char *sa, char *si, char *grp, char *dir ); 63 | int Del_Route( char *addr, UINT port,char *sa, char *si, char *grp, char *dir ); 64 | 65 | int Add_Permit( char *addr, UINT port,char *me, char *sa, char *sp, char *da, char *dp, char *fu, char *grp, char *ba, char *ed, UINT f ); 66 | int Del_Permit( char *addr, UINT port,char *me, char *sa, char *sp, char *da, char *dp, char *fu, char *grp, char *ba, char *ed, UINT f ); 67 | 68 | int Add_Dump( char *addr,UINT port, char *da, char *dp, char *dm ); 69 | int Del_Dump( char *addr,UINT port, char *da, char *dp, char *dm ); 70 | 71 | int Add_Proxy( char *addr,UINT port, char *da, char *dp, char *pa, char *pp, char *sv, UINT f ); 72 | int Del_Proxy( char *addr,UINT port, char *da, char *dp, char *pa, char *pp, char *sv, UINT f ); 73 | 74 | int Write_Config( char *f ); 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /include/SS5Supa.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2010 by Raffaele De Lorenzo - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5SUPA_H 20 | #define SS5SUPA_H 1 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #define LEN_KEY 16 34 | #define LEN_HK_REQ 17 35 | struct ss5_hk_req { 36 | 37 | uint8_t stat; 38 | uint8_t key[LEN_KEY]; 39 | }; 40 | 41 | #define LEN_DH_REQ 778 42 | #define METHOD_SIZE 255 43 | struct ss5_dh_req { 44 | 45 | uint8_t stat; 46 | uint32_t lenp; 47 | uint8_t p[METHOD_SIZE]; 48 | uint32_t leng; 49 | uint8_t g[METHOD_SIZE]; 50 | uint32_t lena; 51 | uint8_t a[METHOD_SIZE]; 52 | }; 53 | 54 | #define LEN_DH_RES 260 55 | struct ss5_dh_res { 56 | 57 | uint8_t stat; 58 | uint32_t lenb; 59 | uint8_t b[METHOD_SIZE]; 60 | }; 61 | 62 | #define LEN_AUTH_REQ 513 63 | struct ss5_auth_req{ 64 | uint8_t ver; 65 | uint8_t ulen; 66 | uint8_t uname[METHOD_SIZE]; 67 | uint8_t plen; 68 | uint8_t password[METHOD_SIZE]; 69 | }; 70 | 71 | /* 72 | * Functions for SUPA 73 | */ 74 | UINT 75 | S5PwdFileOpen( pid_t pid 76 | ); 77 | 78 | int 79 | ss5_secure_auth( int sock, 80 | struct _SS5ClientInfo *ci 81 | ); 82 | 83 | /*static int 84 | ss5_secure_dh_decrypt_key( int s, 85 | unsigned char * session_key, 86 | struct _SS5BasicData * bd 87 | ); 88 | 89 | static unsigned char * 90 | ss5_secure_dh_compute_key( int s, 91 | struct ss5_dh_req * pippo 92 | ); 93 | 94 | static int 95 | ss5_create_dh_response( int s, 96 | unsigned char * public_key, 97 | uint32_t size 98 | ); 99 | 100 | static int ss5_validate_dh_req( int s, 101 | struct ss5_dh_req * pippo 102 | ); 103 | 104 | static int ss5_secure_send_hk_req( int s, 105 | const char * host_key 106 | ); 107 | 108 | static int 109 | ss5_validate_hk_req( struct ss5_hk_req * buf 110 | );*/ 111 | 112 | #endif 113 | -------------------------------------------------------------------------------- /include/SS5Thread.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5THREAD_H 20 | #define SS5THREAD_H 1 21 | 22 | UINT 23 | S5MainThread( int server_socket 24 | ); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /include/SS5Utils.h: -------------------------------------------------------------------------------- 1 | /* Socks Server 5 2 | * Copyright (C) 2003 by Matteo Ricchetti - 3 | 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef SS5UTILS_H 20 | #define SS5UTILS_H 1 21 | 22 | #define REPCHUNK 4096 23 | 24 | 25 | UINT 26 | S5LoadConfig( UINT m 27 | ); 28 | 29 | UINT 30 | S5ReceiveConfig( struct _SS5ClientInfo *ci, 31 | struct _SS5Socks5Data *sd 32 | ); 33 | 34 | UINT 35 | S5PropagateConfig( void 36 | ); 37 | 38 | UINT 39 | S5LoadPeers( void 40 | ); 41 | 42 | UINT 43 | S5AllocConfData( void ); 44 | 45 | UINT 46 | S5LoadConfData( UINT m 47 | ); 48 | 49 | UINT 50 | S5SwitchConfData( void 51 | ); 52 | 53 | UINT 54 | S5FreeConfData( void 55 | ); 56 | 57 | UINT 58 | S5GetIf( void 59 | ); 60 | 61 | UINT 62 | S5OrderIP( struct _S5HostList *s5hostlist, 63 | UINT *s5resolvedhosts 64 | ); 65 | 66 | UINT 67 | S5CheckPort( char *port, 68 | UINT s5port 69 | ); 70 | 71 | UINT 72 | S5GetNetmask( char *sa 73 | ); 74 | 75 | void 76 | S5ReloadConfig( int sig 77 | ); 78 | 79 | void 80 | S5Usage( void 81 | ); 82 | 83 | /*int 84 | S5IfMatch( char ip[16] 85 | );*/ 86 | 87 | ULINT 88 | S5StrHash( char *s 89 | ); 90 | 91 | ULINT 92 | S5GetRange( char *dp 93 | ); 94 | 95 | void S5Memcpy( char *dst, 96 | char *src, 97 | ULINT dsti, 98 | ULINT srci 99 | ); 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /include/SockAddr: -------------------------------------------------------------------------------- 1 | if( uci->Stream == BEGIN_STREAM ) { 2 | if ((uci->Socket = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { 3 | if( bind(uci->Socket,(struct sockaddr *)&serverbind_ssin,sizeof(struct sockaddr_in)) ) { 4 | getsockname(uci->Socket,(struct sockaddr *)&serverbind_ssin,&len); 5 | FD_SET(uci->Socket,&fdset); 6 | if( (fd=select(ci->Socket+uci->Socket+1,&fdset,NULL,NULL,&tv)) ) { 7 | if( FD_ISSET(uci->Socket,&fdset) ) { 8 | sd->UdpRBytesReceived=recvfrom(uci->Socket,gssHeader,sizeof(gssHeader),MSG_PEEK,(struct sockaddr *)&clientBindSsin,(socklen_t *)&len); 9 | sd->UdpRBytesReceived=recvfrom(uci->Socket,sd->UdpRequest,sizeof(sd->UdpRequest),0,(struct sockaddr *)&clientBindSsin,(socklen_t *)&len); 10 | if( (sd->UdpRBytesReceived=recvfrom(uci->Socket,sd->UdpRequest,sizeof(sd->UdpRequest),0,(struct sockaddr *)&clientBindSsin, 11 | uci->Stream = END_STREAM; 12 | strncpy(uci->SrcAddr,addr,sizeof(uci->SrcAddr)); 13 | uci->SrcPort=ntohs(clientBindSsin.sin_port); 14 | if( uci->Stream == BEGIN_STREAM ) { 15 | uci->Stream=CONTINUE_STREAM; 16 | clientBindSsin.sin_port = htons(uci->SrcPort); 17 | clientBindSsin.sin_addr.s_addr = inet_addr(uci->SrcAddr); 18 | if( (sd->UdpRBytesSent=sendto(uci->Socket,sd->UdpRequest,datalen,0,(struct sockaddr *)&clientBindSsin,(socklen_t)len)) == -1 ) { 19 | if( STREQ(uci->SrcAddr,ri->DstAddr,sizeof(uci->SrcAddr) - 1) && (uci->SrcPort == ri->DstPort) ) 20 | else if ( STREQ(ri->DstAddr,"0.0.0.0",sizeof("0.0.0.0") - 1) && (uci->SrcPort == ri->DstPort) ) 21 | -------------------------------------------------------------------------------- /include/config.h: -------------------------------------------------------------------------------- 1 | /* include/config.h. Generated from config.h.in by configure. */ 2 | /* config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define to 1 if you have the header file. */ 5 | #define HAVE_ARPA_INET_H 1 6 | 7 | /* Define to 1 if you have the `bzero' function. */ 8 | #define HAVE_BZERO 1 9 | 10 | /* Define to 1 if you have the header file. */ 11 | #define HAVE_FCNTL_H 1 12 | 13 | /* Define to 1 if you have the `fork' function. */ 14 | #define HAVE_FORK 1 15 | 16 | /* Define to 1 if you have the `gethostbyname' function. */ 17 | #define HAVE_GETHOSTBYNAME 1 18 | 19 | /* Define to 1 if you have the `gettimeofday' function. */ 20 | #define HAVE_GETTIMEOFDAY 1 21 | 22 | /* Define to 1 if you have the `inet_ntoa' function. */ 23 | #define HAVE_INET_NTOA 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | #define HAVE_INTTYPES_H 1 27 | 28 | /* Define to 1 if you have the `dl' library (-ldl). */ 29 | #define HAVE_LIBDL 1 30 | 31 | /* Define to 1 if you have the `ldap' library (-lldap). */ 32 | #define HAVE_LIBLDAP 1 33 | 34 | /* Define to 1 if you have the `pam' library (-lpam). */ 35 | #define HAVE_LIBPAM 1 36 | 37 | /* Define to 1 if you have the `pam_misc' library (-lpam_misc). */ 38 | #define HAVE_LIBPAM_MISC 1 39 | 40 | /* Define to 1 if you have the `pthread' library (-lpthread). */ 41 | #define HAVE_LIBPTHREAD 1 42 | 43 | /* Define to 1 if you have the header file. */ 44 | #define HAVE_MEMORY_H 1 45 | 46 | /* Define to 1 if you have the `memset' function. */ 47 | #define HAVE_MEMSET 1 48 | 49 | /* Define to 1 if you have the header file. */ 50 | #define HAVE_NETDB_H 1 51 | 52 | /* Define to 1 if you have the header file. */ 53 | #define HAVE_NETINET_IN_H 1 54 | 55 | /* Define to 1 if your system has a GNU libc compatible `realloc' function, 56 | and to 0 otherwise. */ 57 | #define HAVE_REALLOC 1 58 | 59 | /* Define to 1 if you have the `select' function. */ 60 | #define HAVE_SELECT 1 61 | 62 | /* Define to 1 if you have the `socket' function. */ 63 | #define HAVE_SOCKET 1 64 | 65 | /* Define to 1 if you have the header file. */ 66 | #define HAVE_STDINT_H 1 67 | 68 | /* Define to 1 if you have the header file. */ 69 | #define HAVE_STDLIB_H 1 70 | 71 | /* Define to 1 if you have the `strdup' function. */ 72 | #define HAVE_STRDUP 1 73 | 74 | /* Define to 1 if you have the `strftime' function. */ 75 | #define HAVE_STRFTIME 1 76 | 77 | /* Define to 1 if you have the header file. */ 78 | #define HAVE_STRINGS_H 1 79 | 80 | /* Define to 1 if you have the header file. */ 81 | #define HAVE_STRING_H 1 82 | 83 | /* Define to 1 if you have the `strtol' function. */ 84 | #define HAVE_STRTOL 1 85 | 86 | /* Define to 1 if you have the header file. */ 87 | #define HAVE_SYSLOG_H 1 88 | 89 | /* Define to 1 if you have the header file. */ 90 | #define HAVE_SYS_IOCTL_H 1 91 | 92 | /* Define to 1 if you have the header file. */ 93 | #define HAVE_SYS_SELECT_H 1 94 | 95 | /* Define to 1 if you have the header file. */ 96 | #define HAVE_SYS_SOCKET_H 1 97 | 98 | /* Define to 1 if you have the header file. */ 99 | #define HAVE_SYS_STAT_H 1 100 | 101 | /* Define to 1 if you have the header file. */ 102 | #define HAVE_SYS_TIME_H 1 103 | 104 | /* Define to 1 if you have the header file. */ 105 | #define HAVE_SYS_TYPES_H 1 106 | 107 | /* Define to 1 if you have that is POSIX.1 compatible. */ 108 | #define HAVE_SYS_WAIT_H 1 109 | 110 | /* Define to 1 if you have the header file. */ 111 | #define HAVE_UNISTD_H 1 112 | 113 | /* Define to 1 if you have the `vfork' function. */ 114 | #define HAVE_VFORK 1 115 | 116 | /* Define to 1 if you have the header file. */ 117 | /* #undef HAVE_VFORK_H */ 118 | 119 | /* Define to 1 if `fork' works. */ 120 | #define HAVE_WORKING_FORK 1 121 | 122 | /* Define to 1 if `vfork' works. */ 123 | #define HAVE_WORKING_VFORK 1 124 | 125 | /* Define to the address where bug reports for this package should be sent. */ 126 | #define PACKAGE_BUGREPORT "BUG-REPORT-ADDRESS" 127 | 128 | /* Define to the full name of this package. */ 129 | #define PACKAGE_NAME "FULL-PACKAGE-NAME" 130 | 131 | /* Define to the full name and version of this package. */ 132 | #define PACKAGE_STRING "FULL-PACKAGE-NAME VERSION" 133 | 134 | /* Define to the one symbol short name of this package. */ 135 | #define PACKAGE_TARNAME "full-package-name" 136 | 137 | /* Define to the version of this package. */ 138 | #define PACKAGE_VERSION "VERSION" 139 | 140 | /* Define to the type of arg 1 for `select'. */ 141 | #define SELECT_TYPE_ARG1 int 142 | 143 | /* Define to the type of args 2, 3 and 4 for `select'. */ 144 | #define SELECT_TYPE_ARG234 (fd_set *) 145 | 146 | /* Define to the type of arg 5 for `select'. */ 147 | #define SELECT_TYPE_ARG5 (struct timeval *) 148 | 149 | /* Define to 1 if you have the ANSI C header files. */ 150 | #define STDC_HEADERS 1 151 | 152 | /* Define to 1 if you can safely include both and . */ 153 | #define TIME_WITH_SYS_TIME 1 154 | 155 | /* Define to empty if `const' does not conform to ANSI C. */ 156 | /* #undef const */ 157 | 158 | /* Define default value of pathname for configuration file */ 159 | #ifdef FREEBSD 160 | #define SS5_CONFIG_FILE "/usr/local/etc/opt/ss5/ss5.conf" 161 | #else 162 | #define SS5_CONFIG_FILE "/etc/opt/ss5/ss5.conf" 163 | #endif 164 | 165 | /* Define default value of pathname for HA file */ 166 | #ifdef FREEBSD 167 | #define SS5_PEERS_FILE "/usr/local/etc/opt/ss5/ss5.ha" 168 | #else 169 | #define SS5_PEERS_FILE "/etc/opt/ss5/ss5.ha" 170 | #endif 171 | 172 | /* Define default value of pathname for password file */ 173 | #ifdef FREEBSD 174 | #define SS5_PASSWORD_FILE "/usr/local/etc/opt/ss5/ss5.passwd" 175 | #else 176 | #define SS5_PASSWORD_FILE "/etc/opt/ss5/ss5.passwd" 177 | #endif 178 | 179 | /* Define default value of pathname for log file */ 180 | #define SS5_LOG_FILE "/var/log/ss5/ss5.log" 181 | 182 | /* Define default value of pathname for pid file */ 183 | #define SS5_PID_FILE "/var/run/ss5/ss5.pid" 184 | 185 | /* Define default value of path for profile files */ 186 | #ifdef FREEBSD 187 | #define SS5_PROFILE_PATH "/usr/local/etc/opt/ss5" 188 | #else 189 | #define SS5_PROFILE_PATH "/etc/opt/ss5" 190 | #endif 191 | 192 | /* Define default value of path for trace files */ 193 | #define SS5_TRACE_PATH "/var/log/ss5" 194 | 195 | /* Define default value of path modules */ 196 | #ifdef FREEBSD 197 | #define SS5_LIB_PATH "/usr/local/lib" 198 | #else 199 | #define SS5_LIB_PATH "/usr/lib" 200 | #endif 201 | 202 | /* Define default value of bind addr */ 203 | #define SS5_DEFAULT_ADDR "0.0.0.0" 204 | 205 | /* Define default value of bind port */ 206 | #define SS5_DEFAULT_PORT "1080" 207 | 208 | /* Define default value of user process */ 209 | #define SS5_DEFAULT_USER "nobody" 210 | 211 | /* Define to `__inline__' or `__inline' if that's what the C compiler 212 | calls it, or to nothing if 'inline' is not supported under any name. */ 213 | #ifndef __cplusplus 214 | /* #undef inline */ 215 | #endif 216 | 217 | /* Define to `int' if does not define. */ 218 | /* #undef pid_t */ 219 | 220 | /* Define to rpl_realloc if the replacement function should be used. */ 221 | /* #undef realloc */ 222 | 223 | /* Define as `fork' if `vfork' does not work. */ 224 | /* #undef vfork */ 225 | -------------------------------------------------------------------------------- /include/config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_ARPA_INET_H 5 | 6 | /* Define to 1 if you have the `bzero' function. */ 7 | #undef HAVE_BZERO 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_FCNTL_H 11 | 12 | /* Define to 1 if you have the `fork' function. */ 13 | #undef HAVE_FORK 14 | 15 | /* Define to 1 if you have the `gethostbyname' function. */ 16 | #undef HAVE_GETHOSTBYNAME 17 | 18 | /* Define to 1 if you have the `gettimeofday' function. */ 19 | #undef HAVE_GETTIMEOFDAY 20 | 21 | /* Define to 1 if you have the `inet_ntoa' function. */ 22 | #undef HAVE_INET_NTOA 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_INTTYPES_H 26 | 27 | /* Define to 1 if you have the `dl' library (-ldl). */ 28 | #undef HAVE_LIBDL 29 | 30 | /* Define to 1 if you have the `ldap' library (-lldap). */ 31 | #undef HAVE_LIBLDAP 32 | 33 | /* Define to 1 if you have the `pam' library (-lpam). */ 34 | #undef HAVE_LIBPAM 35 | 36 | /* Define to 1 if you have the `pam_misc' library (-lpam_misc). */ 37 | #undef HAVE_LIBPAM_MISC 38 | 39 | /* Define to 1 if you have the `pthread' library (-lpthread). */ 40 | #undef HAVE_LIBPTHREAD 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #undef HAVE_MEMORY_H 44 | 45 | /* Define to 1 if you have the `memset' function. */ 46 | #undef HAVE_MEMSET 47 | 48 | /* Define to 1 if you have the header file. */ 49 | #undef HAVE_NETDB_H 50 | 51 | /* Define to 1 if you have the header file. */ 52 | #undef HAVE_NETINET_IN_H 53 | 54 | /* Define to 1 if your system has a GNU libc compatible `realloc' function, 55 | and to 0 otherwise. */ 56 | #undef HAVE_REALLOC 57 | 58 | /* Define to 1 if you have the `select' function. */ 59 | #undef HAVE_SELECT 60 | 61 | /* Define to 1 if you have the `socket' function. */ 62 | #undef HAVE_SOCKET 63 | 64 | /* Define to 1 if you have the header file. */ 65 | #undef HAVE_STDINT_H 66 | 67 | /* Define to 1 if you have the header file. */ 68 | #undef HAVE_STDLIB_H 69 | 70 | /* Define to 1 if you have the `strdup' function. */ 71 | #undef HAVE_STRDUP 72 | 73 | /* Define to 1 if you have the `strftime' function. */ 74 | #undef HAVE_STRFTIME 75 | 76 | /* Define to 1 if you have the header file. */ 77 | #undef HAVE_STRINGS_H 78 | 79 | /* Define to 1 if you have the header file. */ 80 | #undef HAVE_STRING_H 81 | 82 | /* Define to 1 if you have the `strtol' function. */ 83 | #undef HAVE_STRTOL 84 | 85 | /* Define to 1 if you have the header file. */ 86 | #undef HAVE_SYSLOG_H 87 | 88 | /* Define to 1 if you have the header file. */ 89 | #undef HAVE_SYS_IOCTL_H 90 | 91 | /* Define to 1 if you have the header file. */ 92 | #undef HAVE_SYS_SELECT_H 93 | 94 | /* Define to 1 if you have the header file. */ 95 | #undef HAVE_SYS_SOCKET_H 96 | 97 | /* Define to 1 if you have the header file. */ 98 | #undef HAVE_SYS_STAT_H 99 | 100 | /* Define to 1 if you have the header file. */ 101 | #undef HAVE_SYS_TIME_H 102 | 103 | /* Define to 1 if you have the header file. */ 104 | #undef HAVE_SYS_TYPES_H 105 | 106 | /* Define to 1 if you have that is POSIX.1 compatible. */ 107 | #undef HAVE_SYS_WAIT_H 108 | 109 | /* Define to 1 if you have the header file. */ 110 | #undef HAVE_UNISTD_H 111 | 112 | /* Define to 1 if you have the `vfork' function. */ 113 | #undef HAVE_VFORK 114 | 115 | /* Define to 1 if you have the header file. */ 116 | #undef HAVE_VFORK_H 117 | 118 | /* Define to 1 if `fork' works. */ 119 | #undef HAVE_WORKING_FORK 120 | 121 | /* Define to 1 if `vfork' works. */ 122 | #undef HAVE_WORKING_VFORK 123 | 124 | /* Define to the address where bug reports for this package should be sent. */ 125 | #undef PACKAGE_BUGREPORT 126 | 127 | /* Define to the full name of this package. */ 128 | #undef PACKAGE_NAME 129 | 130 | /* Define to the full name and version of this package. */ 131 | #undef PACKAGE_STRING 132 | 133 | /* Define to the one symbol short name of this package. */ 134 | #undef PACKAGE_TARNAME 135 | 136 | /* Define to the version of this package. */ 137 | #undef PACKAGE_VERSION 138 | 139 | /* Define to the type of arg 1 for `select'. */ 140 | #undef SELECT_TYPE_ARG1 141 | 142 | /* Define to the type of args 2, 3 and 4 for `select'. */ 143 | #undef SELECT_TYPE_ARG234 144 | 145 | /* Define to the type of arg 5 for `select'. */ 146 | #undef SELECT_TYPE_ARG5 147 | 148 | /* Define to 1 if you have the ANSI C header files. */ 149 | #undef STDC_HEADERS 150 | 151 | /* Define to 1 if you can safely include both and . */ 152 | #undef TIME_WITH_SYS_TIME 153 | 154 | /* Define to empty if `const' does not conform to ANSI C. */ 155 | #undef const 156 | 157 | /* Define default value of pathname for configuration file */ 158 | #ifdef FREEBSD 159 | #define SS5_CONFIG_FILE "/usr/local/etc/opt/ss5/ss5.conf" 160 | #else 161 | #define SS5_CONFIG_FILE "/etc/opt/ss5/ss5.conf" 162 | #endif 163 | 164 | /* Define default value of pathname for HA file */ 165 | #ifdef FREEBSD 166 | #define SS5_PEERS_FILE "/usr/local/etc/opt/ss5/ss5.ha" 167 | #else 168 | #define SS5_PEERS_FILE "/etc/opt/ss5/ss5.ha" 169 | #endif 170 | 171 | /* Define default value of pathname for password file */ 172 | #ifdef FREEBSD 173 | #define SS5_PASSWORD_FILE "/usr/local/etc/opt/ss5/ss5.passwd" 174 | #else 175 | #define SS5_PASSWORD_FILE "/etc/opt/ss5/ss5.passwd" 176 | #endif 177 | 178 | /* Define default value of pathname for log file */ 179 | #define SS5_LOG_FILE "/var/log/ss5/ss5.log" 180 | 181 | /* Define default value of pathname for pid file */ 182 | #define SS5_PID_FILE "/var/run/ss5/ss5.pid" 183 | 184 | /* Define default value of path for profile files */ 185 | #ifdef FREEBSD 186 | #define SS5_PROFILE_PATH "/usr/local/etc/opt/ss5" 187 | #else 188 | #define SS5_PROFILE_PATH "/etc/opt/ss5" 189 | #endif 190 | 191 | /* Define default value of path for trace files */ 192 | #define SS5_TRACE_PATH "/var/log/ss5" 193 | 194 | /* Define default value of path modules */ 195 | #ifdef FREEBSD 196 | #define SS5_LIB_PATH "/usr/local/lib" 197 | #else 198 | #define SS5_LIB_PATH "/usr/lib" 199 | #endif 200 | 201 | /* Define default value of bind addr */ 202 | #define SS5_DEFAULT_ADDR "0.0.0.0" 203 | 204 | /* Define default value of bind port */ 205 | #define SS5_DEFAULT_PORT "1080" 206 | 207 | /* Define default value of user process */ 208 | #define SS5_DEFAULT_USER "nobody" 209 | 210 | /* Define to `__inline__' or `__inline' if that's what the C compiler 211 | calls it, or to nothing if 'inline' is not supported under any name. */ 212 | #ifndef __cplusplus 213 | #undef inline 214 | #endif 215 | 216 | /* Define to `int' if does not define. */ 217 | #undef pid_t 218 | 219 | /* Define to rpl_realloc if the replacement function should be used. */ 220 | #undef realloc 221 | 222 | /* Define as `fork' if `vfork' does not work. */ 223 | #undef vfork 224 | -------------------------------------------------------------------------------- /man/FreeBSD/ss5.1.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/FreeBSD/ss5.1.gz -------------------------------------------------------------------------------- /man/FreeBSD/ss5.conf.5.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/FreeBSD/ss5.conf.5.gz -------------------------------------------------------------------------------- /man/FreeBSD/ss5.ha.5.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/FreeBSD/ss5.ha.5.gz -------------------------------------------------------------------------------- /man/FreeBSD/ss5.pam.5.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/FreeBSD/ss5.pam.5.gz -------------------------------------------------------------------------------- /man/FreeBSD/ss5.passwd.5.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/FreeBSD/ss5.passwd.5.gz -------------------------------------------------------------------------------- /man/FreeBSD/ss5_gss.5.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/FreeBSD/ss5_gss.5.gz -------------------------------------------------------------------------------- /man/FreeBSD/ss5_supa.5.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/FreeBSD/ss5_supa.5.gz -------------------------------------------------------------------------------- /man/FreeBSD/ss5srv.1.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/FreeBSD/ss5srv.1.gz -------------------------------------------------------------------------------- /man/Linux/ss5.1.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5.1.bz2 -------------------------------------------------------------------------------- /man/Linux/ss5.1.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5.1.gz -------------------------------------------------------------------------------- /man/Linux/ss5.conf.5.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5.conf.5.bz2 -------------------------------------------------------------------------------- /man/Linux/ss5.conf.5.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5.conf.5.gz -------------------------------------------------------------------------------- /man/Linux/ss5.ha.5.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5.ha.5.bz2 -------------------------------------------------------------------------------- /man/Linux/ss5.ha.5.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5.ha.5.gz -------------------------------------------------------------------------------- /man/Linux/ss5.pam.5.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5.pam.5.bz2 -------------------------------------------------------------------------------- /man/Linux/ss5.pam.5.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5.pam.5.gz -------------------------------------------------------------------------------- /man/Linux/ss5.passwd.5.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5.passwd.5.bz2 -------------------------------------------------------------------------------- /man/Linux/ss5.passwd.5.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5.passwd.5.gz -------------------------------------------------------------------------------- /man/Linux/ss5_gss.5.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5_gss.5.bz2 -------------------------------------------------------------------------------- /man/Linux/ss5_gss.5.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5_gss.5.gz -------------------------------------------------------------------------------- /man/Linux/ss5_supa.5.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5_supa.5.bz2 -------------------------------------------------------------------------------- /man/Linux/ss5_supa.5.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5_supa.5.gz -------------------------------------------------------------------------------- /man/Linux/ss5srv.1.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5srv.1.bz2 -------------------------------------------------------------------------------- /man/Linux/ss5srv.1.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/postageapp/ss5/b1b95d817cd7caea4680e72092056ef1f1cc59c8/man/Linux/ss5srv.1.gz -------------------------------------------------------------------------------- /man/SunOS/ss5.1: -------------------------------------------------------------------------------- 1 | .TH ss5 1 "20 Jan 2009" 2 | .SH NAME 3 | .HP 9 4 | ss5 \- A daemon that implements the SOCKS v4 and v5 protocol to execute proxy requests for a client 5 | .SH SYNOPSIS 6 | ss5 \fI[options]\fP 7 | .SH DESCRIPTION 8 | ss5 is a socks server that implements the SOCKS v4 and v5 protocol. As a proxy server, ss5 authenticates, profiles and processes network requests for clients. It establishes connections to application hosts for client applications. When the client attempts to access the network, the client connects to the ss5 daemon instead of the application host. 9 | .PP 10 | Following authentication, clients request that ss5 perform network activities for the client. The activities might include: 11 | .RS 3 12 | .PP 13 | CONNECT 14 | 15 | BIND 16 | 17 | UDP ASSOCIATE 18 | .RE 19 | .PP 20 | The ss5 protocol is independent of application protocols, and can assist with different networking services, including telnet, ftp, finger, whois, gopher, and WWW access. 21 | .PP 22 | .RE 23 | The ss5 daemon supports one authentication method: 24 | .RS 3 25 | .HP 21 26 | Username/Password - Refer to ss5.passwd(5) or ss5.pam(5) for additional information. 27 | .HP 13 28 | .PP 29 | The ss5 daemon supports two profiling methods: 30 | .RS 3 31 | .HP 21 32 | File - Refer to ss5.conf(5) for additional information. 33 | 34 | Ldap - Refer to ss5.conf(5) for additional information. 35 | .HP 13 36 | .RE 37 | .PP 38 | ss5 can run: 39 | .RS 3 40 | .PP 41 | standalone - the default 42 | .TP 43 | prefork processes - include the -n option (not supported in threaded mode) 44 | .HP 14 45 | threaded - if your operating system supports POSIX threads. Include the -t option to run ss5 in threaded mode. 46 | .SH OPTIONS 47 | Separate multiple options with white space. 48 | .TP 49 | -b [\fIhost:port\fP]| 50 | \fIhost:port\fP specifies the host and the port number on that host on which ss5 runs, instead of the default port. When you omit \fIhost\fP, ss5 uses 0.0.0.0 as the \fIhost\fP value. 51 | .TP 52 | .TP 53 | .TP 54 | -n \fIval\fP 55 | Run multiple instances of ss5. -n option control the number of instances. 56 | .TP 57 | .TP 58 | -t 59 | Run ss5 in threaded mode, if your operating system supports POSIX threads. 60 | .TP 61 | -u \fIval\fP 62 | Run ss5 with the specified user name. 63 | .TP 64 | -v 65 | Print a message containing the current ss5 version. 66 | .TP 67 | -s 68 | Use syslog instead of ss5.log log file. 69 | .TP 70 | -c 71 | Run syntax check for config file 72 | .TP 73 | -m 74 | Disable logging 75 | .SH VARIABLES 76 | To set the variables in the configuration file, use the syntax: 77 | .RE 78 | .PP 79 | .RS 5 80 | set \fIvariable [value]\fP 81 | .RE 82 | .TP 83 | SS5_DNSORDER 84 | order domain name answers for implementing failover. 85 | .TP 86 | SS5_STIMEOUT \fIval\fP 87 | \fIval\fP specifies the idle time in seconds, before closing a connection (0 for infinite). 88 | .TP 89 | SS5_VERBOSE 90 | enable verbose output to logfile. 91 | .TP 92 | SS5_CONSOLE 93 | enable web console. 94 | .TP 95 | SS5_SRV 96 | enable server manager command line tool. 97 | .TP 98 | SS5_DEBUG 99 | enable debug output to logfile. 100 | .TP 101 | SS5_SYSLOG_FACILITY 102 | set syslog facility 103 | .TP 104 | SS5_SYSLOG_LEVEL 105 | set syslog level 106 | .TP 107 | SS5_PAM_AUTH 108 | enable PAM authentication 109 | .TP 110 | SS5_AUTHCACHEAGE 111 | enable user authentication caching and set cache age 112 | .TP 113 | SS5_AUTHOCACHEAGE 114 | enable user authorization caching and set cache age 115 | .TP 116 | SS5_LDAP_TIMEOUT 117 | set timeout for ldap query for profiling 118 | .TP 119 | SS5_LDAP_BASE 120 | set BASE method for profiling (see PROFILING section in configuration file) 121 | .TP 122 | SS5_LDAP_FILTER 123 | set FILTER method for profiling (see PROFILING section in configuration file) 124 | .TP 125 | set SS5_RADIUS_AUTH 126 | enable RADIUS authentication 127 | .TP 128 | SS5_RADIUS_INTERIM_INT 129 | set interval beetwen interim update packet 130 | .TP 131 | SS5_RADIUS_INTERIM_TIMEOUT 132 | set interim response timeout 133 | .TP 134 | SS5_STICKY_SESSION 135 | set session feature for balanced connections. SS5 mantain affinity session between 136 | source client and destination server 137 | .TP 138 | SS5_STICKYAGE 139 | set expiration time for session affinity (in seconds) 140 | .TP 141 | SS5_NETBIOS_DOMAIN 142 | enable netbios domain mapping with directory store, during authorization process 143 | .TP 144 | SS5_PROCESSLIFE 145 | set number of requests ss5 process can serv before closing (only preforked mode) 146 | .TP 147 | SS5_SUPAKEY 148 | set SUPA secret key (default SS5_SERVER_S_KEY). See http://csocks.altervista.org 149 | .TP 150 | SS5_ICACHESERVER 151 | set internet address of ICP server 152 | .TP 153 | SS5_GSS_PRINC 154 | set gss service principal 155 | .RS 5 156 | .SH ENVIRONMENT 157 | .TP 158 | SS5_SOCKS_USER 159 | sets the effective user ID of the ss5 process 160 | .TP 161 | SS5_SOCKS_PORT 162 | sets listen port 163 | .TP 164 | SS5_SOCKS_ADDR 165 | sets listen address 166 | .TP 167 | SS5_CONFIG_FILE 168 | sets absolute pathname of ss5 config file 169 | .TP 170 | SS5_PASSWORD_FILE 171 | sets absolute pathname of ss5 password file 172 | .TP 173 | SS5_PROPAGATE_KEY 174 | sets key value for configuration replica 175 | .TP 176 | SS5_ROLE_SLAVE 177 | sets role to slave to accept replica from master (default value is ALONE) 178 | .TP 179 | SS5_LOG_FILE 180 | sets absolute pathname of ss5 log file 181 | .TP 182 | SS5_PROFILE_PATH 183 | sets absolute path of ss5 profile files 184 | .TP 185 | SS5_LIB_PATH 186 | sets absolute path of ss5 modules 187 | .PP 188 | .SH REQUEST FOR COMMENTS 189 | .TP 190 | RFC1928 191 | SOCKS protocol Version 5 192 | .TP 193 | RFC1929 194 | Username/Password Authentication for SOCKS V5 195 | .TP 196 | .PP 197 | .SH SEE ALSO 198 | ss5(1), ss5.conf(5), ss5.pam(5), ss5.passwd(5), ss5.ha(5), ss5srv(1), ss5_supa(5), ss5_gssapi(5) 199 | .PP 200 | .SH AUTHOR 201 | Matteo Ricchetti 202 | .TP 203 | .br 204 | Send comments to matteo.ricchetti@libero.it 205 | -------------------------------------------------------------------------------- /man/SunOS/ss5.ha.5: -------------------------------------------------------------------------------- 1 | .TH ss5.ha 5 "13 Mar 2006" 2 | .SH NAME 3 | .HP 16 4 | ss5.ha \- Contains directives for centralized configuration management 5 | .SH SYNOPSIS 6 | ss5 usually reads the HA file, ss5.ha, in the /etc/opt/ss5 directory. 7 | .PP 8 | .SH DESCRIPTION 9 | To enable centralized configuration management, ss5 opens and reads peers list from ss5.ha file and propagate local configuration to them after load/reload command is received, using a propagate key as security mechanism. HA file contains also directives that must not be propagated to peers, such as . 10 | .PP 11 | In the HA file, add one line for each peer. Each line should contain directive with the internet address of peer. 12 | 13 | .PP 14 | Adding centralized configuration management feature to ss5 requires 3 steps: 15 | .RS 5 16 | .HP 3 17 | 1. Create the HA file with one entry per line. To create an entry for the peer 172.16.0.1, add this line to the ss5.ha file: 18 | .RS 8 19 | .PP 20 | peer 172.16.0.1 21 | .RE 22 | .HP 3 23 | 2. Set the environment variable SS5_PROPAGATE_KEY on master and peers with a key value before launch ss5 binary. The startup file may contain two lines such as: 24 | .RS 8 25 | .PP 26 | SS5_PROPAGATE_KEY=123456789 27 | .PP 28 | export SS5_PROPAGATE_KEY 29 | .RE 30 | .PP 31 | 3. Set the environment variable SS5_ROLE_SLAVE=YES on peers to enable slave role and accept replica from master. 32 | .PP 33 | .SH ROUTING ENTRIES 34 | Route entries describe the addresses ss5 must bind to before CONNECT, BIND and UPSTREAM operations. 35 | .RS 5 36 | .PP 37 | route \fIsource/destination-host bind-address group flag\fP 38 | .RE 39 | .PP 40 | .TP 15 41 | .B \fIsource\fP 42 | Could be host address or network address (source or destination if flag 's' o 'd') 43 | .TP 44 | .B \fIbind-address\fP 45 | Must be host address 46 | .PP 47 | .TP 48 | .B \fIgroup\fP 49 | Could be filename in the /etc/ss5 directory containing usernames, a DN into a directory server or - (None). Not available for UDP requests. 50 | .PP 51 | .TP 52 | .B \fIflag\fP 53 | Could be 's' or 'd'. If =s, route is evaluated as source; if =d, route is evaluated as destination. 54 | .PP 55 | .SH SEE ALSO 56 | ss5(1), ss5.conf(5), ss5.pam(5), ss5.passwd(5), ss5srv(1), ss5_supa(5), ss5_gssapi(5) 57 | .SH AUTHOR 58 | .RS 3 59 | Matteo Ricchetti 60 | .br 61 | .RE 62 | .PP 63 | Send comments to matteo.ricchetti@libero.it 64 | -------------------------------------------------------------------------------- /man/SunOS/ss5.pam.5: -------------------------------------------------------------------------------- 1 | .TH ss5.pam 5 "14 Aug 2003" 2 | .SH NAME 3 | .HP 16 4 | ss5.pam \- Contains configuration lines for PAM authentication. 5 | .SH SYNOPSIS 6 | ss5 usually reads the password file, ss5.passwd, in the /etc/ss5 directory. If SS5_PAM_AUTH option is set, ss5 call PAM api to perform Username/Password. 7 | .PP 8 | .SH DESCRIPTION 9 | To enable PAM authentication with the ss5 daemon you must set SS5_PAM_AUTH options in the ss5.conf file. Before PAM authentication works, you have to create ss5 file in the /etc/pam.d directory and configure it (see /usr/share/doc/ss5/ss5.pam sample file). On Solaris, you have to edit /etc/pam.conf file. 10 | .PP 11 | Like for password file (see ss5.passwd), adding PAM authentication requires 3 steps: 12 | .RS 5 13 | .HP 3 14 | 1. Create the PAM configuration file with one entry per line. To create an entry for using /etc/passwd like source, add this line to the /etc/pam.d/ss5 file: 15 | .RS 8 16 | auth required /lib/security/pam_unix.so 17 | .RE 18 | .HP 3 19 | 2. Edit the auth line in the configuration file to require Username/Password authentication. The configuration file may contain auth lines such as: 20 | .RS 8 21 | auth - - - 22 | .RE 23 | .PP 24 | .RS 3 25 | To add username and password authentication, change the line to: 26 | .RS 5 27 | auth - - u 28 | .PP 29 | set SS5_PAM_AUTH 30 | .RE 31 | .RE 32 | .PP 33 | 3. Restart the server. 34 | .SH SEE ALSO 35 | ss5(1), ss5.conf(5), ss5.pam(5), ss5.passwd(5), ss5.ha(5), ss5srv(1), ss5_supa(5), ss5_gssapi(5) 36 | .SH AUTHOR 37 | .RS 3 38 | Matteo Ricchetti 39 | .br 40 | .RE 41 | .PP 42 | Send comments to matteo.ricchetti@libero.it 43 | -------------------------------------------------------------------------------- /man/SunOS/ss5.passwd.5: -------------------------------------------------------------------------------- 1 | .TH ss5.passwd 5 "14 Jul 2003" 2 | .SH NAME 3 | .HP 16 4 | ss5.passwd \- Contains usernames and passwords for user authentication. 5 | .SH SYNOPSIS 6 | ss5 usually reads the password file, ss5.passwd, in the /etc/opt/ss5 directory. 7 | .PP 8 | .SH DESCRIPTION 9 | To enable Username/Password authentication with the ss5 daemon you must create a password file, and modify the ss5 configuration file, ss5.conf. 10 | .PP 11 | In the password file, add one line for each user. Each line should contain the username and password for the user, separated by white space. 12 | 13 | In the ss5 configuration file, add an auth line to require authentication and allow the user access. For additional information about the ss5 configuration file, refer to the ss5.conf(5) man page. 14 | .PP 15 | Adding Username/Password authentication to ss5 requires 3 steps: 16 | .RS 5 17 | .HP 3 18 | 1. Create the password file with one entry per line. To create an entry for the user named matthew, whose password is secret, add this line to the ss5.passwd file: 19 | .RS 8 20 | matthew secret 21 | .RE 22 | .HP 3 23 | 2. Edit the auth line in the configuration file to require Username/Password authentication. The configuration file may contain auth lines such as: 24 | .RS 8 25 | auth - - - 26 | .RE 27 | .PP 28 | .RS 3 29 | To add username and password authentication, change the line to: 30 | .RS 5 31 | auth - - u 32 | .RE 33 | .RE 34 | .PP 35 | 3. Restart the server. 36 | .SH SEE ALSO 37 | ss5(1), ss5.conf(5), ss5.pam(5), ss5.passwd(5), ss5.ha(5), ss5srv(1), ss5_supa(5), ss5_gssapi(5) 38 | .SH AUTHOR 39 | .RS 3 40 | Matteo Ricchetti 41 | .br 42 | .RE 43 | .PP 44 | Send comments to matteo.ricchetti@libero.it 45 | -------------------------------------------------------------------------------- /man/SunOS/ss5_gss.5: -------------------------------------------------------------------------------- 1 | .TH ss5.gss 5 "22 Feb 2009" 2 | .SH NAME 3 | .HP 16 4 | ss5.gss \- Enable GSS Kerberos authentication, integrity and confidentiality (see RFC 1961) 5 | .SH SYNOPSIS 6 | ss5 usually communicates with socks client in clear-text. If method is set in directive, ss5 establishes a common security mechanism based on Kerberos mechanisms. 7 | .PP 8 | .SH DESCRIPTION 9 | To enable GSSAPI authentication with the ss5 daemon you must set SS5_GSS_PRINC option in the ss5.conf file indicating your Kerberos service principal name. Before GSSAPI authentication works, you must install libgssapi package. In base of socks client want to do, SS5 accepts 0 (auth only), 1 (integrity) or 2 (encryption) encapsulation values. 10 | .PP 11 | To add GSSAPI authentication, change the line to: 12 | .RS 5 13 | auth - - k 14 | .PP 15 | set SS5_GSS_PRINC option containing your Kerberos service principal name (i.e. rcmd@fqdn if service is equivalent to "rcmd") 16 | .RE 17 | .RE 18 | .PP 19 | 3. Restart the server. 20 | .SH SEE ALSO 21 | ss5(1), ss5.conf(5), ss5.pam(5), ss5.passwd(5), ss5.ha(5), ss5srv(1), ss5_supa(5), ss5_gss(5) 22 | .SH AUTHOR 23 | .RS 3 24 | Matteo Ricchetti 25 | .br 26 | .RE 27 | .PP 28 | Send comments to Matteo.Ricchetti@libero.it 29 | -------------------------------------------------------------------------------- /man/SunOS/ss5_supa.5: -------------------------------------------------------------------------------- 1 | .TH ss5.supa 5 "20 Jan 2009" 2 | .SH NAME 3 | .HP 16 4 | ss5.supa \- Enable Secret User Password Autehntication (see http://csocks.altervista.org/) 5 | .SH SYNOPSIS 6 | ss5 usually communicates with socks client in clear-text. If SS5_SUPA option is set, ss5 encrypts user credentials during the authentication step with socks client (see http://csocks.altervista.org/). 7 | .PP 8 | .SH DESCRIPTION 9 | To enable SUPA authentication with the ss5 daemon you must set SS5_SUPA options in the ss5.conf file indicating the secret key value (must be 16 bytes long). Before SUPA authentication works, you must install openssl package. 10 | .PP 11 | To add SUPA authentication, change the line to: 12 | .RS 5 13 | auth - - s 14 | .PP 15 | set SS5_SUPA SS5_SERVER_S_KEY (SS5_SERVER_S_KEY is the default value) 16 | .RE 17 | .RE 18 | .PP 19 | 3. Restart the server. 20 | .SH SEE ALSO 21 | ss5(1), ss5.conf(5), ss5.pam(5), ss5.passwd(5), ss5.ha(5), ss5srv(1), ss5_supa(5), ss5_gssapi(5) 22 | .SH AUTHOR 23 | .RS 3 24 | Raffaele De Lorenzo 25 | .br 26 | .RE 27 | .PP 28 | Send comments to raffaele.delorenzo@libero.it 29 | -------------------------------------------------------------------------------- /man/SunOS/ss5srv.1: -------------------------------------------------------------------------------- 1 | .TH ss5 1 "20 Jan 2008" 2 | .SH NAME 3 | .HP 9 4 | ss5srv \- A command line tool to manage ss5 socks server 5 | .SH SYNOPSIS 6 | ss5srv \fI[options]\fP 7 | .SH DESCRIPTION 8 | ss5srv connects to ss5 server and queries for socks statistics and socks directives. It can also change the ss5 online configuration adding new directives or modifying those existing. 9 | .SH OPTIONS 10 | Separate multiple options with white space. 11 | .TP 12 | .TP 13 | .TP 14 | write_config [\fIfilename\fP] 15 | Write configuration into file.conf and file.ha 16 | .TP 17 | show_connect 18 | Show connection statistics 19 | .TP 20 | .TP 21 | show_bind 22 | Show bind statistics 23 | .TP 24 | .TP 25 | show_udp 26 | Show udp statistics 27 | .TP 28 | list_option 29 | List