{"id":13844242,"url":"https://github.com/vestjoe/cobaltstrike_services","last_synced_at":"2025-07-11T22:31:05.113Z","repository":{"id":48505809,"uuid":"361880338","full_name":"vestjoe/cobaltstrike_services","owner":"vestjoe","description":"AutoStart teamserver and listeners with services","archived":false,"fork":false,"pushed_at":"2021-12-23T15:11:34.000Z","size":9,"stargazers_count":66,"open_issues_count":0,"forks_count":18,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-02-11T21:19:33.739Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vestjoe.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-26T20:09:35.000Z","updated_at":"2024-01-19T10:15:37.000Z","dependencies_parsed_at":"2022-08-29T19:00:26.503Z","dependency_job_id":null,"html_url":"https://github.com/vestjoe/cobaltstrike_services","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vestjoe/cobaltstrike_services","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vestjoe%2Fcobaltstrike_services","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vestjoe%2Fcobaltstrike_services/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vestjoe%2Fcobaltstrike_services/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vestjoe%2Fcobaltstrike_services/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vestjoe","download_url":"https://codeload.github.com/vestjoe/cobaltstrike_services/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vestjoe%2Fcobaltstrike_services/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264909966,"owners_count":23682096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T17:02:38.246Z","updated_at":"2025-07-11T22:31:04.878Z","avatar_url":"https://github.com/vestjoe.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# Running Cobalt Strike Teamserver as a Service\n\nThese scripts can be used as a template to set up teamserver as a service and autostart listeners.\n\nThese scripts have been tested on Ubuntu server, and will need to be adjusted based on your use case.\n\n## Changelog\n\n- 23 Dec 2021 (CS 4.5 update)\n  - Added Max Retry Strategy to script\n\n## Steps\n\n- Update the service files to match your environment.\n  - teamserver.service\n  - listener.service\n  - listener_service.cna\n- Copy the service files to your teamserver\n  - /etc/systemd/system/teamserver.service\n  - /etc/systemd/system/listener.service\n  - /etc/cobaltstrike/listener_service.cna\n- Register the new services\n  - `systemctl daemon-reload`\n- Start the services\n  - `systemctl start teamserver.service`\n  - `systemctl start listener.service`\n- Test\n\n## Teamserver Service\n\nUpdate the settings to match your environment.\n\n- WorkingDirectory: set to the cobaltstrike directory\n- ExecStart: Set with your values\n\n```\n\n# teamserver.service\n[Unit]\nDescription=Cobalt Strike Teamserver Service\nAfter=network.target\nWants=network.target\n\n[Service]\nType=Simple\nWorkingDirectory=/opt/cobaltstrike\nExecStart=/opt/cobaltstrike/teamserver \u003cTEAMSERVER IP\u003e \u003cPASSWORD\u003e \u003cPATH TO C2 PROFILE\u003e\n\n# Example\n# ExecStart=/opt/cobaltstrike/teamserver `hostname -I` thisismypassword /opt/cobaltstrike/c2.profile\n\n[Install]\nWantedBy=multi-user.target\n\n```\n\n## Listener Service\n\nUpdate the settings to match your environment.\n\n- WorkingDirectory: set to the cobaltstrike directory\n- ExecStart: Set with your values\n\n```\n# listener.service\n[Unit]\nDescription=Cobalt Strike aggressor service\nAfter=teamserver.service network.target\nWants=teamserver.service\nStartLimitIntervalSec=33\n\n[Service]\nRestart=on-failure\nRestartSec=10\nWorkingDirectory=/opt/cobaltstrike\nExecStartPre=/bin/sleep 60\nExecStart=/bin/bash /opt/cobaltstrike/agscript 127.0.0.1 50050 \u003cUSER to LOGON TO COBALTSTRIKE\u003e \u003cTEAMSERVER PASSWORD\u003e \u003cPATH TO listener_service.cna\u003e\n\n# Example\n# ExecStart=/bin/bash /opt/cobaltstrike/agscript 127.0.0.1 50050 listener_service thisismypassword /opt/cobaltstrike/listener_service.cna\n\n\n[Install]\nWantedBy=multi-user.target\n```\n\n## Headless aggressor script\n\nThis must be updated to reflect your environment. \n\nThis example aggressor script is used to start an HTTP, HTTPS, and SMB listener with all the needed parameters\n\nWhat to change?\n\n- HTTP Listener\n  - Listnername\n  - host\n  - althost\n- HTTPS Listener\n  - Listnername\n  - host\n  - althost\n- SMB Listener\n  - \n\n\n```\nprintln(\"\n###################################################################\n CobaltStrike Aggressor Script          \n Author:      Joe Vest\n Description: Headless script to create listeners\n###################################################################\");\n\nprintln('Loading listener_service.cna...');\n\non ready{\n    println('listener_service.cna: Creating HTTP Listener...');\n\tlistener_create_ext(\"HTTP\", \"windows/beacon_http/reverse_http\", %(host =\u003e \"iheartredteams.com\", port =\u003e 80, beacons =\u003e \"iheartredteams.com\", althost =\u003e \"iheartredteams.com\", bindto =\u003e 80));\n\n    println('listener_service.cna: Creating HTTPS Listener...');\n\tlistener_create_ext(\"HTTPS\", \"windows/beacon_https/reverse_https\", %(host =\u003e \"iheartredteams.com\", port =\u003e 443, beacons =\u003e \"iheartredteams.com\", althost =\u003e \"iheartredteams.com\", bindto =\u003e 443));\n\n    println('listener_service.cna: Creating SMB Listener...');\n\tlistener_create_ext(\"SMB\", \"windows/beacon_bind_pipe\", %(port =\u003e \"mojo.5887.8051.34782273429370473##\"));\n\tsleep(10000);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvestjoe%2Fcobaltstrike_services","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvestjoe%2Fcobaltstrike_services","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvestjoe%2Fcobaltstrike_services/lists"}