Skip to content

Commit

Permalink
Update to v2.0.0
Browse files Browse the repository at this point in the history
`Update to v2.0.0`. A replacement of qsreplace, accepts URLs as standard input, replaces all query string values with user-supplied values and stdout. Works on every OS. Made with python
  • Loading branch information
R0X4R authored Dec 12, 2021
2 parents 52f6b35 + dede06d commit 3aaeab4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 29 deletions.
26 changes: 8 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<h1 align="center"><b>Bhedak</b></h2>
<p align="center">
<img src=".github/image.png" width=30%>
</p>
<h1 align="center">
<b>Bhedak</b>
</h2>

A replacement of [`qsreplace`](https://github.com/tomnomnom/qsreplace), accepts URLs as standard input, replaces all query string values with user-supplied values and stdout. Only for `linux`, `unix` and `debian` based systems.<br/>
A replacement of [`qsreplace`](https://github.com/tomnomnom/qsreplace), accepts URLs as standard input, replaces all query string values with user-supplied values and stdout. Works on every `OS`. Made with `python`<br/>

<h3><b>Installation</b></h3><br/>

```bash
$ sudo apt install python3 python3-pip
$ wget https://raw.githubusercontent.com/R0X4R/bhedak/main/bhedak && chmod +x bhedak && mv bhedak /usr/bin/
$ wget -O bhedak https://raw.githubusercontent.com/R0X4R/bhedak/main/bhedak.py -q && chmod +x bhedak && mv bhedak /usr/bin/
```

<h3><b>Usage</b></h3><br/>
Expand Down Expand Up @@ -55,20 +59,6 @@ $ wget https://raw.githubusercontent.com/R0X4R/bhedak/main/bhedak && chmod +x bh
```
- **Comparsion**

Some parsing errors

```bash
$ cat test | qsreplace "FUZZ" | grep "failed"
failed to parse url http://testphp.vulnweb.com/hpp/params.php?p=CWS000x%EF%BF%BD=%EF%BF%BD1N%EF%BF%BD@E%DF%AE%EF%BF%B)%EF%BF%BD@%EF%BF%BD %EF%BF%BDHiP"D%EF%BF%BDF%EF%BF%BD
G&9%8E7%EF%BF%BD%DC%82%EF%BF%BDX;!S%EF%BF%BD%EF%BF%BD%CC%9B%EF%BF%BD%EF%BF%BD%EF%B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EF%BF%BDT7$%EF%BF%BDH%EF%BF%BDD6)%EF%BF%BD\vx)%EF%BF%BD%D8%92%EF%BF%BD\x1f\\\aC%EF%BF%BD|%EF%BF%BDQ%EF%BF%BDNc%EF%BF%BDb%EF%BF%BD%EF%BF%BD%EF%BF%BD b_&\x1c%EF%BF%BD5 h%EF%BF%BD%EF%BF%BDg\x0f\x14%EF%BF%BD ]s%EF%BF%BD0Q%EF%BF%BDL<%EF%BF%BD6%EF%BF%BDL%EF%BF%BD_%EF%BF%BDw~%EF%BF%BD[\x17%EF%BF%BD/[%EF%BF%BDm{%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD:n- %EF%BF%BD%EF%BF%BD%EF%BF%BD.%EF%BF%BDd1d%EF%BF%BD%EF%BF%BD?6%EF%BF%BD0 &pp=12": net/url: invalid control character in URL]
failed to parse url http://testphp.vulnweb.com:80/guestbook.php'%22()&%1%3CScRiPt%20%3Eprompt(940521)%3C/ScRiPt%3E [parse "http://testphp.vulnweb.com:80/guestbook.php'%22()&%1%3CScRiPt%20%3Eprompt(940521)%3C/ScRiPt%3E": invalid URL escape "%1%"]
$ cat test | bhedak "FUZZ" | grep "params.php"
http://testphp.vulnweb.com/hpp/params.php?p=FUZZ&9%8E7%EF%BF%BD%DC%82%EF%BF%BDX;!S%EF%BF%BD%EF%BF%BD%CC%9B%EF%BF%BD%EF%BF%BD%EF%BF%BD7Jq%EF%BF%BD%EF%BF%BD%EF%BF%BD.%EF%BF%BD>%EF%BF%BDp%EF%BF%BDc%EF%BF%BDl%EF%BF%BDzG%EF%BF%BD%DC%BEM%EF%BF%BDdkj%EF%BF%BD,%EF%BF%BD(%EF%BF%BD%EF%BF%BDT%EF%BF%BDJj)%EF%BF%BD"%EF%BF%BDT7$%EF%BF%BDH%EF%BF%BDD6)%EF%BF%BD
x)%EF%BF%BD%D8%92%EF%BF%BDC%EF%BF%BD|%EF%BF%BDQ%EF%BF%BDNc%EF%BF%BDb%EF%BF%BD%EF%BF%BD%EF%BF%BD b_&%EF%BF%BD5 h%EF%BF%BD%EF%BF%BDg%EF%BF%BD ]s%EF%BF%BD0Q%EF%BF%BDL<%EF%BF%BD6%EF%BF%BDL%EF%BF%BD_%EF%BF%BDw~%EF%BF%BD[%EF%BF%BD/[%EF%BF%BDm{%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD:n-%EF%BF%BD%EF%BF%BD%EF%BF%BD.%EF%BF%BDd1d%EF%BF%BD%EF%BF%BD?6%EF%BF%BD0 &pp=FUZZ
```

<br/><img src=".github/image.jpg"><br/>

Expand Down
11 changes: 0 additions & 11 deletions bhedak

This file was deleted.

20 changes: 20 additions & 0 deletions bhedak.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python3
'''
Author: R0X4R (Eshan Singh)
Version: 2.0.0
'''
import re
import urllib.parse as ul
from sys import stdin, stdout, argv, exit

encoded = ul.quote(str(argv[1]), safe='')
try:
for url in stdin.readlines():
domain = str(url.strip())
stdout.write(re.sub(r"=[^?\|&]*", '=' + str(encoded), str(domain)) + '\n')
except KeyboardInterrupt:
exit(0)
except IndexError:
exit(127)
except:
exit(127)

0 comments on commit 3aaeab4

Please sign in to comment.