Giter Club home page Giter Club logo

Comments (6)

huanglitong123 avatar huanglitong123 commented on June 3, 2024

Can you tell me details? Change which file?

from stegoveritas.

bannsec avatar bannsec commented on June 3, 2024

So i just switched it over. It's the fact that I was utilizing the GNU file command, which won't be installed by default on Windows machines. I haven't had a chance to test this, so let me know how it works for you.

You'll need to pip install python-magic

The changes are in the "noFileCommand" branch for now (https://github.com/Owlz/stegoVeritas/tree/noFileCommand).

from stegoveritas.

huanglitong123 avatar huanglitong123 commented on June 3, 2024

windows7 x64 python 3.5.2

if I just install python-magic

result

F:\steganography\stegoVeritas-noFileCommand>python3 stegoveritas.py "miao~870F6C
667A6CDC0D1F533859E72C48E0.jpg"
Type: JPEG (ISO 10918)
Mode: RGB

Checking Meta Data

Exif Data

Image ResolutionUnit: Pixels/Inch
Image XResolution: 144
Image YResolution: 144
Image Artist: key:m1a0@888
Image YCbCrPositioning: Centered

Checking for trailing data
Running image filters
Attempting to brute force LSB items
Trying 0.0.0
Traceback (most recent call last):
File "stegoveritas.py", line 70, in
modules.image.run(fArray,args)
File "F:\steganography\stegoVeritas-noFileCommand\modules\image_init_.py",
line 98, in run
autoAnalysis(f,args)
File "F:\steganography\stegoVeritas-noFileCommand\modules\image_init_.py",
line 37, in autoAnalysis
modules.image.imageLSB.auto(f,args)
File "F:\steganography\stegoVeritas-noFileCommand\modules\image\imageLSB.py",
line 143, in auto
testOutput(o,args)
File "F:\steganography\stegoVeritas-noFileCommand\modules\image\imageLSB.py",
line 23, in testOutput
m = magic.from_buffer(b,mime=True)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35-32\lib\site-packag
es\python_magic-0.4.13-py3.5.egg\magic.py", line 142, in from_buffer
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35-32\lib\site-packag
es\python_magic-0.4.13-py3.5.egg\magic.py", line 118, in _get_magic_type
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35-32\lib\site-packag
es\python_magic-0.4.13-py3.5.egg\magic.py", line 67, in init
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35-32\lib\site-packag
es\python_magic-0.4.13-py3.5.egg\magic.py", line 259, in magic_load
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35-32\lib\site-packag
es\python_magic-0.4.13-py3.5.egg\magic.py", line 190, in errorcheck_negative_one

magic.MagicException: b'could not find any magic files!'

then I change the imageLSB.py file

changed code

def testOutput(b,args):
import magic
m = magic.Magic(magic_file="C:\GnuWin32\share\misc")
m2 = m.from_buffer(b,mime=True)
if m2 != 'application/octet-stream':
m2 = magic.from_buffer(b,mime=False)
print("Found something worth keeping!\n{0}".format(m))
# Save it to disk
with open(os.path.join(args.outDir,str(time.time())), "wb") as f:
f.write(b)

result

Traceback (most recent call last):
File "stegoveritas.py", line 70, in
modules.image.run(fArray,args)
File "F:\steganography\stegoVeritas-noFileCommand\modules\image_init_.py
line 98, in run
autoAnalysis(f,args)
File "F:\steganography\stegoVeritas-noFileCommand\modules\image_init_.py
line 37, in autoAnalysis
modules.image.imageLSB.auto(f,args)
File "F:\steganography\stegoVeritas-noFileCommand\modules\image\imageLSB.py
line 144, in auto
testOutput(o,args)
File "F:\steganography\stegoVeritas-noFileCommand\modules\image\imageLSB.py
line 24, in testOutput
m2 = m.from_buffer(b,mime=True)
TypeError: from_buffer() got an unexpected keyword argument 'mime'

**I guess that the magic.from_buffer have some problem, I know a little about magic.from_buffer,maybe you have some solutions **

from stegoveritas.

bannsec avatar bannsec commented on June 3, 2024

Hmm.. So looks like this library (and most others I've seen) relies on libmagic. That said, one thing you probably want to do is provide the fill magic file path instead of the directory:

 m = magic.Magic(magic_file="C:\GnuWin32\share\misc\magic")

Another issue I'm seeing on the windows side is getting the proper DLLs (and right architecture for them) in the correct places. Not sure what a good answer is for now as it seems the Windows solutions for libmagic aren't the greatest.

I'll keep this issue open as a reminder.

from stegoveritas.

bannsec avatar bannsec commented on June 3, 2024

I should say, my guess is that the DLLs could be packaged with python and a smart setup script created for them so that libmagic will work out of the box. However, that would involve updating their rep/creating my own fork of it, as well as shipping with DLLs. Not a horrible thing, but not really what one wants to do with python either.

from stegoveritas.

bannsec avatar bannsec commented on June 3, 2024

This issue ticket is from well before the refactor. Not really a thing anymore.

from stegoveritas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.