Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mtardy/pathgen
A CLI tool for creating arbitrary long paths on Linux
https://github.com/mtardy/pathgen
filesystem linux path
Last synced: 24 days ago
JSON representation
A CLI tool for creating arbitrary long paths on Linux
- Host: GitHub
- URL: https://github.com/mtardy/pathgen
- Owner: mtardy
- License: mit
- Created: 2023-10-24T17:16:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-05T12:07:00.000Z (3 months ago)
- Last Synced: 2024-09-20T06:41:49.339Z (about 2 months ago)
- Topics: filesystem, linux, path
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pathgen
Pathgen is a Golang CLI tool for generating arbitrary long paths on Linux
## Installation
You need Golang to be installed in your environment. Pathgen has no external
dependencies and only use the Go standard library.```bash
go install github.com/mtardy/pathgen@latest
```## Usage
```text
Usage:
pathgen [flags] lengthFlags:
-b string
binary to put at the end of the random path, used when write is enabled
-c cleanup everything under "/tmp/pathgen"
-l create a symlink at "/tmp/pathgen/exe" to the target file, used when write is enabled (default true)
-p string
prefix for the random path, you will need to cleanup manually (default "/tmp/pathgen")
-s string
suffix of the random path, name of the copied binary (default "bin")
-w write the filepath on the filesystem
```For example, to generate a path of 512 bytes and put the binary `nc` at the end
of random path under the name `bin` do:```shell-session
pathgen -w -b $(which nc) 512
```The output should be similar to:
```
/tmp/pathgen/fmblkzrkyvzbokvvwqxuzghimgzuhshccwetfneqsvvypjqocjnbzpvjdtvuszkjzugvrnhibjmfimniyujhagnkpykxcjrlfuelynkhnwfmpkztuvugynvaooktegdlpbtjumpzdznycpqsunbpeqomvdccokcbqbbgcnjllwncupxfoyiuofuywmiituxtsyzuewagurliurxfrdhnfbwvrizniuxwhajabtnuuvlsdhfgtxebzopisjydaoe/ouiefagfyastdxfjkxexpgfryogkqdrwtxpvhgoutwuqbehzhbmimoezrqsbkxfgjfpamonxvkkkohmmkehmmnxamuvmetgmlaxekvunksaqrtukatkcikbvmearvyvsksnsyrgdmcbkmdelwbuzlqrguzasaiwyjxhjzlotwowqdnfvqavrwvnpuzebwlkrcidxiitjvahpxlsysulhbeadmhntpfwnrifvssbjzzzumey/bin
```You will find a symlink at `/tmp/pathgen/exe` that points to the binary that you
can use to trigger execution from the arbitrary path.```shell-session
ls -l /tmp/pathgen
```The output should be similar to:
```
lrwxrwxrwx 1 mahe mahe 512 Oct 24 17:08 exe -> /tmp/pathgen/fmblkzrkyvzbokvvwqxuzghimgzuhshccwetfneqsvvypjqocjnbzpvjdtvuszkjzugvrnhibjmfimniyujhagnkpykxcjrlfuelynkhnwfmpkztuvugynvaooktegdlpbtjumpzdznycpqsunbpeqomvdccokcbqbbgcnjllwncupxfoyiuofuywmiituxtsyzuewagurliurxfrdhnfbwvrizniuxwhajabtnuuvlsdhfgtxebzopisjydaoe/ouiefagfyastdxfjkxexpgfryogkqdrwtxpvhgoutwuqbehzhbmimoezrqsbkxfgjfpamonxvkkkohmmkehmmnxamuvmetgmlaxekvunksaqrtukatkcikbvmearvyvsksnsyrgdmcbkmdelwbuzlqrguzasaiwyjxhjzlotwowqdnfvqavrwvnpuzebwlkrcidxiitjvahpxlsysulhbeadmhntpfwnrifvssbjzzzumey/bin
drwx------ 3 mahe mahe 4096 Oct 24 17:08 fmblkzrkyvzbokvvwqxuzghimgzuhshccwetfneqsvvypjqocjnbzpvjdtvuszkjzugvrnhibjmfimniyujhagnkpykxcjrlfuelynkhnwfmpkztuvugynvaooktegdlpbtjumpzdznycpqsunbpeqomvdccokcbqbbgcnjllwncupxfoyiuofuywmiituxtsyzuewagurliurxfrdhnfbwvrizniuxwhajabtnuuvlsdhfgtxebzopisjydaoe
```## License
[MIT](https://choosealicense.com/licenses/mit/)