Bitcoin Forum
October 20, 2018, 06:02:40 PM *
News: Make sure you are not using versions of Bitcoin Core other than 0.17.0 [Torrent], 0.16.3, 0.15.2, or 0.14.3. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 »  All
  Print  
Author Topic: [HOWTO] Get root access to your Lightningasic controller.  (Read 5663 times)
maardein
Sr. Member
****
Offline Offline

Activity: 420
Merit: 250


View Profile
February 27, 2014, 01:08:41 PM
 #1

Ok, I will post this here, since I think people could benefit from it. I'll have to give most of the credits to Girhes, since he told me about the failsafe mode of openWRT, and assisted me while trying to gain access (he did not have a controller himself yet).

Please note that this is at YOUR OWN RISK, you could brick your device when you have root access to the controller. Please do NOT install any programs when you have root access, unless you really know what you are doing. There is almost no room left on the device, so installing a program could brick your device.

1 - Start the controller in failsafe mode:

Quote from: Girhes
There are different HW versions of the TL-WR703N - on version 1.6 you have to power on the controller, wait until the led starts flashing twice a second (it takes about 4 seconds to get there), then push the reset button immediately. When the led starts to flash much faster your device is in failsafe mode. All other HW versions: power on the controller, wait 10-12 seconds until the led starts flashing, then immediately push the reset button for 1-2 seconds. Again, if the led will start blinking rapidly you are in failsafe mode.

The versioin of your device is stated on the back of the device, underneath the barcode.

2 - Telnet into the device:

On windows go to start, type 'cmd' in the search bar, and start 'cmd.exe'. In the command window you get afterwards, type 'telnet 192.168.1.1'. Make sure you use the correct IP, my device used 192.168.1.1 in failsafe mode.

There is no user/pass required in failsafe mode.

3 - Switch to the live partition:

Type 'mount_root'

Warning! You are in the live partition now, with root permissions. You could seriously fuck thing up now!

4 - Change the root password:

Type 'passwd', and enter the password you would like (twice).

5 - Enable SSH:

Type 'vim /etc/config/dropbear', this will open the SSH config file in the vim text editor. You need to change "option enable" to "on".

You can start editing the file by hitting the 'i' key. You can now insert/delete characters. After you are finished editing hit the 'esc' key to stop editing. Now hit the ':' key, and type 'wq'. This will write the file, and quit the editor. If you made mistakes while editing, and just want to quit (without writing the file), type 'q' instead of 'wq'.

6 - Reboot the device:

Just unplug the usb power, and plug it in again.

7 - Have fun!

You can now SSH into the device while it is running in normal mode. (user: root, password whatever you entered in step 4). Just be carefull not to mess things up. If you are not at least a little familiar with linux, please be very carefull.


BTC: 1788UegKXGXXicfPcbZ1bmSUJ99ZWRCF7p
LTC: LZ2rCcoxK4X8wRRynqdxoimd4d3TDNk7Lk
PMP: PApSSdorQds5tQysymwDXPAN3viJLFTUs8
1540058560
Hero Member
*
Offline Offline

Posts: 1540058560

View Profile Personal Message (Offline)

Ignore
1540058560
Reply with quote  #2

1540058560
Report to moderator
1540058560
Hero Member
*
Offline Offline

Posts: 1540058560

View Profile Personal Message (Offline)

Ignore
1540058560
Reply with quote  #2

1540058560
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1540058560
Hero Member
*
Offline Offline

Posts: 1540058560

View Profile Personal Message (Offline)

Ignore
1540058560
Reply with quote  #2

1540058560
Report to moderator
1540058560
Hero Member
*
Offline Offline

Posts: 1540058560

View Profile Personal Message (Offline)

Ignore
1540058560
Reply with quote  #2

1540058560
Report to moderator
1540058560
Hero Member
*
Offline Offline

Posts: 1540058560

View Profile Personal Message (Offline)

Ignore
1540058560
Reply with quote  #2

1540058560
Report to moderator
worldlybedouin
Sr. Member
****
Offline Offline

Activity: 376
Merit: 250


View Profile WWW
February 27, 2014, 01:22:14 PM
 #2

Ok, so I'm not this adventurous but I do appreciate all your hard work!   Grin

LTC:  LXrAe2E6cBsK52GvUsYraeXkc2s7Ti7R5X
BTC:  1FLTMqVjTZ5MTdCF4npNZGFMEUGyBV4zcj
andre1980
Sr. Member
****
Offline Offline

