Coder Social home page Coder Social logo

zsteg's Introduction

zsteg

Description

detect stegano-hidden data in PNG & BMP

Installation

gem install zsteg

Detects:

Usage

# zsteg -h

Usage: zsteg [options] filename.png [param_string]

    -a, --all                        try all known methods
    -E, --extract NAME               extract specified payload, NAME is like '1b,rgb,lsb'

Iteration/extraction params:
    -o, --order X                    pixel iteration order (default: 'auto')
                                     valid values: ALL,xy,yx,XY,YX,xY,Xy,bY,...
    -c, --channels X                 channels (R/G/B/A) or any combination, comma separated
                                     valid values: r,g,b,a,rg,bgr,rgba,r3g2b3,...
    -b, --bits N                     number of bits, single int value or '1,3,5' or range '1-8'
                                     advanced: specify individual bits like '00001110' or '0x88'
        --lsb                        least significant bit comes first
        --msb                        most significant bit comes first
    -P, --prime                      analyze/extract only prime bytes/pixels
        --shift N                    prepend N zero bits
        --step N                     step
        --invert                     invert bits (XOR 0xff)
        --pixel-align                pixel-align hidden data

Analysis params:
    -l, --limit N                    limit bytes checked, 0 = no limit (default: 256)

        --[no-]file                  use 'file' command to detect data type (default: YES)
        --no-strings                 disable ASCII strings finding (default: enabled)
    -s, --strings X                  ASCII strings find mode: first, all, longest, none
                                     (default: first)
    -n, --min-str-len X              minimum string length (default: 8)

    -v, --verbose                    Run verbosely (can be used multiple times)
    -q, --quiet                      Silent any warnings (can be used multiple times)
    -C, --[no-]color                 Force (or disable) color output (default: auto)

PARAMS SHORTCUT
	zsteg fname.png 2b,b,lsb,xy  ==>  --bits 2 --channel b --lsb --order xy

Examples

Simple LSB

# zsteg flower_rgb3.png

imagedata           .. file: 370 XA sysV pure executable not stripped - version 768
b3,rgb,lsb,xy       .. text: "SuperSecretMessage"

Multi-result file

# zsteg cats.png

meta F              .. ["Z" repeated 14999985 times]
meta C              .. text: "Fourth and last cat is Luke"
meta A              .. [same as "meta F"]
meta date:create    .. text: "2012-03-15T23:32:46+07:00"
meta date:modify    .. text: "2012-03-15T23:32:14+07:00"
imagedata           .. file: 68K BCS executable
b1,r,lsb,xy         .. text: "Second cat is Marussia"
b1,g,lsb,xy         .. text: "Good, but look a bit deeper..."
b1,bgr,lsb,xy       .. text: "MF_WIhf>"
b2,g,lsb,xy         .. text: "VHello, third kitten is Bessy"

wbStego even distributed

# zsteg wbstego/wbsteg_noenc_even.bmp 1b,lsb,bY -v

b1,lsb,bY           .. <wbStego size=22, data="xtSuperSecretMessage\n", even=true, mix=true, controlbyte="t">
    00000000: 51 00 00 16 00 00 74 0d  b5 78 1e a1 39 74 e8 38  |Q.....t..x..9t.8|
    00000010: 53 c6 56 94 75 d1 a5 70  84 c8 27 65 fe 08 72 35  |S.V.u..p..'e..r5|
    00000020: 1f 3e 53 5d a7 65 8b 6e  3b 63 6b 1d bf 72 ee 27  |.>S].e.n;ck..r.'|
    00000030: 65 8d ee 82 74 da 8d 4d  b3 8a 06 65 7e f8 73 9c  |e...t..M...e~.s.|
    00000040: 36 0c 73 aa bd 61 67 29  37 67 5f 0b 06 65 1f a4  |6.s..ag)7g_..e..|
    00000050: 0a a1 f8 35                                       |...5            |

wbStego encrypted

# zsteg wbstego/wbsteg_blowfish_pass_1.bmp 1b,lsb,bY -v

