macsat.com OpenWrt and ASUS WL Forum
March 15, 2010, 03:08:24 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?
Login with username, password and session length
News: Back to macsat.com
 
   Home   Help Search Login Register  
Pages: 1 [2]   Go Down
  Print  
Author Topic: enable telnetd on unmodified firmware (temporary)  (Read 10365 times)
0 Members and 1 Guest are viewing this topic.
jimcpl
Jr. Member
**
Offline Offline

Posts: 75


View Profile
« Reply #15 on: August 09, 2009, 20:25:49 PM »

Hi,

Understanding the security risk mentioned above, I'm still curious if it's possible to get this (telnetd) working on my SMCWAPS-G?

I checked via ftp using 'nobody', and there is a telnetd in /sbin, linked to /bin/busybox, but I still cannot ftp put the updated passwd file into /var/config/passwd ("cannot create file").

Thanks!

Jim
Logged
jimcpl
Jr. Member
**
Offline Offline

Posts: 75


View Profile
« Reply #16 on: August 10, 2009, 02:33:04 AM »

Hi,

This is getting a bit frustrating Sad...

I figured out the password for "root", and I can now ftp into the SMCWAPS-G as "root".

But...

After ftp'ing as "root", when I do an "ls" it was showing no files.  "pwd" says I'm at "/"...

It took me awhile to figure out, but I think that this is because vsftpd.conf has:

chroot_local_user=YES

According to the vsftpd docs, that parameter causes the user to be chrooted to their home directory.  Then, in passwd, the home directory for "root" is "root", i.e., so when I ftp in as "root", I am chrooted to /root.  /root is empty, and since I'm chrooted there, basically, I can't "go" anywhere in the file system Sad...

So, at this point, I'm confused. 

Even if I wasn't having a problem in the part in the original post in this thread about overwriting the "passwd" file, since vsftpd.conf has that "chroot_local_user=YES" parameter set, even if I could ftp in as "root", I wouldn't be able see the dir where "passwd" is or "passwd" itself, so I don't understand how the original procedure was suppose to have worked?

Jim
Logged
jimcpl
Jr. Member
**
Offline Offline

Posts: 75


View Profile
« Reply #17 on: August 10, 2009, 04:35:30 AM »

Hi,

My SMCWAPS-G is at SMC FW R4.00c2_0130, and I was thinking that maybe the reason that those files are not writable is because of that, so I tried to downgrade to FW 20060313_SMC_WAPS-G_R400b5v4.BIN (downloaded from SMC).  I tried this via the Web admin, but I get a "Unallowable firmware upgrade".

Why is that?  Can I not downgrade the firmware to b5v4 anymore?

Again, both the current c2_0130 and the b5v4 that I have were downloaded from SMC.

Thanks,
Jim
Logged
schufti
Sr. Member
****
Offline Offline

Posts: 272



View Profile WWW
« Reply #18 on: August 10, 2009, 22:06:08 PM »

Hi Jim,

yes, downgrade via the GUI might be restricted. You may try to downgrade via the recovery loader.

But why don't you just use the frontdoor instead of trying to crawl through the backdoor?
Flashing upgrade files with lots of features is no more hazardous than updating original FW.
Just flash the c3 gui via rec.loader, then upgrade with the latest of my files.
If that fails, reflash with the orig SMC FW via rec.loader.

rgds,
schufti
Logged

I won't answer posts or PMs about repair/recovery after bad flash until proven that the wiki was read and followed!
find all my MGB100 files here, pass: mgb100
jimcpl
Jr. Member
**
Offline Offline

Posts: 75


View Profile
« Reply #19 on: August 10, 2009, 22:57:12 PM »

Hi Jim,

yes, downgrade via the GUI might be restricted. You may try to downgrade via the recovery loader.

But why don't you just use the frontdoor instead of trying to crawl through the backdoor?
Flashing upgrade files with lots of features is no more hazardous than updating original FW.
Just flash the c3 gui via rec.loader, then upgrade with the latest of my files.
If that fails, reflash with the orig SMC FW via rec.loader.

rgds,
schufti


Hi schufti,

To answer your question, I guess that I was hoping to take the least risky approach, to "get my feet wet".