Activity: 436
Merit: 250


View Profile
February 27, 2014, 02:10:56 PM
 #3

Tried after enabling telnet op W8.1:

Still asks me to login (v1.6) though. Doesn't accept any password i try..

Will try later, somehow i'm locked out from both controllers. (Could be router or firewall issue)
maardein
Sr. Member
****
Offline Offline

Activity: 420
Merit: 250


View Profile
February 27, 2014, 03:56:28 PM
 #4

Tried after enabling telnet op W8.1:

Still asks me to login (v1.6) though. Doesn't accept any password i try..

Will try later, somehow i'm locked out from both controllers. (Could be router or firewall issue)

Are you sure you are in failsafe mode? Is your blue led flashing like crazy?

Depending on your LAN setup, you may have to set a static ip on you computer (ip 192.168.1.2, subnet 255.255.255.0).

BTC: 1788UegKXGXXicfPcbZ1bmSUJ99ZWRCF7p
LTC: LZ2rCcoxK4X8wRRynqdxoimd4d3TDNk7Lk
PMP: PApSSdorQds5tQysymwDXPAN3viJLFTUs8
andre1980
Sr. Member
****
Offline Offline

Activity: 436
Merit: 250


View Profile
February 27, 2014, 09:29:50 PM
 #5

Tried after enabling telnet op W8.1:

Still asks me to login (v1.6) though. Doesn't accept any password i try..

Will try later, somehow i'm locked out from both controllers. (Could be router or firewall issue)

Are you sure you are in failsafe mode? Is your blue led flashing like crazy?

Depending on your LAN setup, you may have to set a static ip on you computer (ip 192.168.1.2, subnet 255.255.255.0).

Well,

After using a paperclip to press the reset button behind the hole (after 2 flashes in the regular speed), it changes to a rapid pace.
So, i assume that's correct. Well, the controllers are (both) connected to my router via assigned DHCP. Should i connect directly to my computer instead?

One gets 192.168.1.112 in regular mode, the other .129. I was able to connect a few times in failsafe mode. I'll try it later, because i don't like the idea that Jack or anyone is able to log in remotely, and i don't even have the password..

Thanks.

Andre
maardein
Sr. Member
****
Offline Offline

Activity: 420
Merit: 250


View Profile
February 27, 2014, 09:58:33 PM
 #6

Tried after enabling telnet op W8.1:

Still asks me to login (v1.6) though. Doesn't accept any password i try..

Will try later, somehow i'm locked out from both controllers. (Could be router or firewall issue)

Are you sure you are in failsafe mode? Is your blue led flashing like crazy?

Depending on your LAN setup, you may have to set a static ip on you computer (ip 192.168.1.2, subnet 255.255.255.0).

Well,

After using a paperclip to press the reset button behind the hole (after 2 flashes in the regular speed), it changes to a rapid pace.
So, i assume that's correct. Well, the controllers are (both) connected to my router via assigned DHCP. Should i connect directly to my computer instead?

One gets 192.168.1.112 in regular mode, the other .129. I was able to connect a few times in failsafe mode. I'll try it later, because i don't like the idea that Jack or anyone is able to log in remotely, and i don't even have the password..

Thanks.

Andre

I think DHCP is disabled on the controller in failsafe mode, the IP will always be 192.168.1.1


Anyone who understands what this script in /bin does?

Code:
#!/bin/sh
# Copyright (C) 2006-2011 OpenWrt.org

if ( ! grep -qs '^root:[!x]\?:' /etc/shadow || \
     ! grep -qs '^root:[!x]\?:' /etc/passwd ) && \
   [ -z "$FAILSAFE" ]
then
echo "Login failed."
exit 0
else
cat << EOF
 === IMPORTANT ============================
  Use 'passwd' to set your login password
  this will disable telnet and enable SSH
 ------------------------------------------
EOF
fi

exec /bin/ash --login

BTC: 1788UegKXGXXicfPcbZ1bmSUJ99ZWRCF7p
LTC: LZ2rCcoxK4X8wRRynqdxoimd4d3TDNk7Lk
PMP: PApSSdorQds5tQysymwDXPAN3viJLFTUs8
asiabtc
Hero Member
*****
Offline Offline

Activity: 868
Merit: 1000

Crypto Currency , Mining, Exchange ATM, Wallet!


View Profile WWW
February 27, 2014, 10:29:10 PM
 #7

