Skip to content
Snippets Groups Projects

a sample of [cdwdoc-2023-001], call me maybe (from external)

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by cleemy desu wayo

    in general, all shell scripts can be called from external programs, unless they assume interactive use only.

    if https://gitlab.com/-/snippets/2494925 and this sample behave as I intended, it should look like this:

    $ ./cdwdoc-2023-001_from_external.rb
    true
    false
    false
    true
    nil

    the execution environment is as follows:

    $ ruby --version
    ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-linux-gnu]
    $ cat /proc/version
    Linux version 6.0.0-kali3-amd64 (devel@kali.org) (gcc-12 (Debian 12.2.0-3) 12.2.0, GNU ld (GNU Binutils for Debian) 2.39) #1 SMP PREEMPT_DYNAMIC Debian 6.0.7-1kali1 (2022-11-07)

    python edition:

    $ ./cdwdoc-2023-001_from_external.py
    True
    False
    False
    True
    None

    the execution environment is as follows:

    $ python -V
    Python 3.10.8
    $ cat /proc/version
    Linux version 6.0.0-kali3-amd64 (devel@kali.org) (gcc-12 (Debian 12.2.0-3) 12.2.0, GNU ld (GNU Binutils for Debian) 2.39) #1 SMP PREEMPT_DYNAMIC Debian 6.0.7-1kali1 (2022-11-07)

    some changes may be needed for old python (python 3.4.x or earlier)

            exit_status = subprocess.call(args=command_args, stderr=open('/dev/null', 'w'))
            return exit_status == 0

    .

    .

    .

    .

    .

    .

    :warning:️ spoiler warning :warning:

    if you have not solved https://gitlab.com/-/snippets/2494925 on your own, the following code may yield almost the direct answer

    .

    .

    .

    .

    .

    .

    Edited
    cdwdoc-2023-001_from_external.py 658 B
    cdwdoc-2023-001_from_external.rb 453 B
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment