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

Race condition: AFTER_COMMANDS may run before git clone completes #491

Closed
ypcrts opened this issue Dec 14, 2019 · 0 comments
Closed

Race condition: AFTER_COMMANDS may run before git clone completes #491

ypcrts opened this issue Dec 14, 2019 · 0 comments

Comments

@ypcrts
Copy link
Contributor

ypcrts commented Dec 14, 2019

#468 describes a race condition where AFTER_COMMANDS may run before the install (git clone) finishes.

I am able to reproduce this also with the johntheripper module, running python 3.7.

ptf> use modules/password-recovery/johntheripper
ptf:(modules/password-recovery/johntheripper)>run


Module Author:         Martin Bos (@purehate_)
Module Description:    This module will install/update John the Ripper. The 'bleeding-jumbo' branch - An CPU-based password recovery tool.This is not 'official' John the Ripper code
-------------------------------------------------------------------------------------
INSTALL_TYPE:           GIT
REPOSITORY_LOCATION:    https://github.com/magnumripper/JohnTheRipper.git
INSTALL_LOCATION:       /pentest/password-recovery/johntheripper/
-------------------------------------------------------------------------------------
[*] Tool not installed yet, will run through install routine
[*] Preparing dependencies for module: modules/password-recovery/johntheripper
Reading package lists...
Building dependency tree...
Reading state information...
git is already the newest version (1:2.20.1-2+deb10u1).
gcc-multilib is already the newest version (4:8.3.0-1).
libgmp3-dev is already the newest version (2:6.1.2+dfsg-4).
lzip is already the newest version (1.21-3).
m4 is already the newest version (1.4.18-2).
make is already the newest version (4.2.1-1.2).
mingw-w64 is already the newest version (6.0.0-3).
The following package was automatically installed and is no longer required:
  libhttrack2
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
[*] Pre-reqs for modules/password-recovery/johntheripper have been installed.
[*] Making the appropriate directory structure first
[*] GIT was the selected method for installation... Using GIT to install.
[*] Installing now.. be patient...
[*] Finished Installing! Enjoy the tool located under: /pentest/password-recovery/johntheripper/
[*] Running after commands for post installation requirements.
[*] Sending after command: cd /pentest/password-recovery/johntheripper/
[*] Sending after command: cd src
[*] Sending after command: ./configure && make -j `nproc` && make install
/bin/sh: 1: ./configure: not found
[*] Sending after command: cd /pentest/password-recovery/johntheripper/
[*] Sending after command: cp -a run/* /pentest/password-recovery/johntheripper/
cp: cannot stat 'run/*': No such file or directory
[*] Sending after command: rm -rf run/
[*] Completed running after commands routine..
[*] Running updatedb to tidy everything up.
ptf:(modules/password-recovery/johntheripper)>run



Module Author:         Martin Bos (@purehate_)
Module Description:    This module will install/update John the Ripper. The 'bleeding-jumbo' branch - An CPU-based password recovery tool.This is not 'official' John the Ripper code
-------------------------------------------------------------------------------------
INSTALL_TYPE:           GIT
REPOSITORY_LOCATION:    https://github.com/magnumripper/JohnTheRipper.git
INSTALL_LOCATION:       /pentest/password-recovery/johntheripper/
-------------------------------------------------------------------------------------
[*] Detected installation already. Going to upgrade for you.
[*] Updating the tool, be patient while git pull is initiated.
[*] Running after commands for post installation requirements.
[*] Sending after command: cd /pentest/password-recovery/johntheripper/
[*] Sending after command: cd src
[*] Sending after command: ./configure && make -j `nproc` && make install
checking build system type... x86_64-unknown-linux-gnu
/...

I'll submit a PR shortly

trustedsec pushed a commit that referenced this issue Dec 16, 2019
resolve subprocess race condition, fixes #491
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

1 participant