Reply
Zettabyte
Tinwable
Posts: 644
Registered: ‎12-27-2009
0

Re: Nmap & telnet: firmware 2.2

wig_out,

 

Thanks.  As I said, this is not my fortay, but I was aware that squashfs wasn't writable & there was no way to access the startup.  I mainly was just trying to make anyone, such as yourself, who was better at this then myself, aware that there was a writable directory if it wasn't already know.

 

I appreciate the link to the playonhd site, I gave it a glance & try to look at it more when I have the time.  As for optware, the only reason that I did it was just to see if it could be done, once again this is something that I don't know a lot about, I'm really just trying to learn as I go, without breaking something,  but I do appreciate that your explaination.

Gigabyte
playdude
Posts: 149
Registered: ‎12-28-2009
0

Re: Nmap & telnet: firmware 2.2

Thank you daemontsai for "accidentally" allowing non password login. You're my hero :smileyhappy:.

 

Tinwable, that can be done. I can't pack a working firmware image for version 2.2 but since telnet login is possible, I can write a script that grab all the required components for a working optware system and hopefully bring all the features I added to 1.45 to 2.2.

 

Better get working now!

Zettabyte
Tinwable
Posts: 644
Registered: ‎12-27-2009
0

Re: Nmap & telnet: firmware 2.2

playdude,

 

Glad to see you back.  I hope that it's possible to get those features back, that would be great.  If you get something put together let me know and I'll try to get it up and running on my FAT+.

 

Don't you just love those little "accidents"! :smileywink:

Yottabyte
bodhi78
Posts: 1,037
Registered: ‎06-04-2009
0

Re: Nmap & telnet: firmware 2.2

 


playdude wrote:

Thank you daemontsai for "accidentally" allowing non password login. You're my hero :smileyhappy:.

 

Tinwable, that can be done. I can't pack a working firmware image for version 2.2 but since telnet login is possible, I can write a script that grab all the required components for a working optware system and hopefully bring all the features I added to 1.45 to 2.2.

 

Better get working now!


Good to see you back, playdude! and yes, a big thanks to that person too :smileyhappy:

 

-------------
Feedback! when asking for help, please remember to let others know whether the suggested solution has solved the problem or not.

Need FAT+/GoFlex TV help? see this thread: http://forums.seagate.com/t5/FreeAgent-Theater-and-GoFlexTV/FreeAgent-Theater-product-page-and-other-information/td-p/76254
Gigabyte
dm
Posts: 189
Registered: ‎08-18-2010
0

Re: Nmap & telnet: firmware 2.2

intersting reference material if anyone wants to compare devices

http://www.mips.com/everywhere/mips-based-products/

Byte
danyim
Posts: 13
Registered: ‎11-05-2010
0

Re: Nmap & telnet: firmware 2.2

I am in the process of writing and testing a telnet session with an expect script.. I'll post details soon.

Byte
danyim
Posts: 13
Registered: ‎11-05-2010
0

Re: Nmap & telnet: firmware 2.2

[ Edited ]

