File: elevated_client.py

package info (click to toggle)
pyro5 5.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,124 kB
  • sloc: python: 14,328; makefile: 161; sh: 66; javascript: 62
file content (15 lines) | stat: -rw-r--r-- 535 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import Pyro5.api


uri = input("Enter the uri of the dmesg server: ")
dmesg = Pyro5.api.Proxy(uri)
try:
    print("Last few lines of the dmesg kernel buffer:\n")
    lines = dmesg.dmesg()
    print("\n".join(lines))
    print("\nNormally you can't read this info from a non-root user. "
          "But the server is running as root and is able to access it for you.")
    print("TIP: now kill the server if you no longer need it!")
except Exception as x:
    print("ERROR:", x)
    print("Is the server running with root privileges?")