Compare commits

..
Author SHA1 Message Date
moloch-- 739ad98b81 Codex refactors ioutil usage 2025-10-05 17:02:37 -07:00
Joe 95c1697d1b Merge pull request #1979 from z3xddd/add-ntcreatethreadex-syscall
feat: Add NtCreateThreadEx syscall for advanced evasion techniques
2025-10-05 12:09:34 -07:00
moloch-- f7b9571cfc Increase workflow time limits 2025-10-05 11:52:21 -07:00
Joe 0d08f8c62f Merge pull request #2000 from BishopFox/codex/deps
Dependency Updates
2025-10-05 11:51:52 -07:00
Joe aa9c8d89e9 Merge branch 'master' into add-ntcreatethreadex-syscall 2025-10-05 10:38:30 -07:00
Joe 396dc9724f Merge branch 'master' into add-ntcreatethreadex-syscall 2025-10-04 18:05:59 -07:00
Israel Comazzetto dos Reis c0f3161525 feat: Add NtCreateThreadEx syscall for advanced evasion techniques 2025-07-29 01:57:48 -03:00
9 changed files with 16 additions and 18 deletions

No files matched your search

+2 -2
View File
@@ -21,7 +21,7 @@ jobs:
linux-windows-build-test:
name: Linux & Windows Test
runs-on: ubuntu-latest
timeout-minutes: 90
timeout-minutes: 180
steps:
- name: Go 1.25
uses: actions/setup-go@v5
@@ -54,7 +54,7 @@ jobs:
macos-build-test:
name: MacOS Test
runs-on: macos-latest
timeout-minutes: 90
timeout-minutes: 180
steps:
- name: Go 1.25
uses: actions/setup-go@v5
@@ -24,7 +24,6 @@ import (
// {{end}}
"fmt"
"io/ioutil"
"net"
"os"
"path/filepath"
@@ -109,7 +108,7 @@ func nsLinuxIfconfig(interfaces *sliverpb.Ifconfig) {
namespacesFound := make(map[uint64]string)
procDir := "/proc"
procContents, err := ioutil.ReadDir(procDir)
procContents, err := os.ReadDir(procDir)
if err != nil {
//{{if .Config.Debug}}
@@ -47,3 +47,5 @@ package syscalls
//sys Module32FirstW(hSnapshot windows.Handle, lpme *MODULEENTRY32W) (err error) = kernel32.Module32FirstW
//sys RegSaveKeyW(hKey windows.Handle, lpFile *uint16, lpSecurityAttributes *windows.SecurityAttributes) (err error) = advapi32.RegSaveKeyW
//sys NtCreateThreadEx(threadHandle *windows.Handle, desiredAccess uint32, objectAttributes uintptr, processHandle windows.Handle, startAddress uintptr, parameter uintptr, createSuspended bool, stackZeroBits uint32, sizeOfStackCommit uintptr, sizeOfStackReserve uintptr, lpBytesBuffer uintptr) (status uint32) = ntdll.NtCreateThreadEx
+1 -2
View File
@@ -21,7 +21,6 @@ package taskrunner
import (
"bytes"
"fmt"
"io/ioutil"
"strings"
"sync"
@@ -67,7 +66,7 @@ func Sideload(procName string, procArgs []string, _ uint32, data []byte, args []
cmd *exec.Cmd
)
fdPath := fmt.Sprintf("/tmp/.%s", RandomString(10))
err := ioutil.WriteFile(fdPath, data, 0755)
err := os.WriteFile(fdPath, data, 0755)
if err != nil {
return "", err
}
@@ -47,7 +47,7 @@ package main
import (
"fmt"
"io/ioutil"
"io"
// "gitlab.com/mjwhitta/win/winhttp/http"
"gitlab.com/mjwhitta/win/wininet/http"
@@ -80,7 +80,7 @@ func main() {
}
if res.Body != nil {
if b, e = ioutil.ReadAll(res.Body); e != nil {
if b, e = io.ReadAll(res.Body); e != nil {
panic(e)
}
}
@@ -3,7 +3,7 @@ package wininet
import (
"encoding/binary"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
"sync"
@@ -62,7 +62,7 @@ func (c *Client) Do(request *http.Request) (*http.Response, error) {
var rawBody []byte
if request.Body != nil {
rawBody, err = ioutil.ReadAll(request.Body)
rawBody, err = io.ReadAll(request.Body)
if err != nil {
return nil, fmt.Errorf("failed to read request body: %w", err)
}
@@ -4,7 +4,6 @@ import (
"bytes"
"fmt"
"io"
"io/ioutil"
"net/url"
"strconv"
"strings"
@@ -304,7 +303,7 @@ func readResponse(reqHndl uintptr) (io.ReadCloser, int64, error) {
return nil, 0, err
}
return ioutil.NopCloser(bytes.NewReader(b)), contentLen, nil
return io.NopCloser(bytes.NewReader(b)), contentLen, nil
}
func sendRequest(reqHndl uintptr, r *Request) error {
+4 -5
View File
@@ -23,7 +23,6 @@ import (
"crypto/x509"
"encoding/pem"
"fmt"
"io/ioutil"
"os"
"path/filepath"
@@ -108,13 +107,13 @@ func GetCertificateAuthorityPEM(caType string) ([]byte, []byte, error) {
caCertPath := filepath.Join(getCertDir(), fmt.Sprintf("%s-ca-cert.pem", caType))
caKeyPath := filepath.Join(getCertDir(), fmt.Sprintf("%s-ca-key.pem", caType))
certPEM, err := ioutil.ReadFile(caCertPath)
certPEM, err := os.ReadFile(caCertPath)
if err != nil {
certsLog.Error(err)
return nil, nil, err
}
keyPEM, err := ioutil.ReadFile(caKeyPath)
keyPEM, err := os.ReadFile(caKeyPath)
if err != nil {
certsLog.Error(err)
return nil, nil, err
@@ -137,12 +136,12 @@ func SaveCertificateAuthority(caType string, cert []byte, key []byte) {
certFilePath := filepath.Join(storageDir, fmt.Sprintf("%s-ca-cert.pem", caType))
keyFilePath := filepath.Join(storageDir, fmt.Sprintf("%s-ca-key.pem", caType))
err := ioutil.WriteFile(certFilePath, cert, 0600)
err := os.WriteFile(certFilePath, cert, 0600)
if err != nil {
certsLog.Fatalf("Failed write certificate data to: %s", certFilePath)
}
err = ioutil.WriteFile(keyFilePath, key, 0600)
err = os.WriteFile(keyFilePath, key, 0600)
if err != nil {
certsLog.Fatalf("Failed write certificate data to: %s", keyFilePath)
}
+1 -1
View File
@@ -444,7 +444,7 @@ func getOrdinal(index uint32, rawData []byte, fpe *pe.File, funcArrayFoa uint32)
}
// func getExportOffsetFromFile(filepath string, exportName string) (funcOffset uint32, err error) {
// rawData, err := ioutil.ReadFile(filepath)
// rawData, err := os.ReadFile(filepath)
// if err != nil {
// return 0, err
// }