Giter VIP home page Giter VIP logo

python-codext's Introduction

dhondta's GitHub Stats dhondta's Most Used Languages

python-codext's People

Contributors

dependabot[bot] avatar dhondta avatar github-actions[bot] avatar smarbal 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

python-codext's Issues

using Codext guess / Codext rank gives an error

When I run it on linux and try to use "codext guess" or "codext rank" I get an error message saying:

# echo "3yZe7d" | codext rank
Traceback (most recent call last):
  File "/usr/local/bin/codext", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/dist-packages/codext/__init__.py", line 184, in main
    args.include, args.exclude = __format_list(args.include), __format_list(args.exclude, False)
AttributeError: 'Namespace' object has no attribute 'include'

UU decoding raises an exception in some cases

# cat raw.txt 
1Oh6axLwfecHErbVpRbtNj8t5JACsSQrofdnnMdQtBmoU8cQj6EyLcVRsQLz1MyWfXbqQDIc9wGyyBuH7uV95lBVpFGn3syGIw0IVLx8wJr4ABsIH9Q71hBH4AvIgljx7XnfjfmafahBNrPMDkK3dsJF0r41nzyMnOf7l36NcllAOgRLoB6Qh0APotZu6plYpkSiRCAkDKowOFm0mybKp336TAJe4JiDecD9hNbl5fBDLkGNYhmSkzOQzLBH1aPumW4o

# codext -i raw.txt decode base62
begin 666 <data>
M'XL( /H^)V("__-)SBB-<O7*+#;,K8PL\/ H\C#UR2LP= H)C0@-RZ\*"P@M
M\"T-\*@(#\]V\<A,*R^W\"@I,W9Q-,LU\8XR=$XM*TYR3PG,2G)+RO P#_'.
?"LRJS#)US0X(KPJH<$U.J@P(<TGR  #3A(K<90      
 
end

# codext -i raw.txt decode base62 | codext decode UU
Traceback (most recent call last):
  File "/usr/lib/python3.8/encodings/uu_codec.py", line 58, in uu_decode
    data = binascii.a2b_uu(s)
binascii.Error: Illegal char

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jeane/.local/bin/codext", line 8, in <module>
    sys.exit(main())
  File "/home/jeane/.local/lib/python3.8/site-packages/codext/__init__.py", line 124, in main
    c = getattr(codecs, ["encode", "decode"][args.command == "decode"])(c, encoding, args.errors)
  File "/home/jeane/.local/lib/python3.8/site-packages/codext/__common__.py", line 691, in decode
    return lookup(encoding).decode(obj, errors)[0]
  File "/usr/lib/python3.8/encodings/uu_codec.py", line 62, in uu_decode
    data = binascii.a2b_uu(s[:nbytes])
binascii.Error: Illegal char

base64 unexpected behavior

Soo I was doing this ctf for which I thought I might need to perform some steg attacks. I ended-up installing StegoLSB which require tinyscript which require python-codext. BUT to my mistake I did this outside of a virtualenv.

Long story short, I eventually had to base64 decode a PDF, which despite my different attempts seemed empty. This was until I realised that calling base64 -d didn't call the beloved /usr/bin/base64 but the ~/.local/bin/base64 of python-codext.

Now the issue,

The script seems to be utf8 encoding the output (without reason) and this whether we redirect the output to a file or not.

As an example I get:

head -c 100 /tmp/a|base64 -d|hexdump -C
00000000  25 50 44 46 2d 31 2e 34  0a 31 20 30 20 6f 62 6a  |%PDF-1.4.1 0 obj|
00000010  0a 3c 3c 0a 2f 54 69 74  6c 65 20 28 c3 be c3 bf  |.<<./Title (....|
00000020  29 0a 2f 43 72 65 61 74  6f 72 20 28 c3 be c3 bf  |)./Creator (....|
00000030  00 77 00 6b 00 68 00 74  00 6d 00 6c 00 74 00 6f  |.w.k.h.t.m.l.t.o|
00000040  00 70 00 64 00 66 00 20  00 30 00 2e 00 31 00 0a  |.p.d.f. .0...1..|

Instead of the expected:

base64.b64decode("JVBERi0xLjQKMSAwIG9iago8PAovVGl0bGUgKP7/KQovQ3JlYXRvciAo/v8AdwBrAGgAdABt")
b'%PDF-1.4\n1 0 obj\n<<\n/Title (\xfe\xff)\n/Creator (\xfe\xff\x00w\x00k\x00h\x00t\x00m'

Namespace error

Getting this error:

$ echo -en "test" | codext encode base64 gzip | codext guess
Traceback (most recent call last):
  File "/home/linuxbrew/.linuxbrew/bin/codext", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.11/site-packages/codext/__init__.py", line 254, in main
    raise e
  File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.11/site-packages/codext/__init__.py", line 230, in main
    s, lb = args.stop_function, args.lang_backend
                                ^^^^^^^^^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'lang_backend'

Any ideas? I installed codext with pip. Thanks.

pip 22.3 / python 3.10 warning on install

Looks like there's a warning on the installation method via pip:

pip install codext         
Collecting codext
  Downloading codext-1.14.0.tar.gz (116 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 116.2/116.2 kB 1.7 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: six in ./venv/lib/python3.10/site-packages (from codext) (1.16.0)
Collecting markdown2>=2.4.0
  Downloading markdown2-2.4.6-py2.py3-none-any.whl (37 kB)
Installing collected packages: markdown2, codext
  DEPRECATION: codext is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for codext ... done
Successfully installed codext-1.14.0 markdown2-2.4.6

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.