(Ab)using technology for fun & profit.

Comments
  • rust_fast_port_scanner returns all ports

    rust_fast_port_scanner returns all ports

    Hello @claudiociardelli , I tested rust_fast_port_scanner today. Not sure if this is an issue or a lack of understanding from me: I run the program with the IP address of my linux server to check what ports might be listening to requests. so I ran the command like this:

    ./target/release/rust_fast_port_scanner 192.168.1.70
    

    I will not print the result here, But I get 1002 rows in the result so, all the ports tested. From @claudiociardelli (https://github.com/skerkour/bloom/issues/72)

    However when I check what ports are listening as per https://www.techrepublic.com/article/how-to-locate-and-close-an-open-port-in-linux/ I only see 6 open ports

    coco@dev01:~/projects/kerkour.com/2021/rust_fast_port_scanner$ sudo ss -tulwn | grep LISTEN
    tcp   LISTEN 0      511                            127.0.0.1:41683      0.0.0.0:*
    
    tcp   LISTEN 0      4096                       127.0.0.53%lo:53         0.0.0.0:*
    
    tcp   LISTEN 0      128                              0.0.0.0:22         0.0.0.0:*
    
    tcp   LISTEN 0      100                              0.0.0.0:25         0.0.0.0:*
    
    tcp   LISTEN 0      100                                 [::]:25            [::]:*
    
    opened by skerkour-dev 6
  • Error: Decrypting large file: aead::Error routine

    Error: Decrypting large file: aead::Error routine

    Hello I found a small error or omission in the decryption function, you forgot to add 16 bytes to BUFFER_LEN (based or you other code to encrypt file

    const BUFFER_LEN: usize = 500;

    to

    const BUFFER_LEN: usize = 500 + 16;

    opened by HelixTP 5
  • Rust File Encryption: Use of unstable library feature 'array_methods'

    Rust File Encryption: Use of unstable library feature 'array_methods'

    image Hey Kerkour! Appreciate the blog posts and projects you have. Was going through the rust_file_encryption one and I'm getting a problem with slicing the buffer at lines 116 and 151 (via .as_slice()). Just letting you know that it is not building right :) thanks!

    opened by Shadorain 3
  • Question about the key and nonce used in 2021/rust_file_encryption

    Question about the key and nonce used in 2021/rust_file_encryption

    Thanks for sharing these useful samples. My question is: in production, should the key and nonce remain private or just the key (in this case, add the nonce to the cipher text as you did in this blog post https://kerkour.com/rust-file-encryption-chacha20poly1305-argon2)?

    opened by egbakou 2
  • Unable to resolve multiple types in email sending example

    Unable to resolve multiple types in email sending example

    Tried to compile an example that shows email sending. Got this error.

    error[E0433]: failed to resolve: could not find `smtp` in `transport`
     --> src/main.rs:2:17
      |
    2 |      transport::smtp::authentication::Credentials, AsyncSmtpTransport, AsyncTransport, Message,
      |                 ^^^^ could not find `smtp` in `transport`
    
    error[E0432]: unresolved imports `lettre::AsyncSmtpTransport`, `lettre::AsyncTransport`, `lettre::Tokio1Executor`
     --> src/main.rs:2:52
      |
    2 |      transport::smtp::authentication::Credentials, AsyncSmtpTransport, AsyncTransport, Message,
      |                                                    ^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^ no `AsyncTransport` in the root
      |                                                    |
      |                                                    no `AsyncSmtpTransport` in the root
    3 |      Tokio1Executor,
      |      ^^^^^^^^^^^^^^ no `Tokio1Executor` in the root
    
    error[E0433]: failed to resolve: use of undeclared type `Credentials`
     --> src/main.rs:9:10
      |
    9 |          Credentials::new("smtp_username".to_string(), "smtp_password".to_string());
      |          ^^^^^^^^^^^ use of undeclared type `Credentials`
    
    
    opened by vbmade2000 2
  • Question about environmental variables

    Question about environmental variables

    Nice to meet you. I have some question about environmental variables in https://github.com/skerkour/kerkour.com/tree/main/2021/deploy_rust_on_heroku 's case. This is my first time to deploy Rust service to Heroku. I want to use environmental variables in this case. But I don't know how to do so. Could you please help me?

    opened by re-taro 2
  • Scans beyond TCP connect

    Scans beyond TCP connect

    Hi! Would this code base be modifiable to support other scan types, for example a Syn scan? My suspicions are you would need a very different approach, since std::net and tokio::net don't give you control over this. (Maybe the socket2 lib?), but I'm curious.

    opened by David-OConnor 1
  • Logic in streaming decryption isn't quite right

    Logic in streaming decryption isn't quite right

    In particular, at https://github.com/skerkour/kerkour.com/blob/main/2021/rust_file_encryption/src/main.rs#L147, if original file size was exactly multiple of 500, the code won't identify the last chunk correctly.

    Thanks for your helpful articles!

    opened by itamarst 1
  • `cross` for cross-compiling Rust

    `cross` for cross-compiling Rust

    I came across your blog post "Reproducible cross-compilation for Rust (with Docker)" via This Week in Rust #410 and want to say that your Dockerfiles are really cool.

    However, there is already a way to cross-compile Rust via Docker. The tool is called cross and is maintained by the Rust Embedded devices Working Group.

    So after installing cross via cargo install cross, you can compile to:

    Windows:

    cargo build --target x86_64-pc-windows-gnu
    

    aarch64 / ARMv8:

    cargo build --target aarch64-unknown-linux-gnu
    

    ARMv7:

    cargo build --target armv7-unknown-linux-gnueabihf
    

    As said, your Dockerfiles are really awesome and doing something by yourself is always a worthwhile experience, however I just want to point out to you that there is already a way to cross-compile.

    opened by linuskmr 1
  • Do not use `sqlx` for

    Do not use `sqlx` for "high performance" sqlite insert benchmark

    As you try to optimize the time to insert a lot of items into a sqlite database, in your blog post here I thought it may be interesting for you to know that sqlx is the wrong tool for that job. Because of the "all is async" approach there is a quite large overhead for executing any query there. According to my own benchmarks executing queries using sqlx is 7 - 70 times slower than doing the same query using diesel. Using rusqlite normally gives you even faster queries. Therefore it might be worth to just use another database framework to improve the numbers there. See the benchmarks here for details on the numbers.

    Disclaimer: As maintainer of diesel I might be biased there.

    opened by weiznich 1
  • Bump axum-core from 0.2.5 to 0.2.8 in /2022/rust_web_s3

    Bump axum-core from 0.2.5 to 0.2.8 in /2022/rust_web_s3

    Bumps axum-core from 0.2.5 to 0.2.8.

    Release notes

    Sourced from axum-core's releases.

    axum-core - v0.2.8

    Security

    • breaking: Added default limit to how much data Bytes::from_request will consume. Previously it would attempt to consume the entire request body without checking its length. This meant if a malicious peer sent an large (or infinite) request body your server might run out of memory and crash.

      The default limit is at 2 MB and can be disabled by adding the new DefaultBodyLimit::disable() middleware. See its documentation for more details.

      This also applies to String which used Bytes::from_request internally.

      (#1346)

    #1346: tokio-rs/axum#1346

    axum-core - v0.2.7

    • fix: Fix typos in RequestParts docs (#1147)

    #1147: tokio-rs/axum#1147

    axum-core - v0.2.6

    • change: axum-core's MSRV is now 1.56 (#1098)

    #1098: tokio-rs/axum#1098

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Please consider the goats

    Please consider the goats

    I started this PR to do some absolutely unnecessary nitpicking, but it turned out the crate ~~actually eats data like there is no tomorrow~~ leads to silent corruption in a number of places, by not handling length read and written.

    Please update the article at https://kerkour.com/rust-file-encryption-chacha20poly1305-argon2 accordingly, if you have time. (Think of the children!)

    The commits are well-isolated, and their commit messages tell a compelling (albeit overly-dramatic) story (or so some say), be sure to read.

    Best regards!

    opened by qm3ster 2
  • Bad assumption on read() results

    Bad assumption on read() results

    In https://github.com/skerkour/kerkour.com/blob/main/2022/rust_file_encryption_with_password/src/main.rs#L75 (and in many other places), you are assumption that the only scenario where you'll get less than the number of requested bytes is when you are at the end of the file. This is wrong.

    See the docs here:

    https://doc.rust-lang.org/std/io/trait.Read.html#tymethod.read

    In particular:

    It is not an error if the returned value n is smaller than the buffer size, even when the reader is not at the end of the stream yet.

    There are many reasons why this may be the case.

    A great example is if the read you are doing happened to start on a region that is already in memory, but continues to a page that is not there yet. The file system will return what it has right now. That can lead to really hard to figure out bugs.

    opened by ayende 5
Owner
Sylvain Kerkour
(Ab)using technology for fun & profit: Programming, Hacking & Entrepreneurship - https://kerkour.com
Sylvain Kerkour
A webring of people who make cool stuff. technology, music, art, writing, anything goes!

a webring of people who make cool stuff. technology, music, art, writing, anything goes!

Kognise 44 Dec 6, 2022
A traditional web forum built in Rust with modern technology to be fast, secure, scalable, and stable.

Volksforo A traditional web forum built in Rust with modern technology to be fast, secure, scalable, and stable. Stack Rust actix-web askama ScyllaDB

Josh 5 Mar 21, 2023
A learning project/fun experiment in internet protocol

Piper a learning project/fun experiment in internet protocol Version 0.4.0 (SEMVER) Goals Piper is Simple. A page is a page. There are no secondary re

null 13 Oct 27, 2022
Mewl, program in cats' language; A just-for-fun language

Mewl The programming language of cats' with the taste of lisp ?? What,Why? Well, 2 years ago in 2020, I created a esoteric programming language called

Palash Bauri 14 Oct 23, 2022
Extending mincaml with "fun" PL ideas.

wowcaml This is a fork of this Rust implementation of mincaml - a compiler for a call-by-value ML-like language, updated to recent versions of craneli

McCoy R. Becker 4 Jul 14, 2022
📱️🚫️🌝️💾️ 3FakeIM is a joke program meant to imitate various fictional characters, and the "[CHARACTER] CALLED ME AT 3:00 AM" clickbait trend, while poking fun.

3FakeIM ??️??️??️??️ 3FakeIM is a joke program meant to imitate various fictional characters, and the "[CHARACTER] CALLED ME AT 3:00 AM" clickbait tre

Sean P. Myrick V19.1.7.2 2 Jul 3, 2023
Rust explained using easy English

Update 22 December 2020: mdBook can be found here. 28 November 2020: Now also available in simplified Chinese thanks to kumakichi! 1 February 2021: No

null 7.3k Jan 3, 2023
A fast uuid generator in Python using Rust

ruuid A fast UUID generator for Python built using Rust. Its a simple wrapper on top of Rust's UUID crate. How to use? Installation: pip3 install ruui

Rahul Nair 19 Jul 13, 2022
An API for getting questions from http://either.io implemented fully in Rust, using reqwest and some regex magic. Provides asynchronous and blocking clients respectively.

eithers_rust An API for getting questions from http://either.io implemented fully in Rust, using reqwest and some regex magic. Provides asynchronous a

null 2 Oct 24, 2021
A mixer for jack-audio using rust and druid UI

A simple mixer to allow me to use my midi controller (Novation LaunchControl XL) on linux and also to explore the new druid ui. Features volume faders

Richard Dodd (dodj) 25 Jul 6, 2022
Serialize & deserialize device tree binary using serde

serde_device_tree Use serde framework to deserialize Device Tree Blob binary files; no_std compatible. Use this library Run example: cargo run --examp

Luo Jia 20 Aug 20, 2022
A turing-complete programming language using only zero-width unicode characters, inspired by brainfuck and whitespace.

Zero-Width A turing-complete programming language using only zero-width unicode characters, inspired by brainfuck and whitespace. Currently a (possibl

Gavin M 2 Jan 14, 2022
Quantogram - Approximate Quantile calculation using Histograms

Quantogram - Approximate Quantile calculation using Histograms A library for Estimating Online Quantiles of Streams Quantogram accepts a stream of flo

Paul Anton Chernoch 11 Dec 24, 2022
Parse and encoding of data using the SCTE-35 standard.

SCTE-35 lib and parser for Rust Work in progress! This library provide access to parse and encoding of data using the SCTE-35 standard. This standard

Rafael Carício 4 May 6, 2022
Public aircraft & flightroute api Built in Rust for Docker, using PostgreSQL & Redis

api.adsbdb.com public aircraft & flightroute api Built in Rust for Docker, using PostgreSQL & Redis See typescript branch for original typescript vers

Jack Wills 66 Dec 22, 2022
Key-value store for embedded systems, for raw NOR flash, using an LSM-Tree.

ekv Key-value store for embedded systems, for raw NOR flash, using an LSM-Tree. Features None yet TODO Everything Minimum supported Rust version (MSRV

Dario Nieuwenhuis 16 Nov 22, 2022
Bitpack a boolean into a pointer using bit magic.

ptr-bool tl;dr: a pointer and boolean with the same size as a pointer. A convenience crate used to bitpack a boolean and pointer into the same eight b

Zack 2 Oct 24, 2022
The utility is designed to check the availability of peers and automatically update them in the Yggdrasil configuration file, as well as using the admin API - addPeer method.

Yggrasil network peers checker / updater The utility is designed to check the availability of peers and automatically update them in the Yggdrasil con

null 6 Dec 25, 2022
Using iced-rs library for YT monitoring app

YouTube Monitoring App (using Rust) Description This app is built on the top of iced library. If you're curious what this is about, check out the YT m

Kushashwa Ravi Shrimali 3 Dec 15, 2022