This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import paramiko | |
import select | |
import threading | |
import sys | |
def usage(): | |
print("Usage: ch2_rforward.py localport ssh_address ssh_port remote_address remote_port") | |
sys.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import paramiko | |
import socket | |
import threading | |
import select | |
import sys | |
host_key = paramiko.RSAKey(filename='ch2_ssh_server.key') | |
server_address = sys.argv[1] | |
server_port = int(sys.argv[2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import paramiko | |
import subprocess | |
import sys | |
#script args | |
server_address = sys.argv[1] | |
server_port = int(sys.argv[2]) | |
username = sys.argv[3] | |
password = sys.argv[4] | |
#connect to the remote ssh server and recieve commands to be #executed and send back output | |
def ssh_command(server_address, server_port, username, password): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import paramiko | |
import threading | |
import sys | |
#script args | |
server_address = sys.argv[1] | |
server_port = int(sys.argv[2]) | |
server_username = sys.argv[3] | |
server_password = sys.argv[4] | |
server_host_key = paramiko.RSAKey(filename="ch2_ssh_server.key") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#a simple tcp proxy | |
import sys | |
import threading | |
import socket | |
import hexdump | |
import time | |
global localhost | |
global localport | |
global remotehost | |
global remoteport |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#netcat example | |
import sys | |
import socket | |
import getopt | |
global target | |
global port | |
target = "" | |
port = 0 | |
def usage(): | |
print(" ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#tcp server tools | |
import socket | |
import getopt | |
import threading | |
import subprocess | |
import sys | |
global target | |
global port | |
global file_destination | |
global execute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import socket | |
import struct | |
from ctypes import * | |
#This is the IP Class inherited from Structure. | |
class IP(Structure): | |
#A fields attribute is required to be able to parse the buffer into 1, 2 or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import struct | |
import threading | |
import sys | |
import os | |
import time | |
from ctypes import * | |
from netaddr import IPNetwork, IPAddress | |
class ICMP(Structure): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scapy.all import * | |
import os | |
import signal | |
import sys | |
import threading | |
import time | |
#ARP Poison parameters | |
gateway_ip = "10.0.0.1" | |
target_ip = "10.0.0.250" |
OlderNewer