Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] - Add polymorphism #7

Open
jenaye opened this issue Jul 11, 2023 · 4 comments
Open

[Feat] - Add polymorphism #7

jenaye opened this issue Jul 11, 2023 · 4 comments

Comments

@jenaye
Copy link
Member

jenaye commented Jul 11, 2023

it could be fun and useful to implement a system like this one

package main

import (
	"bytes"
	"compress/zlib"
	"crypto/rand"
	"io"
	"os"
)

func polymorph() {
}

func main() {
	// part of the code that will not change 
	code := []byte(`
		package main

		import "fmt"

		func main() {
			fmt.Println("pwn")
		}
	`)

	polymorph()
	var compressedCode bytes.Buffer
	writer := zlib.NewWriter(&compressedCode)
	writer.Write(code)
	writer.Close()

	key := make([]byte, 32)
	rand.Read(key)

	file, _ := os.Create("packed_binary")

	defer file.Close()
	file.Write(key)
	file.Write(compressedCode.Bytes())
}
@TomChv
Copy link
Collaborator

TomChv commented Jul 15, 2023

So you would like to make possible the insertion of dynamic code?

What is the difference between this and #4 ?

@jenaye
Copy link
Member Author

jenaye commented Jul 15, 2023

In fact, in PR 4, we'd be using raw models that wouldn't move, only the key/encryption method and the location where the shellcode is stored would change.

In this case, the code would have to be dynamic, so that the footprint would change regularly, OR the other option would be to create a program able to modifying ASM instructions AFTER compilation, but for me this as the subject of another project.

@TomChv
Copy link
Collaborator

TomChv commented Jul 16, 2023

I'm confused how we could do that, you would like to insert the polymorph function during the compilation?
Who shall provide this function?

@jenaye
Copy link
Member Author

jenaye commented Jul 16, 2023

It could be an option, yes but don't worry about this issue, I think the others have priority and require less effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants