## How Dijkstra’s algorithm forms shortest path tree when multiple nodes have same shortest path length

I came across following problem:

Consider below graph:

What will be the shortest path tree starting with node $$A$$ returned by Dijkstra’s algorithm, if we assume priority queue is implemented as binary min heap?

My solution:

I referred Dijkstra from CLRS:

With A as a starting node, we will have priority queue bin min heap as follows:

``A{root, 0}     | Rest all:{∅,∞} ``

(Notation: `{parent in SPT, shortest path weight}`)

It will extract A from priority queue and add it to SPT and will relax AC and AB:

``    B{A:5}      /  \ C{A:6}  Rest all:{∅,∞}  ``

It will extract B from priority queue and and add it to SPT:

``   C{A:6}       | Rest all:{∅,∞}  ``

and will relax BE:

``            C{A:6}              /   \ Rest all:{∅,∞}   E{B,6} ``

Next it will extract C and so one. Thus the SPT will be:

But not:

Q1. Am I correct with above?
Q2. CLRS algo does not dictate which node to add to SPT if multiple of them have same shortest path weight. Hence its dependent on how priority queue is implemented. If no information was given about how priority queue was implemented then we cannot tell how SPT will be formed. Am I right?

## Hydra http-post-form when there are two forms on the page

I am trying to brute force the login creditials on the following website

``<!doctype html> <html>     <head>         <title>Admin Login -- Cody's First Blog</title>     </head>     <body>         <h1>Admin Login</h1>         <form method="POST">     Username: <input type="text" name="username"><br>     Password: <input type="password" name="password"><br>     <input type="submit" value="Log In"><br>     <span style="color: red;">Incorrect username or password</span></form>         <br>         <br>         <hr>         <h3>Comments</h3>         <!--<a href="?page=admin.auth.inc">Admin login</a>-->         <h4>Add comment:</h4>         <form method="POST">             <textarea rows="4" cols="60" name="body"></textarea><br>             <input type="submit" value="Submit">         </form>     </body> </html> ``

I have been running the hydra command

``hydra **domain** http-post-form /**subdomain**/?page=admin.auth.inc:username=^USER^:password=^PASS^:F='Incorrect username or password' -L ~/Documents/SecLists/Usernames/top-usernames-shortlist.txt -P ~/Documents/SecLists/Passwords/darkweb2017-top100.txt -t 30 -w 30 -o ~/Desktop/hydra-http-post-attack.txt ``

I get the output

``hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2019-12-30 16:01:39 [WARNING] Restorefile (you have 10 seconds to abort... (use option -I to skip waiting)) from a previous session found, to prevent overwriting, ./hydra.restore [DATA] max 30 tasks per 1 server, overall 30 tasks, 1683 login tries (l:17/p:99), ~57 tries per task [DATA] attacking http-post-form://**domain**:80/**subdomain**/?page=admin.auth.inc:username=^USER^:password=^PASS^:Incorrect username or password [STATUS] 30.00 tries/min, 30 tries in 00:01h, 1653 to do in 00:56h, 30 active [STATUS] 10.00 tries/min, 30 tries in 00:03h, 1653 to do in 02:46h, 30 active [STATUS] 4.29 tries/min, 30 tries in 00:07h, 1653 to do in 06:26h, 30 active [STATUS] 2.00 tries/min, 30 tries in 00:15h, 1653 to do in 13:47h, 30 active [STATUS] 0.97 tries/min, 30 tries in 00:31h, 1653 to do in 28:29h, 30 active [STATUS] 0.64 tries/min, 30 tries in 00:47h, 1653 to do in 43:10h, 30 active [STATUS] 0.48 tries/min, 30 tries in 01:03h, 1653 to do in 57:52h, 30 active [STATUS] 0.38 tries/min, 30 tries in 01:19h, 1653 to do in 72:33h, 30 active [STATUS] 0.32 tries/min, 30 tries in 01:35h, 1653 to do in 87:15h, 30 active [STATUS] 0.27 tries/min, 30 tries in 01:51h, 1653 to do in 101:57h, 30 active [STATUS] 0.24 tries/min, 30 tries in 02:07h, 1653 to do in 116:38h, 30 active [STATUS] 0.21 tries/min, 30 tries in 02:23h, 1653 to do in 131:20h, 30 active [STATUS] 0.19 tries/min, 30 tries in 02:39h, 1653 to do in 146:01h, 30 active [STATUS] 0.17 tries/min, 30 tries in 02:55h, 1653 to do in 160:43h, 30 active [STATUS] 0.16 tries/min, 30 tries in 03:11h, 1653 to do in 175:25h, 30 active [STATUS] 0.14 tries/min, 30 tries in 03:27h, 1653 to do in 190:06h, 30 active [STATUS] 0.13 tries/min, 30 tries in 03:43h, 1653 to do in 204:48h, 30 active [STATUS] 0.13 tries/min, 30 tries in 03:59h, 1653 to do in 219:29h, 30 active [STATUS] 0.12 tries/min, 30 tries in 04:15h, 1653 to do in 234:11h, 30 active [STATUS] 0.11 tries/min, 30 tries in 04:31h, 1653 to do in 248:53h, 30 active [STATUS] 0.10 tries/min, 30 tries in 04:47h, 1653 to do in 263:34h, 30 active ``

