Skip to content

Instantly share code, notes, and snippets.

View anmolj7's full-sized avatar

Anmol Jhamb anmolj7

View GitHub Profile
@anmolj7
anmolj7 / SETTING_UP_DEBIAN.md
Last active July 19, 2022 15:54
A list of commands to help me setup a debain based operating system.

SETTING UP DEBAIN

  1. Starting by updating. sudo apt-get update && sudo apt-get upgrade
  2. Installing snapd sudo apt-get install snapd
  3. Adding some alias that I use echo "alias cls=clear" >> ~/.bashrc
@anmolj7
anmolj7 / caesar_cypher.py
Created January 15, 2021 17:21
Just a small code to encrypt and decrypt caesar cypher.
LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
def encrypt(string, shift=1):
'''
Caesar Cypher shifts the letters by the given shift, for example, if key=1
then, a becomes b, be becomes c, and c becomes d, etc
'''
assert 1<=shift<26
@anmolj7
anmolj7 / CompressJpeg.py
Created October 30, 2020 18:01
Python file to compress a batch of jpegs/pngs of a given folder. Didn't make this a repo because was too lazy, and still had some modifications to do before posting it as a proper repo.
__author__ = "Anmol Jhamb, https://instagram.com/thetechgeek_"
from PIL import Image
import os
import sys
def breakline():
print("*"*50)
#Using OOP
class Employee:
def __init__(self, name, salary):
self.name = name
self.salary = salary
def change_salary(self, change, increment=True):
if increment:
self.salary += change
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anmolj7
anmolj7 / UFUV.md
Last active January 21, 2020 06:03

Analysis on Unrestricted File Upload Vulnerability

The Modern code by which EVERY PROGRAMMER should live, is, "NEVER EVER TRUST USER INPUT, FOR THE WORLD IS FULL OF HACKERS", and in this dedicated post, we'll be talking about UFUV, which also happens to be one of the OWASP Top 10 Vulnerablities. This vulnerability can lead to CSRF, SSRF, XSS, and even DOS attacks!

Attacking Scenarios

A few attacking scenarios that I TOTALLY DIDN'T READ FROM GOOGLE and I AM TOTALLY NOT PARAPHRASING.

MIME Checking Flaws

When a file is uploaded on any server by user interface, there are several things like Filename, File type, File Identifier, File content and File size that are to be checked, the payloads can be embedded in the file name, even the file headers that can be edited by using simple hex editors like Bliss Hex Editor. The file identifier can be fooled by embedding wrong file signatures that can make the code think that the uploaded file is a jpg but the MIME can be crafted to carry the payload. Ev

Steps Taken To instal Fedora

  1. Making a bootable USB. This is a repo, I made, which takes care of EVERYTHING for making a Fedora ISO, i.e, downlodads ISO, verifies CHECKSUM, and burns it to USB.
git clone https://github.com/anmolj7/fedora_media_writer_linux.git
cd fedora_media_writer_linux
python3 main.py
  1. The next part is booting through the usb we just made. For that, just restart your device, and while it's booting, press the combination of keys required to bring the boot menu for your system. It can vary from system to system, for my system, ASUS TUF GAMING, it was, ESC.
  2. Once in the BootMenu, Select the pendrive we just made :P
@anmolj7
anmolj7 / README.md
Last active January 20, 2020 14:30
Chromium Installation in Fedora.

Procedure to install flakpak on Fedora

There are no steps, really. It already comes installed on Fedora systems, and a person just needs to use the command

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Procedure to install Chromium on Fedora

There are 2 ways to achieve the following goal, one way would be to use the GUI to install Chromium, which is as simple as going to the software Center and Searching for Chromium :P Although, being a programmer, a CLI is always better and prefered to install things.

@anmolj7
anmolj7 / README.md
Last active January 19, 2020 18:09
Ansible-Vault

ANSIBLE-VAULT!

Steps taken to install..

  1. None Really. Didn't need to! It came with the installation of ansible! And if somebody needs to see how to install ansible, then, that person really oughta think about changing their line of work :P

Uses of Ansible-Vault

#include "bits/stdc++.h"
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
int main(){
ios_base::sync_with_stdio(0);