├── version ├── captures ├── .empty ├── 024114.png ├── 024138.png ├── 024203.png ├── 203007.png ├── 203047.png ├── 203056.png └── 203525.png ├── etc ├── ppp │ ├── pap-secrets │ ├── chap-secrets │ └── pppoe-server-options ├── config │ ├── pw │ └── pppoe └── init.d │ ├── pw │ └── pppoe-server ├── stage1 ├── 1000.bin ├── 1001.bin ├── 1050.bin ├── 1070.bin ├── 1071.bin ├── 1100.bin ├── 900.bin ├── 950.bin ├── 951.bin └── 960.bin ├── stage2 ├── 1000.bin ├── 1001.bin ├── 1050.bin ├── 1070.bin ├── 1071.bin ├── 1100.bin ├── 900.bin ├── 950.bin ├── 951.bin └── 960.bin ├── www ├── assets │ ├── img │ │ └── home1600_bg-nhasset.jpg │ ├── js │ │ ├── plugin.modal.js │ │ ├── underscore-min.js │ │ ├── main.js │ │ └── backbone-min.js │ └── css │ │ ├── custom.css │ │ └── base.css ├── pppwn.html └── cgi-bin │ └── pw.cgi ├── installer.sh └── README.md /version: -------------------------------------------------------------------------------- 1 | 185 -------------------------------------------------------------------------------- /captures/.empty: -------------------------------------------------------------------------------- 1 | nothing 2 | -------------------------------------------------------------------------------- /etc/ppp/pap-secrets: -------------------------------------------------------------------------------- 1 | # client server secret IP addresses 2 | ppp * ppp * 3 | -------------------------------------------------------------------------------- /stage1/1000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage1/1000.bin -------------------------------------------------------------------------------- /stage1/1001.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage1/1001.bin -------------------------------------------------------------------------------- /stage1/1050.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage1/1050.bin -------------------------------------------------------------------------------- /stage1/1070.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage1/1070.bin -------------------------------------------------------------------------------- /stage1/1071.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage1/1071.bin -------------------------------------------------------------------------------- /stage1/1100.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage1/1100.bin -------------------------------------------------------------------------------- /stage1/900.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage1/900.bin -------------------------------------------------------------------------------- /stage1/950.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage1/950.bin -------------------------------------------------------------------------------- /stage1/951.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage1/951.bin -------------------------------------------------------------------------------- /stage1/960.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage1/960.bin -------------------------------------------------------------------------------- /stage2/1000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage2/1000.bin -------------------------------------------------------------------------------- /stage2/1001.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage2/1001.bin -------------------------------------------------------------------------------- /stage2/1050.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage2/1050.bin -------------------------------------------------------------------------------- /stage2/1070.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage2/1070.bin -------------------------------------------------------------------------------- /stage2/1071.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage2/1071.bin -------------------------------------------------------------------------------- /stage2/1100.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage2/1100.bin -------------------------------------------------------------------------------- /stage2/900.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage2/900.bin -------------------------------------------------------------------------------- /stage2/950.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage2/950.bin -------------------------------------------------------------------------------- /stage2/951.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage2/951.bin -------------------------------------------------------------------------------- /stage2/960.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/stage2/960.bin -------------------------------------------------------------------------------- /etc/ppp/chap-secrets: -------------------------------------------------------------------------------- 1 | #USERNAME PROVIDER PASSWORD IPADDRESS 2 | ppp * ppp 192.168.2.11 3 | -------------------------------------------------------------------------------- /captures/024114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/captures/024114.png -------------------------------------------------------------------------------- /captures/024138.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/captures/024138.png -------------------------------------------------------------------------------- /captures/024203.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/captures/024203.png -------------------------------------------------------------------------------- /captures/203007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/captures/203007.png -------------------------------------------------------------------------------- /captures/203047.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/captures/203047.png -------------------------------------------------------------------------------- /captures/203056.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/captures/203056.png -------------------------------------------------------------------------------- /captures/203525.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/captures/203525.png -------------------------------------------------------------------------------- /www/assets/img/home1600_bg-nhasset.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/HEAD/www/assets/img/home1600_bg-nhasset.jpg -------------------------------------------------------------------------------- /etc/ppp/pppoe-server-options: -------------------------------------------------------------------------------- 1 | # PPP options for the PPPoE server 2 | # LIC: GPL 3 | require-chap 4 | login 5 | lcp-echo-interval 10 6 | lcp-echo-failure 2 7 | mru 1492 8 | mtu 1492 9 | ms-dns 8.8.8.8 -------------------------------------------------------------------------------- /etc/config/pw: -------------------------------------------------------------------------------- 1 | config params 2 | option root '/root' 3 | option path '/payloads' 4 | option interface 'br-lan' 5 | option version '1100' 6 | option timeout '0' 7 | option retry 'yes' 8 | option sleep 'no' 9 | option stage1 '/root/stage1/1100.bin' 10 | option stage2 '/root/stage2/1100.bin' -------------------------------------------------------------------------------- /etc/config/pppoe: -------------------------------------------------------------------------------- 1 | config pppoe_server 2 | option interface 'br-lan' 3 | option ac_name 'access-concentrator-name' 4 | option localip '192.168.2.1' 5 | option firstremoteip '192.168.2.2' 6 | option maxsessions '64' 7 | option optionsfile '/etc/ppp/pppoe-server-options' 8 | option randomsessions '1' 9 | option unit '0' 10 | option offset '0' 11 | option timeout '60' 12 | option mss '1468' 13 | option sync '0' 14 | option maxsessionsperpeer '1' -------------------------------------------------------------------------------- /etc/init.d/pw: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=99 4 | STOP=15 5 | 6 | start() { 7 | 8 | if ! pgrep pppwn > /dev/null; then 9 | 10 | interface=$(uci get pw.@params[0].interface) 11 | retry=$(uci get pw.@params[0].retry) 12 | sleep=$(uci get pw.@params[0].sleep) 13 | version=$(uci get pw.@params[0].version) 14 | stage1=$(uci get pw.@params[0].stage1) 15 | stage2=$(uci get pw.@params[0].stage2) 16 | timeout=$(uci get pw.@params[0].timeout) 17 | 18 | if [ "$sleep" = "yes" ]; then 19 | sleep="--real-sleep" 20 | elif [ "$sleep" = "no" ]; then 21 | sleep="" 22 | fi 23 | if [ "$retry" = "yes" ]; then 24 | retry="--auto-retry" 25 | elif [ "$retry" = "no" ]; then 26 | retry="" 27 | fi 28 | 29 | if pgrep pppoe-server > /dev/null; then 30 | /etc/init.d/pppoe-server stop 31 | sleep 3 32 | fi 33 | 34 | ip link set $interface down 35 | sleep 5 36 | ip link set $interface up 37 | 38 | result=$(pppwn --interface "$interface" --fw "$version" --stage1 "$stage1" --stage2 "$stage2" --timeout $timeout $sleep $retry) 39 | 40 | if [[ "$result" == *"\[\+\] Done\!"* ]]; then 41 | if ! pgrep pppoe-server > /dev/null; then 42 | /etc/init.d/pppoe-server start 43 | sleep 3 44 | fi 45 | exit 0 46 | else 47 | if ! pgrep pppoe-server > /dev/null; then 48 | /etc/init.d/pppoe-server start 49 | sleep 3 50 | fi 51 | exit 1 52 | fi 53 | 54 | fi 55 | 56 | } 57 | 58 | stop() { 59 | 60 | if ! pgrep pppoe-server > /dev/null; then 61 | /etc/init.d/pppoe-server start 62 | sleep 3 63 | fi 64 | 65 | interface=$(uci get pw.@params[0].interface) 66 | 67 | ip link set $interface down 68 | sleep 5 69 | ip link set $interface up 70 | 71 | pids=$(pgrep pppwn) 72 | 73 | for pid in $pids; do 74 | kill $pid 75 | done 76 | 77 | } 78 | 79 | update() { 80 | 81 | /tmp/updater.sh 82 | wait 83 | 84 | } -------------------------------------------------------------------------------- /www/assets/js/plugin.modal.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Name: Modal plugin 3 | * Project: Modular 4 | * version: 0.5 5 | * email: manyandamariano@hotmail.com 6 | */ 7 | 8 | (function($){ 9 | 10 | $.fn.modal = function(callback){ 11 | 12 | $.modal.selector = this; 13 | $.modal.open(callback); 14 | 15 | return this; 16 | } 17 | 18 | $.modal = function(callback){ 19 | 20 | $.modal.open(callback); 21 | return this; 22 | /* 23 | se debe arreglar esta opcion 24 | if(typeof options == 'object'){ 25 | 26 | var selector = $(options.selector); 27 | 28 | if(selector.length){ 29 | 30 | options = $.extend({ 31 | selector: selector, 32 | url: options.selector.val(), 33 | data: options.selector.data(), 34 | open: $.modal.open 35 | }, options); 36 | 37 | } 38 | 39 | this.options = options; 40 | 41 | } 42 | 43 | return this;*/ 44 | 45 | } 46 | 47 | $.modal.open = function(callback){ 48 | 49 | this._open = callback; 50 | 51 | if(!$(document.body).find('.modal-background').length){ 52 | 53 | this._background = $(document.createElement('div')).addClass('modal-background'); 54 | this._container = $(document.createElement('div')).addClass('modal-container'); 55 | this._content = $(document.createElement('div')).addClass('modal-content'); 56 | 57 | this._background.append(this._container.append(this._content)); 58 | 59 | callback(this); 60 | 61 | } 62 | 63 | if(typeof callback == 'function'){ 64 | 65 | if(this._background){ 66 | $(document.body).data('noscroll', 1) 67 | .append(this._background.css({opacity:0}) 68 | .animate({opacity:1}, 300)); 69 | } 70 | 71 | } 72 | 73 | return this; 74 | } 75 | 76 | $.modal.content = function(html_content){ 77 | 78 | if(this._content.length){ 79 | this._content.html(html_content); 80 | } 81 | 82 | } 83 | 84 | $.modal.loading = function(html_text){ 85 | 86 | if(this._content.length){ 87 | 88 | this._waiting = $(document.createElement('div')).addClass('modal-waiting') 89 | .html($(document.createElement('div')).addClass('modal-loading-icon')); 90 | this._content.append(this._waiting); 91 | 92 | } 93 | 94 | } 95 | 96 | $.modal.close = function(time = 150){ 97 | 98 | if($(document.body).data('noscroll')){ 99 | 100 | if(this._background.length){ 101 | 102 | this._background.animate({opacity:0}, time, function(){ 103 | $(this).remove(); 104 | }) 105 | 106 | } 107 | 108 | } 109 | 110 | } 111 | 112 | }(jQuery)); -------------------------------------------------------------------------------- /etc/init.d/pppoe-server: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2006-2011 OpenWrt.org 3 | 4 | START=50 5 | STOP=50 6 | USE_PROCD=1 7 | 8 | pppoe_triggers() { 9 | local cfg="$1" 10 | local enabled interface 11 | config_get_bool enabled "$cfg" enabled 1 12 | [ "$enabled" -gt 0 ] || return 0 13 | config_get interface "$cfg" interface 14 | procd_add_reload_interface_trigger $interface 15 | } 16 | 17 | pppoe_instance() { 18 | local cfg="$1" 19 | local enabled interface ac_name service_names service_name maxsessionsperpeer localip firstremoteip maxsessions optionsfiles randomsession unit offset timeout mss sync OPTIONS 20 | config_get_bool enabled "$cfg" enabled 1 21 | [ "$enabled" -gt 0 ] || return 0 22 | config_get interface "$cfg" interface 23 | config_get ac_name "$cfg" ac_name 24 | config_get service_names "$cfg" service_name 25 | config_get maxsessionsperpeer "$cfg" maxsessionsperpeer 26 | config_get localip "$cfg" localip 27 | config_get firstremoteip "$cfg" firstremoteip 28 | config_get maxsessions "$cfg" maxsessions 29 | config_get optionsfile "$cfg" optionsfile 30 | config_get_bool randomsession "$cfg" randomsession 1 31 | config_get_bool unit "$cfg" unit 0 32 | config_get offset "$cfg" offset 33 | config_get timeout "$cfg" timeout 34 | config_get mss "$cfg" mss 35 | config_get_bool sync "$cfg" sync 0 36 | config_get_bool use_non_uci_config "$cfg" use_non_uci_config 0 37 | 38 | if [ "$use_non_uci_config" -gt 0 ]; then 39 | . /etc/default/pppoe-server 40 | else 41 | . /lib/functions/network.sh network_get_physdev $interface || return 1 42 | [ -n "$ac_name" ] && append OPTIONS "-C $ac_name" 43 | for service_name in $service_names; do 44 | append OPTIONS "-S $service_name" 45 | done 46 | append OPTIONS "-I $interface" 47 | [ -n "$maxsessionsperpeer" ] && append OPTIONS "-x $maxsessionsperpeer" 48 | [ -n "$localip" ] && append OPTIONS "-L $localip" 49 | [ -n "$firstremoteip" ] && append OPTIONS "-R $firstremoteip" 50 | [ -n "maxsessions" ] && append OPTIONS "-N $maxsessions" 51 | [ -n "optionsfile" ] && append OPTIONS "-O $optionsfile" 52 | [ "$randomsession" = "1" ] && append OPTIONS "-r" 53 | [ "$unit" = "1" ] && append OPTIONS "-u" 54 | [ -n "$offset" ] && append OPTIONS "-o $offset" 55 | [ -n "$timeout" ] && append OPTIONS "-T $timeout" 56 | [ -n "$mss" ] && append OPTIONS "-m $mss" 57 | [ "$sync" = "1" ] && append OPTIONS "-s" 58 | fi 59 | 60 | procd_open_instance 61 | procd_set_param command /usr/sbin/pppoe-server -F -k $OPTIONS 62 | procd_set_param respawn 63 | procd_set_param file /etc/ppp/options 64 | procd_append_param file /etc/ppp/pppoe-server-options 65 | procd_close_instance 66 | } 67 | 68 | start_service() { 69 | config_load pppoe 70 | config_foreach pppoe_instance pppoe_server 71 | } 72 | 73 | service_triggers() { 74 | procd_add_reload_trigger "pppoe" 75 | 76 | config_load pppoe 77 | config_foreach pppoe_triggers pppoe_server 78 | } 79 | -------------------------------------------------------------------------------- /www/assets/css/custom.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Custom style 3 | */ 4 | 5 | body{ 6 | font-family: Arial; 7 | color: #000000; 8 | background-color: #0A1855; 9 | background-image: url(/assets/img/home1600_bg-nhasset.jpg); 10 | background-position: center top; 11 | background-repeat: no-repeat; 12 | font-size: 18px; 13 | width: 100%; 14 | } 15 | 16 | #appWeb, #footer, #header{ 17 | max-width: 750px; 18 | background-color: #ffffffe0; 19 | color: #000000; 20 | } 21 | 22 | #appWeb fieldset{ 23 | color: #000000; 24 | background-color: #ffffff; 25 | border:none; 26 | } 27 | 28 | #header{ 29 | background: #ffffffa2; 30 | text-transform: uppercase; 31 | margin-left: auto; 32 | margin-right: auto; 33 | } 34 | 35 | #header h1{ 36 | color: hsl(146, 100%, 97%); 37 | text-shadow: #1b1b1b 1px 4px 4px; 38 | } 39 | 40 | #header .top-title{ 41 | line-height: 60px; 42 | margin-top: 10px; 43 | margin-bottom: 10px; 44 | } 45 | 46 | #header .menu{ 47 | padding: 10px; 48 | } 49 | 50 | #header .menu li{ 51 | padding: 20px; 52 | font-weight: bolder; 53 | } 54 | 55 | .btn-form{ 56 | background-color: #383838 !important; 57 | color: rgb(255, 255, 255) !important; 58 | border-color: #b9b9b9 !important; 59 | } 60 | 61 | .btn-form:focus{ 62 | background-color: rgb(15, 15, 15) !important; 63 | } 64 | 65 | .group-center{ 66 | display: block; 67 | margin-left: auto; 68 | position: relative; 69 | } 70 | 71 | #task-log{ 72 | width: 100%; 73 | padding: 15px; 74 | } 75 | 76 | #task-log .output{ 77 | border-radius: 10px; 78 | background-color: #1b1b1b; 79 | padding: 10px; 80 | color: #FFF; 81 | height: 150px; 82 | width: 100%; 83 | font-size: 10pt; 84 | } 85 | 86 | .form{ 87 | color: #1b1b1b; 88 | } 89 | 90 | .form .top-label{ 91 | width: 100px; 92 | } 93 | 94 | .form input, .form select{ 95 | background-color: #343434; 96 | color: #FFF; 97 | } 98 | 99 | .form .field-group .input-attach{ 100 | padding: 15px; 101 | font-size: 9pt; 102 | font-weight: 200; 103 | text-transform: uppercase; 104 | } 105 | 106 | .form .expand-slc .op-selected{ 107 | background-color: #000000; 108 | color: #FFF; 109 | } 110 | 111 | /* Custom buttons */ 112 | .input-switch{ 113 | display: block; 114 | width: 60px; 115 | height: 30px; 116 | background-color: #1b1b1b; 117 | border-radius: 15px; 118 | cursor: pointer; 119 | } 120 | 121 | .input-switch .push-circle{ 122 | width: 20px; 123 | height: 20px; 124 | display: block; 125 | background-color: #606060; 126 | margin: 5px; 127 | border-radius: 10px; 128 | } 129 | 130 | .sent-payload{ 131 | margin-top: 5px; 132 | margin-bottom: 5px; 133 | background-color: #434343; 134 | color: #FFF; 135 | } 136 | 137 | /* Message */ 138 | .dialog-box{ 139 | background-color: #FFF; 140 | position: relative; 141 | padding: 20px; 142 | font-size: 9pt; 143 | width: 90%; 144 | margin-left: auto; 145 | margin-right: auto; 146 | } 147 | 148 | .message-success{ 149 | background-color: #32a72e; 150 | color:#1b1b1b; 151 | position: relative; 152 | display: block; 153 | } 154 | 155 | #footer{ 156 | padding: 20px; 157 | } 158 | 159 | #footer a{ 160 | color:#000a29; 161 | } 162 | 163 | .expand-slc{ 164 | width: 80%; 165 | } 166 | 167 | /* Modal */ 168 | .modal-container{ 169 | background-color: #d23838; 170 | max-width: 500px; 171 | margin-top: 10%; 172 | margin-left: auto; 173 | margin-right: auto; 174 | } 175 | .modal-container .modal-content{ 176 | width: 100%; 177 | position: relative; 178 | } 179 | 180 | .preloader{ 181 | width: 70px; 182 | height: 70px; 183 | border: 10px solid rgb(236, 247, 255); 184 | border-radius: 50%; 185 | border-top-color: rgb(191, 191, 191); /* Color del cuarto de círculo */ 186 | animation: girar 2s infinite linear; 187 | } 188 | 189 | .preaction{ 190 | top: 0; 191 | left: 50%; 192 | right: 0; 193 | position: absolute; 194 | margin-top: 10px; 195 | margin-left: -30px; 196 | width: 60px; 197 | } 198 | 199 | .btn-stop{ 200 | width: 100%; 201 | background-color: #760f0f; 202 | color:#ffffff; 203 | border-radius: 50px; 204 | line-height: 50px; 205 | cursor: pointer; 206 | font-size: 9pt; 207 | } 208 | 209 | .btn-message{ 210 | padding: 12px; 211 | margin: 5px; 212 | cursor: pointer; 213 | } 214 | 215 | .btn-stop:focus{ 216 | background-color: #512323; 217 | } 218 | 219 | @keyframes girar { 220 | 0% { 221 | transform: rotate(0deg); 222 | } 223 | 100% { 224 | transform: rotate(360deg); 225 | } 226 | } 227 | 228 | .md-close{ 229 | position: absolute; 230 | top: 0; 231 | right: 0; 232 | display: block; 233 | padding: 10px; 234 | font-weight: bold; 235 | cursor: pointer; 236 | background: none; 237 | } 238 | 239 | @media screen and (max-width: 430px){ 240 | 241 | .container-background video{ 242 | display:none; 243 | } 244 | 245 | .container-background img{ 246 | display: inherit; 247 | margin: 0; 248 | width: 100%; 249 | position: absolute; 250 | } 251 | 252 | } 253 | 254 | @media (min-width: 320px) and (max-width: 463px){ 255 | 256 | .container-background video{ 257 | display:none; 258 | } 259 | 260 | .container-background img{ 261 | display: inherit; 262 | margin: 0; 263 | width: 100%; 264 | position: absolute; 265 | } 266 | 267 | } 268 | 269 | @media (max-width: 1024px) { 270 | 271 | .container-background video{ 272 | display:none; 273 | } 274 | 275 | .container-background img{ 276 | display: inherit; 277 | margin: 0; 278 | width: 100%; 279 | position: absolute; 280 | } 281 | 282 | } 283 | -------------------------------------------------------------------------------- /installer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | if [ -f /etc/config/pppoe ]; then 4 | rm -r /etc/config/pppoe 5 | fi 6 | if [ -f /etc/config/pw ]; then 7 | rm -r /etc/config/pw 8 | fi 9 | if [ -f /etc/init.d/pppoe-server ]; then 10 | rm -r /etc/init.d/pppoe-server 11 | fi 12 | if [ -f /etc/init.d/pw ]; then 13 | rm -r /etc/init.d/pw 14 | fi 15 | if [ -f /etc/ppp/chap-secrets ]; then 16 | rm -f /etc/ppp/chap-secrets 17 | fi 18 | if [ -f /etc/ppp/pap-secrets ]; then 19 | rm -f /etc/ppp/pap-secrets 20 | fi 21 | if [ -f /etc/ppp/pppoe-server-options ]; then 22 | rm -f /etc/ppp/pppoe-server-options 23 | fi 24 | 25 | if [ -f /tmp/main.zip ]; then 26 | rm -r /tmp/main.zip 27 | fi 28 | if [ -d /root/offsets ]; then 29 | rm -r /root/offsets 30 | fi 31 | if [ -d /root/stage1 ]; then 32 | rm -r /root/stage1 33 | fi 34 | if [ -d /root/stage2 ]; then 35 | rm -r /root/stage2 36 | fi 37 | if [ -d /www/assets ]; then 38 | rm -r /www/assets 39 | fi 40 | if [ -f /www/cgi-bin/pw.cgi ]; then 41 | rm /www/cgi-bin/pw.cgi 42 | fi 43 | if [ -f /www/pppwn.html ]; then 44 | rm /www/pppwn.html 45 | fi 46 | if [ -f /root/pw.conf ]; then 47 | rm /root/pw.conf 48 | fi 49 | if [ -f /root/version ]; then 50 | rm /root/version 51 | fi 52 | if [ -f /root/run.sh ]; then 53 | rm /root/run.sh 54 | fi 55 | 56 | installer_setup(){ 57 | 58 | dir_root="" 59 | 60 | if [ "$1" = "download" ]; then 61 | 62 | dir_root="/tmp/PPPwn_ow-main/" 63 | 64 | wget -O /tmp/main.zip https://github.com/CodeInvers3/PPPwn_ow/archive/refs/heads/main.zip 65 | unzip /tmp/main.zip -d /tmp 66 | rm /tmp/main.zip 67 | 68 | fi 69 | 70 | echo "Confirm installation type." 71 | read -p "Complete installacion? y/n: " optyn 72 | 73 | if [ "$optyn" = "y" ]; then 74 | 75 | if [ "$1" = "offline" ]; then 76 | 77 | if [ -f rp-pppoe-common*.ipk ]; then 78 | opkg install rp-pppoe-common*.ipk 79 | fi 80 | if [ -f rp-pppoe-server*.ipk ]; then 81 | opkg install rp-pppoe-server*.ipk 82 | fi 83 | fi 84 | 85 | if [ "$1" = "download" ]; then 86 | 87 | if ! command -v pppoe-server >/dev/null 2>&1; then 88 | opkg update 89 | opkg install rp-pppoe-common 90 | opkg install rp-pppoe-server 91 | fi 92 | 93 | fi 94 | 95 | mv -f ${dir_root}etc/config/pw /etc/config 96 | mv -f ${dir_root}etc/config/pppoe /etc/config 97 | mv -f ${dir_root}etc/init.d/pppoe-server /etc/init.d 98 | mv -f ${dir_root}etc/ppp/pap-secrets /etc/ppp 99 | mv -f ${dir_root}etc/ppp/chap-secrets /etc/ppp 100 | mv -f ${dir_root}etc/ppp/pppoe-server-options /etc/ppp 101 | mv -f ${dir_root}www/cgi-bin/pw.cgi /www/cgi-bin/ 102 | mv -f ${dir_root}www/pppwn.html /www/ 103 | mv -f ${dir_root}www/assets /www/ 104 | 105 | chmod +x /etc/init.d/pppoe-server /www/cgi-bin/pw.cgi 106 | 107 | uci del_list firewall.@zone[0].device='ppp+' 108 | uci add_list firewall.@zone[0].device='ppp+' 109 | uci set firewall.@zone[1].input='ACCEPT' 110 | uci commit firewall 111 | 112 | /etc/init.d/pppoe-server enable 113 | /etc/init.d/pppoe-server start 114 | 115 | else 116 | 117 | mtype=$(uname -m) 118 | echo "Download PPPWN that is compatible with your chip." 119 | echo "Your machine type: $mtype" 120 | echo "1) aarch64-linux-musl" 121 | echo "2) arm-linux-musleabi(cortex_a7)" 122 | echo "3) arm-linux-musleabi(pi_zero_w)" 123 | echo "4) arm-linux-musleabi(mpcorenovfp)" 124 | echo "5) x86_64-linux-musl" 125 | echo "6) mipsel-linux-musl" 126 | echo "7) mips-linux-musl" 127 | 128 | while true; do 129 | read -p "Select a option: " optdwn 130 | case $optdwn in 131 | 1) 132 | repo_ref="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/stored/aarch64-linux-musl.tar.gz" 133 | break 134 | ;; 135 | 2) 136 | repo_ref="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/stored/arm-linux-musleabi(cortex_a7).tar.gz" 137 | break 138 | ;; 139 | 3) 140 | repo_ref="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/stored/arm-linux-musleabi(pi_zero_w).tar.gz" 141 | break 142 | ;; 143 | 4) 144 | repo_ref="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/stored/arm-linux-musleabi(mpcorenovfp).tar.gz" 145 | break 146 | ;; 147 | 5) 148 | repo_ref="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/stored/x86_64-linux-musl.tar.gz" 149 | break 150 | ;; 151 | 6) 152 | repo_ref="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/stored/mipsel-linux-musl.tar.gz" 153 | break 154 | ;; 155 | 7) 156 | repo_ref="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/stored/mips-linux-musl.tar.gz" 157 | break 158 | ;; 159 | *) 160 | echo "Invalid selection, retry again." 161 | ;; 162 | esac 163 | done 164 | 165 | echo "Select ethernet connection" 166 | echo "1) eth0" 167 | echo "2) br-lan" 168 | 169 | read -p "Select option: " opt1 170 | 171 | case $opt1 in 172 | 1) 173 | adapter="eth0" 174 | ;; 175 | 2) 176 | adapter="br-lan" 177 | ;; 178 | *) 179 | adapter="br-lan" 180 | ;; 181 | esac 182 | 183 | echo "Set firmware version" 184 | echo "1) 9.00" 185 | echo "2) 9.50" 186 | echo "3) 9.51" 187 | echo "4) 9.60" 188 | echo "5) 10.00" 189 | echo "6) 10.01" 190 | echo "7) 11.00" 191 | 192 | read -p "Select option: " opt2 193 | 194 | case $opt2 in 195 | 1) 196 | version=900 197 | ;; 198 | 2) 199 | version=950 200 | ;; 201 | 3) 202 | version=951 203 | ;; 204 | 4) 205 | version=960 206 | ;; 207 | 5) 208 | version=1000 209 | ;; 210 | 6) 211 | version=1001 212 | ;; 213 | 7) 214 | version=1100 215 | ;; 216 | *) 217 | version=1100 218 | ;; 219 | esac 220 | 221 | read -p "Set timeout 0 to 60 (default 0): " timeout 222 | 223 | if [ -z "$timeout" ]; then 224 | timeout=0 225 | fi 226 | 227 | wget -O ${dir_root}pppwn.tar.gz $repo_ref 228 | tar -xvzf ${dir_root}pppwn.tar.gz -C $dir_root 229 | rm ${dir_root}pppwn.tar.gz 230 | 231 | mv -f ${dir_root}etc/config/pw /etc/config 232 | 233 | uci set pw.@params[0].interface="$adapter" 234 | uci set pw.@params[0].version="$version" 235 | uci set pw.@params[0].timeout="$timeout" 236 | uci set pw.@params[0].stage1="/root/stage1/$version.bin" 237 | uci set pw.@params[0].stage2="/root/stage2/$version.bin" 238 | uci commit pw 239 | 240 | fi 241 | 242 | if [ -f ${dir_root}pppwn ]; then 243 | mv -f ${dir_root}pppwn /usr/sbin 244 | chmod +x /usr/sbin/pppwn 245 | fi 246 | mv -f ${dir_root}etc/init.d/pw /etc/init.d 247 | mv -f ${dir_root}version /root 248 | mv -f ${dir_root}stage1 /root 249 | mv -f ${dir_root}stage2 /root 250 | 251 | chmod +x /etc/init.d/pw 252 | 253 | if [ "$optyn" = "n" ]; then 254 | /etc/init.d/pw enable 255 | fi 256 | 257 | if [ "$1" = "offline" ]; then 258 | 259 | if [ -d /root/PPPwn_ow ]; then 260 | rm -rf /root/PPPwn_ow 261 | fi 262 | if [ -d /root/PPPwn_ow-main ]; then 263 | rm -rf /root/PPPwn_ow-main 264 | fi 265 | 266 | fi 267 | 268 | if [ "$1" = "download" ]; then 269 | 270 | rm /tmp/installer.sh 271 | if [ -d /tmp/PPPwn_ow-main ]; then 272 | rm -r /tmp/PPPwn_ow-main 273 | fi 274 | 275 | fi 276 | 277 | echo "PPPwn web is hosted at http://ip_address/pppwn.html" 278 | echo "--- INSTALLATION COMPLETED! ---" 279 | 280 | exit 0 281 | 282 | break 283 | } 284 | 285 | echo "PPPwn installer" 286 | echo "The complete installation includes settings from a web interface." 287 | echo "the minimal installation only includes the necessary executables." 288 | 289 | if ping -c 1 www.google.com >/dev/null 2>&1; then 290 | if [ -f /tmp/installer.sh ]; then 291 | installer_setup "download" 292 | else 293 | installer_setup "offline" 294 | fi 295 | else 296 | installer_setup "offline" 297 | fi -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This activation method works for devices with the OpenWrt Linux system as long as they can run PPPwn C++. Check the repository of [Xfangfang](https://github.com/xfangfang/PPPwn_cpp) for compatibility. 2 | 3 | ## Requirements: 4 | 5 | - Supports PS4 FW 9.00, 9.50, 9.51, 9.60, 10.00, 10.01 and 11.00 6 | - Router/Modem with LAN connection and OpenWrt. 7 | - PuTTY installed on your PC to access the terminal. 8 | - Verify `PPPwn_cpp` for OpenWrt Linux distributions by using the command `uname -m`. It is recommended to install the MIPSEL build. 9 | - Download `goldhen.bin` for your console's firmware from [Sistro](https://github.com/GoldHEN/GoldHEN/releases). 10 | - USB drive with 1GB or more of storage. 11 | - Tested model [GL-MT300N-V2 Mango](https://www.gl-inet.com/products/gl-mt300n-v2/) 12 | 13 | ## Offline Installation 14 | 15 | 1. Search and download the compatible version of `pppoe-server` and `pppoe-common` from `https://downloads.openwrt.org/releases/`. 16 | 2. Download and extract the files `PPPwn_ow.zip` and `pppwn.tar.gz` from my repository. 17 | 3. Copy the files `pppwn`, `rp-pppoe-common.ipk`, and `rp-pppoe-server.ipk` to the `PPPwn_ow` folder. 18 | 4. Transfer the `PPPwn_ow` folder using WinSCP. Use the SCP protocol with the host address `192.168.1.1` and port 22. 19 | 5. Open Git Bash or PuTTY and access the terminal. Navigate to the directory where `installer.sh` is located using the command `cd PPPwn_ow`. 20 | 6. Run the following command to proceed with the installation: 21 | ```sh 22 | chmod +x installer.sh && ./installer.sh 23 | ``` 24 | You will receive a message about the type of installation. If you require the full installation, enter `y`. For minimal installation, select the corresponding option. 25 | 7. Go to `http://192.168.1.1/pppwn.html` and complete the necessary configuration. 26 | 8. The minimal installation requires additional adjustments and does not install the web interface. 27 | 28 | ## Installation with Download (Requires Internet Connection) 29 | 30 | 1. Update the OpenWrt operating system before proceeding. 31 | 2. The router must be connected to the internet before continuing. 32 | 3. Open PuTTY or Git Bash and log in from the terminal with the assigned credentials. 33 | 4. Check if `unzip` is installed with the following command: 34 | ```sh 35 | opkg list-installed | grep unzip 36 | ``` 37 | If you see `command not found`, install it with the following command: 38 | ```sh 39 | opkg update 40 | opkg install unzip 41 | ``` 42 | 5. From the terminal, run the following commands: 43 | ```sh 44 | wget -O /tmp/installer.sh https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/main/installer.sh 45 | chmod +x /tmp/installer.sh 46 | /tmp/installer.sh 47 | ``` 48 | Select option 2 for a complete installation or option 1 for a minimal installation that does not include the web interface. 49 | 6. Copy `goldhen.bin` to your USB drive. Make sure it is formatted in exFAT or FAT32 and connect it to your console. 50 | 7. From your PS4 console, configure a network connection using PPPoE with `ppp` as the username and password. 51 | 8. Wait a few seconds for the connection to establish, then access `http:///pppwn.html` from the console's web browser. 52 | 9. Select the build compatible with your router and click "Install". Wait for the installation to complete. 53 | 10. If you encounter an error or don't get the expected result in Ethernet, you can restart the installation by clicking "Update". 54 | 55 | ## Add payloads to the web interface 56 | 57 | 1. Create a directory named `payloads` in root, it should look like this: `/www/pppwn/payloads`. 58 | 2. Copy your `payload.bin` files to the `/www/pppwn/payloads` directory. You can add subdirectories, for example: `/www/pppwn/payloads/linux`. 59 | 3. If your device has USB ports, mount your storage device to `/www/pppwn/payloads`. 60 | 5. Copy your `payload.bin` files to USB storage device. 61 | 62 | ## How enable ftp local network 63 | 64 | The screenshots show the necessary settings to enable the local network connection. 65 | 66 | In the firewall, you will find the option. 67 | ![In the firewall, you will find the option](https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/refs/heads/main/captures/203007.png) 68 | In WAN input zones, it should be set to 'reject' by default 69 | ![In WAN input zones, it should be set to 'reject' by default](https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/refs/heads/main/captures/203047.png) 70 | Select 'accept' for input, and you will be able to access it from the local network. 71 | ![Select 'accept' for input, and you will be able to access it from the local network](https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/refs/heads/main/captures/203056.png) 72 | In the Port Forwarding tabs, you can find out the local IP of the device or check it from the main modem. 73 | ![In the Port Forwarding tabs, you can find out the local IP of the device or check it from the main modem](https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/refs/heads/main/captures/203525.png) 74 | To transfer via FTP to the PS4, it is necessary to redirect the IP address to the PS4 as shown in the screenshots. 75 | ![024138](https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/refs/heads/main/captures/024138.png) 76 | The PS4's IP is selected as the internal IP address. 77 | ![024114](https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/refs/heads/main/captures/024114.png) 78 | - You can now connect via FTP from your PC to the console using the IP address of the mini router, as in this example: 192.168.1.17:2121 79 | - Lastly, you will need to enable active mode / disable passive mode for the FTP connection. 80 | ![024203](https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/refs/heads/main/captures/024203.png) 81 | 82 | PPPwn from https://github.com/xfangfang/PPPwn_cpp 83 | 84 | ### Credits: TheFlowTheOfficialFloW / Sistro / Xfangfang 85 | 86 | --- 87 | 88 | # PPPwn_OpenWrt 89 | Interfaz web para arrancar PPPwn_cpp desde el navegador web de PS4. 90 | 91 | ## Requerimientos: 92 | 93 | - Soporta PS4 FW 9.00, 9.50, 9.51, 9.60, 10.00, 10.01 y 11.00 94 | - Router/Modem conexión lan con OpenWrt. 95 | - Tener instalado PuTTY en tu PC para acceder por el terminal. 96 | - Verificar PPPwn_cpp para distribuciones Linux OpenWrt, verificar con el comando `uname -m` recomiendo instalar la compilación MIPSEL. 97 | - Descargar goldhen.bin para el Firmware de tu consola [Sistro](https://github.com/GoldHEN/GoldHEN/releases). 98 | - Memoria USB 1GB o más 99 | 100 | ## Instalación sin conexión 101 | 102 | 1. Busca y descarga la versión compatible de `pppoe-server` y `pppoe-common` desde `https://downloads.openwrt.org/releases/`. 103 | 2. Descarga y extrae los archivos `PPPwn_ow.zip` y `pppwn.tar.gz` desde mi repositorio. 104 | 3. Copia los archivos `pppwn`, `rp-pppoe-common.ipk` y `rp-pppoe-server.ipk` a la carpeta `PPPwn_ow`. 105 | 4. Transfiere la carpeta `PPPwn_ow` utilizando WinSCP. Usa el protocolo SCP con la dirección del host `192.168.1.1` y el puerto 22. 106 | 5. Abre Git Bash o PuTTY y accede al terminal. Navega al directorio donde se encuentra `installer.sh` utilizando el comando `cd PPPwn_ow`. 107 | 6. Ejecuta el siguiente comando para realizar la instalación: 108 | ```sh 109 | chmod +x installer.sh && ./installer.sh 110 | ``` 111 | Recibirás un mensaje con el tipo de instalación. Si requieres la instalación completa, ingresa `y`. Si prefieres la mínima, elige la opción correspondiente. 112 | 7. Ve a `http://192.168.1.1/pppwn.html` y realiza la configuración necesaria. 113 | 8. La instalación mínima requiere ajustes adicionales y no incluye la interfaz web. 114 | 115 | ## Instalación con descarga (Requiere conexión a Internet) 116 | 117 | 1. Actualiza el sistema operativo OpenWrt antes de continuar. 118 | 2. El router debe estar conectado a Internet antes de continuar. 119 | 3. Abre PuTTY o Git Bash y accede desde el terminal con las credenciales asignadas. 120 | 4. Verifica si tienes instalado `unzip` con el siguiente comando: 121 | ```sh 122 | opkg list-installed | grep unzip 123 | ``` 124 | Si aparece `command not found`, instálalo con el siguiente comando: 125 | ```sh 126 | opkg update 127 | opkg install unzip 128 | ``` 129 | 5. Desde el terminal, ejecuta estos comandos: 130 | ```sh 131 | wget -O /tmp/installer.sh https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/main/installer.sh 132 | chmod +x /tmp/installer.sh 133 | /tmp/installer.sh 134 | ``` 135 | Selecciona la opción 2 para una instalación completa o la opción 1 para una instalación mínima, que no incluye la interfaz web. 136 | 6. Copia `goldhen.bin` a tu memoria USB. Asegúrate de que esté formateada en exFAT o FAT32 y conéctala a tu consola. 137 | 7. Desde tu consola PS4, configura una conexión de red en PPPoE usando `ppp` como usuario y contraseña. 138 | 8. Espera unos segundos hasta que se establezca la conexión y, desde el navegador web de la consola, accede a la dirección `http:///pppwn.html`. 139 | 9. Selecciona la compilación compatible con tu router y haz clic en "Instalar". Espera hasta que se complete la instalación. 140 | 10. En caso de que haya un error o no obtengas el resultado esperado, puedes reiniciar la instalación haciendo clic en "Uninstall". 141 | 142 | ## Añadir payloads a la interfaz web 143 | 144 | 1. Crea un directorio llamado `payloads` en root, debe quedar así: `/www/pppwn/payloads`. 145 | 2. Copia tus archivos `payload.bin` en el directorio `/www/pppwn/payloads`. Puedes añadir subdirectorios, por ejemplo: `/root/payloads/linux`. 146 | 3. Si tu dispositivo tiene puertos USB, monta tu dispositivo de almacenamiento en `/www/pppwn/payloads`. 147 | 4. Copia tus archivos `payload.bin` tu dispositivo de almacenamiento USB. 148 | 149 | Probado en mini router [GL-MT300N-V2 Mango](https://www.gl-inet.com/products/gl-mt300n-v2/) 150 | -------------------------------------------------------------------------------- /www/pppwn.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | PPPWN OpenWRT PS4 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 24 |
25 |
26 |
27 |
28 | 137 | 150 | 175 |
176 |
177 |
178 | 187 |
188 | 189 | 190 | 191 | -------------------------------------------------------------------------------- /www/cgi-bin/pw.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | token="token_id" 4 | stoken="" 5 | token_file="/tmp/token" 6 | 7 | if ! [ -f "$token_file" ]; then 8 | stoken=$(head -30 /dev/urandom | tr -dc "0123456789" | head -c20) 9 | echo "$stoken" > "$token_file" 10 | else 11 | stoken=$(cat "$token_file") 12 | fi 13 | 14 | read postData 15 | 16 | token=$(echo $postData | sed -n 's/^.*token=\([^&]*\).*$/\1/p' | sed "s/%20/ /g") 17 | adapter=$(echo $postData | sed -n 's/^.*adapter=\([^&]*\).*$/\1/p' | sed "s/%20/ /g") 18 | adapter=$(echo "$adapter" | sed 's/+/ /g') 19 | version=$(echo $postData | sed -n 's/^.*version=\([^&]*\).*$/\1/p' | sed "s/%20/ /g") 20 | stage1=$(echo $postData | sed -n 's/^.*stage1=\([^&]*\).*$/\1/p' | sed "s/%20/ /g") 21 | stage1=$(echo "$stage1" | sed 's/%2F/\//g') 22 | stage2=$(echo $postData | sed -n 's/^.*stage2=\([^&]*\).*$/\1/p' | sed "s/%20/ /g") 23 | stage2=$(echo "$stage2" | sed 's/%2F/\//g') 24 | timeout=$(echo $postData | sed -n 's/^.*timeout=\([^&]*\).*$/\1/p' | sed "s/%20/ /g") 25 | auto=$(echo $postData | sed -n 's/^.*auto=\([^&]*\).*$/\1/p' | sed "s/%20/ /g") 26 | retry=$(echo $postData | sed -n 's/^.*retry=\([^&]*\).*$/\1/p' | sed "s/%20/ /g") 27 | sleep=$(echo $postData | sed -n 's/^.*sleep=\([^&]*\).*$/\1/p' | sed "s/%20/ /g") 28 | task=$(echo $postData | sed -n 's/^.*task=\([^&]*\).*$/\1/p' | sed "s/%20/ /g") 29 | option=$(echo $postData | sed -n 's/^.*option=\([^&]*\).*$/\1/p' | sed "s/%20/ /g") 30 | path=$(echo $postData | sed -n 's/^.*path=\([^&]*\).*$/\1/p' | sed "s/%20/ /g") 31 | path=$(echo "$path" | sed 's/%2F/\//g') 32 | 33 | if [ -z "$timeout" ]; then 34 | timeout=0 35 | fi 36 | if [ -z "$path" ]; then 37 | path="/payloads" 38 | fi 39 | 40 | set_params(){ 41 | 42 | uci set pw.@params[0].path="$path" 43 | uci set pw.@params[0].retry="$retry" 44 | uci set pw.@params[0].sleep="$sleep" 45 | uci set pw.@params[0].interface="$adapter" 46 | uci set pw.@params[0].version="$version" 47 | uci set pw.@params[0].timeout="$timeout" 48 | uci set pw.@params[0].stage1="$stage1" 49 | uci set pw.@params[0].stage2="$stage2" 50 | uci commit pw 51 | 52 | } 53 | 54 | rm_files(){ 55 | 56 | "$(opkg remove rp-pppoe-server && rp-pppoe-common)" 57 | 58 | if [ -f /etc/init.d/pppoe-server ]; then 59 | rm /etc/init.d/pppoe-server 60 | fi 61 | if [ -f /etc/config/pppoe ]; then 62 | rm /etc/config/pppoe 63 | fi 64 | if [ -f /etc/ppp/chap-secrets ]; then 65 | rm /etc/ppp/chap-secrets 66 | fi 67 | if [ -f /etc/ppp/pap-secrets ]; then 68 | rm /etc/ppp/pap-secrets 69 | fi 70 | if [ -f /etc/ppp/pppoe-server-options ]; then 71 | rm /etc/ppp/pppoe-server-options 72 | fi 73 | 74 | rm -f /usr/sbin/pppwn /etc/init.d/pw /etc/config/pw && rm -rf /root/* 75 | 76 | if [ -d /www/assets ]; then 77 | rm -rf /www/assets 78 | fi 79 | if [ -f /www/pppwn.html ]; then 80 | rm -f /www/pppwn.html 81 | fi 82 | if [ -f /www/cgi-bin/pw.cgi ]; then 83 | rm -f /www/cgi-bin/pw.cgi 84 | fi 85 | 86 | } 87 | 88 | ls_dir(){ 89 | 90 | dir="$1" 91 | path="$2" 92 | dirpath="$1$2" 93 | sp="$3" 94 | list_dir=$(ls "$dirpath") 95 | 96 | for index in $list_dir; do 97 | 98 | echo "$sp{" 99 | echo "\"label\":\"$(basename $index | sed 's/\.bin$//')\"," 100 | if [ -f "$dirpath/$index" ]; then 101 | echo "\"sub\":false," 102 | echo "\"path\":\"$2/$index\"" 103 | elif [ -d "$dirpath/$index" ]; then 104 | echo "\"sub\":true," 105 | echo "\"dir\":[$(ls_dir "$dir" "$path/$index" "")]" 106 | fi 107 | 108 | if [ "$sp" = "" ]; then 109 | sp="," 110 | fi 111 | echo "}" 112 | 113 | done 114 | 115 | } 116 | 117 | case "$task" in 118 | 119 | "setup") 120 | 121 | echo "Content-Type: application/json" 122 | echo "" 123 | 124 | repo_refs="" 125 | if [ "$option" = "aarch64-linux-musl" ]; then 126 | repo_refs="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/stored/aarch64-linux-musl.tar.gz" 127 | elif [ "$option" = "arm-linux-musleabi(cortex_a7)" ]; then 128 | repo_refs="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/stored/arm-linux-musleabi(cortex_a7).tar.gz" 129 | elif [ "$option" = "arm-linux-musleabi(pi_zero_w)" ]; then 130 | repo_refs="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/stored/arm-linux-musleabi(pi_zero_w).tar.gz" 131 | elif [ "$option" = "arm-linux-musleabi(mpcorenovfp)" ]; then 132 | repo_refs="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/stored/arm-linux-musleabi(mpcorenovfp).tar.gz" 133 | elif [ "$option" = "x86_64-linux-musl" ]; then 134 | repo_refs="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/stored/x86_64-linux-musl.tar.gz" 135 | elif [ "$option" = "mipsel-linux-musl" ]; then 136 | repo_refs="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/stored/mipsel-linux-musl.tar.gz" 137 | elif [ "$option" = "mips-linux-musl" ]; then 138 | repo_refs="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/stored/mips-linux-musl.tar.gz" 139 | elif [ "$option" = "custom-aarch64-linux-musl" ]; then 140 | repo_refs="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/compiled/aarch64-linux-musl/pppwn" 141 | elif [ "$option" = "custom-arm-linux-musleabi_cortex_a7" ]; then 142 | repo_refs="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/compiled/arm-linux-musleabi_cortex_a7/pppwn" 143 | elif [ "$option" = "custom-arm-linux-musleabi_mpcorenovfp" ]; then 144 | repo_refs="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/compiled/arm-linux-musleabi_mpcorenovfp/pppwn" 145 | elif [ "$option" = "custom-arm-linux-musleabi_pi_zero_w" ]; then 146 | repo_refs="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/compiled/arm-linux-musleabi_pi_zero_w/pppwn" 147 | elif [ "$option" = "custom-mips-linux-musl" ]; then 148 | repo_refs="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/compiled/mips-linux-musl/pppwn" 149 | elif [ "$option" = "custom-mipsel-linux-musl" ]; then 150 | repo_refs="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/compiled/mipsel-linux-musl/pppwn" 151 | elif [ "$option" = "custom-x86_64-linux-musl" ]; then 152 | repo_refs="https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/master/custom/compiled/x86_64-linux-musl/pppwn" 153 | fi 154 | 155 | if [[ "$repo_refs" =~ tar\.gz$ ]]; then 156 | cd /tmp/ 157 | if wget -O pppwn.tar.gz $repo_refs; then 158 | "$(tar -xzvf pppwn.tar.gz)" 159 | "$(rm pppwn.tar.gz)" 160 | "$(chmod +x pppwn)" 161 | "$(mv pppwn /usr/sbin)" 162 | echo "{\"output\":\"PPPwn installed\",\"pppwn\":true}" 163 | exit 0 164 | else 165 | echo "{\"output\":\"Cannot to get repos: $repo_refs\"}" 166 | exit 1 167 | fi 168 | else 169 | "$(wget -O /usr/sbin/pppwn $repo_refs)" 170 | "$(chmod +x /usr/sbin/pppwn)" 171 | echo "{\"output\":\"PPPwn installed\",\"pppwn\":true}" 172 | exit 0 173 | fi 174 | 175 | ;; 176 | "state") 177 | 178 | echo "Content-Type: application/json" 179 | echo "" 180 | 181 | echo "{" 182 | 183 | current_version=$(cat /root/version) 184 | latest_version=$(wget -qO- "https://raw.githubusercontent.com/CodeInvers3/PPPwn_ow/main/version" 2>/dev/null) 185 | 186 | echo "\"stored_token\":\"$stoken\"," 187 | echo "\"chipname\":\"$(uname -m)\"," 188 | echo "\"path\":\"$(uci get pw.@params[0].path)\"," 189 | 190 | if [ "$latest_version" -gt "$current_version" ]; then 191 | if ! [ -f /tmp/updater.sh ]; then 192 | "$(wget -O /tmp/updater.sh https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/refs/heads/master/files/updater.sh)" 193 | chmod +x /tmp/updater.sh 194 | fi 195 | echo "\"update\":true," 196 | else 197 | echo "\"update\":false," 198 | fi 199 | 200 | if pgrep pppoe-server > /dev/null; then 201 | echo "\"pppoe\":true," 202 | else 203 | echo "\"pppoe\":false," 204 | fi 205 | if command -v pppwn > /dev/null 2>&1; then 206 | echo "\"pppwn\":true," 207 | echo "\"interfaces\":[" 208 | parts=$(pppwn list | sed "s/\s*$/\"},/") 209 | if [ "$parts" != "" ]; then 210 | eths=$(echo "$parts" | sed "s/^\s*/{\"adapter\":\"/") 211 | echo $eths | sed "s/,$//" 212 | fi 213 | echo "],"; 214 | if pgrep pppwn > /dev/null; then 215 | echo "\"running\":true," 216 | else 217 | echo "\"running\":false," 218 | fi 219 | payloads1=$(ls /root/stage1/*.bin) 220 | payloads2=$(ls /root/stage2/*.bin) 221 | separator="" 222 | echo "\"versions\":[" 223 | for payload in $payloads1; do 224 | 225 | filename=$(basename "$payload" | sed 's/\.bin$//') 226 | echo "$separator\"$filename\"" 227 | if [ "$separator" = "" ]; then 228 | separator="," 229 | fi 230 | 231 | done 232 | separator="" 233 | echo "],\"stage1\":{" 234 | for payload in $payloads1; do 235 | 236 | filename=$(basename "$payload" | sed 's/\.bin$//') 237 | echo "$separator\"$filename\":\"$payload\"" 238 | 239 | if [ "$separator" = "" ]; then 240 | separator="," 241 | fi 242 | 243 | done 244 | separator="" 245 | echo "},\"stage2\":{" 246 | for payload in $payloads2; do 247 | 248 | filename=$(basename "$payload" | sed 's/\.bin$//') 249 | echo "$separator\"$filename\":\"$payload\"" 250 | 251 | if [ "$separator" = "" ]; then 252 | separator="," 253 | fi 254 | 255 | done 256 | echo "}," 257 | 258 | echo "\"retry\":\"$(uci get pw.@params[0].retry)\"," 259 | echo "\"sleep\":\"$(uci get pw.@params[0].sleep)\"," 260 | echo "\"adapter\":\"$(uci get pw.@params[0].interface)\"," 261 | echo "\"version\":\"$(uci get pw.@params[0].version)\"," 262 | echo "\"timeout\":\"$(uci get pw.@params[0].timeout)\"," 263 | 264 | else 265 | echo "\"pppwn\":false," 266 | echo "\"compiled\":[" 267 | type=$(uname -m) 268 | if echo "$type" | grep -q "aarch64"; then 269 | echo "{\"label\":\"Arch64 Linux\",\"type\":\"aarch64-linux-musl\"}," 270 | echo "{\"label\":\"Custom Arch64 Linux\",\"type\":\"custom-aarch64-linux-musl\"}" 271 | elif echo "$type" | grep -q "arm"; then 272 | echo "{\"label\":\"ARM Cortex A7\",\"type\":\"arm-linux-musleabi(cortex_a7)\"}," 273 | echo "{\"label\":\"ARM Pi Zero W\",\"type\":\"arm-linux-musleabi(pi_zero_w)\"}," 274 | echo "{\"label\":\"ARM MP Core Nov Fp\",\"type\":\"arm-linux-musleabi(mpcorenovfp)\"}," 275 | echo "{\"label\":\"Custom ARM Cortex A7\",\"type\":\"custom-arm-linux-musleabi_cortex_a7\"}," 276 | echo "{\"label\":\"Custom ARM MP Core Nov\",\"type\":\"custom-arm-linux-musleabi_mpcorenovfp\"}," 277 | echo "{\"label\":\"Custom ARM Pi Zero W\",\"type\":\"custom-arm-linux-musleabi_pi_zero_w\"}" 278 | elif echo "$type" | grep -q "x86_64"; then 279 | echo "{\"label\":\"X86-64 Linux\",\"type\":\"x86_64-linux-musl\"}," 280 | echo "{\"label\":\"Custom x86_64 Linux\",\"type\":\"custom-x86_64-linux-musl\"}" 281 | elif echo "$type" | grep -q "mips"; then 282 | echo "{\"label\":\"MIPSEL Linux\",\"type\":\"mipsel-linux-musl\"}," 283 | echo "{\"label\":\"MIPS Linux\",\"type\":\"mips-linux-musl\"}," 284 | echo "{\"label\":\"Custom MIPSEL Linux\",\"type\":\"custom-mipsel-linux-musl\"}," 285 | echo "{\"label\":\"Custom MIPS\",\"type\":\"custom-mips-linux-musl\"}" 286 | elif "$type" | grep -q "mipsel"; then 287 | echo "{\"label\":\"MIPSEL Linux\",\"type\":\"mipsel-linux-musl\"}," 288 | echo "{\"label\":\"Custom MIPSEL Linux\",\"type\":\"custom-mipsel-linux-musl\"}" 289 | fi 290 | echo "]," 291 | fi 292 | if ls -l /etc/rc.d/ | grep -q pw; then 293 | echo "\"autorun\":\"yes\"" 294 | else 295 | echo "\"autorun\":\"no\"" 296 | fi 297 | echo "}" 298 | 299 | ;; 300 | "start") 301 | 302 | set_params 303 | /etc/init.d/pw start 304 | 305 | ;; 306 | "stop") 307 | 308 | echo "Content-Type: application/json" 309 | echo "" 310 | 311 | /etc/init.d/pw stop 312 | 313 | echo "{" 314 | echo "\"autorun\":\"$auto\"," 315 | echo "\"retry\":\"$retry\"," 316 | echo "\"sleep\":\"$sleep\"," 317 | echo "\"path\":\"$path\"," 318 | echo "\"adapter\":\"$adapter\"," 319 | echo "\"version\":\"$version\"," 320 | echo "\"timeout\":\"$timeout\"" 321 | echo "}" 322 | 323 | exit 0 324 | 325 | ;; 326 | "save") 327 | 328 | echo "Content-Type: application/json" 329 | echo "" 330 | 331 | set_params 332 | 333 | if [ "$auto" = "yes" ]; then 334 | /etc/init.d/pw enable 335 | fi 336 | if [ "$auto" = "no" ]; then 337 | /etc/init.d/pw disable 338 | fi 339 | 340 | echo "{" 341 | echo "\"autorun\":\"$auto\"," 342 | echo "\"retry\":\"$retry\"," 343 | echo "\"sleep\":\"$sleep\"," 344 | echo "\"path\":\"$path\"," 345 | echo "\"adapter\":\"$adapter\"," 346 | echo "\"version\":\"$version\"," 347 | echo "\"timeout\":\"$timeout\"" 348 | echo "}" 349 | 350 | exit 0 351 | 352 | ;; 353 | "update") 354 | 355 | echo "Content-Type: application/json" 356 | echo "" 357 | 358 | #/etc/init.d/pw update 359 | "$(/tmp/updater.sh)" 360 | wait 361 | 362 | echo "{\"output\":\"Updated!\"}" 363 | 364 | exit 0 365 | 366 | ;; 367 | "remove") 368 | 369 | echo "Content-Type: application/json" 370 | echo "" 371 | 372 | rm_files 373 | 374 | echo "{\"output\":\"Uninstalled\"}" 375 | 376 | exit 0 377 | 378 | ;; 379 | "reconnect") 380 | 381 | echo "Content-Type: application/json" 382 | echo "" 383 | 384 | echo "{" 385 | if pgrep pppoe-server > /dev/null; then 386 | /etc/init.d/pppoe-server stop 387 | echo "\"output\":\"PPPoE service stopped\"," 388 | elif ! pgrep pppoe-server > /dev/null; then 389 | /etc/init.d/pppoe-server start 390 | echo "\"output\":\"PPPoE service started\"," 391 | fi 392 | if pgrep pppoe-server > /dev/null; then 393 | echo "\"pppoe\":true" 394 | else 395 | echo "\"pppoe\":false" 396 | fi 397 | echo "}" 398 | 399 | exit 0 400 | 401 | ;; 402 | "payloads") 403 | 404 | echo "Content-Type: application/json" 405 | echo "" 406 | 407 | path="$(uci get pw.@params[0].path)" 408 | 409 | echo "{" 410 | echo "\"file_list\":[" 411 | if [ -d "/www$path" ]; then 412 | ls_dir "/www" "$path" "" 413 | fi 414 | echo "]" 415 | echo "}" 416 | 417 | exit 0 418 | 419 | ;; 420 | *) 421 | 422 | echo "Status: 400 Bad Request" 423 | echo "" 424 | echo "Invalid task" 425 | exit 1 426 | 427 | ;; 428 | esac -------------------------------------------------------------------------------- /www/assets/js/underscore-min.js: -------------------------------------------------------------------------------- 1 | !function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define("underscore",r):(n="undefined"!=typeof globalThis?globalThis:n||self,function(){var t=n._,e=n._=r();e.noConflict=function(){return n._=t,e}}())}(this,(function(){ 2 | // Underscore.js 1.13.6 3 | // https://underscorejs.org 4 | // (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors 5 | // Underscore may be freely distributed under the MIT license. 6 | var n="1.13.6",r="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},t=Array.prototype,e=Object.prototype,u="undefined"!=typeof Symbol?Symbol.prototype:null,o=t.push,i=t.slice,a=e.toString,f=e.hasOwnProperty,c="undefined"!=typeof ArrayBuffer,l="undefined"!=typeof DataView,s=Array.isArray,p=Object.keys,v=Object.create,h=c&&ArrayBuffer.isView,y=isNaN,d=isFinite,g=!{toString:null}.propertyIsEnumerable("toString"),b=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=Math.pow(2,53)-1;function j(n,r){return r=null==r?n.length-1:+r,function(){for(var t=Math.max(arguments.length-r,0),e=Array(t),u=0;u=0&&t<=m}}function J(n){return function(r){return null==r?void 0:r[n]}}var G=J("byteLength"),H=K(G),Q=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var X=c?function(n){return h?h(n)&&!q(n):H(n)&&Q.test(a.call(n))}:C(!1),Y=J("length");function Z(n,r){r=function(n){for(var r={},t=n.length,e=0;e":">",'"':""","'":"'","`":"`"},$n=zn(Ln),Cn=zn(_n(Ln)),Kn=tn.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Jn=/(.)^/,Gn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Hn=/\\|'|\r|\n|\u2028|\u2029/g;function Qn(n){return"\\"+Gn[n]}var Xn=/^\s*(\w|\$)+\s*$/;var Yn=0;function Zn(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var o=Mn(n.prototype),i=n.apply(o,u);return _(i)?i:o}var nr=j((function(n,r){var t=nr.placeholder,e=function(){for(var u=0,o=r.length,i=Array(o),a=0;a1)er(a,r-1,t,e),u=e.length;else for(var f=0,c=a.length;f0&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}}var cr=nr(fr,2);function lr(n,r,t){r=Pn(r,t);for(var e,u=nn(n),o=0,i=u.length;o0?0:u-1;o>=0&&o0?a=o>=0?o:Math.max(o+f,a):f=o>=0?Math.min(o+1,f):o+f+1;else if(t&&o&&f)return e[o=t(e,u)]===u?o:-1;if(u!=u)return(o=r(i.call(e,a,f),$))>=0?o+a:-1;for(o=n>0?a:f-1;o>=0&&o0?0:i-1;for(u||(e=r[o?o[a]:a],a+=n);a>=0&&a=3;return r(n,Rn(t,u,4),e,o)}}var wr=_r(1),Ar=_r(-1);function xr(n,r,t){var e=[];return r=Pn(r,t),mr(n,(function(n,t,u){r(n,t,u)&&e.push(n)})),e}function Sr(n,r,t){r=Pn(r,t);for(var e=!tr(n)&&nn(n),u=(e||n).length,o=0;o=0}var Er=j((function(n,r,t){var e,u;return D(r)?u=r:(r=Bn(r),e=r.slice(0,-1),r=r[r.length-1]),jr(n,(function(n){var o=u;if(!o){if(e&&e.length&&(n=Nn(n,e)),null==n)return;o=n[r]}return null==o?o:o.apply(n,t)}))}));function Br(n,r){return jr(n,Dn(r))}function Nr(n,r,t){var e,u,o=-1/0,i=-1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=tr(n)?n:jn(n)).length;ao&&(o=e);else r=Pn(r,t),mr(n,(function(n,t,e){((u=r(n,t,e))>i||u===-1/0&&o===-1/0)&&(o=n,i=u)}));return o}var Ir=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Tr(n){return n?U(n)?i.call(n):S(n)?n.match(Ir):tr(n)?jr(n,Tn):jn(n):[]}function kr(n,r,t){if(null==r||t)return tr(n)||(n=jn(n)),n[Un(n.length-1)];var e=Tr(n),u=Y(e);r=Math.max(Math.min(r,u),0);for(var o=u-1,i=0;i1&&(e=Rn(e,r[1])),r=an(n)):(e=qr,r=er(r,!1,!1),n=Object(n));for(var u=0,o=r.length;u1&&(t=r[1])):(r=jr(er(r,!1,!1),String),e=function(n,t){return!Mr(r,t)}),Ur(n,e,t)}));function zr(n,r,t){return i.call(n,0,Math.max(0,n.length-(null==r||t?1:r)))}function Lr(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[0]:zr(n,n.length-r)}function $r(n,r,t){return i.call(n,null==r||t?1:r)}var Cr=j((function(n,r){return r=er(r,!0,!0),xr(n,(function(n){return!Mr(r,n)}))})),Kr=j((function(n,r){return Cr(n,r)}));function Jr(n,r,t,e){A(r)||(e=t,t=r,r=!1),null!=t&&(t=Pn(t,e));for(var u=[],o=[],i=0,a=Y(n);ir?(e&&(clearTimeout(e),e=null),a=c,i=n.apply(u,o),e||(u=o=null)):e||!1===t.trailing||(e=setTimeout(f,l)),i};return c.cancel=function(){clearTimeout(e),a=0,e=u=o=null},c},debounce:function(n,r,t){var e,u,o,i,a,f=function(){var c=Wn()-u;r>c?e=setTimeout(f,r-c):(e=null,t||(i=n.apply(a,o)),e||(o=a=null))},c=j((function(c){return a=this,o=c,u=Wn(),e||(e=setTimeout(f,r),t&&(i=n.apply(a,o))),i}));return c.cancel=function(){clearTimeout(e),e=o=a=null},c},wrap:function(n,r){return nr(r,n)},negate:ar,compose:function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},after:function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},before:fr,once:cr,findKey:lr,findIndex:pr,findLastIndex:vr,sortedIndex:hr,indexOf:dr,lastIndexOf:gr,find:br,detect:br,findWhere:function(n,r){return br(n,kn(r))},each:mr,forEach:mr,map:jr,collect:jr,reduce:wr,foldl:wr,inject:wr,reduceRight:Ar,foldr:Ar,filter:xr,select:xr,reject:function(n,r,t){return xr(n,ar(Pn(r)),t)},every:Sr,all:Sr,some:Or,any:Or,contains:Mr,includes:Mr,include:Mr,invoke:Er,pluck:Br,where:function(n,r){return xr(n,kn(r))},max:Nr,min:function(n,r,t){var e,u,o=1/0,i=1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=tr(n)?n:jn(n)).length;ae||void 0===t)return 1;if(t