Any idea whats going wrong? It seems none of the threads are being resolved.

## Can non-lycanthropes with specific alternate forms appear as hybrids?

Say a succubus from Savage Species chooses to look like a country’s queen as her alternate form. But she also wants to use her demonic claws and wings. Can she just take the queen’s appearance as her alternate form, then assume a “hybrid” appearance (the queen, but with claws; or the queen, but with wings) or would doing so require taking three separate alternate forms?

## OWASP ZAP submit forms

I’m trying to find SQL injection vulnerability in DVWA with OWASP ZAP. After some clicking through the page I have a small site map:

I ran Active scan, Spider and AJAX spider on the `GET:sqli` node. As you can see in the screenshot above, SQL injection vulnerability was not found. Neither was the form action from the `https://localhost:8081/vulnerabilities/sqli/` page:

Only if I manually submit the form, the form action shows up in the Sites tab:

And only if I run Active scan again, the SQL Injection vulnerability is detected.

Is there any way to force spider / active scan to submit forms and detect their vulnerabilities automatically?

## Forms of magical forensics, magical investigation and code breaking using magic in D&D 3.5

I am currently in the process of writing a D&D 3.5 scenario for my players and I’m looking at producing a sort of slow burn mystery for them to solve. In the earlier stages the party may (or may not) depending upon their actions intercept a cipher as it travels from sender to recipient written in ink on a perfectly ordinary mundane piece of parchment, detect magic reveals no magical auras present. Now just considering the cipher itself leaving aside situation and circumstance and aside from the mundane usage of Decipher Script to decrypt as discussed in Complete Adventurer page 98 and spells of the Divination school presented within the Player’s Handbook, what other magical methods exist in order to gain information as to the plain text? The identity of the sender or would be recipient? I would largely appreciate any responses sourcing D&D 3.5 material published by WoTC but supplementary by 3rd party publishers is okay too.

## ¿Como eliminar las tablas que no le pertenezcan a una base de datos en un TreeView? c# Windows Forms, Microsoft SQL Server

Resulta que tengo un TreeView que me muestra todas las bases de datos que hay con sus respectivas tablas. El problema como verán es que me aparecen tablas a las que le pertenecen a una base de datos pero que tambien les aparecen en otras, lo cual está mal.

Y lo que quiero es que me muestren nomas las tablas a las que les pertenecen la base de datos únicamente.

