From ac232b5ca88dfe64bc59fa108edc4e2f4b68e9de Mon Sep 17 00:00:00 2001 From: Ryan Dens Date: Wed, 30 Apr 2025 14:12:58 -0700 Subject: [PATCH 1/2] :sparkles: Example Feature --- introduction/other_views.py | 76 +++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 introduction/other_views.py diff --git a/introduction/other_views.py b/introduction/other_views.py new file mode 100644 index 00000000..71629a6b --- /dev/null +++ b/introduction/other_views.py @@ -0,0 +1,76 @@ +import hashlib +from django.shortcuts import render,redirect +from django.http import HttpResponse, HttpResponseBadRequest, JsonResponse +from .models import FAANG, AF_session_id,info,login,comments,authLogin, tickits, sql_lab_table,Blogs,CF_user,AF_admin +from django.core import serializers +from requests.structures import CaseInsensitiveDict +from django.contrib.auth import login,authenticate +from django.contrib.auth.forms import UserCreationForm +import random +import string +import os +from hashlib import md5 +import datetime +from .forms import NewUserForm +from django.contrib import messages +#*****************************************Lab Requirements****************************************************# + +from .models import FAANG,info,login,comments,otp +from random import randint +from xml.dom.pulldom import parseString, START_ELEMENT +from xml.sax.handler import feature_external_ges +from xml.sax import make_parser +from django.views.decorators.csrf import csrf_exempt +from django.template import loader +from django.template.loader import render_to_string +import subprocess +import pickle +import base64 +import yaml +import json +from dataclasses import dataclass +import uuid +from .utility import filter_blog, customHash +import jwt +from PIL import Image,ImageMath +import base64 +from io import BytesIO +from argon2 import PasswordHasher +import logging +import requests +import re +#*****************************************Login and Registration****************************************************# + +@csrf_exempt +def cmd_lab3(request): + if request.user.is_authenticated: + if (request.method=="POST"): + domain=request.POST.get('domain') + domain=domain.replace("https://www.",'') + os=request.POST.get('os') + print(os) + if(os=='win'): + command="nslookup {}".format(domain) + else: + command = "dig {}".format(domain) + try: + # output=subprocess.check_output(command,shell=True,encoding="UTF-8") + process = subprocess.Popen( + command, + shell=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + stdout, stderr = process.communicate() + data = stdout.decode('utf-8') + stderr = stderr.decode('utf-8') + # res = json.loads(data) + # print("Stdout\n" + data) + output = data + stderr + print(data + stderr) + except: + output = "Something went wrong" + return render(request,'Lab/CMD/cmd_lab.html',{"output":output}) + print(output) + return render(request,'Lab/CMD/cmd_lab.html',{"output":output}) + else: + return redirect('login') \ No newline at end of file From b1ed9e99df9b9cc38073e0a45cfe2431fc3f9680 Mon Sep 17 00:00:00 2001 From: pixeegithub-testuser2 <120673387+pixeegithub-testuser2@users.noreply.github.com> Date: Sat, 3 Jan 2026 19:46:54 -0800 Subject: [PATCH 2/2] :alembic: Example commit to make this PR and any analysis that operates on it unique. --- test.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 test.txt diff --git a/test.txt b/test.txt new file mode 100644 index 00000000..86e041da --- /dev/null +++ b/test.txt @@ -0,0 +1,3 @@ +foo +bar +baz