-
Notifications
You must be signed in to change notification settings - Fork 90
Making PATH modification optional #64
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
Conversation
Mzack9999
commented
Feb 3, 2023
- Optional path modification
- Supports set/unset via -sp/-up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mzack9999 , Printing PATH env variable values does not seem necessary/good idea.
./pdtm
____
____ ____/ / /_____ ___
/ __ \/ __ / __/ __ __ \
/ /_/ / /_/ / /_/ / / / / /
/ .___/\__,_/\__/_/ /_/ /_/
/_/ v0.0.3
projectdiscovery.io
[INF] [OS: DARWIN] [ARCH: ARM64] [GO: 1.19.4]
[INF] Path to download project binary: /Users/tarun/.pdtm/go/bin
[INF] Path /Users/tarun/.pdtm/go/bin configured in environment variable $PATH: /Users/tarun/.pdtm/go/bin,/opt/homebrew/opt/libpcap/bin,/Users/tarun/.projectdiscovery,/opt/homebrew/opt/openjdk/bin,/Users/tarun/go/bin,/opt/local/bin,/opt/local/sbin,/opt/homebrew/sbin,/opt/homebrew/bin
1. subfinder (latest) (2.5.5)
2. dnsx (latest) (1.1.1)
3. naabu (latest) (2.1.1)
4. httpx (latest) (1.2.6)
5. nuclei (latest) (2.8.8)
6. uncover (latest) (1.0.2)
7. cloudlist (latest) (1.0.2)
8. proxify (latest) (0.0.8)
9. tlsx (latest) (1.0.5)
10. notify (latest) (1.0.4)
11. chaos-client (latest) (0.4.0)
12. shuffledns (latest) (1.0.8)
13. mapcidr (latest) (1.0.3)
14. interactsh-client (latest) (1.0.7)
15. katana (latest) (0.0.3)
|
@Mzack9999 , I was thinking we could something similar to this ./pdtm
____
____ ____/ / /_____ ___
/ __ \/ __ / __/ __ __ \
/ /_/ / /_/ / /_/ / / / / /
/ .___/\__,_/\__/_/ /_/ /_/
/_/ v0.0.3
projectdiscovery.io
[INF] [OS: DARWIN] [ARCH: ARM64] [GO: 1.19.4]
[INF] Path to download project binary: /Users/tarun/.pdtm/go/bin
[INF] Path /Users/tarun/.pdtm/go/bin configured in environment variable $PATH:
1. subfinder (latest) (2.5.5)
2. dnsx (latest) (1.1.1)
3. naabu (latest) (2.1.1)
4. httpx (latest) (1.2.6)
5. nuclei (latest) (2.8.8)
6. uncover (latest) (1.0.2)
7. cloudlist (latest) (1.0.2)
8. proxify (latest) (0.0.8)
9. tlsx (latest) (1.0.5)
10. notify (latest) (1.0.4)
11. chaos-client (latest) (0.4.0)
12. shuffledns (latest) (1.0.8)
13. mapcidr (latest) (1.0.3)
14. interactsh-client (latest) (1.0.7)
15. katana (latest) (0.0.3)
|
tarunKoyalwar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm !
$ ./pdtm
____
____ ____/ / /_____ ___
/ __ \/ __ / __/ __ __ \
/ /_/ / /_/ / /_/ / / / / /
/ .___/\__,_/\__/_/ /_/ /_/
/_/ v0.0.3
projectdiscovery.io
[INF] [OS: DARWIN] [ARCH: ARM64] [GO: 1.19.4]
[INF] Path to download project binary: /Users/tarun/.pdtm/go/bin
[INF] Path /Users/tarun/.pdtm/go/bin configured in environment variable $PATH
1. subfinder version not found
2. dnsx version not found
3. naabu version not found
4. httpx (latest) (1.2.7)
5. nuclei version not found
6. uncover version not found
7. cloudlist version not found
8. proxify version not found
9. tlsx (latest) (1.0.5)
10. notify version not found
11. chaos-client version not found
12. shuffledns version not found
13. mapcidr version not found
14. interactsh-client version not found
15. katana (latest) (0.0.3)@Mzack9999 since we only track/show/update tools installed via pdtm (i.e $HOME/.pdtm) Instead of printing nuclei version not found what do you think if we did something like this
$ ./pdtm
____
____ ____/ / /_____ ___
/ __ \/ __ / __/ __ __ \
/ /_/ / /_/ / /_/ / / / / /
/ .___/\__,_/\__/_/ /_/ /_/
/_/ v0.0.3
projectdiscovery.io
[INF] [OS: DARWIN] [ARCH: ARM64] [GO: 1.19.4]
[INF] Path to download project binary: /Users/tarun/.pdtm/go/bin
[INF] Path /Users/tarun/.pdtm/go/bin configured in environment variable $PATH
1. httpx (latest) (1.2.7)
2. tlsx (latest) (1.0.5)
3. katana (latest) (0.0.3)
[INF] Tools not tracked[installed] by pdtm
1. nuclei version not found
2. uncover version not found
3. cloudlist version not found
4. notify version not found
5. chaos-client version not found
6. shuffledns version not found
7. mapcidr version not found
8. interactsh-client version not found
9. subfinder version not found
10. dnsx version not found
11. naabu version not found|
since there were some issues with pdtm many users installed tools via |
|
@Mzack9999 , since path modification is disabled by default what do you think of alias ? alias nuclei="/Users/tarun/.pdtm/go/bin/nuclei"What do you think ? |
|
Still, to make it persistent, it's necessary to store it somewhere on the system. I think we can suggest to the user the command to execute (pdtm or system commands). As a reference, homebrew indicates to the user the commands to copy/paste and execute. |
|
Todo: (cc @tarunKoyalwar )
|
tarunKoyalwar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ go run . -u nuclei
____
____ ____/ / /_____ ___
/ __ \/ __ / __/ __ __ \
/ /_/ / /_/ / /_/ / / / / /
/ .___/\__,_/\__/_/ /_/ /_/
/_/ v0.0.4
projectdiscovery.io
parent is /Users/tarun
sub is /Users/tarun/.pdtm/go/bin
[INF] nuclei: not found in path /Users/tarun/.pdtm/go/bin/nuclei
got error here
[ERR] error while updating nuclei: tool nuclei not found in path /Users/tarun/.pdtm/go/bin/nuclei: skippingRevisting CRUD operations other than (default PDTM PATH)
- Now after trying this out , I think we don't need all CRUD operations supported for cases when path is different from default PATH
As a User, I think pdtm should detect all pd tools , install them if explicitly mentioned and update my tools (installed with pdtm and without pdtm [Keeping HOME FOLDER restriction HERE]) also I don't want pdtm to take complete ownership (DELETE PERM) of tools that were not installed via pdtmso I think we should only support READ UPDATE for tools outside of pdtm default path . this way we are less invasive keeping User experience same . What do you think @Mzack9999
|
@tarunKoyalwar I'm unable to reproduce it: $ ls /Users/marcornvh/.pdtm/go/bin/nuclei
/Users/marcornvh/.pdtm/go/bin/nuclei
$ go run . -u nuclei
____
____ ____/ / /_____ ___
/ __ \/ __ / __/ __ __ \
/ /_/ / /_/ / /_/ / / / / /
/ .___/\__,_/\__/_/ /_/ /_/
/_/ v0.0.4
projectdiscovery.io
[INF] nuclei: already up to dateTesting on OSX latest I'm not sure we should update tools arbitrarily outside of scoped directories. Eventually one improvement we might try, is to detect if they are within the go bin folder, and in such case trigger the install via |
|
|
@tarunKoyalwar do you mean installing the tool if not present? Actually if the tool is not installed we skip all I/O operations and just return an error |
|
@Mzack9999 , not installing but a additional check before updating a tool when we try to update any not existent tool $ which dnsx
dnsx not found $ ./pdtm -u dnsx
____
____ ____/ / /_____ ___
/ __ \/ __ / __/ __ __ \
/ /_/ / /_/ / /_/ / / / / /
/ .___/\__,_/\__/_/ /_/ /_/
/_/ v0.0.4
projectdiscovery.io
[INF] Current pdtm version v0.0.4 (latest)
[INF] dnsx: not found in path /Users/tarun/.pdtm/go/bin/dnsx
[ERR] error while updating dnsx: tool dnsx not found in path /Users/tarun/.pdtm/go/bin/dnsx: skippingas you can see in above example . pdtm first tries to find if dnsx is in path . if not it should fail silently (or skip the next step). instead currently even tries to update a not existent tool and returns I think the proper output for this should be $ ./pdtm -u dnsx
____
____ ____/ / /_____ ___
/ __ \/ __ / __/ __ __ \
/ /_/ / /_/ / /_/ / / / / /
/ .___/\__,_/\__/_/ /_/ /_/
/_/ v0.0.4
projectdiscovery.io
[INF] Current pdtm version v0.0.4 (latest)
[INF] dnsx: not found in path /Users/tarun/.pdtm/go/bin/dnsx: skipping update |
ehsandeep
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pdtm $./pdtm -ua
____
____ ____/ / /_____ ___
/ __ \/ __ / __/ __ __ \
/ /_/ / /_/ / /_/ / / / / /
/ .___/\__,_/\__/_/ /_/ /_/
/_/ v0.0.4
projectdiscovery.io
[INF] Current pdtm version v0.0.4 (latest)
[INF] subfinder: already up to date
[INF] dnsx: already up to date
[INF] naabu: already up to date
[INF] httpx: already up to date
[INF] nuclei: already up to date
[INF] uncover: already up to date
[INF] cloudlist: already up to date
[INF] proxify: already up to date
[INF] tlsx: already up to date
[INF] notify: already up to date
[INF] chaos-client: already up to date
[INF] shuffledns: already up to date
[INF] mapcidr: already up to date
[INF] interactsh-client: already up to date
[INF] katana: already up to date
[INF] pdtm: already up to date
[INF] asnmap: already up to date
pdtm $./pdtm -ia
____
____ ____/ / /_____ ___
/ __ \/ __ / __/ __ __ \
/ /_/ / /_/ / /_/ / / / / /
/ .___/\__,_/\__/_/ /_/ /_/
/_/ v0.0.4
projectdiscovery.io
[INF] Current pdtm version v0.0.4 (latest)
[INF] subfinder: already installed
[INF] dnsx: already installed
[INF] naabu: already installed
[INF] httpx: already installed
[INF] nuclei: already installed
[INF] uncover: already installed
[INF] cloudlist: already installed
[INF] proxify: already installed
[INF] tlsx: already installed
[INF] notify: already installed
[INF] chaos-client: already installed
[INF] shuffledns: already installed
[INF] mapcidr: already installed
[INF] interactsh-client: already installed
[INF] katana: already installed
[INF] pdtm: already installed
[INF] asnmap: already installed
tarunKoyalwar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm !
$ ./pdtm
____
____ ____/ / /_____ ___
/ __ \/ __ / __/ __ __ \
/ /_/ / /_/ / /_/ / / / / /
/ .___/\__,_/\__/_/ /_/ /_/
/_/ v0.0.4
projectdiscovery.io
[INF] Current pdtm version v0.0.4 (latest)
[INF] [OS: DARWIN] [ARCH: ARM64] [GO: 1.20.2]
[INF] Path to download project binary: /Users/tarun/.pdtm/go/bin
[INF] Path /Users/tarun/.pdtm/go/bin configured in environment variable $PATH
1. subfinder (latest) (2.5.7)
2. dnsx (latest) (1.1.3)
3. naabu (latest) (2.1.4)
4. httpx (latest) (1.2.9)
5. nuclei (not installed)
6. uncover (latest) (1.0.3)
7. cloudlist (latest) (1.0.2)
8. proxify (latest) (0.0.8)
9. tlsx (latest) (1.0.6)
10. notify (latest) (1.0.4)
11. chaos-client (latest) (0.5.1)
12. shuffledns (latest) (1.0.8)
13. mapcidr (latest) (1.1.1)
14. interactsh-client (latest) (1.1.2)
15. katana (latest) (1.0.0)
16. pdtm (latest) (0.0.4)
17. asnmap (latest) (1.0.2)