b1,lsb,bY           .. <wbStego size=26, data="\rC\xF5\xBF#\xFF[6\e\xB3"..., even=false, hdr="\x01", enc="Blowfish">
    00000000: 1a 00 00 00 ff 01 01 0d  43 f5 bf 23 ff 5b 36 1b  |........C..#.[6.|
    00000010: b3 17 42 4a 3f ba eb c7  ee 9c d7 7a 2b           |..BJ?......z+   |

zlib

# zsteg ndh2k12_sp113.bmp -b 1 -o yx -v

b1,rgb,lsb,yx       .. zlib: data="%PDF-1.4\n%\xC3\xA4\xC3\xBC\xC3\xB6\xC3\x9F\n2 0 obj\n<</Length 3 0 R/Filter/FlateDecode>>\nstream\nx\x9C\x8DT\xC9n\xDB@\f\xBD\xCFW\xF0\x1C \x13\x92\xB3\x03\x86\x80\xC8K\xD1\xDE\\\b\xE8\xA1...", offset=4, size=186
    00000000: 00 02 eb 9b 78 9c d4 b9  65 54 24 cc 92 36 58 b8  |....x...eT$..6X.|
    00000010: d3 68 e3 ee ee 4e e3 ee  ee 0e 85 bb 3b dd 68 23  |.h...N......;.h#|
    00000020: 8d bb bb bb 3b 8d bb bb  3b 34 ee 6e 1f ef 7b ef  |....;...;4.n..{.|
    00000030: 9d 3b b3 e7 cc 9e d9 3d  df 9e dd cd 8a 1f 99 19  |.;.....=........|
    00000040: 99 55 11 99 4f 58 25 99  82 88 18 1d 13 3d 2b 2c  |.U..OX%......=+,|
    00000050: 59 6f 7e 6f 7b 6f 63 6f  16 2c 33 21 23 a1 9d 91  |Yo~o{oco.,3!#...|
    00000060: 25 2c 2f 2f 83 0c d0 d6  cc d9 9c 90 e5 73 46 89  |%,//.........sF.|
    00000070: 41 cc c2 da 19 e8 c8 20  66 6d e8 0c 14 01 1a db  |A...... fm......|
    00000080: 99 00 f9 f8 60 9d 9c 1d  81 86 36 b0 ee e9 bf 54  |....`.....6....T|
    00000090: 86 6d 57 05 e0 3b 26 d5  2f 71 09 51 63 eb c0 82  |.mW..;&./q.Qc...|
    000000a0: bf 0f 49 4f 6f e8 40 ff  c9 f9 43 25 1d 9e 6b 1b  |[email protected]%..k.|
    000000b0: a3 73 fd 42 c4 a6 65 3d  ef 0a 07 32 17 2d dc f9  |.s.B..e=...2.-..|
    000000c0: 10 8c 0d 4b d7 9d e6 01  12 4f 11 6f f0 cd 64 f2  |...K.....O.o..d.|
    000000d0: f2 19 5c df 76 eb 01 49  dc fd cd 76 65 a2 3a 8a  |..\.v..I...ve.:.|
    000000e0: fd bb 13 a9 e6 3a c9 da  19 34 ae f0 43 bb 90 90  |.....:...4..C...|
    000000f0: 58 88 de 46 ce 91 6f aa  8d d9 7d b8 d6 88 a6 65  |X..F..o...}....e|

See also

  1. https://29a.ch/photo-forensics/
  2. https://holloway.nz/steg/

License

Released under the MIT License. See the LICENSE file for further details.

zsteg's People

Contributors

dependabot[bot] avatar zed-0xff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zsteg's Issues

Files causing abnormal behavior

Hi,

I have a couple .pngs that causes zsteg to behave abnormally.

sample1.png
sample1
Traceback:

Traceback (most recent call last): 16: from /usr/local/bin/zsteg:23:in <main>' 15: from /usr/local/bin/zsteg:23:in load' 14: from /var/lib/gems/2.7.0/gems/zsteg-0.2.5/bin/zsteg:8:in <top (required)>' 13: from /var/lib/gems/2.7.0/gems/zsteg-0.2.5/lib/zsteg.rb:30:in run' 12: from /var/lib/gems/2.7.0/gems/zsteg-0.2.5/lib/zsteg/cli/cli.rb:151:in run' 11: from /var/lib/gems/2.7.0/gems/zsteg-0.2.5/lib/zsteg/cli/cli.rb:151:in each_with_index' 10: from /var/lib/gems/2.7.0/gems/zsteg-0.2.5/lib/zsteg/cli/cli.rb:151:in each' 9: from /var/lib/gems/2.7.0/gems/zsteg-0.2.5/lib/zsteg/cli/cli.rb:158:in block in run' 8: from /var/lib/gems/2.7.0/gems/zsteg-0.2.5/lib/zsteg/cli/cli.rb:158:in each' 7: from /var/lib/gems/2.7.0/gems/zsteg-0.2.5/lib/zsteg/cli/cli.rb:162:in block (2 levels) in run' 6: from /var/lib/gems/2.7.0/gems/zsteg-0.2.5/lib/zsteg/cli/cli.rb:245:in check' 5: from /var/lib/gems/2.7.0/gems/zsteg-0.2.5/lib/zsteg/checker.rb:113:in check' 4: from /var/lib/gems/2.7.0/gems/zsteg-0.2.5/lib/zsteg/analyzer.rb:11:in analyze!' 3: from /var/lib/gems/2.7.0/gems/zsteg-0.2.5/lib/zsteg/analyzer.rb:34:in detect_block_size' 2: from /var/lib/gems/2.7.0/gems/zpng-0.3.3/lib/zpng/image.rb:337:in []' 1: from /var/lib/gems/2.7.0/gems/zpng-0.3.3/lib/zpng/scan_line.rb:147:in []' /var/lib/gems/2.7.0/gems/zpng-0.3.3/lib/zpng/scan_line.rb:289:in `decoded_bytes': invalid ScanLine filter 252 (RuntimeError)

Additionally I have a malformed .png that a causes memory leak on my system and the analysis never finishes. If you want I can share that too via method you prefer.

Thanks for making a great tool

If you're still here, I have a question about inflating extracted data from a steg file

One of your samples: ndh2k12_sp113.bmp

zsteg -a ndh2k12_sp113.bmp
...
b1,rgb,lsb,yx       .. zlib: data="%PDF-1.4\n%\xC3\xA4\xC3\xBC\xC3\xB6\xC3\x9F\n2 0 obj\n<</Length 3 0 R/Filter/FlateDecode>>\nstream\nx\x9C\x8DT\xC9n\xDB@\f\xBD\xCFW\xF0\x1C \x13\x92\xB3\x03\x86\x80\xC8K\xD1\xDE\\\b\xE8\xA1...", offset=4, size=186                                                                                  
...

But I can't figure out how to inflate the data after I have extracted it. I have tried zlib-inflate, pigz, and faking headers for gzip.

Thanks

How to extract `b10000000,r,lsb,yx` ?

Solved

zsteg -b 0x80 -c r -o yx mmm.png -n 0 -v

b10000000,r,lsb,yx  .. text: "passkey_is_xxxxx"
➜  lsbtest zsteg -e b10000000,r,lsb,yx mmm.png                              
Traceback (most recent call last):
	14: from /usr/local/bin/zsteg:23:in `<main>'
	13: from /usr/local/bin/zsteg:23:in `load'
	12: from /var/lib/gems/2.6.0/gems/zsteg-0.2.11/bin/zsteg:8:in `<top (required)>'
	11: from /var/lib/gems/2.6.0/gems/zsteg-0.2.11/lib/zsteg.rb:30:in `run'
	10: from /var/lib/gems/2.6.0/gems/zsteg-0.2.11/lib/zsteg/cli/cli.rb:151:in `run'
	 9: from /var/lib/gems/2.6.0/gems/zsteg-0.2.11/lib/zsteg/cli/cli.rb:151:in `each_with_index'
	 8: from /var/lib/gems/2.6.0/gems/zsteg-0.2.11/lib/zsteg/cli/cli.rb:151:in `each'
	 7: from /var/lib/gems/2.6.0/gems/zsteg-0.2.11/lib/zsteg/cli/cli.rb:158:in `block in run'
	 6: from /var/lib/gems/2.6.0/gems/zsteg-0.2.11/lib/zsteg/cli/cli.rb:158:in `each'
	 5: from /var/lib/gems/2.6.0/gems/zsteg-0.2.11/lib/zsteg/cli/cli.rb:160:in `block (2 levels) in run'
	 4: from /var/lib/gems/2.6.0/gems/zsteg-0.2.11/lib/zsteg/cli/cli.rb:249:in `extract'
	 3: from /var/lib/gems/2.6.0/gems/zsteg-0.2.11/lib/zsteg/cli/cli.rb:235:in `_extract_data'
	 2: from /var/lib/gems/2.6.0/gems/zsteg-0.2.11/lib/zsteg/cli/cli.rb:198:in `decode_param_string'
	 1: from /var/lib/gems/2.6.0/gems/zsteg-0.2.11/lib/zsteg/cli/cli.rb:198:in `each'
/var/lib/gems/2.6.0/gems/zsteg-0.2.11/lib/zsteg/cli/cli.rb:215:in `block in decode_param_string': uknown param "b10000000" (RuntimeError)

Solved

edit /var/lib/gems/2.6.0/gems/zsteg-0.2.11/lib/zsteg/cli/cli.rb

        when /^(\d+)b$/, /^b(\d)$/

to

       when /^(\d+)b$/, /^b(\d+)$/

Getting error messages on installing

Can someone please help me out here. I not sure what I'm doing wrong. I installed zsteg into a folder and tried to run it on a png file, but I got these errors.

I had used gem install zsteg to install.

The command I was trying to use was zsteg filename.png


Traceback (most recent call last): 15: from C:/Ruby27-x64/bin/zsteg:23:in <main> 14: from C:/Ruby27-x64/bin/zsteg:23:in load 13: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/bin/zsteg:8:in <top (required)>'
12: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg.rb:30:in run' 11: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:151:in run'
10: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:151:in each_with_index' 9: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:151:in each'
8: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:158:in block in run' 7: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:158:in each'
6: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:162:in block (2 levels) in run' 5: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:245:in check'
4: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/checker.rb:68:in check' 3: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/file_cmd.rb:67:in start!'
2: from C:/Ruby27-x64/lib/ruby/2.7.0/open3.rb:101:in popen3' 1: from C:/Ruby27-x64/lib/ruby/2.7.0/open3.rb:213:in popen_run'
C:/Ruby27-x64/lib/ruby/2.7.0/open3.rb:213:in spawn': No such file or directory - file -n -b -f - (Errno::ENOENT) 13: from C:/Ruby27-x64/bin/zsteg:23:in

'
12: from C:/Ruby27-x64/bin/zsteg:23:in load' 11: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/bin/zsteg:8:in <top (required)>'
10: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg.rb:30:in run' 9: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:151:in run'
8: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:151:in each_with_index' 7: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:151:in each'
6: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:158:in block in run' 5: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:158:in each'
4: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:162:in block (2 levels) in run' 3: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:245:in check'
2: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/checker.rb:119:in check' 1: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/zsteg-0.2.4/lib/zsteg/checker.rb:119:in ensure in check'`

There is a problem analyzing bmp files, how should I solve it?

[?] 2 bytes of extra data after image end (IEND), offset = 0x269b0e
extradata:0 .. ["\x00" repeated 2 times]
imagedata .. file: OpenPGP Public Key
b1,lsb,bY .. /var/lib/gems/3.1.0/gems/iostruct-0.1.2/lib/iostruct.rb:136:in block in inspect': undefined method type' for nil:NilClass (NoMethodError)

      when f.type == Integer
            ^^^^^
    from /var/lib/gems/3.1.0/gems/iostruct-0.1.2/lib/iostruct.rb:133:in `each'
    from /var/lib/gems/3.1.0/gems/iostruct-0.1.2/lib/iostruct.rb:133:in `map'
    from /var/lib/gems/3.1.0/gems/iostruct-0.1.2/lib/iostruct.rb:133:in `inspect'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker/wbstego.rb:41:in `to_s'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:291:in `puts'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:291:in `puts'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:291:in `show_result'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:326:in `process_result'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:271:in `check_channels'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:191:in `check_channels'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:116:in `block (3 levels) in check'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:99:in `each'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:99:in `block (2 levels) in check'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:98:in `each'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:98:in `block in check'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:97:in `each'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:97:in `check'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/cli/cli.rb:258:in `check'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/cli/cli.rb:172:in `block (2 levels) in run'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/cli/cli.rb:168:in `each'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/cli/cli.rb:168:in `block in run'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/cli/cli.rb:161:in `each'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/cli/cli.rb:161:in `each_with_index'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/cli/cli.rb:161:in `run'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg.rb:26:in `run'
    from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/bin/zsteg:8:in `<top (required)>'
    from /usr/local/bin/zsteg:25:in `load'
    from /usr/local/bin/zsteg:25:in `<main>'

Use question

meta XML:com.adobe.xmp.. /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker/zlib.rb:24:in index': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError) from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker/zlib.rb:24:in check_data'
from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:395:in data2result' from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:314:in process_result'
from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:185:in block in check_metadata' from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:182:in each'
from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:182:in check_metadata' from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/checker.rb:77:in check'
from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/cli/cli.rb:258:in check' from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/cli/cli.rb:172:in block (2 levels) in run'
from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/cli/cli.rb:168:in each' from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/cli/cli.rb:168:in block in run'
from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/cli/cli.rb:161:in each' from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/cli/cli.rb:161:in each_with_index'
from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg/cli/cli.rb:161:in run' from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/lib/zsteg.rb:26:in run'
from /var/lib/gems/3.1.0/gems/zsteg-0.2.13/bin/zsteg:8:in <top (required)>' from /usr/local/bin/zsteg:25:in load'
from /usr/local/bin/zsteg:25:in `

'

MSB mode equivalence

I was expecting this
$ zsteg -o xy -c rgb -b 10000000 --lsb

to be equivalent to
$ zsteg -o xy -c rgb -b1 --msb
or even
$ zsteg -o xy -c rgb -b 00000001 --msb

what did I miss ?

thanks

Zsteg does not find a full solution

Following this question on ruSO:
https://ru.stackoverflow.com/questions/1529122/Нужно-вытащить-инфу-из-png

Zsteg worked pretty fine on analyzing the file and brought up a "*near" solution with the desired string and 5 false positives:

b1,r,lsb,xy         .. text: "P~ZKP:VZ70v0"
b1,r,msb,xy         .. text: "h\\Xjlj~V"
b1,rgb,lsb,xy       .. text: "\ntadluudcl\ndqsushhud\nrmtzamjrgqgb\nowibnivvur\nskbynqx\nfub\nfnsqczqlp\neekr\nzukgr\niqm\niqghhmk\npswzfztfeor\nlhdososrra\nhdajkwyjc\npml\nmcunotfpoog\naenn\nqvfjdebnx\nesdaeenjpp\nzdcygkocgdwa\nhyizstsq\nsbuecriqv\nkov\nkglbfridcq\nhaqfeijqf\nzqusqewebg\naevxiodbztm\njvovealysgs"
b2,g,lsb,xy         .. text: "QAEAQ@AD"
b2,b,lsb,xy         .. text: "PQQT@PAPPTPPP"
b2,b,msb,xy         .. text: "U_]WuW]W"

The problem is, this b1,rgb,lsb,xy text does not have the hidden message which is "there is no quest with a portal it's just an excuse" hidden among a multi-line string with some random chars. However this site and another site worked fine and did yield 62 lines compared to 28 given by zsteg. Websites also do provide some binary chars at the end.

Given that, zsteg is missing something.

Error After Reinstallling on Kali

I've just reinstalled zsteg and getting the following error:


└─$ sudo gem uninstall zsteg                    
[sudo] password for user: 
Remove executables:
        zsteg, zsteg-mask, zsteg-reflow

in addition to the gem? [Yn]  Y
Removing zsteg
Removing zsteg-mask
Removing zsteg-reflow
Successfully uninstalled zsteg-0.2.2

┌──(user㉿kali)-[~]
└─$ sudo gem install zsteg --force                                       1 ⨯
Fetching zsteg-0.2.2.gem
Successfully installed zsteg-0.2.2
Parsing documentation for zsteg-0.2.2
Installing ri documentation for zsteg-0.2.2
Done installing documentation for zsteg after 0 seconds
1 gem installed
                                                                             
┌──(user㉿kali)-[~]
└─$ zsteg
Traceback (most recent call last):
        10: from /usr/local/bin/zsteg:23:in `<main>'
         9: from /usr/local/bin/zsteg:23:in `load'
         8: from /var/lib/gems/2.7.0/gems/zsteg-0.2.2/bin/zsteg:6:in `<top (required)>'
         7: from /usr/local/lib/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
         6: from /usr/local/lib/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
         5: from /var/lib/gems/2.7.0/gems/zsteg-0.2.2/lib/zsteg.rb:9:in `<top (required)>'
         4: from /usr/local/lib/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
         3: from /usr/local/lib/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
         2: from /var/lib/gems/2.7.0/gems/zsteg-0.2.2/lib/zsteg/result.rb:2:in `<top (required)>'
         1: from /var/lib/gems/2.7.0/gems/zsteg-0.2.2/lib/zsteg/result.rb:3:in `<module:ZSteg>'
/var/lib/gems/2.7.0/gems/zsteg-0.2.2/lib/zsteg/result.rb:11:in `<module:Result>': uninitialized constant ZSteg::Result::IOStruct (NameError)
Did you mean?  ZSteg::Result::Struct

check_*.sh

needs arg to disable tools to use

for example openStego just hangs and blocks the rest of check_png.sh

getting this error when running zsteg on a png

C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/file_cmd.rb:106:in `stop!': undefined method `close' for nil:NilClass (NoMethodError)
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/checker.rb:119:in `ensure in check'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/checker.rb:119:in `check'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:245:in `check'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:162:in `block (2 levels) in run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:158:in `each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:158:in `block in run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:151:in `each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:151:in `each_with_index'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:151:in `run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg.rb:30:in `run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/bin/zsteg:8:in `<top (required)>'
        from C:/Ruby30-x64/bin/zsteg:23:in `load'
        from C:/Ruby30-x64/bin/zsteg:23:in `<main>'
C:/Ruby30-x64/lib/ruby/3.0.0/open3.rb:221:in `spawn': No such file or directory - file -n -b -f - (Errno::ENOENT)
        from C:/Ruby30-x64/lib/ruby/3.0.0/open3.rb:221:in `popen_run'
        from C:/Ruby30-x64/lib/ruby/3.0.0/open3.rb:102:in `popen3'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/file_cmd.rb:67:in `start!'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/checker.rb:68:in `check'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:245:in `check'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:162:in `block (2 levels) in run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:158:in `each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:158:in `block in run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:151:in `each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:151:in `each_with_index'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg/cli/cli.rb:151:in `run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/lib/zsteg.rb:30:in `run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zsteg-0.2.4/bin/zsteg:8:in `<top (required)>'
        from C:/Ruby30-x64/bin/zsteg:23:in `load'
        from C:/Ruby30-x64/bin/zsteg:23:in `<main>'

[Feature Request] Extract all encoutered hidden files

I don't think there's currently a way to automatically extract all the hidden files found by -a. It'd be nice if we could just:

$ zstego -E -a image.png

To extract everything hidden on image.png to an output dir.

zsteg executable won't run with 'require' error

Hello,

I am not familiar with Ruby, so I may be missing something very obvious, but I think I have an issue, which is specific to zsteg.

After installing zsteg to my machine with gem install zsteg, the zsteg executable will not run. I get the following error:

<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- prime (LoadError)
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /home/yutanagano/.local/share/gem/ruby/gems/zsteg-0.2.9/lib/zsteg/extractor.rb:1:in `<top (required)>'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /home/yutanagano/.local/share/gem/ruby/gems/zsteg-0.2.9/lib/zsteg.rb:6:in `<top (required)>'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /home/yutanagano/.local/share/gem/ruby/gems/zsteg-0.2.9/bin/zsteg:6:in `<top (required)>'
	from ./zsteg:25:in `load'
	from ./zsteg:25:in `<main>'

I thought at first that maybe something is wrong with the Ruby install on my machine and tried installing other gems, and they worked fine. That's why I'm posting my issue here.

I am on a Fedora Linux (v36) machine.
Ruby version: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Gem version: 3.3.7

Thank you!

Bug

Whenever I try to run zsteg it gives me this output and im a too much of a ruby novice to solve it.
zsteg

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.