``       TreeNode node;     TreeNode hijo;     private void Form1_Load(object sender, EventArgs e)     {         DataTable tabla = new DataTable();         DataTable tablas = new DataTable();          ReglasDeNegocios.OperacionesBD operaciones = new ReglasDeNegocios.OperacionesBD();         if (operaciones.BaseDatos(sUsuario, sPassword, ref tabla))         {               foreach (DataRow dr in tabla.Rows)             {                 node = new TreeNode(dr["name"].ToString());                 string hijos = Convert.ToString(dr["name"].ToString());                 if (operaciones.BaseDatos(sUsuario, sPassword, hijos, ref tablas))                 {                     foreach (DataRow dr2 in tablas.Rows)                     {                          hijo = new TreeNode(dr2["Tabla"].ToString());                         node.Nodes.Add(hijo);                     }                     treeView1.Nodes.Add(node);                 }              }             }         else         {              MessageBox.Show("Ocurrio un error: " + operaciones.sLastError);         }     } ``

Asi mando a llamar la BaseDatos:

``  public Boolean BaseDatos(String sUsuario, String sPassword, String BD, ref DataTable Tabla)     {         Boolean bAllOk = false;         using (SqlConnection conexion = new SqlConnection())         {             try             {                  conexion.ConnectionString = \$  "Server=ROBERTODIAZ; User Id={sUsuario}; Password={sPassword}";                 conexion.Open();                 SqlCommand comando = new SqlCommand(\$  "use {BD} select sc.name+'.'+tb.name AS Tabla from sys.tables tb inner join sys.schemas sc on tb.schema_id = sc.schema_id order by Tabla ASC", conexion);                 SqlDataAdapter adapter = new SqlDataAdapter(comando);                 adapter.Fill(Tabla);                   bAllOk = true;              }             catch (Exception ex)             {                 sLastError = ex.Message;             }             finally             {                 conexion.Close();             }         }         return bAllOk;     } ``

¿Como solucionarían esto?

## SharePoint Online – How to make custom forms launch in a dialog?

I’ve created a new custom edit form for a document library in SharePoint designer. “Launch forms in a dialog?” option in advanced settings is set to “yes”, however, it does not affect anything. The form always shows as page. Out-of-box Edit form for a customized document type always pops up as a dialog, however, all other forms, including out-of-box forms for customized link to a document and document set, always appear as page. Please help. Is there a way to specify page appearance on the page definition?

## SP13 with IP13 forms and no IP13

Are there workarounds for manipulating InfoPath forms now that IP13 has been deprecated? Caveats: I cannot use SPD (limited energy-user [for lack of a better term] SP deployment) and I now have a machine with MS Office 2016 (IP no longer offered as a stand-alone program). I have several IP forms that were created when I had a Office 2013 machine that need updating, etc. Is my only option to delete the IP forms and just use OOTB solutions? Thank you in advance for any help/info/answers.

## Windows Forms decrypt password SQL Entity Framework

tengo la siguiente cuestión, necesito hacer un proyecto en windows forms que consulte datos de una base de SQL que fue generada por Entity Framework, entonces estoy tratando de comparar contraseñas entre la que ingreso por WF con la que tengo en la base de datos, la cuestion está en que EF encripta los datos de la contraseña y por tanto si lo tengo que comparar pues, necesito desencriptarlo. Esto es una suposición, no se haya otra forma de comparar estos datos. Y pues este es el código que tengo

``public partial class MainWindow : Window {     private Models.SecurityController _security;     public MainWindow()     {         InitializeComponent();         _security = new Models.SecurityController();     }      private void Button_Click(object sender, RoutedEventArgs e)     {         var email = EmailInput.Text;         var pass = PassInput.Password;         email = email.Replace(" ", "");         if (email == "" )         {             EmailInput.Focus();             Errorlbl.Content = "Por favor utiliza un mail valido";         }         else if (pass == "")         {             PassInput.Focus();             Errorlbl.Content = "Por favor utiliza una contraseña";         }         else if (email != null && pass != null)         {             using (DBEnt db = new DBEnt())             {                 var item = db.AspNetUsers.Where(u => u.Email.Equals(email)).FirstOrDefault();                  if (item == null)                 {                     Errorlbl.Content = "Usuario mail invalido";                 }                 else {                     Errorlbl.Content = "Usuario valido";                 }                  var query =                 db.AspNetUsers.Where(u => u.Email.Equals(email)).FirstOrDefault();                 var hashedpassword = query.PasswordHash;                 var unhashed = _security.Decrypt(pass, hashedpassword);             }         }     } } ``

