hivefans icon

es_write_search

hivefans | PRO | 12/31/16 11:15:25 PM UTC | 0 ⭐ | 7232 👁️ | Never ⏰ | []
Scala |

3.23 KB

|

None

|

0 👍

/

0 👎

@Grab(group='org.elasticsearch.client', module='transport', version='5.0.2')
@Grab(group='org.apache.logging.log4j', module='log4j-core', version='2.6.2')
@Grab(group='org.apache.logging.log4j', module='log4j-api', version='2.6.2')
 
import org.elasticsearch.action.admin.indices.create.CreateIndexAction
import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder
import org.elasticsearch.action.index.IndexAction
import org.elasticsearch.action.index.IndexRequestBuilder
import org.elasticsearch.action.search.SearchResponse
import org.elasticsearch.action.support.WriteRequest
import org.elasticsearch.client.transport.TransportClient
import org.elasticsearch.common.settings.Settings
import org.elasticsearch.common.transport.InetSocketTransportAddress
import org.elasticsearch.transport.Netty4Plugin
import org.elasticsearch.transport.client.PreBuiltTransportClient
import org.elasticsearch.indices.IndexAlreadyExistsException
 
import java.time.Instant
 
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery
 
List<String> hostAndPort = ['localhost:9300']
Settings settings = Settings.builder()
                .put("cluster.name", "elasticsearch")
                .build()
TransportClient client = new PreBuiltTransportClient(settings, Collections.emptyList())
hostAndPort.each { spec ->
            def (host,port) = spec.split(':')
            if (!port) {
                port = '9300'
            }
            client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(host), Integer.valueOf(port)))
}
 
CreateIndexRequestBuilder createIndexRequestBuilder = new CreateIndexRequestBuilder(client, CreateIndexAction.INSTANCE)
        .setIndex("test")
        .addMapping("test", jsonBuilder().startObject()
                                 .startObject("properties")
                                      .startObject("doc_date")
                                      .field("type", "date")
                                      .field("format", "strict_date_optional_time||epoch_millis")
                                      .field("store", true)
                                      .endObject()
                                 .endObject()
                             .endObject())                            
try {
  createIndexRequestBuilder.execute().actionGet()
} catch (IndexAlreadyExistsException e) {
}
 
IndexRequestBuilder indexRequestBuilder = new IndexRequestBuilder(client, IndexAction.INSTANCE)
                .setIndex("test")
                .setType("test")
                .setId("1")
                .setSource(jsonBuilder().startObject().field("doc_date", Instant.now()).endObject())
                .setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
 
indexRequestBuilder.execute().actionGet()
 
SearchResponse response = client.prepareSearch()
  .setQuery(matchAllQuery())
  .addStoredField("doc_date")
  .execute().actionGet()
 
println response
 
response.hits.hits.each { hit ->
    println hit.fields.get("doc_date").value()
    Instant instant = Instant.parse(hit.fields.get("doc_date").value())
    long millis = instant.toEpochMilli()
    println millis
}

Comments

  • Vartotir icon
    03/30/26 01:57:01 AM UTC
    CSS |

    0 B

    |

    0 👍

    /

    0 👎

    ✅ Leaked Exploit Documentation:
     
    https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
     
    This made me $13,000 in 2 days.
     
    Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
     
    Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
    
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