Skip to content

Instantly share code, notes, and snippets.

View mpoerwito's full-sized avatar
🇮🇩
koding

Medi I Poerwito mpoerwito

🇮🇩
koding
View GitHub Profile
@mpoerwito
mpoerwito / arpscanner.py
Last active November 17, 2022 18:40
using scapy to scan the network by sending/receiving ARP packets
import socket
from time import sleep
from scapy.layers.l2 import ARP, Ether
from scapy.all import *
def arpscan(network):
ether = Ether(dst="ff:ff:ff:ff:ff:ff")
for i in range(1,20):
targetIP = network + str(i)
@mpoerwito
mpoerwito / spoofdetector.py
Created November 11, 2022 01:07
check ARP table for duplicate entries. final project
import os
import platform
from datetime import datetime
def filterARP():
arptable_file = "data/table.txt"
lines = []
MACaddrs = []
ip2mac = {}
@mpoerwito
mpoerwito / curl_cheatsheet.md
Last active October 27, 2022 04:00
curl cheatsheet from HTB

cURL

Command Description
 curl -h cURL help menu
 curl inlanefreight.com Basic GET request
 curl -s -O inlanefreight.com/index.html Download file
 curl -k https://inlanefreight.com Skip HTTPS (SSL) certificate validation
 curl inlanefreight.com -v Print full HTTP request/response details
 curl -I https://www.inlanefreight.com Send HEAD request (only prints response headers)
@mpoerwito
mpoerwito / Program.cs
Last active November 8, 2022 16:28
Stripe Webhook Minimalist API
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Mvc;
using NLog.Web;
using Stripe;
using System.Text.Json;
var builder = WebApplication.CreateBuilder(args);
@mpoerwito
mpoerwito / simpleclient.cs
Last active November 8, 2022 16:33
Simple API client
using System;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using System.Runtime.Serialization.Json;
using Client.Entities;
@mpoerwito
mpoerwito / Program.cs
Created January 13, 2021 00:08
HttpClient usage
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Text.Json;
namespace runthis
{
class Program
{
@mpoerwito
mpoerwito / Program.cs
Last active January 8, 2021 22:47
make SOAP POST content and reading SOAP response
using System;
using System.Xml.Linq;
using System.IO;
using System.Text;
using System.Collections.Generic;
namespace runthis
{
class Program
{
oooo oooo
`888 `888
888 .ooooo. .oooo. oooo ooo .ooooo. ooo. .oo. .oo. .ooooo. 888 .oo. .ooooo. oooo d8b .ooooo.
888 d88' `88b `P )88b `88. .8' d88' `88b `888P"Y88bP"Y88b d88' `88b 888P"Y88b d88' `88b `888""8P d88' `88b
888 888ooo888 .oP"888 `88..8' 888ooo888 888 888 888 888ooo888 888 888 888ooo888 888 888ooo888
888 888 .o d8( 888 `888' 888 .o 888 888 888 888 .o 888 888 888 .o 888 888 .o
o888o `Y8bod8P' `Y888""8o `8' `Y8bod8P' o888o o888o o888o `Y8bod8P' o888o o888o `Y8bod8P' d888b `Y8bod8P'
@mpoerwito
mpoerwito / L3D.py
Last active June 6, 2017 03:34
control raspi led
#!/usr/bin/env python3
# pylint: disable=invalid-name
from time import sleep
import RPi.GPIO as GPIO
pin = 40
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(pin, GPIO.OUT)
@mpoerwito
mpoerwito / GetTmblrLinks.ps1
Last active May 4, 2017 03:38
get a list of links from a web page