Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login Problem on 6.45+ #47

Closed
bluwebz opened this issue Jul 2, 2019 · 30 comments
Closed

Login Problem on 6.45+ #47

bluwebz opened this issue Jul 2, 2019 · 30 comments

Comments

@bluwebz
Copy link

bluwebz commented Jul 2, 2019

After os update login not working ....

@ultimus247
Copy link

We are experiencing the same issue. Upgraded to 6.45 and our login broke. We were using version b5 instead of b6 but on upgrading to the new .phar file we get the following error:
exception 'Exception' with message 'Class PEAR2\Net\RouterOS\Client could not be loaded from PEAR2/Net/RouterOS/Client.php, file does not exist (registered paths="phar:///public_html/PEAR2_Net_RouterOS-1.0.0b6file.phar/PEAR2_Net_RouterOS-1.0.0b6/src") [PEAR2_Autoload-@PACKAGE_VERSION@]' in phar:///public_html/PEAR2_Net_RouterOS-1.0.0b6file.phar/PEAR2_Net_RouterOS-1.0.0b6/src/PEAR2/Autoload.php:305
Stack trace:
#0 [internal function]: PEAR2\Autoload::load('PEAR2\Net\Route...')
#1 /public_html/sshtest.php(22): spl_autoload_call('PEAR2\Net\Route...')
#2 {main}

@boenrobot
Copy link
Member

boenrobot commented Jul 2, 2019

Can you try installing the "dev-develop" version with composer?

There is a new login algorithm in 6.43+, though the old one should've remained supported for a while by RouterOS. Regardless, this new algorithm is supported in dev-develop.

This comment suggests not even dev-develop works with 6.45+, but again, I'll need some more information to debug.

@boenrobot
Copy link
Member

I just tried to replicate with dev-develop, and I can't.

I can succesfully login to an 6.45.1 x86 VM using dev-develop.

However, 1.0.0b6 (and therefore dev-master) does fail to login, and the roscon message is clear enough that the error is on login. Of course, it doesn't include "new login protocol" in the list of possible reasons, since that wasn't a thing then.

@ultimus247
Copy link

I was able to install composer and get the beta version with
php composer.phar require pear2/net_routeros:@beta
however I cannot seem to find the branch for dev-develop, I tried
php composer.phar require pear2/net_routeros:
@dev
but that one didnt work.

Sorry been at this all morning the pear seems to be no longer supported, and the phar creation through pyrus is no longer able to be downloaded. Looks like composer is our last resort here.

@ultimus247
Copy link

OK I got the develop files from the git repository, now just trying to figure out how to make composer use the local develop branch of the git project.

@boenrobot
Copy link
Member

boenrobot commented Jul 2, 2019

composer require pear2/net_routeros:dev-develop@dev

@maximiliandallmair
Copy link

any news?

@umarzahid028
Copy link

any update??

@nickarellano
Copy link

any news?
any update??

Authentication is working on the dev-develop branch.

@maximiliandallmair
Copy link

pear install pear2.php.net/PEAR2_Net_RouterOS-dev-develop@dev
parsePackageName(): only one version/state delimiter "-" is allowed in "pear2.php.net/PEAR2_Net_RouterOS-dev-develop@dev"
invalid package name/package file "pear2.php.net/PEAR2_Net_RouterOS-dev-develop@dev"
install failed

@boenrobot
Copy link
Member

develop versions are not available over PEAR(2) in any way.

And in fact, it seems like the pear2.php.net website has silently went down, meaning no PEAR2 package can be installed at all over PEAR.

They can only be installed via composer, as shown above. I'll try to make a phar soon, but if you're using composer, you can use it right now.

@maximiliandallmair
Copy link

I'll try to make a phar soon
how soon?

@adam-gweleg
Copy link

composer require pear2/net_routeros:dev-develop@dev

can't install develop@dev

PS C:\xampp\htdocs\2> composer require pear2/net_routeros:dev-develop@dev
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for pear2/net_routeros dev-develop@dev -> satisfiable by pear2/net_routeros[dev-develop].
- pear2/net_routeros dev-develop requires pear2/net_transmitter >=1.0.0b1 || dev-develop@dev -> satisfiable by pear2/net_transmitter[1.0.0b1, 1.0.0b2, dev-develop, dev-master] but these conflict with your requirements or minimum-stability.

Installation failed, deleting ./composer.json.

@maximiliandallmair
Copy link

i still need a solution

@wdjag
Copy link

wdjag commented Jul 11, 2019

Hey mate, use command
composer require pear2/net_transmitter:1.0.0b1 pear2/cache_shm pear2/net_routeros:dev-develop@dev
It's work ;)

$php roscon.php -v IP USER PASSWORD
MODE |   LENGTH    |    LENGTH    |  CONTENTS
     |  (decoded)  |  (encoded)   |
-----|-------------|--------------|--------------------------------------------
NOTE |     Connection started     |
SEND |    <prompt> |     <prompt> | /system/package/print

SEND |    <prompt> |     <prompt> |

SENT |          21 |         0x15 | /system/package/print
SENT |           0 |         0x00 |
RECV |           3 |         0x03 | !re
RECV |           7 |         0x07 | =.id=*1
RECV |          21 |         0x15 | =name=routeros-mipsbe
RECV |          15 |         0x0F | =version=6.45.1
RECV |          32 |         0x20 | =build-time=jun/27/2019 10:23:23
RECV |          11 |         0x0B | =scheduled=
RECV |          15 |         0x0F | =disabled=false
RECV |           0 |         0x00 |
SEND |    <prompt> |     <prompt> | 


@bluwebz
Copy link
Author

bluwebz commented Jul 11, 2019

Thank you very much @wdjag
Its work for me.

@bluwebz bluwebz closed this as completed Jul 12, 2019
@maximiliandallmair
Copy link

maximiliandallmair commented Jul 13, 2019

still need pear solution¨
dont have composer

@andrearos
Copy link

Thank you @wdjag!!!!!!!
I'm searching for a solution for weeks!
It works for me!

@egoan82
Copy link

egoan82 commented Sep 17, 2019

Hey mate, use command
composer require pear2/net_transmitter:1.0.0b1 pear2/cache_shm pear2/net_routeros:dev-develop@dev
It's work ;)

$php roscon.php -v IP USER PASSWORD
MODE |   LENGTH    |    LENGTH    |  CONTENTS
     |  (decoded)  |  (encoded)   |
-----|-------------|--------------|--------------------------------------------
NOTE |     Connection started     |
SEND |    <prompt> |     <prompt> | /system/package/print

SEND |    <prompt> |     <prompt> |

SENT |          21 |         0x15 | /system/package/print
SENT |           0 |         0x00 |
RECV |           3 |         0x03 | !re
RECV |           7 |         0x07 | =.id=*1
RECV |          21 |         0x15 | =name=routeros-mipsbe
RECV |          15 |         0x0F | =version=6.45.1
RECV |          32 |         0x20 | =build-time=jun/27/2019 10:23:23
RECV |          11 |         0x0B | =scheduled=
RECV |          15 |         0x0F | =disabled=false
RECV |           0 |         0x00 |
SEND |    <prompt> |     <prompt> | 

Excelente con esto logre solucionar el problema de inicio de sesión.
Excellent with this I managed to solve the login problem.

@mvalsasna
Copy link

develop branch + Net/Transmitter 1.0.0a3 1.0.0b2 work for me on routeros 6.45.6, thanks

is there a plan to release a Net/RouterOS RELEASE-1.0.0b7?

thanks for the good work

MAtteo

@leo-combes
Copy link

leo-combes commented Dec 5, 2019

Thanks @wdjag, work like a charm!

@blindrain
Copy link

Still, Waiting on Net/RouterOS RELEASE-1.0.0b7? phar file.

@Kamauink
Copy link

So I can get the roscon.php file to connect seamlessly, however using both the Net/RouterOS RELEASE-1.0.0b6 and composer dev-develop@dev, I get a http 500 reply with no further info... anybody with a workaround?

@Kamauink
Copy link

Hey mate, use command
composer require pear2/net_transmitter:1.0.0b1 pear2/cache_shm pear2/net_routeros:dev-develop@dev
It's work ;)

$php roscon.php -v IP USER PASSWORD
MODE |   LENGTH    |    LENGTH    |  CONTENTS
     |  (decoded)  |  (encoded)   |
-----|-------------|--------------|--------------------------------------------
NOTE |     Connection started     |
SEND |    <prompt> |     <prompt> | /system/package/print

SEND |    <prompt> |     <prompt> |

SENT |          21 |         0x15 | /system/package/print
SENT |           0 |         0x00 |
RECV |           3 |         0x03 | !re
RECV |           7 |         0x07 | =.id=*1
RECV |          21 |         0x15 | =name=routeros-mipsbe
RECV |          15 |         0x0F | =version=6.45.1
RECV |          32 |         0x20 | =build-time=jun/27/2019 10:23:23
RECV |          11 |         0x0B | =scheduled=
RECV |          15 |         0x0F | =disabled=false
RECV |           0 |         0x00 |
SEND |    <prompt> |     <prompt> | 

So I can get the roscon.php file to connect seamlessly, however using both the Net/RouterOS RELEASE-1.0.0b6 and composer dev-develop@dev, I get a http 500 reply with no further info... anybody with a workaround?

@boenrobot
Copy link
Member

Seems like you have another problem in your file that causes either a syntax error, or a fatal error before you even reach the authentication point.

Can you give an example full file you're trying to use?

@Kamauink
Copy link

Kamauink commented Jul 17, 2020

Seems like you have another problem in your file that causes either a syntax error, or a fatal error before you even reach the authentication point.

Can you give an example full file you're trying to use?

Here's my script:
Screenshot from 2020-07-17 13-43-58

i'm just trying to initiate a simple connection to the router, so as I was saying when I run "php roscon.php -v 192.168.88.1 user password" it works perfectly, but when i use the script, including classes from dev-develop@dev and PEAR2_Net_RouterOS-1.0.0b6', I get the 500 error. I have also downgraded to various versions of RouterOS with no luck.

@boenrobot
Copy link
Member

That's not composer's autoloader, that's PEAR2's autoloader there. If you're installing from composer, you should be using the composer autoloader in vendor/autoload.php.

@Kamauink
Copy link

Kamauink commented Jul 18, 2020 via email

@maxwellrm
Copy link

maxwellrm commented Feb 2, 2021

i solved with this, and work (mikrotik version 6,48)

Net_RouterOS/src/PEAR2/Net/RouterOS/Client.php between line 288 and 299

Changed this
$request = new Request('/login'); $request->send($com); $response = new Response($com, false, $timeout); $request->setArgument('name', $username); $request->setArgument( 'response', '00' . md5( chr(0) . $password . pack('H*', $response->getProperty('ret')) ) ); $request->verify($com)->send($com);

to
$request = new Request('/login'); $request->send($com); $response = new Response($com, false, $timeout); $request->setArgument('name', $username); $request->setArgument('password', $password); $request->verify($com)->send($com);

@k3nshjnz
Copy link

Can anyone update .phar file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests