随笔分类 - Python
摘要:控制端代码: import socket import optparse import sys import threading import json import base64 class MyTCPServer: def __init__(self) -> None: self.port =
阅读全文
摘要:渗透测试中利用Python实现自动化案例分享-自动提取靶机网页特定内容 靶机信息 靶机名称:Vulnhub:Samsara 靶机地址: https://www.vulnhub.com/entry/samsara-1,643/ 场景描述 在Kali Linux利用浏览器发现访问url有一定规律,即增加
阅读全文
摘要:利用Python实现简易版netcat from argparse import Action import optparse import sys import socket import threading import subprocess import shlex class MyNetCa
阅读全文
摘要:利用Python实现端口扫描及Banner采集 import threading import sys import optparse import socket class BannerGrab: def __init__(self) -> None: self.target = self.get
阅读全文
摘要:利用Python ZipFile模块破解加密文档 `import zipfile import optparse import threading import sys import os import queue class ZipDecrypt: def init(self) -> None:
阅读全文
摘要:利用Python破解Linux密码 import sys import optparse import os import crypt # The Program is intended to decyrpt Linux hashed password # The main module will
阅读全文
摘要:FTPLIb STORLINES方法出错解决过程 错误现象 import ftplib import optparse import sys class FTPWebpageDetect: def __init__(self) -> None: self.target = self.get_para
阅读全文
摘要:import requests from collections import deque import optparse import sys from lxml import etree import re import time class MySpider: def __init__(sel
阅读全文
摘要:import requests from collections import deque import optparse import sys from lxml import etree import re import time class MySpider: def __init__(sel
阅读全文
摘要:import socket import sys import struct import binascii class RawSniffer: def __init__(self) -> None: try: self.raw_s = socket.socket(socket.PF_PACKET,
阅读全文
摘要:from socket import socket import socketserver import sys class MyTCPRequestHandler(socketserver.StreamRequestHandler): def handle(self) -> None: while
阅读全文
摘要:import subprocess import sys import json import os import optparse import re class WiFiNetworksCredentials: def __init__(self) -> None: self.filename
阅读全文
摘要:from scapy.all import * import sys import optparse import termcolor class ARPSpoofDetector: def __init__(self): self.interface = self.get_params() def
阅读全文
摘要:利用本代码可以实现比如JS代码的插入或者修改. from scapy.all import * import netfilterqueue import sys import optparse import re class HTTPManipulate: def __init__(self) ->
阅读全文
摘要:本代码基于面向对象思想编写,主要利用到的模块为netfilterqueue,以及scapy模块,前者主要是将iptables重定向过来的报文进行缓存,后者是对缓存队列的报文进行解析以及修改。 由于网络中HTTP访问请求以及响应很多,第一步如何识别出含有可执行文件的下载请求,这点通过分析报文load中
阅读全文
摘要:本代码主要利用到的模块为netfilterqueue,该模块会将所有的报文进行缓存,缓存到队列的报文从而利用scapy进行解析,并进一步修改,然后将修改后的报文发送出去。 需要设置iptables规则,这里模拟本机发起的请求: iptables -I OUTPUT -j NFQUEUE --queu
阅读全文
摘要:"" 开始尝试用python的第三方库pyPDF2来破解PDF文档的密码,结果运行的时候报错: "NotImplementedError: only algorithm code 1 and 2 are supported" 提示不支持该加密算法。 只能放弃这个模块,哈哈,而且看了一下这个模块的官方
阅读全文
摘要:代码比较简单,用python第三方模块Selenium实现即可,这里用的浏览器是Firefox, 可以根据情况选择Firefox或者Chrome. from selenium import webdriverimport timeclass InstagramBot: """ Args: usern
阅读全文
摘要:Python的第三方包NetfilterQueue 功能强大,当需要对特定类型的报文进行修改或者丢弃等操作时,可以使用这个第三方包,该包(Package)可以提供对 Linux 中 匹配iptables 规则的数据包的访问,针对这些匹配的数据包可以被接受、丢弃、更改、重新排序或给予标记。 但是在安装
阅读全文

浙公网安备 33010602011771号