Having said that, I think I understand what you're saying, about the backdoor, but I've been reading through the wiki, plus this forum for about a week, and I'm a little confused, which makes me even more wary about doing something like this.  I suppose that you've been working with these devices for awhile, so you're comfortable with doing this stuff, but as a relative newbie to this, it's a little different Sad...

But, if that telnet procedure at the beginning of this thread isn't going to be possible, then I guess I'm willing to try, but, before I do that I'd like to confirm some things.

1) "Recovery Loader":  Going through a lot of reading, I think that, by "recovery loader", you're referring to the procedure here:

http://www.macsat.com/macsat/component/option,com_openwiki/Itemid,66/id,recovery_from_bad_flash/

i.e.,

a) Connect a WinXP machine directly to the SMCWAPS-G via either a crossover cable or via a switch
b) Set PC IP address to 192.168.123.xxx (e.g., 192.168.123.50)
c) Put the SMCWAPS-G into recovery mode by power off, press and hold both buttons, and then power on
d) On PC, run command: TFTP -i 192.168.123.254 PUT c:\filename.BIN

Is that correct?

2) From this link:

http://www.macsat.com/macsat/component/option,com_openwiki/Itemid,66/id,rebranding_the_fw/

I think it says that a "complete" firmware has 5 sections, with each section having something like:

xxxxxx00: 4c4c 4d5f 5255 5330 3031 0000 0000 857e LLM_RUS001.....~
xxxxxx10: 5175 6565 6e00 0000 0000 0000 11e1 6bc7 Queen.........k.

So, if I use a hex editor, and look through a .BIN and find 5 such strings, that means that the .BIN contains a "complete" firmware.

Is that correct?

3) Re. use of "recovery loader":  Is it correct that given either a "complete" (i.e., 5 sections) firmware or a "not complete" firmware .BIN, the recovery loader procedure works in most situations?  What I mean by "most situations" is that, unlike the web upgrade, which apparently checks checksums and matches branding, that if I do a recovery loader procedure, whatever I send via TFTP will get flashed to the SMCWAPS-G firmware, regardless of the branding info or bad checksum in the .BIN?

