Skip to content

Commit

Permalink
Ready
Browse files Browse the repository at this point in the history
  • Loading branch information
solanav committed Jan 15, 2024
1 parent 93cc812 commit 75c7b5a
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 6 deletions.
2 changes: 1 addition & 1 deletion phishflood/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def extract_inputs_from_url(url: str) -> Optional[Dict[str, Any]]:
json=raw_form,
headers=auth_headers,
)
print(f"Uploaded form: {res.status_code}, {res.text}")
print(f"Uploaded form: {res.status_code}")

for input_ in form["inputs"]:
print(f"Uploading input {input_}")
Expand Down
16 changes: 16 additions & 0 deletions phishings/migrations/0007_remove_form_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 5.0 on 2024-01-15 15:51

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("phishings", "0006_form_page"),
]

operations = [
migrations.RemoveField(
model_name="form",
name="page",
),
]
18 changes: 18 additions & 0 deletions phishings/migrations/0008_form_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.0 on 2024-01-15 15:52

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("phishings", "0007_remove_form_page"),
]

operations = [
migrations.AddField(
model_name="form",
name="page",
field=models.IntegerField(default=0),
preserve_default=False,
),
]
14 changes: 13 additions & 1 deletion phishings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class Phishing(models.Model):
def save(self, *args, **kwargs):
self.id = hashlib.sha256(self.url.encode("utf-8")).hexdigest()
super(Phishing, self).save(*args, **kwargs)

def __str__(self) -> str:
return f"<URL: {self.url}, ID: {self.id}>"


class Form(models.Model):
Expand All @@ -22,16 +25,19 @@ class Form(models.Model):
Phishing, on_delete=models.CASCADE, related_name="forms"
)
meta_id = models.IntegerField()
page = models.IntegerField()

html_id = models.CharField(max_length=255, null=True)
html_action = models.CharField(max_length=255, null=True)
html_method = models.CharField(max_length=255, null=True)
html_type = models.CharField(max_length=255, null=True)
page = models.IntegerField(blank=False, null=False)

def save(self, *args, **kwargs):
self.id = f"{self.phishing.id}-{self.page}-{self.meta_id}"
super(Form, self).save(*args, **kwargs)

def __str__(self) -> str:
return f"<URL: {self.phishing.url}, PAGE: {self.page}, ID: {self.meta_id}>"


class Input(models.Model):
Expand All @@ -51,6 +57,9 @@ class Input(models.Model):
def save(self, *args, **kwargs):
self.id = f"{self.form.id}-{self.meta_id}"
super(Input, self).save(*args, **kwargs)

def __str__(self) -> str:
return f"<URL: {self.form.phishing.url}, PAGE: {self.form.page}, FORM: {self.form.meta_id}, ID: {self.meta_id}>"


class Action(models.Model):
Expand All @@ -63,3 +72,6 @@ class Action(models.Model):
value = models.CharField(max_length=255, blank=True, null=True)
status = models.CharField(max_length=255)
created_at = models.DateTimeField(auto_now_add=True)

def __str__(self) -> str:
return f"<URL: {self.phishing.url}, PAGE: {self.form.page}, FORM: {self.form.meta_id}, INPUT: {self.input.meta_id}, ACTION: {self.action}, STATUS: {self.status}>"
1 change: 1 addition & 0 deletions phishings/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Meta:
model = Form
fields = [
"phishing",
"page",
"meta_id",
"html_id",
"html_action",
Expand Down
8 changes: 4 additions & 4 deletions samples/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
"page": 0,
"form": 0,
"input": 1,
"value": "jmars34",
"value": "anhtotinh",
"status": "success"
},
{
Expand All @@ -203,7 +203,7 @@
"page": 0,
"form": 0,
"input": 3,
"value": "hip-hoper",
"value": "078289157",
"status": "success"
},
{
Expand All @@ -219,15 +219,15 @@
"page": 1,
"form": 0,
"input": 1,
"value": "gqkxinfuhh",
"value": "cplpfmgmhu",
"status": "success"
},
{
"action": "fill",
"page": 1,
"form": 0,
"input": 2,
"value": "loren1994",
"value": "haikevein1",
"status": "success"
},
{
Expand Down
Binary file modified samples/output.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit 75c7b5a

@eliasdiek
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@solanav hi ,I'm looking for someone with your stack to work on our platform as a freelancer or full time . some projects start soon and others begin in half a year . are you up ? contact me on telegram @eliasdiek or via email at [email protected]

Please sign in to comment.