프로그래밍(38)
-
C#을 사용하여 HTTP 헤더의 IP 주소를 수정하는 예제코드입니다.
using System; using System.Net; namespace ModifyIPAddress { class Program { static void Main(string[] args) { // Create a new HTTPWebRequest object with the URL of the website you want to connect to var request = (HttpWebRequest)WebRequest.Create("http://www.google.com"); // Set the IP address of the remote host request.ServicePoint.BindIPEndPointDelegate = delegate (ServicePoint servicePoint, I..
2023.01.10 -
C# IP 주소 스푸핑을 위한 헤더 수정 예제
using System; using System.Net; using System.IO; namespace ConsoleApp { class Program { static void Main(string[] args) { // Create a web request to the target website HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.example.com"); // Set the desired IP address as the value of the "X-Forwarded-For" header request.Headers["X-Forwarded-For"] = "1.2.3.4"; // Send the request a..
2023.01.10 -
Python에서 Selenium을 통해 액세스하는 웹 사이트의 IP 주소 스푸핑 예제
from selenium import webdriver # Replace PROXY_HOST and PROXY_PORT with the host and port of the proxy server PROXY_HOST = "PROXY_HOST" PROXY_PORT = "PROXY_PORT" # Create a new Chrome webdriver instance driver = webdriver.Chrome() # Set the proxy for the webdriver driver.get("http://{}:{}".format(PROXY_HOST, PROXY_PORT)) # Use the webdriver to visit a website driver.get("http://www.example.com")..
2023.01.10 -
C#에서 압축 파일과 실행파일 결합 예제
using System; using System.IO; using System.IO.Compression; namespace ConsoleApp1 { class Program { static void Main(string[] args) { // Path to the compressed file string compressedFilePath = "path/to/compressed/file.zip"; // Path to the executable file string exeFilePath = "path/to/exe/file.exe"; // Create a new zip archive using (ZipArchive archive = ZipFile.Open(compressedFilePath, ZipArchiv..
2023.01.10 -
C#으로 Windows Update를 중지하는 데 사용할 수 있는 몇 가지 샘플 코드
using System; using System.Management; namespace StopWindowsUpdate { class Program { static void Main(string[] args) { try { // Connect to the local machine. ConnectionOptions options = new ConnectionOptions(); ManagementScope scope = new ManagementScope(@"\\localhost", options); scope.Connect(); // Get the Windows Update service. ManagementPath path = new ManagementPath("Win32_Service"); Object..
2023.01.10 -
각종 GenericConverter 모음
- 각종 GenericConverter 모음 public class GenericBooleanToVisibilityConverter : IValueConverter { public Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture) { if (targetType == typeof(Visibility)) { var visible = System.Convert.ToBoolean(value, culture); if (InvertVisibility) visible = !visible; return visible ? Visibility.Visible : Visibility.Collapsed; } throw new ..
2022.01.12