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

Exception: argument of type 'WindowsPath' is not iterable #9

Open
NaaeemMalik opened this issue Aug 24, 2019 · 5 comments
Open

Exception: argument of type 'WindowsPath' is not iterable #9

NaaeemMalik opened this issue Aug 24, 2019 · 5 comments

Comments

@NaaeemMalik
Copy link

am getting this error

[X] Exception: argument of type 'WindowsPath' is not iterable

Screenshot (11)

@NaaeemMalik
Copy link
Author

i was able to change error little bit:
cmd: python carboncopy.py microsoft.com 443 ConsoleApplication1.exe 1.exe
+-+-+-+-+-+-+-+-+-+-+-+-+
|C|a|r|b|o|n|S|i|g|n|e|r|
+-+-+-+-+-+-+-+-+-+-+-+-+

CarbonSigner v1.0
Author: Paranoid Ninja

[+] Loading public key of microsoft.com in Memory...
[+] Cloning Certificate Version
[+] Cloning Certificate Serial Number
[+] Cloning Certificate Subject
[+] Cloning Certificate Issuer
[+] Cloning Certificate Registration & Expiration Dates
[+] Signing Keys
[+] Creating certs\microsoft.com.crt and certs\microsoft.com.key
[+] Clone process completed. Creating PFX file for signing executable...
[+] Platform is Windows OS...
[+] Signing 1.exe with signtool.exe...
Traceback (most recent call last):
File "carboncopy.py", line 102, in
main()
File "carboncopy.py", line 99, in main
CarbonCopy(argv[1], argv[2], argv[3], argv[4])
File "carboncopy.py", line 76, in CarbonCopy
"/td", "SHA256", "/fd", "SHA256", signed])
File "C:\Users\Ali\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 342, in check_call
retcode = call(*popenargs, **kwargs)
File "C:\Users\Ali\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 323, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Users\Ali\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 775, in init
restore_signals, start_new_session)
File "C:\Users\Ali\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1119, in _execute_child
args = list2cmdline(args)
File "C:\Users\Ali\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 530, in list2cmdline
needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'WindowsPath' is not iterable

@joeminicucci
Copy link

Same exact problem in Windows 10.
Is the following lines of code assuming that the 'certs' directory will be made within the pwd? If so I believe this is the source of the bug.

        certDir = Path('certs')
        certDir.mkdir(exist_ok=True)

@Y33Tcoder
Copy link

Found the problem,
the PFXFILE variable called on line 75 is a WindowsPath instead of a string, just change it to str(PFXFILE) to fix the issue.

@TechForBad
Copy link

SignTool Error: The signer's certificate is not valid for signing.

cmd: python CarbonCopy.py microsoft.com 443 test2.exe test3.exe
+-+-+-+-+-+-+-+-+-+-+-+-+
|C|a|r|b|o|n|S|i|g|n|e|r|
+-+-+-+-+-+-+-+-+-+-+-+-+

CarbonSigner v1.0
Author: Paranoid Ninja

[+] Loading public key of microsoft.com in Memory...
[+] Cloning Certificate Version
[+] Cloning Certificate Serial Number
[+] Cloning Certificate Subject
[+] Cloning Certificate Issuer
[+] Cloning Certificate Registration & Expiration Dates
[+] Signing Keys
[+] Creating certs\microsoft.com.crt and certs\microsoft.com.key
[+] Clone process completed. Creating PFX file for signing executable...
[+] Platform is Windows OS...
[+] Signing test3.exe with signtool.exe...
The following certificate was selected:
Issued to: *.oneroute.microsoft.com
Issued by: Microsoft IT TLS CA 5
Expires: Mon May 17 07:43:05 2021
SHA1 hash: 21343D6FEE63B96EC4748102DFA3F8F411AFFDB7

Done Adding Additional Store
SignTool Error: The signer's certificate is not valid for signing.
SignTool Error: An error occurred while attempting to sign: test3.exe

Number of files successfully Signed: 0
Number of warnings: 0
Number of errors: 1
[X] Something Went Wrong!
[X] Exception: Command '['signtool.exe', 'sign', '/v', '/f', 'certs\microsoft.com.pfx', '/d', 'MozDefCorp', '/tr', 'http://sha256timestamp.ws.symantec.com/sha256/timestamp', '/td', 'SHA256', '/fd', 'SHA256', 'test3.exe']' returned non-zero exit status 1.

@e-bitch
Copy link

e-bitch commented Dec 2, 2022

SignTool Error: The signer's certificate is not valid for signing.

cmd: python CarbonCopy.py microsoft.com 443 test2.exe test3.exe +-+-+-+-+-+-+-+-+-+-+-+-+ |C|a|r|b|o|n|S|i|g|n|e|r| +-+-+-+-+-+-+-+-+-+-+-+-+

CarbonSigner v1.0 Author: Paranoid Ninja

[+] Loading public key of microsoft.com in Memory... [+] Cloning Certificate Version [+] Cloning Certificate Serial Number [+] Cloning Certificate Subject [+] Cloning Certificate Issuer [+] Cloning Certificate Registration & Expiration Dates [+] Signing Keys [+] Creating certs\microsoft.com.crt and certs\microsoft.com.key [+] Clone process completed. Creating PFX file for signing executable... [+] Platform is Windows OS... [+] Signing test3.exe with signtool.exe... The following certificate was selected: Issued to: *.oneroute.microsoft.com Issued by: Microsoft IT TLS CA 5 Expires: Mon May 17 07:43:05 2021 SHA1 hash: 21343D6FEE63B96EC4748102DFA3F8F411AFFDB7

Done Adding Additional Store SignTool Error: The signer's certificate is not valid for signing. SignTool Error: An error occurred while attempting to sign: test3.exe

Number of files successfully Signed: 0 Number of warnings: 0 Number of errors: 1 [X] Something Went Wrong! [X] Exception: Command '['signtool.exe', 'sign', '/v', '/f', 'certs\microsoft.com.pfx', '/d', 'MozDefCorp', '/tr', 'http://sha256timestamp.ws.symantec.com/sha256/timestamp', '/td', 'SHA256', '/fd', 'SHA256', 'test3.exe']' returned non-zero exit status 1.

you fix it?

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

5 participants