LocaMartin/replacex

GitHub: LocaMartin/replacex

一款增强版的 qsreplace 风格命令行工具,用于批量替换、追加和去重 URL 查询参数值。

Stars: 0 | Forks: 0

Go Version

replacex

### 安装 ``` go install github.com/locamartin/replacex@latest ``` 或者 [下载发布版本](https://github.com/locamartin/replacex/releases) 并将其放置在您的 `$PATH` 中的某个位置 (例如在 /usr/local/bin 中)。

用法

### 替换 Query String 值 ``` -$ cat urls.txt | replacex newval https://example.com/path?one=newval&two=newval https://example.com/pathtwo?one=newval&two=newval https://example.net/a/path?one=newval&two=newval ``` ### 追加到 Query String 值 ``` -$ cat urls.txt | replacex -a newval https://example.com/path?one=1newval&two=2newval https://example.com/pathtwo?one=1newval&two=2newval https://example.net/a/path?one=1newval&two=2newval ``` ### 移除重复的 URL 和参数组合 省略 `-a` (追加) 参数,以仅输出一次每个 URL 和 query string 参数的组合: ``` -$ cat urls.txt | replacex -a https://example.com/path?one=1&two=2 https://example.com/pathtwo?one=1&two=2 https://example.net/a/path?one=1&two=2 ``` ### 使用 `-f` (文件) 标志从字典中替换 ### 使用单个标志 `-ra` (替换并追加) 进行替换和追加 ``` cat file.txt | replacex -ra -f payload.txt https://example.com/path?one=1234&two=1234 https://example.com/pathtwo?one=1+1&two=1+1 https://example.net/a/path?one=dsf&two=dsf ``` ### 替换特定单词而不改变文件的实际内容 `-rw` (替换单词) `-ww` (为该单词) ``` cat file.txt | replacex -rw "google" -ww "facebook" > file2.txt ``` |file.txt|file2.txt| |-|-| |google.com|facebook.com| |google.in|facebook.in| |adbcgoogle.br|adbcfacebook.br| |googleabcd.in|facebookabcd.in|
标签:EVTX分析, 文档结构分析, 日志审计