su

How do you start Python Paramiko SFTP with sudo?

眉间皱痕 提交于 2019-12-06 02:21:18
Using the standard client.open_sftp() handle gives me SFTP controls but without sudo/root permissions, any sort of /etc/** files can't be edited. I have a user that has passwordless sudo access, I figured I could maybe start off with sudo su and then invoke SFTP but that did not seem to be the case. t = paramiko.Transport(('192.168.56.102', 22)) t.connect(username='vagrant', password='vagrant') chan = t.open_session() chan.get_pty() chan.invoke_subsystem('sftp') chan.exec_command('sudo su') sftp = paramiko.SFTPClient.from_transport(t) .. the error paramiko.ssh_exception.SSHException: Channel

Android : programmatically copying apk to /system/app

 ̄綄美尐妖づ 提交于 2019-12-05 23:50:26
问题 I am trying to install a system app from my java code, and so far, I haven't had any success. Following is what I have done so far: My device is rooted. My "installer" app is installed as a system app. (copied it manually to /system/app) I have signed the installer apk with platform key, and I have android:sharedUserId="android.uid.system" in the Manifest. I have been trying (and trying, and then some more) for Runtime.getRuntime.exec("su") . I intend to mount the system partition as rw , do

GDB problems inside docker

爱⌒轻易说出口 提交于 2019-12-05 22:16:50
With docker version Docker version 1.1.0, build 79812e3 on Ubuntu 13.04, and using the docker container created by: # docker build -t gdb_problem_testing - < THIS_FILE FROM ubuntu RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list RUN apt-get update RUN apt-get install -y build-essential gdb Doing this: user@host $ sudo docker run --rm -it --user=root gdb_problem_testing su root -c bash root@690396061e81:/# cat <<EOF > test.c && gcc -ggdb test.c -o test && gdb -ex run test > #include <stdio.h> > > int main(int argc, char **argv) { > printf("Hello\n!")

msysGit sudo-like command

老子叫甜甜 提交于 2019-12-05 05:41:19
If we open msysgit as administrator, we can use it as if we were root. However, it is often easier to open without administrator privileges. For example, for administrator privileges, you often have to go to Windows Explorer, the Start menu/screen, etc., and you can't do this from the taskbar. Sometimes, I'm too lazy to do all this, but I want to gain administrator privileges while in Bash. Is there a sudo - or su -like command or script, etc., for Git Bash? Going into cmd.exe , PowerShell , etc., then doing something like runas would work, if there's nothing else. you can't do it from the

Root detection methodology in android which cannot be bypassed

橙三吉。 提交于 2019-12-05 03:08:06
问题 I know that running an app which possess sensitive information on a rooted device is not secure at all. So developers usually do root detection in such cases and if the device is found rooted,then that app won't get installed. everything is ok. The major techniques used by developers in root detection are checking for the superuser.apk file,check for chainfire,busybox,executing su command,etc. But an attacker can simply bypass these checks by several means like renaming the superuser.apk to

Mounting afp as different user for php access

邮差的信 提交于 2019-12-04 18:55:08
I've mounted an afp directory, afp://ServerName/Foo/, with "Finder->Go->Connect to Server" to /Volumes/Foo, now I'm trying to access it with: opendir("/Volumes/Foo/dirname/"); However, I get an Warning: opendir(/Volumes/Foo/dirname/) [function.opendir]: failed to open dir: Permission denied in... mount in terminal gives me: afp_1VqvPY000e413wKcJE13gANY-7.2d000004 on /Volumes/Foo (afpfs, nodev, nosuid, mounted by daniel) So I need to mount the folder as _www, or somehow allow _www to use my mount. How can I do either one of these? I'm guessing I want to possibly su to _www or something, but I

Android: Screencap to bytes directly - Skip saving to file

旧时模样 提交于 2019-12-04 15:51:50
I use the following code to take screenshot on a rooted device: sh = Runtime.getRuntime().exec("su", null,null); os = sh.getOutputStream(); os.write(("/system/bin/screencap -p " + "/sdcard/img.jpg" + "\n").getBytes("ASCII")); os.flush(); os.close(); sh.waitFor(); myBitmap = BitmapFactory.decodeFile("/sdcard/img.jpg"); As i want to take screenshots frequently, I don't want to first save it to the file and then read the bytes. Is there a better way to get the screenshot bitmap directly? I just wan't to eliminate this unnecessary delay. Thanks a lot! Update: The screencap.cpp code can be viewed

Why fork bomb did not crash android?

风流意气都作罢 提交于 2019-12-04 07:37:39
This is the simplest fork bomb :() { :|: & }; : I executed it on many linux distros and all of them crashed. But when I executed this in an android terminal there was no effect even after granting Super user permissions. Any Explanations why it did not crash the android system? In a word: ulimit . the linux kernel allows a limit on the number of child processes, this can be tweaked using the ulimit() system call or the ulimit shell builtin. eg: ulimit -u 5 来源: https://stackoverflow.com/questions/27466905/why-fork-bomb-did-not-crash-android

JSCH sudo su command “tty” error

只愿长相守 提交于 2019-12-04 02:59:18
问题 Java - Jsch sudo command. I am using Jsch and my task is to login to server and run command as following sudo su - bumboo Using following code i am successfully able to connect but when i try to run command it gives me error sudo: sorry, you must have a tty to run sudo Following is my code public static Channel sudoBamboo(Session session, String sudo_pass) throws Exception { ChannelExec channel = (ChannelExec) session.openChannel("exec"); //SUDO to bamboo user String command = "sudo su -

What's the difference between `sudo -i -u user` and `sudo su - user`? [closed]

白昼怎懂夜的黑 提交于 2019-12-03 16:58:56
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 months ago . Both commands: sudo -i -u username sudo su - username Will log me in as username if I enter my password. Is there actually any difference between these commands? 回答1: The su command stands for "substitute user", and allows you to become different user(super user). sudo su changes the current user to root but