Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 42 |
Nodes: | 6 (0 / 6) |
Uptime: | 01:28:17 |
Calls: | 220 |
Calls today: | 1 |
Files: | 824 |
Messages: | 121,541 |
Posted today: | 6 |
On 2024-08-01, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
On Thu, 1 Aug 2024 22:14:53 -0000 (UTC), rek2 hispagatos wrote:
Last year I made a small Go program to automatize some of the first
steps I do when participating on HackTheBox, I decided to migrate it
to rust, this is the result, free software GPLv3
https://git.sr.ht/~rek2/rek2htb-rust
I assume you are munging the hosts file just so your web client will
pass the right “Host:” header line. There should be easier (i.e. less
intrusive) ways of doing that: for example, in wget you can add the
option “--header="Host: «hostname»"”, and there should be something
similar in whatever HTTP client you are using.
Actually I found a couple bugs that I fixed related to ffuf one of them
was missing flag to add the Host header -H "Host: FFUZ.{}.htb" as it was before it was just passing the site -s other issue was the output,
also I have fixed it.
Thanks, I will had read your msg and found out as well even if I had not noticed it before, so thank you for the reply, good to know someone is reading.
Happy Hacking ReK2
I don't know Rust, so your program is a bit of an introduction.
With that in mind, I wonder if this wouldn't be a little bit
better:
- -%<- cut here - -
--- main.rs~ 2024-08-04 03:44:07.000000000 -0700
+++ main.rs 2024-08-04 03:45:19.824804343 -0700
@@ -106,7 +106,7 @@
}
// If the entry does not exist, append it to the file using SUPERUSER_CMD
- let update_hosts_command = format!("echo {} {}.htb | tee -a /etc/hosts", ip_address, box_name);
+ let update_hosts_command = format!("echo {} | tee -a /etc/hosts", entry);
let mut command = Command::new(SUPERUSER_CMD);
command
.arg("sh")
- -%<- cut here - -
Would that work? If so, it would let you change the entry format
in "entry" in only one place, if you decide to do so.
(Also, was intrigued by how "let" seems to work, if I understand it correctly.
Will have to take a look at Rust!)
Finally, I've long been disappointed that git doesn't preserve
timestamps on files. Does anyone know of any discussion about
why that is, and perhaps changing git to have that capability?
[ sorry about not honoring your fu2, my server doesn't seem to
have alt.comp.lang.rust. ]
Finally, I've long been disappointed that git doesn't preserve
timestamps on files.
Last year I made a small Go program to automatize some of the first
steps I do when participating on HackTheBox, I decided to migrate it to
rust, this is the result, free software GPLv3
https://git.sr.ht/~rek2/rek2htb-rust
On Thu, 1 Aug 2024 22:14:53 -0000 (UTC), rek2 hispagatos wrote:
Last year I made a small Go program to automatize some of the first
steps I do when participating on HackTheBox, I decided to migrate it to
rust, this is the result, free software GPLv3
https://git.sr.ht/~rek2/rek2htb-rust
I assume you are munging the hosts file just so your web client will pass
the right “Host:” header line. There should be easier (i.e. less intrusive) ways of doing that: for example, in wget you can add the option “--header="Host: «hostname»"”, and there should be something similar in whatever HTTP client you are using.