Skip to content

Instantly share code, notes, and snippets.

View MohitDabas's full-sized avatar
🎯
Focusing

Mohit Dabas MohitDabas

🎯
Focusing
  • Ground 0
View GitHub Profile
@MohitDabas
MohitDabas / mohit_dabas_eng_crawl.py
Created June 29, 2015 11:24
Mohit Dabas English Music Crawler
import urllib2
search=raw_input('Enter The Name of The Song->')
search=search.replace(' ','_')
print "http://junglevibe.net/tracks/{}".format(search)
request = urllib2.Request("http://junglevibe.net/tracks/{}.html".format(search), headers={"User-Agent" : "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0"})
contents = urllib2.urlopen(request)
#print contents.read()
print dir(contents.info())
cookie=contents.info()['set-cookie']
index=cookie.find(';')
@MohitDabas
MohitDabas / counter.html
Created December 31, 2019 15:07
A simple javascript timer with start,stop,reset option
<!DOCTYPE html>
<head>
<script>
var timeCount=0
var dumb;
function startTimer()
{
digit=document.getElementById("digit");
timeCount=timeCount+1
@MohitDabas
MohitDabas / console.html
Created December 31, 2019 19:28
A javascript program for creating terminal Like Feel
<!DOCTYPE html>
<head>
<script>
setInterval(blinktext, 100);
var txt = "";
var count = 0;
function blinktext() {
var cntrl = document.getElementById("input");
if (count == 0)
txt = cntrl.innerHTML;
@MohitDabas
MohitDabas / FindMacWifiPass.py
Last active March 9, 2023 08:54
Finding Macosx wifi password through python api (Requires root privilege)
import contextlib
import ctypes
import struct
from ctypes import c_void_p, c_uint16, c_uint32, c_int32, c_char_p, POINTER
from keyring.py27compat import string_types, add_metaclass
sec_keychain_ref = sec_keychain_item_ref = c_void_p
OS_status = c_int32
@MohitDabas
MohitDabas / phpserializeattack.php
Created June 15, 2020 03:54
Php Object Injection Attack Code Snippets
<?php
class PHPObjectInjection{
public $inject;
function __wakeup(){
if(isset($this->inject)){
eval($this->inject);
}
}
@MohitDabas
MohitDabas / Jar Debugging
Created June 30, 2020 06:36
The following gist contain information regarding setting up environment for remote code debugging on docker.
#mvn run on a particular port
mvn jetty:run -D jetty.port=9229
#mvn debug
export MAVEN_OPTS="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=0.0.0.0:9090,server=y,suspend=n"
#visual studio debug config
{
"version": "0.2.0",
@MohitDabas
MohitDabas / autorunpermissionfinder.py
Last active March 6, 2021 12:37
The Following code snippets find permission on paths found in autoruns sysinternal utils
import re
import os
autoRunFileData=open('autorun.txt',encoding='utf-16').readlines()
count=1
for line in autoRunFileData:
matches=re.findall(r'[a-zA-Z]:\\[\\\S|*\S]?.*$',line)
try:
path=matches[0].split('"\t')[0]
print(path)
os.system('accesschk64.exe -wvu "'+path+'"')
@MohitDabas
MohitDabas / collectfuncNstring.py
Created June 6, 2021 12:33
A python ghidra script that will parse the functions and the referenced strings by those function
from ghidra.program.util import DefinedDataIterator
from ghidra.app.util import XReferenceUtil
def getAddress(offset):
return currentProgram.getAddressFactory().getDefaultAddressSpace().getAddress(offset)
string_and_funcdata=[]
functionManager = currentProgram.getFunctionManager()
@MohitDabas
MohitDabas / inputparser.py
Created June 8, 2021 11:37
The following small code of python grabs all the inputs from the html page or templates in a project and gives you a clear picture to attack and fuzz.
from os import listdir
from os.path import isfile, join
import re
from os import walk
from bs4 import BeautifulSoup
def fileGetter():
fileNames = []
mypath='<folder_name>'
@MohitDabas
MohitDabas / naso.html
Created November 23, 2022 17:09
HTML 5 Based Command Console with multiple autocomplete
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>HTML 5 Based Command Console with multiple autocomplete </title>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<style>
flex:1;