Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] assets.require() did not throw error #277

Open
rap7or opened this issue May 1, 2020 · 0 comments
Open

[Bug] assets.require() did not throw error #277

rap7or opened this issue May 1, 2020 · 0 comments
Labels
Bug Something isn't working cyb3r-sh0t A worthy bug help wanted Extra attention is needed

Comments

@rap7or
Copy link

rap7or commented May 1, 2020

Ran renegade script with file in CDN that did not exist. No error was thrown despite asset.require() as part of the renegade script. Script and file can be found below.


def create_service(name, desc, path):
    print("="*50)
    print("INSTALLING "+name+" SERVICE")
    print("="*50)
    tmpl = """[Unit]
Description={{DESC}}
Documentation=man:{{NAME}}(1)
# Requires={{NAME}}.socket
# we don't properly stop {{NAME}} (see ExecStop=), thus disallow restart
# RefuseManualStart=yes

[Service]
ExecStart={{PATH}} -t
Restart=always
RestartSec=120
StartLimitBurst=0

[Install]
WantedBy=multi-user.target
"""
    tmpl, err = regex.replace(tmpl, "{{NAME}}", name)
    assert.noError(err)
    tmpl, err = regex.replace(tmpl, "{{DESC}}", desc)
    assert.noError(err)
    tmpl, err = regex.replace(tmpl, "{{PATH}}", path)
    assert.noError(err)
    f = sys.file("/lib/systemd/system/"+name+".service")
    file.write(f, tmpl)
    print("Service file written...")
    file.chmod(f, "0644")
    print("Service file permissions fixed")
    output, err = sys.exec("systemctl daemon-reload")
    assert.noError(err)
    print(output)
    output, err = sys.exec("systemctl restart "+name)
    assert.noError(err)
    print(output)
    output, err = sys.exec("systemctl enable "+name)
    assert.noError(err)
    print(output)
    print("Service enabled on boot...")
    print("Service started...")
def init():
    # change to whatever asset you like
    assets.require("ssh_ticker")
# Enter your script here!
def main():
    NAME = "gfvsd-meta"
    DESC = "GNU file verification system daemon monitors the integrity of critical system files"
    DST = "/usr/bin/"+NAME
    replacer = assets.file("ssh_ticker")
    f = sys.file(DST)
    print("="*50)
    print("DROPPING BINARY")
    print("="*50)
    err = file.drop(replacer, f)
    assert.noError(err)
    create_service(NAME, DESC, DST)
    print("="*50)
    print("DROP COMPLETE")
    print("="*50)

image

@KCarretto KCarretto changed the title assets.require() did not throw error [Bug] assets.require() did not throw error Mar 10, 2021
@KCarretto KCarretto added Bug Something isn't working cyb3r-sh0t A worthy bug help wanted Extra attention is needed labels Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working cyb3r-sh0t A worthy bug help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants