GoSH, a Golang reverse/bind shell generator

Hello 0x00sec !

Having to spend plenty of time in home due to the coronavirus outbreak, I decided to write a simple (and hopefully useful :slight_smile: ) tool that automates generation of shells in Golang. More detailed info is available in the README, but I think that the usage is self explanatory.

DISCLAIMER: I have started learning Go just a few days ago, so the code probably will look shitty to the more experienced wielders of this beautiful language. I would love to see your contributions and ideas for improvements :>

Here is the link to the repository:
https://github.com/TheSecondSun/GoSH

Best wishes to everyone

2 Likes

Bless you,hahahahahaha

Pretty cool project. I have a question though, what are these files? I don’t see anything about 'em in the README / Source Code

https://github.com/TheSecondSun/GoSH/blob/master/gosh
https://github.com/TheSecondSun/GoSH/blob/master/.gosh.go.swp
https://github.com/TheSecondSun/GoSH/blob/master/templates/.bind.go.swp
https://github.com/TheSecondSun/GoSH/blob/master/templates/.reverse.go.swp

@Tyr4n7 without looking at the repo I assume gosh (short for go shell) is the actual shell generator binary
The *.swp files are temporary lock files e.g. created by vim to hold meta information about changes made to these files. So they are not relevant to the project and can safely be deleted (which they should be automatically when closing vim properly)

Context:

==============================================================================
 1. The swap file                                        swap-file

 Vim stores the things you changed in a swap file.  Using the original file
 you started from plus the swap file you can mostly recover your work.
2 Likes

without looking at the repo I assume gosh (short for go shell) is the actual shell generator binary

I assumed that as well, but any good public GitHub project should include full specifications on the project and its files to let other Devs continue the work. Cheers

The *.swp files are temporary lock files e.g. created by vim to hold meta information about changes made to these files. So they are not relevant to the project and can safely be deleted (which they should be automatically when closing vim properly)

I never used VIM, wouldn’t have known, but what does it store and what information can be recovered from such files?
reglarless, he removed the *.swp files in the last commit.

1 Like

well I’ll give you that but for a repo with only src and the compiled binary there’s not much detective work to do.

Like my code block states these filename.swp files hold all the made changes to filename since opening it for editing. These files are non-volatile, meaning they stay as long on disk as you do not close the open buffer (in this case a file to edit) properly. Now if you e.g. get a power outage or your terminal crashes you’d lose all your unsaved changes you were editing. However, since the .swp files exist you can recover the already made changes and continue working where you left of.

Furthermore, they serve as an actual lock file! Try opening a file in vim and in another terminal try opening the same file again. In the second terminal you’ll get a warning that the file you’re trying to open is already opened and changes you were about to make in this instance may cause troubles.

Nowadays in days of full fledged IDEs with permanent auto save features these *.swp file could be seen as relicts from old times. Finally, when you use sublime, or vscode and you close your editor without saving all your files and open it up again later on (even after reboot) your unsaved but opened files are still there. That’s the same magic vim does for ages but less obvious to the user :slight_smile: .

But that’s enough off topic for now. If you have further questions let’s move this to discord/dm

1 Like