Ask coding questions

← Back to all posts
Is there a way to become root on here?
Elitemagikarp (9)

Title

Comments
hotnewtop
timmy_i_chen (1167)

You mean, on a repl? You should totally try to get root access and let us know if/when you do ;)

Dunce (58)

I know this is an ancient post. But the solution from the deleted user actually works, I tried it.

mavaddat (0)

@Dunce "Works" to do what? It downloads opera browser, extracts it, and moves the binary to opera. At no point does this script even request or acquire root privileges. Nothing that it does requires root privileges either. You can do all of that from bash without issues.

Dunce (58)

@mavaddat Idk, I just needed to get root privileges for something I was working on, and I tried this, and it seemed to work.

mavaddat (0)

@Dunce Do you mean that the subprocess.call method is able to acquire root?

Dunce (58)

@mavaddat Maybe, I don't know what I'm talking about. If you really want to know you can run the code yourself :)

[deleted]

import subprocess
#subprocess.call(["wget","https://dllb2.pling.com/api/files/download/id/1571585428/s/78ac70dac7ed48404c39c5a833cf8672496f48b73ffa31d460eddfd604df420d343e803aae8cd76485bb6ee8d478947bfa3c1ff46514c0d187b65abd8414d1cd7/t/1571597207/c/cbcc435f77f10b067333fe7e759a3d6c613fac4026eaf8011998420 2cabe843c056b149280f0244e73e55efa49e2cb1e75a45ad8d7b10b2cb07b692971caf5c1/lt/download/Firefox-x8f6_64.AppImage"])
#subprocess.call(["chmod","a+x","Firefox-x86_64.AppImage"])
#subprocess.call(["./Firefox-x86_64.AppImage"])
#subprocess.call(["uname","-a"])
subprocess.call(["rm","-rf","opera-11.64-1403.x86_64.linux"])
subprocess.call(["wget","http://get.opera.com/pub/opera/linux/1164/opera-11.64-1403.x86_64.linux.tar.bz2"])
subprocess.call(["tar","-xvjf","opera-11.64-1403.x86_64.linux.tar.bz2"])
subprocess.call(["rm","-rf","opera-11.64-1403.x86_64.linux.tar.bz2"])
subprocess.call(["rm","-rf","opera"])
subprocess.call(["mv","opera-11.64-1403.x86_64.linux","opera"])
subprocess.call(["rm","-rf","opera-11.64-1403.x86_64.linux"])
#subprocess.call(["install-pkg","firefox"])
subprocess.call(["bash"])
#subprocess.call(["./opera/opera","google.com"])
input()

[deleted]

Pretty sure that'd be a security flaw if you could, so presumably you can't - unless you find a way they didn't discover, of course.

paulfears (95)

the closest Ive come is
os.popen("su")
os.popen("1234")