Run this from any *nix machine by saving the following into a file (we'll call it fatty in this post):

Save this into fatty
 
#!/usr/bin/expect
##########################################################################
# Written by danyim for the Seagate FreeAgent Theater+ Community Forums
# Resources:
##########################################################################
# Procedure to attempt a connection; Return 0 if OK, 1 otherwise
proc connect {usr} {
    expect {
        "Venus login:" { 
            send "$usr\r"
            expect {
                "#*" {
                    return 0
                }  
            }
        }
    }
    # Timed out
    return 1
}
############### CHANGE THESE VALUES WITH YOUR INFORMATION ################
# FAT+'s local LAN address
set host "1.2.3.4"
# Default port for telnet connections
set port 23
##########################################################################
# The username (default user is root for FAT+ v2.20)
set usr "root"
# The flash drive device name (via script arg)
set usb [lindex $argv 0]
# Check the arguments
if { $usb == ""  } {
     puts "Usage: fatty [USB device name (sda0, sda1, ...)]\n"
     exit 1
}
# Spawn a telnet process and attempt a connection
spawn telnet $host $port
# Call the connect procedure to see if the connection was successful
set fatty [connect $usr]
if { $fatty == 0 } {
    send "echo Performing rcS2 bind mount\r"
    expect "#"
    send "cp /etc/init.d/rcS2 /tmp/usbmounts/$usb/rcS2\r"
    expect "#"
    send "mount -o /tmp/usbmounts/$usb/rcS2 /etc/init.d/rcS2\r"
    expect "#"
    send "echo Executing the startup script...\r"
    send "/etc/init.d/rcS2\r"
    expect "#"
    send "exit\r"
    expect eof
    exit 0
}
puts "\nError connecting to the FAT+ device ($host).\nMake sure this is the right address.\n"
exit 1

Then enter this into the shell:
chmod 775 fatty
./fatty sda1
where sda1 is whatever the device name of your USB device is. (to do this, probe around via the ls /tmp/usbmounts -al command and find your thumb drive!)
I just loosely followed what wig_out has mentioned. At the moment, I don't think running this will really do anything except for rebooting the system, but I wanted to give you guys a working script that automates most of this. You can easily run ./fatty sda1 from any shell, and it will automatically mount/copy files/do whatever you want!
I hope this will help guide our project in the right direction.

 

Gigabyte
dm
Posts: 189
Registered: ‎08-18-2010
0

Re: Nmap & telnet: firmware 2.2

I was thinking of doing somting like that but with windows scripting.

Ie, make a small program that just has a list of common commands and let people send them at certain timeslike if it reboots..etc.

 

I found this script as a sample and use it for dmesg when it boots  for testing.

 

this was from another device actually but still works

 

echo off
echo Set objShell = WScript.CreateObject("WScript.Shell") > asusrescue.vbs
echo Set objExecObject = objShell.Exec("cmd /c ping -t -w 1 192.168.1.33") >> asusrescue.vbs
echo Wscript.Echo "Now, start your O!Play..." >> asusrescue.vbs
echo Do While Not objExecObject.StdOut.AtEndOfStream >> asusrescue.vbs
echo     strText = objExecObject.StdOut.ReadLine() >> asusrescue.vbs
echo     Wscript.Echo strText >> asusrescue.vbs
echo     If Instr(strText, "Reply") > 0 Then >> asusrescue.vbs
echo         Exit Do >> asusrescue.vbs
echo     End If >> asusrescue.vbs
echo Loop >> asusrescue.vbs
echo objShell.Run("telnet 192.168.1.33") >> asusrescue.vbs
echo Do Until Success = True >> asusrescue.vbs
echo     Success = objShell.AppActivate("telnet") >> asusrescue.vbs
echo Loop >> asusrescue.vbs
echo Wscript.Sleep 300 >> asusrescue.vbs
echo Success = objShell.AppActivate("telnet") >> asusrescue.vbs
echo objShell.SendKeys "root" >> asusrescue.vbs
echo objShell.SendKeys "{ENTER}" >> asusrescue.vbs
echo objShell.SendKeys "dmesg" >> asusrescue.vbs
echo objShell.SendKeys "{ENTER}" >> asusrescue.vbs
echo Wscript.Echo "Done... You can close this window." >> asusrescue.vbs
rem echo Wscript.Quit >> asusrescue.vbs

CALL CScript asusrescue.vbs
del asusrescue.vbs

 

 

 

Perhaps it would be good to start collecting command lists for various functions or cool things that people can do :smileyhappy:

 

 

Byte
danyim
Posts: 13
Registered: ‎11-05-2010
0

Re: Nmap & telnet: firmware 2.2

That vbscript seems interesting... I could definitely use its idea for listening to a ping packet to monitor if the device has been restarted--and then remount the custom root directory structure when triggered.

Kilobyte
capatty
Posts: 31
Registered: ‎08-10-2010
0

Re: Nmap & telnet: firmware 2.2

[ Edited ]

I've been busy with work lately and got some time yesterday/today to mess around.  Glad to see that someone is messing around with Expect/TCL, since it allows for accurate telnet scripting.  Ping would be useful but unnecessary in this case because you can just throw a CR or include another expect command to check for a hot connection.

 

Actually, the easiest solution for writing your own custom firmware might be to write an expect script that kills all proccesses, put a custom image onto a USB drive, erase the squashfs partition, then write the custom image back to flash.  It could probably work similar to this process for OpenWRT: http://www.cs.cmu.edu/~ecc/dockstar-howto.html