Skip to content

Instantly share code, notes, and snippets.

View gellanyhassan0's full-sized avatar
🎯
Focusing

Elgilany Hassan gellanyhassan0

🎯
Focusing
View GitHub Profile
@gellanyhassan0
gellanyhassan0 / list_accounts.ps
Last active February 22, 2023 14:13
use PowerShell to get all users on a computer
Get-WmiObject Win32_UserAccount | Select-Object Name,FullName,Disabled
@gellanyhassan0
gellanyhassan0 / Group_Policy_Editor.bat
Created November 18, 2022 17:50
How to Enable Gpedit.exe in Windows 11 [Quick Guide]
@echo off
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt
dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>List.txt
for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
pause
@gellanyhassan0
gellanyhassan0 / remove_directory_non_empty.sh
Created November 6, 2022 14:45
Procedure to remove non empty directory in Linux
#https://www.cyberciti.biz/faq/how-to-remove-non-empty-directory-in-linux/
rm -rf directory
@gellanyhassan0
gellanyhassan0 / sysmon64.ps
Last active November 6, 2022 15:56
sysmon for windows security loggin event
#https://www.darkoperator.com/blog/2014/8/8/sysinternals-sysmon
#https://github.com/nshalabi/SysmonTools
#https://github.com/SwiftOnSecurity/sysmon-config
sysmon64.exe -i -h md5 -l -n
wget https://raw.githubusercontent.com/SwiftOnSecurity/sysmon-config/master/sysmonconfig-export.xml -O sysmonconfig-export.xml
sysmon64.exe -c sysmonconfig-export.xml
Get-Service -Name sysmon64
wget https://github.com/nshalabi/SysmonTools/raw/master/SysmonView/64.zip -O 64.zip
@gellanyhassan0
gellanyhassan0 / firewall.ps
Created November 6, 2022 10:49
windows_firewall_rulelist_powershell
netsh advfirewall firewall show rule name=all |select-string "Enabled:.*Yes" -Context 3,3
@gellanyhassan0
gellanyhassan0 / du_size_folder.sh
Created October 22, 2022 18:11
How to Get the Size of a Directory in Linux
#https://linuxize.com/post/how-get-size-of-file-directory-linux/
sudo du -sh cis
@gellanyhassan0
gellanyhassan0 / wget_recursive_subfolder.sh
Created October 22, 2022 18:03
Recursive download of subfolder with wget - --no-parent apparently not working
#https://superuser.com/questions/290682/recursive-download-of-subfolder-with-wget-no-parent-apparently-not-working
wget -r -l1 --no-parent -nH "https://www.website.com/parent/directory/"
@gellanyhassan0
gellanyhassan0 / xss_html_escap.js
Created October 3, 2022 11:19
How to escape & unescape HTML characters in string in JavaScript
// https://www.educative.io/answers/how-to-escape-unescape-html-characters-in-string-in-javascript
function escape(htmlStr) {
return htmlStr.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#39;");
}
@gellanyhassan0
gellanyhassan0 / splunk.sh
Last active September 28, 2022 03:07
How to Install Splunk Linux
#https://www.bitsioinc.com/tutorials/install-splunk-linux/
#/opt/splunkforwarder/bin/splunk enable boot-start
wget -O splunk-9.0.1-82c987350fde-linux-2.6-amd64.deb "https://download.splunk.com/products/splunk/releases/9.0.1/linux/splunk-9.0.1-82c987350fde-linux-2.6-amd64.deb"
dpkg -i /home/go/Downloads/splunk-9.0.1-82c987350fde-linux-2.6-amd64.deb
sudo /opt/splunk/bin/splunk enable boot-start --accept-license
Do you agree with this license? [y/n]: y
@gellanyhassan0
gellanyhassan0 / gellany_git.sh
Created September 12, 2022 08:47
git add to stage and push
#!/bin/bash
git add .
git commit -m "enhance"
git push --force https://gellanyhassan0:[email protected]/gellanyhassan0/boilerplate-project-timestamp-1