Knowledge Bank
  • 🔭About Us
    • 👋Welcome to Securescape!
  • 👶Fundamentals
    • 🖥️Operating Systems (WIP)
      • Introduction to Operating Systems
      • Processes and Process Management
        • 📠Processes
        • 🧵Threads
        • 📅Scheduling
      • Memory Management
        • Virtual Memory Management
      • Storage Management
      • I/O Management
    • 🐧Linux (WIP)
      • Introduction to Linux
      • Linux System Management
    • ⚡Programming (WIP)
      • 🔗Assembly
      • 💪C(++/#)
      • 🐍Python
      • 👑Nim
      • 🔨Bash
        • Introduction to Bash Scripting
        • Variables, Loops, and Port Scanner
    • 🚩Networking (WIP)
      • 📶Networking 101
        • 🕸️Networking Basics
        • 🛑Protocols
        • 🧓IPv4
        • 🧒IPv6
      • 🪡Packet Tracer
        • Interface
        • Connections
        • Creating Networks
        • Virtual LANS & Trunks
      • 🕸️Subnetting
      • 🕵️Network Security
    • ✍️Report Writing (WIP)
      • 🔍Research Skills
      • 🏗️Structuring a Report
      • 🗃️Creating Templates
  • 🦂General Security
    • 🗒️Methodologies
      • 🇭🇰OSSTMM
      • 🐝OWASP
        • Web Security Testing Guide
        • Mobile Security Testing Guide
      • 🦅NIST
      • 🥢PTES
      • ⛓️Cyber Killchain
    • 🍔Binary Exploitation
      • ir0nstone's Binary Exploitation Notes
    • 🎩Cheat Sheets
      • Enumeration
        • Network Scan
        • Vulnerability Scan
        • Web Scan
      • Exploitation
        • Page 1
        • Payloads & Shells
      • Post Exploitation
        • Lay of The Land
        • Persistence
        • Data Exfiltration
        • Pivoting
      • Command & Control
      • Disassembly
        • ☢️Radare2
        • 🥜GDB
      • CEH Cheatsheet
  • ⚔️Offensive Security
    • 💡Hardware Exploitation
      • Intro to Hardware
    • 🥷Red Team
      • 🦠Malware Development
        • Crow Malware Development
        • 🪡C# Malware
      • 🏭Offensive Development
        • 🔧Offensive DevOps
          • 🏷️GitLab
            • GitLab Setup
            • Simple Calculator Project
            • Making our CI/CD Pipeline
            • Build Artifacts
          • 🌆TeamCity
            • TeamCity Setup
            • Creating TeamCity Projects
            • Obfuscating Payloads
          • 🍷Jenkins (WIP)
            • Jenkins Setup
            • Creating Pipelines
            • Managing Projects
            • API Interaction
        • 🏗️Infrastructure Development (WIP)
          • 🎮Command & Control Infrastructure
            • 🤖Command & Control Anatomy
              • Command & Control Frameworks
              • Ⓜ️Metasploit Framework
                • Installing Metasploit
                • Metasploit Basics
                • Advanced Features
                • Metasploit Documentation
              • 🐲Mythic Framework
                • Installing Mythic
                • Malleable Command & Control
                • All About Agents
                • Services
                • Mythic Documentation
            • 🚥Traffic Redirection
              • Nginx
              • Amazon Web Services
              • Microsoft Azure
              • Google Cloud Platform
              • Cloudflare Workers
            • 🥷Covert Infrastructure
              • Ensuring Resiliency
              • Traffic Masking
              • Network Rules
          • 🎣Phishing Infrastructure
            • 📧Email Anatomy
            • 🐟Phishing Infrastructure Setup
            • 🚚Payload Delivery
            • 🚩Removing Red Flags
          • 🪄Infrastructure as Code
            • 🏝️Terraform
              • Interacting with Docker
              • Going to the Cloud
              • Hybrid Deployment
            • 🧊Pulumi
            • 🎼Ansible
          • ⚙️Infrastructure Automation
            • 🦴Structuring our Project
            • 🏭Automating Server Setups
            • 🎼Orchestrating our Infrastructure
            • 🔧CI/CD Integration
      • 🏙️Active Directory (WIP)
        • Active Directory Overview
        • Authentication
        • AD Lab
      • Red Team Operations - Joas Santos
  • 🛡️Defensive Security
  • 📻Software Defined Radios
    • ⚠️Disclaimer
    • 📡Baofeng
      • Programming
  • 🧑‍🔬Home Lab
    • 💨Virtualisation
      • 🔸Proxmox
  • 🏁Capture The Flag
    • 🧊HackTheBox
      • 👾Cyber Apocalypse
        • Cyber Apocalypse 2023
    • 🐤TryHackMe
      • 🎄Advent of Code
      • 🚪Rooms
        • 🐥Basic Pentesting
        • 👨‍💻Blog
      • 👟Paths
    • 🏳️Competitions
      • Nahamcon
        • Nahamcon 2023
          • Binary Exploitation
            • Open Sesame
      • 👁️Iris CTF
  • 🦺DRAFTS
    • GS
      • 📱Mobile Application Security
      • 👨‍🔬Reverse Engineering
      • 🌐Web Application Security
      • 📌Information Security
      • 🔒Cryptography
      • 🤫Operational Security
    • DS
      • 🧠Threat Intelligence
        • 🦌ELK Stack
          • 🤸Elasticsearch
          • 🏕️Kibana
          • 🦤SELKS
        • 🚓Yara
      • 🏹Threat Hunting
      • 🧬Malware Analysis
        • Fundamentals
      • 🔬Forensics
        • 📶Network Forensics
          • 🦈Wireshark
          • 🥟TCP Dump
        • 💾Memory Forensics
          • ⚡Volatility
        • 💽Disk Forensics
          • 🐕Autopsy
        • 🪟Windows Forensics
        • 🐧Linux Forensics
      • 🌲Security Operations
        • Intrusion Detection & Prevention
          • 🐛Splunk
            • Splunk Basics
            • Integrating Suricata with Splunk
          • 🐗Suricata
            • Intro to Suricata
          • 🐽Snort
            • Snort Basics
        • Security Information and Event Management (SIEM)
        • Security Orchestration, Automation and Response (SOAR)
    • HL
      • 🖥️Hardware
    • OS
      • 📶Network Exploitation
      • 🌩️Cloud Exploitation
Powered by GitBook
On this page
  • Module Objectives
  • Introduction
  • Public Repositories
  • Private Repositories

Was this helpful?

Edit on GitHub
  1. Offensive Security
  2. Red Team
  3. Offensive Development
  4. Offensive DevOps
  5. TeamCity

Creating TeamCity Projects

Short module on how to pull repositories from different sources

PreviousTeamCity SetupNextObfuscating Payloads

Last updated 1 year ago

Was this helpful?

Module Objectives

  • Pulling Public Repositories from GitHub

  • Pulling Private Repositories from GitLab

Introduction

TeamCity's projects consist of repositories pulled from public and private sources such as an internal GitLab server, or GitHub. By default, TeamCity will check for updates from the repository every 60 seconds, then pull the latest changes - though this can be changed per project if this is not something that you want/need.

You can also select which branches to pull from - either the default main branch, all branches (by inserting a wildcard *), or a specific branch such as dev or nightly if you're looking for bleeding edge changes.

Public Repositories

Creating your public project

To create our project, first get a GitHub link (We will use Seatbelt and Ligolo-ng for our demo). On TeamCity, select Create Project -> From a repository URL -> <REPOSITORY LINK> -> Proceed

  • Make sure you have an internet connection to your server

  • Add a username and token if you are pulling from a private repository

Next, change the builder configuration name to something memorable or related to the project, and add the branch that you would like to monitor. You can go to the original project's repository to see what the other branches are. Once you're ready, click proceed.

After clicking proceed, you will be met with the configuration page for our builder. TeamCity will automatically detect a build step to use based on our project, but we can change this later

Use the selected build step, then click on edit next to the .NET builder

The compile instructions on Seatbelt tells us to use .NET 3.5 or 4.0 to build our project, and to target release. We will reflect these requirements in our build step.

  1. Set the MSBuild Version to 2019

  2. Set the Required SDK to 3.5 or 4.0

  3. Set the Configuration to Release

  4. Save your changes

Now, we need to specify where our binary will be built. We will choose Seatbelt\bin\Release\Seatbelt.exe

Troubleshooting

  • Double check that JDK 17 or 22 are installed on your system

  • If you do not have any agents, then you can click on Agents from the dashboard, click on Install Agent, then follow the instructions

Cont.

If everything went well, you should be able to run your build step, and get your first artifact!

If the build is successful, you should see the Seatbelt executable in your artifacts tab, if you cannot find it here then add the C:\BuildAgent directory to your Defender exclusions (if you've installed an agent post server setup)

You can download the artifact by clicking on its name. You might need to add another exclusion at C:\ProgramData\JetBrains\TeamCity. We will take a look at how to make the binary less detectable in the next chapter.

Private Repositories

Pulling from private repositories is just as easy as from public ones, the only difference is that private repositories must be accessible and you must have the necessary credentials to access them.

Let's try pulling our calculator project, then testing and building it using TeamCity

# Double check your connection to your GitLab server from TeamCity's server
PS> ping 192.168.8.142

Pinging 192.168.8.142 with 32 bytes of data:
Reply from 192.168.8.142: bytes=32 time<1ms TTL=64
Reply from 192.168.8.142: bytes=32 time<1ms TTL=64

If successful, you should see this screen:

Go to the next section, then click on Build Features - we have to enable the Golang feature to be able to run Go commands

Go back to Build Steps, then in the Command Line option paste this in:

go test -json ./...
exit 0

This will run a test on all the folders within the project.

Save and run this step. If the build succeeds, you should see a tab called Tests and the two test cases that we have set in Simple Calculator Project

You can add a second build step after the test with go build ./... -o calculator to get your executable

If you run into an error on .NET SDK 3.5 not being installed, go to the visual studio installer and add .NET Framework 3.5 Developer Tools from the Individual Components tab and install then restart your VM

If you recall from the , we added our SSH key and created an access token. We will use these to pull the repository - the same can be done for GitHub using Personal Access Tokens or SSH keys.

⚔️
🥷
🏭
🔧
🌆
Microsoft .NET Framework 3.5 Service Pack 1
Rubeus
Seatbelt
SafetyKatz
SharpUp
SharpDpapi
Ligolo-ng
Trufflehog
previous module
Create Project -> Seatbelt
TeamCity Project Setup
Seatbelt GitHub Repository
TeamCity build step detection
Editing the build step
Seatbelt Compile Instructions
.NET build step
Artifact Path
Install Agent
Agent Download URL
Running the build step
Successful Build
Seatbelt Executing Successfully
Defender nuking our artifact
Add your credentials and the repo
Successful authentication
Golang build feature
Command Line options
Tests succeeded