Ok, I will post this here, since I think people could benefit from it. I'll have to give most of the credits to Girhes, since he told me about the failsafe mode of openWRT, and assisted me while trying to gain access (he did not have a controller himself yet).

Please note that this is at YOUR OWN RISK, you could brick your device when you have root access to the controller. Please do NOT install any programs when you have root access, unless you really know what you are doing. There is almost no room left on the device, so installing a program could brick your device.

1 - Start the controller in failsafe mode:

Quote from: Girhes
There are different HW versions of the TL-WR703N - on version 1.6 you have to power on the controller, wait until the led starts flashing twice a second (it takes about 4 seconds to get there), then push the reset button immediately. When the led starts to flash much faster your device is in failsafe mode. All other HW versions: power on the controller, wait 10-12 seconds until the led starts flashing, then immediately push the reset button for 1-2 seconds. Again, if the led will start blinking rapidly you are in failsafe mode.

The versioin of your device is stated on the back of the device, underneath the barcode.

2 - Telnet into the device:

On windows go to start, type 'cmd' in the search bar, and start 'cmd.exe'. In the command window you get afterwards, type 'telnet 192.168.1.1'. Make sure you use the correct IP, my device used 192.168.1.1 in failsafe mode.

There is no user/pass required in failsafe mode.

3 - Switch to the live partition:

Type 'mount_root'

Warning! You are in the live partition now, with root permissions. You could seriously fuck thing up now!

4 - Change the root password:

Type 'passwd', and enter the password you would like (twice).

5 - Enable SSH:

Type 'vim /etc/config/dropbear', this will open the SSH config file in the vim text editor. You need to change "option enable" to "on".

You can start editing the file by hitting the 'i' key. You can now insert/delete characters. After you are finished editing hit the 'esc' key to stop editing. Now hit the ':' key, and type 'wq'. This will write the file, and quit the editor. If you made mistakes while editing, and just want to quit (without writing the file), type 'q' instead of 'wq'.

6 - Reboot the device:

Just unplug the usb power, and plug it in again.

7 - Have fun!

You can now SSH into the device while it is running in normal mode. (user: root, password whatever you entered in step 4). Just be carefull not to mess things up. If you are not at least a little familiar with linux, please be very carefull.



well done.someday, i will public all source code.
thanks a lot.

there is many scam. they are using my similar skype id, qq, whatever . pls go to my website to place order only.www.lightningasic.com 币圈老兵,从2013年战斗至今。ASIC GPU矿机,ATM, 硬件钱包,挖矿。ALTCOIN,BTC,LTC,Dogecoin research, Producing BTC LTC Dogecoin Mining Machine, Exchange market policy study.Skype:  altcoin Twitter: @lightningasic Co-Founder of LIGHTNINGASIC 关注微博: @比特币矿机 TWITTER: @LIGHTNINGASIC, 获得最新资讯。
MWNinja
Hero Member
*****
Offline Offline

Activity: 629
Merit: 500



View Profile WWW
February 27, 2014, 10:40:46 PM
 #8

Making the source code open and free is what is best for the community.  I know your team worked hard to develop the controller firmware, but really much of that firmware is based on GPL open source projects such as cgminer and cpuminer. By making it open and free, you will have the force of the community there to make improvements and make it better for everyone. I'd love to get in there and modify some simple things right now, such as the timeout.  Also I would implement a cold reboot call for when the USB bus hangs.
sandor111
Hero Member
*****
Offline Offline

Activity: 616
Merit: 500



View Profile WWW
February 27, 2014, 10:46:13 PM
 #9

Making the source code open and free is what is best for the community.  I know your team worked hard to develop the controller firmware, but really much of that firmware is based on GPL open source projects such as cgminer and cpuminer. By making it open and free, you will have the force of the community there to make improvements and make it better for everyone. I'd love to get in there and modify some simple things right now, such as the timeout.  Also I would implement a cold reboot call for when the USB bus hangs.

Firmware coder speaking here. I have been looking into a cold reboot call, it does not seem possible with the controller, as there is no way to toggle the controller's USB power. If you're lucky your USB hub supports per port switching, then you can use hub-ctrl.c Your best bet is using a relay to switch the 5v from the USB (works for me). Anyway this is only a problem with the red miners, the new miners have a ST32 MCU which fixes the hanging problem.

maardein
Sr. Member
****
Offline Offline

Activity: 420
Merit: 250


View Profile
February 28, 2014, 09:33:48 AM
 #10


...


well done.someday, i will public all source code.
thanks a lot.

I hope you are not mad at me  Kiss

You must have known it was only a matter of time before someone found this. Especially since it is clearly documented in the openwrt wiki.

Why don't you just publish the source now? I don't really see the problem. You will just get a lot of programmers who can improve your software for free.

Really, bitcoin (and altcoins) wouldn't have been where they are now if everything would have been closed source.

BTC: 1788UegKXGXXicfPcbZ1bmSUJ99ZWRCF7p
LTC: LZ2rCcoxK4X8wRRynqdxoimd4d3TDNk7Lk
PMP: PApSSdorQds5tQysymwDXPAN3viJLFTUs8
worldlybedouin
Sr. Member
****
Offline Offline

Activity: 376
Merit: 250


View Profile WWW
February 28, 2014, 11:21:51 AM
 #11


...


well done.someday, i will public all source code.
thanks a lot.

I hope you are not mad at me  Kiss

You must have known it was only a matter of time before someone found this. Especially since it is clearly documented in the openwrt wiki.

Why don't you just publish the source now? I don't really see the problem. You will just get a lot of programmers who can improve your software for free.

Really, bitcoin (and altcoins) wouldn't have been where they are now if everything would have been closed source.

Yes, I'd love to see the source code for the firmware released to open source.  Clearly the delay in sorting out the issues with the miners could be much quicker if we had a community of developers who could help out instead of the single developer at LightingASIC.  A great example of this is how cgminer has been modified and improved...there's cgminer for various OSes, a scrypt-only version, optimizations for various GPUs/pools, and even new algorithms...none of this would have happened if the community relied only on a single developer and closed-source code.

LTC:  LXrAe2E6cBsK52GvUsYraeXkc2s7Ti7R5X
BTC:  1FLTMqVjTZ5MTdCF4npNZGFMEUGyBV4zcj
chMiner
Full Member
***
Offline Offline

Activity: 154
Merit: 100



View Profile
March 01, 2014, 12:28:38 AM
 #12


....someday, i will public all source code.
thanks a lot.

Please today Jack and not someday ...  Grin

It would help you and us.

Thanks in advance.
andre1980
Sr. Member
****
Offline Offline

Activity: 436
Merit: 250


View Profile
March 02, 2014, 01:12:32 PM
 #13

Hi,

Was finally able to login and change password..
I now want to enable SSH, but unsure what to do..

No option enable listed..

These are my options:

" === IMPORTANT ============================
  Use 'passwd' to set your login password
  this will disable telnet and enable SSH
 ------------------------------------------


BusyBox v1.19.4 (2013-03-14 11:28:31 UTC) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
config dropbear
        option PasswordAuth 'on'
        option RootPasswordAuth 'on'
        option Port         '22'
#       option BannerFile   '/etc/banner'
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
- /etc/config/dropbear 1/5 20%"

This is the RC1 firmware, is the edit not needed? (Since it mentions password change will enable SSH?)
Will a FW upgrade overwrite this?

Besides that:

Has anyone found where you can disable the controller reboots?
Don't want anyone besides myself messing with settings..
maardein
Sr. Member
****
Offline Offline

Activity: 420
Merit: 250


View Profile
March 02, 2014, 01:16:59 PM
 #14

Hi,

I somehow are unable to connect via telnet after first try..
It just won't respond..

The weird thing is: SSH works somehow without enabling it.. I have no idea what the password is though.
Tried 123456, and the one i tried to set.. No joy.
Any way to reset the pass from SSH?

Thanks

No, there is no way to change the pass over SSH if you can not login. You should really try to get into failsafe mode. When SSH is enabled, telnet only works in failsafe mode. Did your led start flashing very fast when you tried to enter failsafe mode?

BTC: 1788UegKXGXXicfPcbZ1bmSUJ99ZWRCF7p
LTC: LZ2rCcoxK4X8wRRynqdxoimd4d3TDNk7Lk
PMP: PApSSdorQds5tQysymwDXPAN3viJLFTUs8
andre1980
Sr. Member
****
Offline Offline

Activity: 436
Merit: 250


View Profile
March 02, 2014, 01:38:01 PM
 #15

Hi,

I somehow are unable to connect via telnet after first try..
It just won't respond..

The weird thing is: SSH works somehow without enabling it.. I have no idea what the password is though.
Tried 123456, and the one i tried to set.. No joy.
Any way to reset the pass from SSH?

Thanks

No, there is no way to change the pass over SSH if you can not login. You should really try to get into failsafe mode. When SSH is enabled, telnet only works in failsafe mode. Did your led start flashing very fast when you tried to enter failsafe mode?

See above. No idea why i was locked out of telnet earlier, but now tried on 1 controller from my computer directly.
Now i got the correct telnet, etc.

Still unsure if it's safe to reboot.
maardein
Sr. Member
****
Offline Offline

Activity: 420
Merit: 250


View Profile
March 02, 2014, 04:00:07 PM
 #16

My config looks like this:

Code:
config dropbear
option enable 'on'
option PasswordAuth 'on'
option RootPasswordAuth 'on'
option Port         '22'
# option BannerFile   '/etc/banner'

You could add the 'option enable' line, but I don't think it is necessary.

BTC: 1788UegKXGXXicfPcbZ1bmSUJ99ZWRCF7p
LTC: LZ2rCcoxK4X8wRRynqdxoimd4d3TDNk7Lk
PMP: PApSSdorQds5tQysymwDXPAN3viJLFTUs8
andre1980
Sr. Member
****
Offline Offline

Activity: 436
Merit: 250


View Profile
March 02, 2014, 04:29:01 PM
 #17

My config looks like this:

Code:
config dropbear
option enable 'on'
option PasswordAuth 'on'
option RootPasswordAuth 'on'
option Port         '22'
# option BannerFile   '/etc/banner'

You could add the 'option enable' line, but I don't think it is necessary.

You're right, it worked! Tried on one controller first, and it still works and SSH as well.
I think you used the previous firmware?

Anyway, hopefully someone knows what options we could change to prevent resets, etc..
maardein
Sr. Member
****
Offline Offline

Activity: 420
Merit: 250


View Profile
March 02, 2014, 04:36:57 PM
 #18

My config looks like this:

Code:
config dropbear
option enable 'on'
option PasswordAuth 'on'
option RootPasswordAuth 'on'
option Port         '22'
# option BannerFile   '/etc/banner'

You could add the 'option enable' line, but I don't think it is necessary.

You're right, it worked! Tried on one controller first, and it still works and SSH as well.
I think you used the previous firmware?

Anyway, hopefully someone knows what options we could change to prevent resets, etc..

My firmware is the one it came with from lightningasic.

BTC: 1788UegKXGXXicfPcbZ1bmSUJ99ZWRCF7p
LTC: LZ2rCcoxK4X8wRRynqdxoimd4d3TDNk7Lk
PMP: PApSSdorQds5tQysymwDXPAN3viJLFTUs8
andre1980
Sr. Member
****
Offline Offline

Activity: 436
Merit: 250


View Profile
March 02, 2014, 05:23:14 PM
 #19

My config looks like this:

Code:
config dropbear
option enable 'on'
option PasswordAuth 'on'
option RootPasswordAuth 'on'
option Port         '22'
# option BannerFile   '/etc/banner'

You could add the 'option enable' line, but I don't think it is necessary.

You're right, it worked! Tried on one controller first, and it still works and SSH as well.
I think you used the previous firmware?

Anyway, hopefully someone knows what options we could change to prevent resets, etc..

My firmware is the one it came with from lightningasic.

I received RC1 from a tech, don't know what was on the units. Did notice a drop in hashspeed, but i didn't find a copy of the older FW elsewhere.
maardein
Sr. Member
****
Offline Offline

Activity: 420
Merit: 250


View Profile
March 03, 2014, 03:33:32 PM
 #20

My config looks like this:

Code:
config dropbear
option enable 'on'
option PasswordAuth 'on'
option RootPasswordAuth 'on'
option Port         '22'
# option BannerFile   '/etc/banner'

You could add the 'option enable' line, but I don't think it is necessary.

You're right, it worked! Tried on one controller first, and it still works and SSH as well.
I think you used the previous firmware?

Anyway, hopefully someone knows what options we could change to prevent resets, etc..

My firmware is the one it came with from lightningasic.

I received RC1 from a tech, don't know what was on the units. Did notice a drop in hashspeed, but i didn't find a copy of the older FW elsewhere.

That's a new update? Could you upload it somewhere? I'm interested Smiley

BTC: 1788UegKXGXXicfPcbZ1bmSUJ99ZWRCF7p
LTC: LZ2rCcoxK4X8wRRynqdxoimd4d3TDNk7Lk
PMP: PApSSdorQds5tQysymwDXPAN3viJLFTUs8
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!