[주의!] 문서의 이전 버전(에 수정)을 보고 있습니다. 최신 버전으로 이동
분류
1. 개요[편집]
특정 서버나 네트워크에 과도한 트래픽을 발생시켜 정상적인 서비스 제공을 방해하는 사이버 공격.
매우 간단한 예제이다.
원리는 requests로 서버에 과부화를 주는 것.사실상 이코드로 DDos 공격은 불가능이다.
신기하게 깃허브에는 DDOS 코드가 존재한다...
매우 간단한 예제이다.
원리는 requests로 서버에 과부화를 주는 것.
신기하게 깃허브에는 DDOS 코드가 존재한다...
import requests
url = "https://www.google.com"
for i in range(1):
a = requests.post(url)
print(a)
print(a.text)using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
string url = "https://www.google.com";
using (HttpClient client = new HttpClient())
{
HttpResponseMessage response = await client.PostAsync(url, null);
Console.WriteLine(response);
string text = await response.Content.ReadAsStringAsync();
Console.WriteLine(text);
}
}
}#include <iostream>
#include <string>
#include <curl/curl.h>
size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* buffer) {
size_t totalSize = size * nmemb;
buffer->append((char*)contents, totalSize);
return totalSize;
}
int main() {
CURL* curl;
CURLcode res;
std::string response;
curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://www.google.com");
curl_easy_setopt(curl, CURLOPT_POST, 1L);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
res = curl_easy_perform(curl);
std::cout << "Response Code: " << res << std::endl;
std::cout << "Response Text:\n" << response << std::endl;
curl_easy_cleanup(curl);
}
return 0;
}2. 범죄[편집]
사이버 공격은 엄연한 범죄이다.