Part of the reason for this particular question is that you suggested "flash the c3 gui via rec. loader", and I was looking at "uc3gui.bin", and the beginning looks like:

Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000000  40 6D 21 74 72 26 64 00 00 00 00 00 00 00 EC 0C  @m!tr&d.......ì.
00000010  40 6D 21 74 72 26 64 00 00 00 00 00 8B EE 6B C7  @m!tr&d.....‹îkÇ
00000020  00 00 3B 00 00 00 04 00 10 00 3B 00 04 BA 02 00  ..;.......;..º..
00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000040  42 48 01 01 50 00 05 01 00 00 3B 00 0B 00 3D 27  BH..P.....;...='
00000050  40 4D 21 54 2E 00 00 00 00 00 00 00 00 00 00 00  @M!T............
00000060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000070  60 00 00 00 1C 0C 00 00 B0 AD 02 00 80 B2 02 00  `.......°­..€²..
00000080  58 B5 02 00 48 B7 02 00 B4 B7 02 00 74 B8 02 00  Xµ..H·..´·..t¸..
00000090  B4 B8 02 00 0C B9 02 00 00 00 00 00 00 00 00 00  ´¸...¹..........
000000A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000B0  7D 00 FF FF 61 70 2E 68 74 6D 00 FF FF FF FF FF  }.ÿÿap.htm.ÿÿÿÿÿ

i.e., it's not (what I call) a "complete" .BIN and it doesn't have the branding string.

So, I'm assuming that even though that is the case, I can use the recovery load procedure (using TFTP) to just "push" the above .BIN file and update the SMCWAPS-G flash.

4) This question is re. your suggestion:  I'm understanding that you're saying to use the recovery loader/TFTP to update the SMCWAPS-G firmware from "uc3gui.zip" from your repository.  From looking at the uc3gui.bin, it looks like this contains a bunch of HTML pages, and, I guess replaces just the web gui of the SMCWAPS-G. 

Is that correct?

Then you suggest "upgrade with the latest of my files", but I'm not sure which is "the latest of my files"?
Which file are you referring to, and are you talking about from Rapidshare or from "http://schufti.macsat.com"?

Also, I'm curious, with what you're suggesting, why the two separate .BIN files, rather than what I call a "complete" .BIN with the 5 sections in it?

5) Finally, if I do the uc3gui and the other upgrade, what kind of functionality is added vs. the SMC firmware?  I'm not asking for a detailed list Smiley, but, in general?  Also, will I "lose" any functionality vs. the original SMC firmware?


Sorry for all of the questions Sad..  As I mentioned to Ernst in the other thread, I am kind of a little worried about bricking my SMCWAPS-G, as I do use it, and they're getting harder to find...

Later, and thanks!!

Jim
Logged
jimcpl
Jr. Member
**
Offline Offline

Posts: 75


View Profile
« Reply #20 on: August 11, 2009, 01:56:07 AM »

Hi,

My SMCWAPS-G is at SMC FW R4.00c2_0130, and I was thinking that maybe the reason that those files are not writable is because of that, so I tried to downgrade to FW 20060313_SMC_WAPS-G_R400b5v4.BIN (downloaded from SMC).  I tried this via the Web admin, but I get a "Unallowable firmware upgrade".

Why is that?  Can I not downgrade the firmware to b5v4 anymore?

Again, both the current c2_0130 and the b5v4 that I have were downloaded from SMC.

Thanks,
Jim

Hi,

BTW, I'm still curious about this "Unallowable firmware upgrade".  I don't understand why I'm getting it.  Both the firmware currently on the box (c2_0130) and the original firmware (b5v4, came with it installed) are from SMC, so branding shouldn't be an issue, right?  Also, I checked both .BINs, and they says the same thing.

So why would I be getting an "Unallowable firmware upgrade"?

Thanks,
Jim
Logged
jimcpl
Jr. Member
**
Offline Offline

Posts: 75


View Profile
« Reply #21 on: August 11, 2009, 03:26:00 AM »

Hi,

My SMCWAPS-G is at SMC FW R4.00c2_0130, and I was thinking that maybe the reason that those files are not writable is because of that, so I tried to downgrade to FW 20060313_SMC_WAPS-G_R400b5v4.BIN (downloaded from SMC).  I tried this via the Web admin, but I get a "Unallowable firmware upgrade".

Why is that?  Can I not downgrade the firmware to b5v4 anymore?

Again, both the current c2_0130 and the b5v4 that I have were downloaded from SMC.

Thanks,
Jim

Hi,

BTW, I'm still curious about this "Unallowable firmware upgrade".  I don't understand why I'm getting it.  Both the firmware currently on the box (c2_0130) and the original firmware (b5v4, came with it installed) are from SMC, so branding shouldn't be an issue, right?  Also, I checked both .BINs, and they says the same thing.

So why would I be getting an "Unallowable firmware upgrade"?

Thanks,
Jim

Hi,

Out of curiousity, I re-tried the web GUI firmware downgrade, but this time from another PC that was connected to the same switch that the SMCWAPS-G is connected to (earlier, I have been doing it from a PC in another room - which is also connected physically, but going through my main router and then to a hub, and then, finally, the switch that the SMCWAPS-G is physically connected to).

Guess what?

Yep, this time, the downgrade worked.

After checking whether or not the /etc/passwd still had only read permissions (it did Sad), I reflashed the SMCWAPS-G to c2_0130, which again worked.

So, basically, I'm back to where I started, at SMC's 4.00c2_0130, but now I know that if I do a flash, I'm going to have to do it from that PC that's on the same physical switch as the SMCWAPS-G itself.

Having said that, I'm not 100% sure why doing it from my main PC didn't work.  I'm assuming that maybe it was because of some timing differences because of the number of routers/switches/hubs that it went through.

Whew Smiley!!

Jim
Logged
jimcpl
Jr. Member
**
Offline Offline

Posts: 75


View Profile
« Reply #22 on: August 11, 2009, 05:53:21 AM »

Scufti,

I've been doing more reading (and re-reading), and I'm guessing that what you were suggesting was:

1) Use the *recovery loader procedure* to flash from the file at:

http://schufti.macsat.com/?download=uc3gui.zip

2) Then, reboot the SMCWAPS-G (I'm guessing that I have to reboot the SMCWAPS-G after the recovery load), and then use the *web GUI upload* to upload to the SMCWAPS-G using the file at:

http://schufti.macsat.com/C3/?download=MGB100_v4c3sq_080926.zip

3) And, if #2 fails, I can use the web GUI upload to flash using the SMC "c2_0130" firmware to get back to original.

Is that right?


From what I tell (reading and also looking at those files in #1 and #2 using a hex editor), both the files in #1 and #2 are not "complete" firmwares, but are kind of "patches", with the file in #1 being a patch for the web GUI, and the file in #2 being a patch for I don't know what.

Since the files in #1 and #2 are "patches", they don't overwrite the entire firmware, and, in particular, don't overwrite the branding info in the firmware, and because of that, if need be, I can flash using the original SMC "c2_0130" .BIN file afterwards, and that would take me back to the SMC c2_0130.

Is that correct?

Pls advise, and if everything that I said above is accurate, I'll give it a try.

Thanks,
Jim
Logged
jimcpl
Jr. Member
**
Offline Offline

Posts: 75


View Profile
« Reply #23 on: August 11, 2009, 20:33:33 PM »

Scufti,

I've been doing more reading (and re-reading), and I'm guessing that what you were suggesting was:

1) Use the *recovery loader procedure* to flash from the file at:

http://schufti.macsat.com/?download=uc3gui.zip

2) Then, reboot the SMCWAPS-G (I'm guessing that I have to reboot the SMCWAPS-G after the recovery load), and then use the *web GUI upload* to upload to the SMCWAPS-G using the file at:

http://schufti.macsat.com/C3/?download=MGB100_v4c3sq_080926.zip

3) And, if #2 fails, I can use the web GUI upload to flash using the SMC "c2_0130" firmware to get back to original.

Is that right?


From what I tell (reading and also looking at those files in #1 and #2 using a hex editor), both the files in #1 and #2 are not "complete" firmwares, but are kind of "patches", with the file in #1 being a patch for the web GUI, and the file in #2 being a patch for I don't know what.

Since the files in #1 and #2 are "patches", they don't overwrite the entire firmware, and, in particular, don't overwrite the branding info in the firmware, and because of that, if need be, I can flash using the original SMC "c2_0130" .BIN file afterwards, and that would take me back to the SMC c2_0130.

Is that correct?

Pls advise, and if everything that I said above is accurate, I'll give it a try.

Thanks,
Jim

schufti,

I think I just did it (upgrade).  This is probably getting a lot off-topic, so I'll post a new thread with the details.

Thanks,
Jim
Logged
schufti
Sr. Member
****
Offline Offline

Posts: 272



View Profile WWW
« Reply #24 on: August 11, 2009, 20:55:47 PM »

Hi Jim,

so there come some trickling answers to the stream of questions ... in no special order...

o) yes, this is the rec.loader I mentioned
o) yes, the rec.loader accepts more than the GUI, but still, not everything (e.g. cross-branding).
o) @m!tr&d is a "special branding"
o) yes, c3gui.bin just replaces the GUI part in flash to support new functions in fw
o) orig. FW doesn't generally have to have 5 sections. Some versions skipped the bootloader
o) if something fails, most probably the rec.loader will get you back on track (not GUI)
o) yes, generally all these files are only "patches" with info on destination and length in the header
o) stable samba, printserver, auto swap, nfs, ntfs, telnet, autostart script, http-ftp-torrent downloads, ....
o) GPL upgrade files have different (unknown) format and are only accepted via GUI


allways make sure that the connection during flash doesn't break! The fw allways gets directly flashed, no buffering, no checksumming (the same for official and unofficial fw!). Therefor any playing with up/down grades has same risk.

schufti

p.s.: yes, that's getting semi-offtopic; but maybe helps the future unsuccessful wanabe telnet user
« Last Edit: August 11, 2009, 20:59:09 PM by schufti » Logged

I won't answer posts or PMs about repair/recovery after bad flash until proven that the wiki was read and followed!
find all my MGB100 files here, pass: mgb100
jimcpl
Jr. Member
**
Offline Offline

Posts: 75


View Profile
« Reply #25 on: August 11, 2009, 21:32:56 PM »

schufti,

Thanks for the answers!!

Jim
Logged
Pages: 1 [2]   Go Up
  Print  
 
Jump to:  

English Steel 1.6 © Saxon North Technologies
Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.084 seconds with 24 queries.