Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/reflective_loader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ edition = "2021"
crate-type = ["cdylib"]

[profile.dev]
opt-level = "z" # This reduces the numebr of symbols not found.
opt-level = "z" # This reduces the number of symbols not found.
lto = true
codegen-units = 1
panic = "abort"
Expand Down
6 changes: 3 additions & 3 deletions bin/reflective_loader/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ struct PeFileHeaders64 {
section_headers: [IMAGE_SECTION_HEADER; MAX_PE_SECTIONS],
}

// Pares the PE file from a series of bytes
// Parses the PE file from a series of bytes
#[cfg(target_arch = "x86_64")]
impl PeFileHeaders64 {
fn new(dll_bytes_ptr: *mut c_void) -> Self {
Expand Down Expand Up @@ -390,7 +390,7 @@ fn process_import_address_tables(
function_ordinal_ptr,
) as _;
} else {
// Calculate a refernce to the function name by adding the dll_base and name's RVA.
// Calculate a reference to the function name by adding the dll_base and name's RVA.
let image_import_ptr: *mut IMAGE_IMPORT_BY_NAME = (new_dll_base as usize
+ unsafe { library_thunk.u1.AddressOfData } as usize)
as *mut IMAGE_IMPORT_BY_NAME;
Expand Down Expand Up @@ -819,7 +819,7 @@ mod tests {
assert_eq!(base_reloc_entry.reloc_type, 0xa);
}

// PE Headers change everytime create file dll is built
// PE Headers change every time create file dll is built
// #[test]
// fn test_reflective_loader_parse_pe_headers() -> () {

Expand Down
2 changes: 1 addition & 1 deletion implants/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ rand_chacha = { version = "0.3.1", default-features = false, features = ["std"]}
regex = { version = "1.5.5", default-features = false}
reqwest = { version = "0.12.15", default-features = false }
russh = "0.37.1"
russh-sftp = "=2.0.8" # `thiserror` dependcy in older versions causes downstream issues in other libraries.
russh-sftp = "=2.0.8" # `thiserror` dependency in older versions causes downstream issues in other libraries.
russh-keys = "0.37.1"
rustls = "0.23"
quinn = { version = "0.11", default-features = false, features = ["ring", "runtime-tokio"] }
Expand Down
2 changes: 1 addition & 1 deletion implants/golem/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ fn main() -> anyhow::Result<()> {
});
}
}
// If we havent specified tomes in INPUT, we need to look through the asset locker for tomes to run
// If we haven't specified tomes in INPUT, we need to look through the asset locker for tomes to run
if parsed_tomes.is_empty() {
match locker.list() {
Ok(assets) => {
Expand Down
2 changes: 1 addition & 1 deletion implants/golem/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fn test_golem_main_loaded_files() -> anyhow::Result<()> {

// Test running `./golem -a ../../bin/golem_cli_test/ -e`
// NOTE: Depending on how this test is run, the commands may not actually be run
// therefor we only test the output of eldritch and not the stdlib
// therefore we only test the output of eldritch and not the stdlib
#[test]
fn test_golem_main_loaded_and_embdedded_files() -> anyhow::Result<()> {
let mut cmd = Command::new(cargo_bin!("golem"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ pub fn find_best_match(target: &str, candidates: &[String]) -> Option<String> {
// Threshold logic:
// Allow a distance of up to 4, or half the string length + 1.
// This allows "config" (6) -> "get_config" (10) (dist 4, threshold 4)
// "apend" (5) -> "append" (6) (dist 1, threshold 3)
// "append" (5) -> "append" (6) (dist 1, threshold 3)
let threshold = (target.len() / 2 + 1).clamp(1, 4);

for candidate in candidates {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl StdAssetsLibrary {
// Make a hashset of the new asset names
let new_assets: HashSet<String> =
backend.assets().into_iter().map(Cow::into_owned).collect();
// See if any name overlap with existin assets
// See if any name overlap with existing assets
let colliding_names: Vec<&str> = self
.asset_names
.intersection(&new_assets)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async fn handle_ncat(address: String, port: i32, data: String, protocol: String)
// Connect to remote host
let mut connection = TcpStream::connect(&address_and_port).await?;

// Write our meessage
// Write our message
connection.write_all(data.as_bytes()).await?;

// Read server response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ async fn handle_port_scan(

let mut result: Vec<(String, i32, String, String)> = vec![];
// Await results of each job.
// We are not acting on scan results indepently so it's okay to loop through each and only return when all have finished.
// We are not acting on scan results independently so it's okay to loop through each and only return when all have finished.
for task in all_scan_futures {
match task.await? {
Ok(res) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ mod tests {
offset: u64,
data: Vec<u8>,
) -> Result<Status, Self::Error> {
//Warning this will only write one chunk - subsequesnt chunks will overwirte the old ones.
//Warning this will only write one chunk - subsequesnt chunks will overwrite the old ones.
// Tests over the size of the chunk will fail
let tmp_data = String::from_utf8(data).unwrap();
fs::write(handle, tmp_data.trim_end_matches(char::from(0))).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion implants/lib/transport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ http = { workspace = true }
tower = { workspace = true }
# Use hyper 1.x for grpc
hyper = { workspace = true, features = ["client"] }
# These crates are kinda funky gonna keep them in just transprot for now.
# These crates are kinda funky gonna keep them in just transport for now.
hyper_legacy = { package = "hyper", version = "0.14", features = ["client", "http1", "http2", "stream"] }
hyper-util = { version = "0.1", features = ["client", "client-legacy", "http1", "http2"] }
hyper-rustls = { version = "0.27", default-features = false, features = ["webpki-tokio", "http2"] }
Expand Down
2 changes: 1 addition & 1 deletion tavern/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ import (
tavernmcp "realm.pub/tavern/internal/mcp"
"realm.pub/tavern/internal/portals"
"realm.pub/tavern/internal/portals/mux"
"realm.pub/tavern/internal/portals/ssh"
"realm.pub/tavern/internal/portals/pty"
"realm.pub/tavern/internal/portals/ssh"
"realm.pub/tavern/internal/redirectors"
"realm.pub/tavern/internal/scheduler"
"realm.pub/tavern/internal/secrets"
Expand Down
1 change: 0 additions & 1 deletion tavern/internal/c2/api_claim_tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,4 +494,3 @@ func (srv *Server) ClaimTasks(ctx context.Context, req *c2pb.ClaimTasksRequest)
// Return claimed tasks
return &resp, nil
}

4 changes: 2 additions & 2 deletions tavern/internal/cdn/download_screenshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func TestDownloadScreenshot(t *testing.T) {
wantBody: []byte(fmt.Sprintf("%s\n", cdn.ErrInvalidFileID.Error())),
},
{
name: "Cached",
reqURL: fmt.Sprintf("/download/%d", existingScreenshot.ID),
name: "Cached",
reqURL: fmt.Sprintf("/download/%d", existingScreenshot.ID),
wantStatus: cdn.ErrFileNotModified.StatusCode,
wantBody: []byte(fmt.Sprintf("%s\n", cdn.ErrFileNotModified.Error())),
},
Expand Down
2 changes: 1 addition & 1 deletion tavern/internal/ent/enttest/testdb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tavern/internal/http/shell/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const (
type WebsocketControlFlowSignal string

// WebsocketControlFlowSignalPortalUpgrade indicates that the connection has been upgraded to use a portal for interactivity.
// WebsocketControlFlowSignalPortalDowngrade indicates that the connection has been downgraded to a non-interactive polling model, indicating that the portal has closed or is unuseable.
// WebsocketControlFlowSignalPortalDowngrade indicates that the connection has been downgraded to a non-interactive polling model, indicating that the portal has closed or is unusable.
const (
WebsocketControlFlowSignalPortalUpgrade = "PORTAL_UPGRADE"
WebsocketControlFlowSignalPortalDowngrade = "PORTAL_DOWNGRADE"
Expand Down
2 changes: 1 addition & 1 deletion tavern/internal/redirectors/quic/quic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func TestRedirector_QUIC_UnaryAndStreaming(t *testing.T) {

// 2. Setup the QUIC redirector
redirecter := &quicRedirector.Redirector{}

// Create UDP listener to find a free port
conn, err := net.ListenUDP("udp", &net.UDPAddr{IP: net.ParseIP("127.0.0.1"), Port: 0})
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion tavern/test_data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
// TestCreateTestData ensures createTestData runs without error and creates at least one beacon.
func TestCreateTestData(t *testing.T) {
var (
ctx = context.Background()
ctx = context.Background()
)
graph := enttest.OpenTempDB(t)
defer graph.Close()
Expand Down
4 changes: 2 additions & 2 deletions tavern/tomes/file_tree/main.eldritch
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ def can_read(f):
# Are we root?
root = usernfo["euid"]["uid"] == 0

# If the user isnt root and the user doesnt own the file, clear the user byte
# If the user isn't root and the user doesn't own the file, clear the user byte
if not root and f["owner"] not in (usernfo["euid"]["name"], usernfo["uid"]["name"]):
f_user = 0

# TODO: https://github.com/spellshift/realm/issues/570
# Will NOT match any group other than primary until #570 is fixed

# If the user isnt root and the group doesnt own the file, clear the group byte
# If the user isn't root and the group doesn't own the file, clear the group byte
if not root and f["group"] not in (str(usernfo["egid"]), str(usernfo["gid"])):
f_group = 0

Expand Down
2 changes: 1 addition & 1 deletion tavern/tomes/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func findTomePaths(tree *object.Tree) ([]string, error) {
return tomePaths, nil
}

// parseNamespaceFromGit attempts to return a shortend namespace for the tome based on the git URL.
// parseNamespaceFromGit attempts to return a shortened namespace for the tome based on the git URL.
// If it cannot or something goes wrong, this will return the provided git URL as the namespace.
func parseNamespaceFromGit(gitURLStr string) string {
gitURL, err := url.Parse(gitURLStr)
Expand Down
2 changes: 1 addition & 1 deletion tavern/tomes/netstat/main.eldritch
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def netstat():
for p in process.list():
pids[p['pid']] = p['name']

# Counts for dynamic column formating
# Counts for dynamic column formatting
counts = [6, 6, 7, 6, 8]
rows = [["PROTO", "LOCAL", "REMOTE", "STATE", "PROCESS"]]
# Loop through each net result and format the columns
Expand Down
Loading