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
This file contains 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
#!/bin/bash | |
set -x | |
threads=10 | |
iterations=200 | |
valid_username="admin" | |
valid_password="admin" | |
client_id="client" | |
url="https://127.0.0.1/auth/realms/realm/protocol/openid-connect/token" |
This file contains 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
import os | |
import time | |
from urllib.parse import unquote | |
import requests | |
from requests.exceptions import RequestException | |
from requests.adapters import HTTPAdapter | |
from requests.packages.urllib3.util.retry import Retry | |
from concurrent.futures import ThreadPoolExecutor, as_completed | |
# Base URL and download directory |
This file contains 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
def create_nested_json_string(depth): | |
json_string = '{"a":' * depth + '1' + '}' * depth | |
return json_string | |
depth = 10000 | |
nested_json = create_nested_json_string(depth) | |
print(nested_json) |
This file contains 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
#!/bin/bash | |
output_dir="decompiled" | |
mkdir -p "$output_dir" | |
find . -name "*.jar" -exec sh -c ' | |
for jarfile do | |
decompile_dir="$0/$(basename "${jarfile}" .jar)" | |
mkdir -p "$decompile_dir" | |
jd-cli "$jarfile" -od "$decompile_dir" |
This file contains 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
<?php | |
$baseUrl = 'https://[domain.tld]/?item=[item]&id=[id]'; | |
$maxItems = 1000; | |
$maxId = 2000; | |
function getUrl($url, $headersOnly = TRUE) { | |
$userAgent = 'Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20100101 Firefox/8.0'; | |
$options = [ |
This file contains 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
%!PS-Adobe-2.0 EPSF-1.2 | |
%%Creator: Adobe Illustrator(TM) 1.2d4 | |
%%For: OpenWindows Version 2 | |
%%Title: vector.eps | |
%%CreationDate: 4/12/90 3:20 AM | |
%%DocumentProcSets: Adobe_Illustrator_1.2d1 0 0 | |
%%DocumentSuppliedProcSets: Adobe_Illustrator_1.2d1 0 0 | |
%%BoundingBox: 17 171 567 739 | |
%%EndComments |
This file contains 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
<?php | |
$addresses = file('addresses.txt', FILE_IGNORE_NEW_LINES); | |
$responding = []; | |
foreach ($addresses as $address) { | |
if ($url = parse_url($address)) { | |
if (!isset($url['scheme'])) { | |
$address = 'http://' . $address; | |
} |
This file contains 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
<?php | |
function lottery649($maxn = "49",$maxb="6") { | |
srand((double)microtime() * 1000000); | |
while (1>0) { | |
$lottery[] = rand(1,$maxn); | |
$lottery = array_unique($lottery); | |
if (sizeof($lottery) == $maxb) break; | |
} | |
sort($lottery); | |
return implode(", ",$lottery); |
This file contains 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
<?php | |
$startYear = 2019; | |
$endYear = 2020; | |
for ($year = $startYear; $year <= $endYear; $year++) { | |
$startMonth = 1; | |
$endMonth = 12; | |
for ($month = $startMonth; $month <= $endMonth; $month++) { | |
$paddedMonth = sprintf("%02d", $month); |
NewerOlder