Skip to content

Commit

Permalink
Abdal Fake Web Server
Browse files Browse the repository at this point in the history
  • Loading branch information
ebrasha committed Jul 6, 2024
1 parent 65db725 commit d381820
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "AbdalFakeWebServer"
version = "0.1.0"
edition = "2021"

[dependencies]
tokio = { version = "1", features = ["full"] }
hyper = { version = "0.14", features = ["full"] }
futures-util = "0.3.30"
60 changes: 60 additions & 0 deletions README.fa.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Abdal Fake Web Server

## 🎤 ترجمه اطلاعات نرم افزار
- [English](README.md)
- [فارسی](README.fa.md)

## 👀 پیش نمایس

<p align="center"><img src="resources/img/fa.png?raw=true"></p>



## 💎 هدف اصلی
یک نرم افزار قوی و پر سرعت برای مهندسی معکوس درخواست های وب و تحلیل محتوای آن

## 🛠️ پیش نیاز برای برنامه نویسان
> Rust and Cargo
> necessary libraries
## ✨ قابلیت ها

* ایجاد سرور وب
* پشتیبانی از درخواست‌های HTTP و HTTPS
* استفاده از کتابخانه‌های پیشرفته
* پشتیبانی از توابع ناهمگام (Asynchronous)
* تولید پاسخ‌های ساده
* مدیریت خطاها
* قابلیت توسعه و سفارشی‌سازی
* نمایش اطلاعات سرور در زمان شروع به کار
* چاپ درخواست‌های دریافتی
* پشتیبانی از ترافیگ های بسیار سنگین
* بدون هیچ کد مخربی



## 📝️ چگونه کار می کند ؟
این نرم افزار برای اجرا نیاز به پورت 80 و 443 دارد پس باید روی سیستم شما این پورت ها رزرو نباشد ، در ویندوز با دوبار کلیک بر روی فایل اجرایی ، نرم افزار شروع به کار می کند اما در لینوکس ابتدا دسترسی اجرای به فایل دهید سپس آن را اجرا کنید به صورت زیر
```bash
chmod +x AbdalFakeWebServer
./AbdalFakeWebServer
```

## ❤️ کمک به پروژه

از لینک های داخل نرم افزار استفاده کنید

## 🤵 برنامه نویس
دست ساز با عشق توسط ابراهیم شفیعی (ابراشا)

E-Mail = Prof.Shafiei@Gmail.com

Telegram: https://t.me/ProfShafiei

## ☠️ گزارش خطا

اگر با مشکلی در پیکربندی مواجه هستید یا چیزی آنطور که انتظار دارید کار نمی‌کند، لطفا از Prof.Shafiei@Gmail.com استفاده کنید.طرح مشکلات بر روی GitLab یا Github نیز پذیرفته می‌شوند.



58 changes: 57 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,57 @@
# abdal-fake-web-server
# Abdal Fake Web Server

## 🎤 README Translation
- [English](README.md)
- [فارسی](README.fa.md)

## 👀 Screenshot

<p align="center"><img src="resources/img/en.png?raw=true"></p>


## 💎 General purpose
A powerful and fast software for reverse engineering web requests and analyzing their content
## 🛠️ Development Environment Setup
>Rust and Cargo
> necessary libraries
## ✨ Features

* Web server creation
* Support for HTTP and HTTPS requests
* Usage of advanced libraries
* Support for asynchronous functions
* Generation of simple responses
* Error handling
* Expandability and customization
* Display server info at startup
* Print received requests
* Support for very high traffic
* Without any malicious code


## 📝️ How it Works?
This software requires ports 80 and 443 to run, so these ports must not be reserved on your system. On Windows, the software starts by double-clicking the executable file. However, on Linux, first grant execution permission to the file and then run it as follows:

```bash
chmod +x AbdalFakeWebServer
./AbdalFakeWebServer
```

## ❤️ Donation

Use the links within the software.

## 🤵 Programmer
Handcrafted with Passion by Ebrahim Shafiei (EbraSha)

E-Mail = Prof.Shafiei@Gmail.com

Telegram: https://t.me/ProfShafiei

## ☠️ Reporting Issues

If you are facing a configuration issue or something is not working as you expected to be, please use the **Prof.Shafiei@Gmail.com** . Issues on GitLab or Github are also welcomed.


Binary file added resources/img/en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/img/fa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
**********************************************************************
* -------------------------------------------------------------------
* Project Name : Abdal Fake Web Server
* File Name : sds.rs
* Author : Ebrahim Shafiei (EbraSha)
* Email : Prof.Shafiei@Gmail.com
* Created On : 2024-07-06
* Description : [A brief description of what this file does]
* -------------------------------------------------------------------
*
* "Coding is an engaging and beloved hobby for me. I passionately and insatiably pursue knowledge in cybersecurity and programming."
* – Ebrahim Shafiei
*
**********************************************************************
*/

use futures_util::TryFutureExt;
use hyper::service::{make_service_fn, service_fn};
use hyper::{Body, Request, Response, Server};
use std::convert::Infallible;

async fn handle_request(req: Request<Body>) -> Result<Response<Body>, Infallible> {
println!("Received request: {:?}", req);
println!();
println!();
Ok(Response::new(Body::from("Request received")))

}

#[tokio::main]
async fn main() {
println!("===========================================");
println!("Welcome to Abdal Fake Web Server ver 1.0");
println!("Programmer : Ebrahim Shafiei (EbraSha)");
println!("Email : Prof.Shafiei@Gmail.com");
println!("===========================================");
if let Err(e) = run().await {
eprintln!("Server error: {}", e);
}
}

async fn run() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let addr = ([0, 0, 0, 0], 80).into();
let make_svc =
make_service_fn(|_conn| async { Ok::<_, Infallible>(service_fn(handle_request)) });
let server = Server::bind(&addr).serve(make_svc);

let addr_ssl = ([0, 0, 0, 0], 443).into();
let make_svc_ssl =
make_service_fn(|_conn| async { Ok::<_, Infallible>(service_fn(handle_request)) });
let server_ssl = Server::bind(&addr_ssl).serve(make_svc_ssl);

println!("Listening on http://{} and https://{}", addr, addr_ssl);

tokio::try_join!(
server.map_err(|e| Box::new(e) as Box<dyn std::error::Error + Send + Sync>),
server_ssl.map_err(|e| Box::new(e) as Box<dyn std::error::Error + Send + Sync>)
)?;

Ok(())
}

0 comments on commit d381820

Please sign in to comment.