Tortax has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks

I got myself locked-out the webportal of an old IO/device by reverting to a older backup. The device runs a linux os, and it mainly works with some perl scripts and a Apache web-server for the html GUI.

I can still login as a plain user, but I can not make any changes. So it is ready for bin if I can not regain access.

Did some poking around and I found my user credentials file inside but it is a encrypted/compiled .pl file starting with "use Filter::decrypt ;" Tried basic decompile commands but it won't work.

Anyone want to give it a try file.pl?
Or do you have any advice on what I could try?

Replies are listed 'Best First'.
Re: Regain access to old IO device
by Anonymous Monk on Jan 08, 2023 at 21:27 UTC
Re: Regain access to old IO device
by bliako (Abbot) on Jan 11, 2023 at 10:48 UTC

    in the meantime just boot the device from somewhere you do have root access, say a livecd, mount the disk and erase root's password hash in the (shadow) password file.

      With access to the bootloader, you probably don't even need a second boot medium. Just passing init=/bin/sh as extra kernel parameter should give you a root shell with / mounted ro, and not much else. mount -o remount,rw / makes / writable. Then do whatever you like (probably mount /proc and /sys). Unmount everything you mounted. After that, there are two ways to cleanly exit: mount -o remount,ro / followed by exec /sbin/init just boots into the regular init. Alternatively, sync once or twice, then reboot the hard way (Ctrl-Alt-Del or reset button or power cycle).

      BTW: Because messing with the bootloader is so easy, paranoid people lock down the bootloader and prevent physical access to the computer.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re: Regain access to old IO device
by Anonymous Monk on Jan 08, 2023 at 21:51 UTC
    search that machine for a file decrypt.xs and post it here
      I could only find "Filter/decrypt.pm" and "B/Deparse.pm"
      The perl version is 5.10
      Can it have a different name, what directory should it be in ?