Giter Club home page Giter Club logo

Comments (7)

Ali-Razmjoo avatar Ali-Razmjoo commented on July 22, 2024 1

Thanks @CodeMaxx.

from zsc.

Ali-Razmjoo avatar Ali-Razmjoo commented on July 22, 2024

Hi Brian,

Thanks for your report, First I want just notice that you can grep the payloads by witn own zsc command

python zsc.py --show-payloads linux_x86

here are more samples:

Search windows_x86 shellcodes: python zsc.py --show-payloads windows_x86 (this need exact os name or you can use pattern)
or search a word with pattern:

python zsc.py -l windows*
python zsc.py -l *exec*
python zsc.py -l *xor_random

That's weird, I don't have problem with python zsc.py --show-payloads *linux_x86/system/none, but using grep will makes the problem!

t2

  • notice: to search a specific payload please use one or two star(s) *
python zsc.py --show-payloads *linux_x86/system/none
python zsc.py --show-payloads linux_x86/system/none*
python zsc.py --show-payloads *linux_x86/system/none*

from zsc.

Ali-Razmjoo avatar Ali-Razmjoo commented on July 22, 2024

Hi Brian again, I've found this problem in here, it's because of \n is end of the printing line.

the line is info(payload+'\n') , if we go inside of info() we can see:

def info(content):
    sys.stdout.write(color.color('yellow') + '[+] ' + color.color('green') +
                     content + color.color('reset'))
    return

it's color + content + color but in our case is color + content + \n + color, by using grep we could catch the line which is including out search pattern linux_x86/system/none and our lines are same:

color + content
reset color + color + content
reset color + color + content
reset color + color + content

as I referred this problem could be solved by using zsc --show-payloads *linux_x86/system/none* or any solution for fixing this in info()?

I was thinking about replacing \n with reset color+\n but it's not a good idea...

@sizzop @jowasp @Pratik151 @paraschetal @CodeMaxx any idea ?

from zsc.

CodeMaxx avatar CodeMaxx commented on July 22, 2024

@Ali-Razmjoo I'm unable to reproduce this. Ok now I can.

from zsc.

CodeMaxx avatar CodeMaxx commented on July 22, 2024

@Ali-Razmjoo What we can do is to modify the info() function to remove \ns at the end of content and add same no. of \n after color.color('reset')

from zsc.

Ali-Razmjoo avatar Ali-Razmjoo commented on July 22, 2024

Hey Akash, I think one solution could be like this (check the last char if it's \n and replace it with color.color('reset') + '\n' ):

def info(content):
    content =  content[:-1] + color.color('reset') + '\n' if (content[-1] == '\n') else content
    sys.stdout.write(color.color('yellow') + '[+] ' + color.color('green') +
                     content + color.color('reset'))
    return

I think content = content[:-1] + color.color('reset') + '\n' if (content[-1] == '\n') else content should be add to all stdout functions, or if anyone have better idea ?

from zsc.

CodeMaxx avatar CodeMaxx commented on July 22, 2024

@Ali-Razmjoo Yeah thats exactly what I mean ... except that we count the newline characters at the end of content because if there are multiple newlines then we need to remove all of them.

Number of newline chars at the end = len(content) - len(content.rstrip("\n"))

from zsc.

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.