Giter VIP home page Giter VIP logo

Comments (2)

Koczek9 avatar Koczek9 commented on August 18, 2024

We could test if capsh is present on machine, if it is use old approach in it isn't we can create mask manually. I created proof of concept script that you can use or modify for your liking:

#! /bin/bash

text="0000000020200420"

# as text is string in hex format we actually need to convert it to hex value
hex_value=$((16#$text))

# those masks were taken directly from https://github.com/torvalds/linux/blob/master/include/uapi/linux/capability.h
#cap_dac_read_search 2
#cap_net_raw    13
#cap_sys_module 16
#cap_sys_ptrace 19
#cap_sys_admin  21

# create mask with all unwanted flag
mask=$(((0x1 << 2) | (0x1 << 13) | (0x1 << 16) | (0x1 << 19) | (0x1 << 21)))

result=$((hex_value & mask))
if [ "$result" != 0 ]; then
	printf "Not wanted flags set 0x%x\n" "$result"
else
	echo "success"
fi

This should work on every platform, it doesn't name what flag is set but at least gives you its hex representation which is always something.

from dobby-security-tool.

Koczek9 avatar Koczek9 commented on August 18, 2024

It is resolved already.

from dobby-security-tool.

Related Issues (5)

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.