Skip to content

Commit 804c894

Browse files
authored
Merge pull request #1930 from MustCodeAl/cloudflare
Cloudflare
2 parents 74300a9 + f85c4d5 commit 804c894

2 files changed

Lines changed: 53 additions & 3 deletions

File tree

src/network-services-pentesting/pentesting-web/uncovering-cloudflare.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ There have been a number of Cloudflare solvers developed:
111111

112112
### Fortified Headless Browsers <a href="#option-4-scrape-with-fortified-headless-browsers" id="option-4-scrape-with-fortified-headless-browsers"></a>
113113

114-
Use a headless browser that isn't deetcted as an automated browser (you might need to customize it for that). Some options are:
114+
Use a headless browser that isn't detected as an automated browser (you might need to customize it for that). Some options are:
115115

116116
- **Puppeteer:** The [stealth plugin](https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-stealth) for [puppeteer](https://github.com/puppeteer/puppeteer).
117117
- **Playwright:** The [stealth plugin](https://www.npmjs.com/package/playwright-stealth) is coming to Playwright soon. Follow developments [here](https://github.com/berstend/puppeteer-extra/issues/454) and [here](https://github.com/berstend/puppeteer-extra/tree/master/packages/playwright-extra).
118-
- **Selenium:** The [undetected-chromedriver](https://github.com/ultrafunkamsterdam/undetected-chromedriver) an optimized Selenium Chromedriver patch.
119-
118+
- **Selenium:** [SeleniumBase](https://github.com/seleniumbase/SeleniumBase) is a modern browser automation framework featuring built-in stealth capabilities. It offers two modes: **UC Mode**, an optimized Selenium ChromeDriver patch based on [undetected-chromedriver](https://github.com/ultrafunkamsterdam/undetected-chromedriver), and **CDP Mode**, which can bypass bot detection, solve CAPTCHAs, and leverage advanced methods from the Chrome DevTools Protocol.
119+
120120
### Smart Proxy With Cloudflare Built-In Bypass <a href="#option-5-smart-proxy-with-cloudflare-built-in-bypass" id="option-5-smart-proxy-with-cloudflare-built-in-bypass"></a>
121121

122122
**Smart proxies** proxies are continuously updated by specialized companies, aiming to outmaneuver Cloudflare's security measures (as thats their business).

src/todo/rust-basics.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
22

33
{{#include ../banners/hacktricks-training.md}}
44

5+
### Ownership of variables
6+
7+
Memory is managed through a system of ownership with the following rules that the compiler checks at compile time:
8+
9+
1. Each value in Rust has a variable that's called its owner.
10+
2. There can only be one owner at a time.
11+
3. When the owner goes out of scope, the value will be dropped.
12+
13+
```rust
14+
fn main() {
15+
let student_age: u32 = 20;
16+
{ // Scope of a variable is within the block it is declared in, which is denoted by brackets
17+
let teacher_age: u32 = 41;
18+
println!("The student is {} and teacher is {}", student_age, teacher_age);
19+
} // when an owning variable goes out of scope, it will be dropped
20+
21+
// println!("the teacher is {}", teacher_age); // this will not work as teacher_age has been dropped
22+
}
23+
```
24+
25+
26+
527
### Generic Types
628

729
Create a struct where 1 of their values could be any type
@@ -34,6 +56,24 @@ pub enum Option<T> {
3456

3557
You can use functions such as `is_some()` or `is_none()` to check the value of the Option.
3658

59+
60+
### Result, Ok & Err
61+
62+
Used for returning and propagating errors
63+
64+
```rust
65+
pub enum Result<T, E> {
66+
Ok(T),
67+
Err(E),
68+
}
69+
```
70+
71+
You can use functions such as `is_ok()` or `is_err()` to check the value of the result
72+
73+
The `Option` enum should be used in situations where a value might not exist (be `None`).
74+
The `Result` enum should be used in situations where you do something that might go wrong
75+
76+
3777
### Macros
3878

3979
Macros are more powerful than functions because they expand to produce more code than the code you’ve written manually. For example, a function signature must declare the number and type of parameters the function has. Macros, on the other hand, can take a variable number of parameters: we can call `println!("hello")` with one argument or `println!("hello {}", name)` with two arguments. Also, macros are expanded before the compiler interprets the meaning of the code, so a macro can, for example, implement a trait on a given type. A function can’t, because it gets called at runtime and a trait needs to be implemented at compile time.
@@ -363,6 +403,16 @@ Integrate it in CI and fail on `--deny warnings`.
363403

364404
`cargo deny check advisories` offers similar functionality plus licence and ban-list checks.
365405

406+
#### Code coverage with cargo-tarpaulin
407+
408+
`cargo tarpaulin` is a code coverage reporting tool for the Cargo build system
409+
410+
```bash
411+
cargo binstall cargo-tarpaulin
412+
cargo tarpaulin # no options are required, if no root directory is defined Tarpaulin will run in the current working directory.
413+
```
414+
On Linux, Tarpaulin's default tracing backend is still Ptrace and will only work on x86_64 processors. This can be changed to the llvm coverage instrumentation with `--engine llvm`. For Mac and Windows, this is the default collection method.
415+
366416
#### Supply-chain verification with cargo-vet (2024)
367417

368418
`cargo vet` records a review hash for every crate you import and prevents unnoticed upgrades:

0 commit comments

Comments
 (0)