Murga-Projects Forums
Praise for murgalua - Printable Version

+- Murga-Projects Forums (http://www.murga-projects.com/forum)
+-- Forum: Project Forums (/forumdisplay.php?fid=1)
+--- Forum: MurgaLua - General (/forumdisplay.php?fid=2)
+--- Thread: Praise for murgalua (/showthread.php?tid=300)


Praise for murgalua - asafp - 03-07-2008 01:05 PM

I've only been using lua/murgalua a very short time. I've found it to be very easy to learn and there are great features other languages don't have.

The flexible way of expressing string literals is fantastic with single or double quotes and the bracket notation. The string functions and builtin pattern matching is both simple and extremely powerful. Pattern matching is just there for me, I don't have to deal with pain-in-the-ass stuff like creating a regular expression object and I don't have a completely different set of commands for regular expressions and simple character matching and I don't need external libraries. Sockets is builtin to murgalua and fits in perfectly and doesn't seem like a clunky add-on like so many things in python do.

My main gripe is that on some linux systems, murgalua just isn't available to me and I don't have authority to install it. I miss it dearly. I hope someday murgalua will be like grep as a standard part of linux.

The Lua doc is also very good. I have the hardcopy of both the Lua Reference and the Programming in Lua books. I can usually find exactly what I need in there quickly.


RE: Praise for murgalua - mikshaw - 03-07-2008 01:21 PM

Quote:
on some linux systems, murgalua just isn't available to me and I don't have authority to install it

Sorry, but that's not true. Regardless of what permissions you have in the file system, as long as you have a writable home directory you can install whatever software you want. You can create a $HOME/bin directory and add that to your PATH variable. You can put executables here. You can modify your LD_LIBRARY_PATH variable to include $HOME/lib for libraries that can't be installed into /lib, /usr/lib, or /usr/local/lib.

When installing from source with the typical "configure/make/make install" techique you can configure --prefix=$HOME or edit the config script to have the application built to install entirely within your home directory.


RE: Praise for murgalua - asafp - 03-07-2008 02:33 PM

I should rephrase that. I have authority to install things into my own directory. I don't have authority to execute a compiled module that is not in the standard /usr/bin or /usr/lib/bin. So, in other words, I can install it, but not execute it.

This type of situation is common with the limited shell access offered by many web hosting companies.


RE: Praise for murgalua - mikshaw - 03-08-2008 12:10 AM

oh....I see your situation.
I'd really hate to be using a system like that...too much of my computing depends on custom scripts.


RE: Praise for murgalua - Juergen - 03-08-2008 04:37 AM

asafp Wrote:
I should rephrase that. I have authority to install things into my own directory. I don't have authority to execute a compiled module that is not in the standard /usr/bin or /usr/lib/bin. So, in other words, I can install it, but not execute it.

This type of situation is common with the limited shell access offered by many web hosting companies.


Normally, such an account doesn't make sense. If it is that limited, ftp only access would make more sense (from an administrator point of view).

If a (stupid) administrator thinks he can limit access to the system with a normal restricted shell, he is totally wrong. Normally it is nearly impossible to completely lock a system with a r-shell. There are so many possibilities to circumvent it, so that most admins (those who try are normally not the brightest/experienced) don't even bother to try (except they want to adress novice users). The only way to lock a system completely is to use SELinux and co. (which is a pain to set up).

Have you tried to put the binary in your homedir, set the permissions and use "env ~/murgaLua" for example?

I guess there are also perl,python,awk, ..... interpreters in /usr/bin? This way there should be no problem to call murgaLua or a more useful shell.

Juergen

P.S.: It is of course a completely different question if it is a good idea to circumvent such restrictions (The owner/administrator of the system could be offended).


RE: Praise for murgalua - asafp - 03-11-2008 10:38 AM

Quote:
Have you tried to put the binary in your homedir, set the permissions and use "env ~/murgaLua" for example?


I tried that and get "permission denied". I also tried putting murgalua into /tmp directory which has execute permission and same message.


RE: Praise for murgalua - Juergen - 03-11-2008 09:08 PM

asafp Wrote:

Quote:
Have you tried to put the binary in your homedir, set the permissions and use "env ~/murgaLua" for example?


I tried that and get "permission denied". I also tried putting murgalua into /tmp directory which has execute permission and same message.


The standard UNIX/POSIX file permission don't allow to restrict execution permissions to directories. The x you see in the directory permissions has a different meaning. It means that you can list the directory contents. If someone wants to limit execution then this could be done with a mount option.

What are the permissions of the binary? (Did you do chmod 700 murgaLua ?)
Where does the permission denied come from? (What was the exact error message?)

If env doesn't work, then there might be find, xargs, awk, gawk, perl, python, tclsh, wish, rx, rz, ed, vi, defective shell scripts, ....

Juergen


RE: Praise for murgalua - asafp - 03-13-2008 10:28 AM

Tried

awk '{system("./murgaLua")}'

and I get the simple message

./murgaLua: permission denied

The same message no matter how I try to invoke any binary executable file.


RE: Praise for murgalua - asafp - 03-13-2008 10:40 AM

Permission for murgaLua is 755, btw. I checked that.


RE: Praise for murgalua - asafp - 03-13-2008 10:46 AM

When executing with env command, the error message is a little different. It refers to the directory.

env ~ ./murgaLua

env: /mnt/b02add6f/www: Permission denied


RE: Praise for murgalua - Juergen - 03-14-2008 01:17 AM

asafp Wrote:
When executing with env command, the error message is a little different. It refers to the directory.

env ~ ./murgaLua

env: /mnt/b02add6f/www: Permission denied


That is what you should expect: "env ~ ./murgaLua" expands to "env /mnt/b02add6f/www ./murgaLua". So you are telling env to exec your home directory with the additional parameter "./murgaLua" which is clearly not supposed to work. You should have typed "env ~/murgaLua" but this may not work if /mnt/b02add6f" is mounted with the noexec option. You can check this with "env /bin/mount" or "cat /proc/$$/mounts". If this is the case then it will be not "that easy" to circumvent, and might be a little bit to intrusive (to start with more aggressive methods). In this case it would be a better idea to switch to another provider which has a more liberal setup.

If your home directory is mounted with the noexec option there is one thing that could (temporarily) work (it is fixed with kernels >=2.6.24 and should also be fixed with security backports for older kernels): You should get a stock lua binary or unpack murgaLua (upx -d) and then copy it in your homedir. Then you can try to invoke it with "env /lib/ld-linux.so.2 ~/murgaLua" or with awk,.... (but always through /lib/ld-linux.so.2). But as I said, it is most likely that it won't work, if the kernel is up to date.

Juergen


RE: Praise for murgalua - asafp - 03-14-2008 03:01 AM

env ~/murgaLua
env: /mnt/b02add6f/www/murgaLua: Permission denied

env /bin/mount
env: /bin/mount: No such file or directory

cat /proc/$$/mounts
cat: /proc/30800/mounts: No such file or directory

env /lib/ld-linux.so.2 ~/murgaLua
env: /lib/ld-linux.so.2: No such file or directory

No luck. In the past when I've asked why there is no gcc compiler or why I can't install software or execute programs, the answer is always that some people have abused the privilege. I've never been able to get a specific answer as to what the abuse was. I suspect they just want to discourage you from using cpu cycles and bandwidth unless you want to upgrade to one of their more expensive deluxe hosting packages.

In my case, I just end up burning cpu cycles and bandwidth with awk or python instead of murgaLua.


RE: Praise for murgalua - Juergen - 03-14-2008 03:52 AM

asafp Wrote:
env ~/murgaLua
env: /mnt/b02add6f/www/murgaLua: Permission denied

Most likely mounted with noexec.

Quote:
env /bin/mount
env: /bin/mount: No such file or directory

could be also /sbin/mount or you are in a special environment, where no mount exists.

Quote:
cat /proc/$$/mounts
cat: /proc/30800/mounts: No such file or directory

does /proc exist?

Quote:
env /lib/ld-linux.so.2 ~/murgaLua
env: /lib/ld-linux.so.2: No such file or directory

is this a Linux system after all? (and not a Slowaris or HP-SUX or something else?) what does uname -a say? (or env /bin/uname -a)

Quote:
No luck. In the past when I've asked why there is no gcc compiler or why I can't install software or execute programs, the answer is always that some people have abused the privilege. I've never been able to get a specific answer as to what the abuse was. I suspect they just want to discourage you from using cpu cycles and bandwidth unless you want to upgrade to one of their more expensive deluxe hosting packages.

If you can run binaries, then you can install nearly everything. It would be possible to install something like OpenOffice and run it remote or install a file sharing client, organizing a botnet, sending out spam, ... , jeopardizing system integrity and doing all sorts of nasty things.
And traffic accounting and bandwidth limiting could also be bypassed.

Quote:
In my case, I just end up burning cpu cycles and bandwidth with awk or python instead of murgaLua.

Python is not that bad. And it would be a lot better, if it wouldn't use the indentation nonsense ;-)

Juergen


RE: Praise for murgalua - asafp - 03-14-2008 05:44 AM

You are right. It's freebsd. I found that out by running python. (The operating system displays when you run python in interactive mode.)

So, there is no /proc and no uname command.

I have encountered the same issue on systems that I know are debian linux, so I'll try your suggestions there when the situation arises in the future.

Thanks for your help.

p.s. yes, the python indention is a royal pain. I thought it was kind of cool when I was first learning python, but it gets in the way when you are trying to do something quick and copying and pasting and that kind of thing.