I'm working on a CTF challenge that is find a secret password.This secret password base on the username and password that i input and the hash value had print out after hash calculation and i want to capture this hash value at a parameter to my script to calculate the secret pass Can someone tell me how can i do it or another solution to solve my problem Thanks
1 Answer
It sounds like you want your python script to read from stdin.
import sys
if not sys.stdin.isatty():
param = sys.stdin.read()
print("param",param)
To use it: echo 'param value' | python3 script.py
-
tks but i want it read from stdout of program because the program will print one value that i need for calculating– y_manDec 3, 2020 at 9:32
-
If you're not familiar with linux, the
|
command redirects the output (stdout) of one program to the input (stdin) of another. Sosomecommand | python3 script.py
will do what you've asked. Dec 3, 2020 at 16:28