hasta este punto hashedpassword me devuelve `null`

Y todo esta es la clase SecurityController

``class SecurityController {     public string Encrypt(string key, string data)     {         string encData = null;         byte[][] keys = GetHashKeys(key);          try         {             encData = EncryptStringToBytes_Aes(data, keys[0], keys[1]);         }         catch (CryptographicException) { }         catch (ArgumentNullException) { }          return encData;     }      public string Decrypt(string key, string data)     {         string decData = null;         byte[][] keys = GetHashKeys(key);          try         {             decData = DecryptStringFromBytes_Aes(data, keys[0], keys[1]);         }         catch (CryptographicException) { }         catch (ArgumentNullException) { }          return decData;     }      private byte[][] GetHashKeys(string key)     {         byte[][] result = new byte[2][];         Encoding enc = Encoding.UTF8;          SHA256 sha2 = new SHA256CryptoServiceProvider();          byte[] rawKey = enc.GetBytes(key);         byte[] rawIV = enc.GetBytes(key);          byte[] hashKey = sha2.ComputeHash(rawKey);         byte[] hashIV = sha2.ComputeHash(rawIV);          Array.Resize(ref hashIV, 16);          result[0] = hashKey;         result[1] = hashIV;          return result;     }      //source: https://msdn.microsoft.com/de-de/library/system.security.cryptography.aes(v=vs.110).aspx     private static string EncryptStringToBytes_Aes(string plainText, byte[] Key, byte[] IV)     {         if (plainText == null || plainText.Length <= 0)             throw new ArgumentNullException("plainText");         if (Key == null || Key.Length <= 0)             throw new ArgumentNullException("Key");         if (IV == null || IV.Length <= 0)             throw new ArgumentNullException("IV");          byte[] encrypted;          using (AesManaged aesAlg = new AesManaged())         {             aesAlg.Key = Key;             aesAlg.IV = IV;              ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV);              using (MemoryStream msEncrypt = new MemoryStream())             {                 using (CryptoStream csEncrypt =                         new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write))                 {                     using (StreamWriter swEncrypt = new StreamWriter(csEncrypt))                     {                         swEncrypt.Write(plainText);                     }                     encrypted = msEncrypt.ToArray();                 }             }         }         return Convert.ToBase64String(encrypted);     }      //source: https://msdn.microsoft.com/de-de/library/system.security.cryptography.aes(v=vs.110).aspx     private static string DecryptStringFromBytes_Aes(string cipherTextString, byte[] Key, byte[] IV)     {         byte[] cipherText = Convert.FromBase64String(cipherTextString);          if (cipherText == null || cipherText.Length <= 0)             throw new ArgumentNullException("cipherText");         if (Key == null || Key.Length <= 0)             throw new ArgumentNullException("Key");         if (IV == null || IV.Length <= 0)             throw new ArgumentNullException("IV");          string plaintext = null;          using (Aes aesAlg = Aes.Create())         {             aesAlg.Key = Key;             aesAlg.IV = IV;              ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);              using (MemoryStream msDecrypt = new MemoryStream(cipherText))             {                 using (CryptoStream csDecrypt =                         new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read))                 {                     using (StreamReader srDecrypt = new StreamReader(csDecrypt))                     {                         plaintext = srDecrypt.ReadToEnd();                     }                 }             }         }         return plaintext;     } }    ``

Quiza me estoy complicando mucho, alguien sabe como puedo hacer esto mejor o si lo estoy haciendo bien?