-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added print new lines. * Add EOF newline. * rename eld to eldritch.
- Loading branch information
Showing
27 changed files
with
98 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
echo hello from an embedded shell script | ||
echo hello from an embedded shell script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/sh | ||
echo "hello from an embedded shell script" | ||
echo "hello from an embedded shell script" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
print("This script just prints") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,35 @@ | ||
--- | ||
title: Golem | ||
tags: | ||
tags: | ||
- User Guide | ||
description: Golem User Guide | ||
permalink: user-guide/golem | ||
--- | ||
## What is Golem | ||
|
||
Golem is the standalone interpreter for Eldritch. | ||
This program exists to help users get experience with the Eldritch language as well as a jumping off point if you're interested in implementing your own program using the Eldritch language. | ||
|
||
Golem can also be used operationally as an alternative to a system native shell. | ||
You can leverage the power of Eldritch with minimal exposure in the system process tree. | ||
|
||
## Try it out. | ||
## Try it out | ||
|
||
```bash | ||
git clone [email protected]:KCarretto/realm.git | ||
cd realm/implants/golem | ||
cargo run -- -i | ||
# - or - | ||
# - or - | ||
cargo build --release && \ | ||
../target/debug/golem ../../tests/golem_cli_test/tomes/hello_world.tome | ||
``` | ||
|
||
## Golem embedded files | ||
The Eldritch interpreter can embed files at compile time. To interact with these assets use the `assets` module in eldritch. In addition to programmatic access the embedded files can be automatically executed at run time. If no other option is specified `-i` or a file path, golem will iterate over every instance of `main.eld` in the embedded assets launching each one as a separate thread. This behavior is desirable when trying to perform recon or deploy persistence quickly. | ||
|
||
The Eldritch interpreter can embed files at compile time. To interact with these assets use the `assets` module in eldritch. In addition to programmatic access the embedded files can be automatically executed at run time. If no other option is specified `-i` or a file path, golem will iterate over every instance of `main.eldritch` in the embedded assets launching each one as a separate thread. This behavior is desirable when trying to perform recon or deploy persistence quickly. | ||
|
||
## Golem as a stage 0 | ||
|
||
Golem can also be used as a stage 0 to load imix or other c2 agents. | ||
This can help in a few ways such as: | ||
|
||
|
@@ -68,4 +72,4 @@ def main(): | |
return | ||
run_payload() | ||
main() | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
print(input_params['msg']) | ||
print(input_params['msg']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ paramdefs: | |
- label: Message | ||
name: msg | ||
placeholder: Something to print | ||
type: string | ||
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
print(sys.hostname()) | ||
print("\n") | ||
print("\n") | ||
print("\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
def netstat(): | ||
nets = process.netstat() | ||
|
||
print("----TCP----") | ||
print("socket_type,local,remote,state,pids") | ||
print("----TCP----\n") | ||
print("socket_type,local,remote,state,pids\n") | ||
for n in nets: | ||
if str(n['socket_type']) == "TCP": | ||
print(str(n['socket_type'])+", "+str(n['local_address'])+":"+str(n['local_port'])+", "+str(n['remote_address'])+":"+str(n['remote_port'])+", "+str(n['state'])+", "+str(n['pids'])) | ||
print("----UDP----") | ||
print("socket_type,local,pids") | ||
print(str(n['socket_type'])+", "+str(n['local_address'])+":"+str(n['local_port'])+", "+str(n['remote_address'])+":"+str(n['remote_port'])+", "+str(n['state'])+", "+str(n['pids'])+"\n") | ||
|
||
print("----UDP----\n") | ||
print("socket_type,local,pids\n") | ||
for n in nets: | ||
if str(n['socket_type']) == "UDP": | ||
print(str(n['socket_type'])+", "+str(n['local_address'])+":"+str(n['local_port'])+", "+str(n['pids'])) | ||
print(str(n['socket_type'])+", "+str(n['local_address'])+":"+str(n['local_port'])+", "+str(n['pids'])+"\n") | ||
|
||
|
||
|
||
return | ||
|
||
netstat() | ||
netstat() | ||
print("\n") | ||
print("\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
name: netstat | ||
description: List network connections | ||
description: List network connections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ paramdefs: | |
- name: timeout | ||
type: int | ||
label: Timeout | ||
placeholder: "2" | ||
placeholder: "2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
def shell_cmd(cmd): | ||
res = sys.shell(cmd) | ||
print("stdout: {}".format(res['stdout'])) | ||
print("stderr: {}".format(res['stderr'])) | ||
print("status: {}".format(res['status'])) | ||
print("stdout: {}\n".format(res['stdout'])) | ||
print("stderr: {}\n".format(res['stderr'])) | ||
print("status: {}\n".format(res['status'])) | ||
|
||
shell_cmd(input_params['cmd']) | ||
shell_cmd(input_params['cmd']) | ||
print("\n") | ||
print("\n") |